Code formatting (#280)
This commit is contained in:
@@ -2,12 +2,12 @@
|
||||
import core from "@actions/core"
|
||||
import github from "@actions/github"
|
||||
import octokit from "@octokit/graphql"
|
||||
import setup from "../metrics/setup.mjs"
|
||||
import mocks from "../mocks/index.mjs"
|
||||
import metrics from "../metrics/index.mjs"
|
||||
import fs from "fs/promises"
|
||||
import paths from "path"
|
||||
import sgit from "simple-git"
|
||||
import metrics from "../metrics/index.mjs"
|
||||
import setup from "../metrics/setup.mjs"
|
||||
import mocks from "../mocks/index.mjs"
|
||||
process.on("unhandledRejection", error => {
|
||||
throw error
|
||||
})
|
||||
@@ -18,11 +18,15 @@
|
||||
|
||||
//Info logger
|
||||
const info = (left, right, {token = false} = {}) => console.log(`${`${left}`.padEnd(56 + 9 * (/0m$/.test(left)))} │ ${
|
||||
Array.isArray(right) ? right.join(", ") || "(none)" :
|
||||
right === undefined ? "(default)" :
|
||||
token ? /^MOCKED/.test(right) ? "(MOCKED TOKEN)" : /^NOT_NEEDED$/.test(right) ? "(NOT NEEDED)" : (right ? "(provided)" : "(missing)") :
|
||||
typeof right === "object" ? JSON.stringify(right) :
|
||||
right
|
||||
Array.isArray(right)
|
||||
? right.join(", ") || "(none)"
|
||||
: right === undefined
|
||||
? "(default)"
|
||||
: token
|
||||
? /^MOCKED/.test(right) ? "(MOCKED TOKEN)" : /^NOT_NEEDED$/.test(right) ? "(NOT NEEDED)" : (right ? "(provided)" : "(missing)")
|
||||
: typeof right === "object"
|
||||
? JSON.stringify(right)
|
||||
: right
|
||||
}`)
|
||||
info.section = (left = "", right = " ") => info(`\x1b[36m${left}\x1b[0m`, right)
|
||||
info.group = ({metadata, name, inputs}) => {
|
||||
@@ -65,14 +69,28 @@
|
||||
|
||||
//Core inputs
|
||||
const {
|
||||
user:_user, repo:_repo, token,
|
||||
template, query, "setup.community.templates":_templates,
|
||||
filename:_filename, optimize, verify, "markdown.cache":_markdown_cache,
|
||||
debug, "debug.flags":dflags, "use.mocked.data":mocked, dryrun,
|
||||
user:_user,
|
||||
repo:_repo,
|
||||
token,
|
||||
template,
|
||||
query,
|
||||
"setup.community.templates":_templates,
|
||||
filename:_filename,
|
||||
optimize,
|
||||
verify,
|
||||
"markdown.cache":_markdown_cache,
|
||||
debug,
|
||||
"debug.flags":dflags,
|
||||
"use.mocked.data":mocked,
|
||||
dryrun,
|
||||
"plugins.errors.fatal":die,
|
||||
"committer.token":_token, "committer.branch":_branch, "committer.message":_message, "committer.gist":_gist,
|
||||
"committer.token":_token,
|
||||
"committer.branch":_branch,
|
||||
"committer.message":_message,
|
||||
"committer.gist":_gist,
|
||||
"use.prebuilt.image":_image,
|
||||
retries, "retries.delay":retries_delay,
|
||||
retries,
|
||||
"retries.delay":retries_delay,
|
||||
"output.action":_action,
|
||||
...config
|
||||
} = metadata.plugins.core.inputs.action({core})
|
||||
@@ -111,8 +129,11 @@
|
||||
//Test token validity
|
||||
else if (!/^NOT_NEEDED$/.test(token)) {
|
||||
const {headers} = await api.rest.request("HEAD /")
|
||||
if (!("x-oauth-scopes" in headers))
|
||||
throw new Error("GitHub API did not send any \"x-oauth-scopes\" header back from provided \"token\". It means that your token may not be valid or you're using GITHUB_TOKEN which cannot be used since metrics will fetch data outside of this repository scope. Use a personal access token instead (see https://github.com/lowlighter/metrics/blob/master/.github/readme/partials/setup/action/setup.md for more informations).")
|
||||
if (!("x-oauth-scopes" in headers)) {
|
||||
throw new Error(
|
||||
'GitHub API did not send any "x-oauth-scopes" header back from provided "token". It means that your token may not be valid or you\'re using GITHUB_TOKEN which cannot be used since metrics will fetch data outside of this repository scope. Use a personal access token instead (see https://github.com/lowlighter/metrics/blob/master/.github/readme/partials/setup/action/setup.md for more informations).',
|
||||
)
|
||||
}
|
||||
info("Token validity", "seems ok")
|
||||
}
|
||||
//Extract octokits
|
||||
@@ -179,17 +200,21 @@
|
||||
}
|
||||
else
|
||||
throw error
|
||||
|
||||
}
|
||||
//Retrieve previous render SHA to be able to update file content through API
|
||||
committer.sha = null
|
||||
try {
|
||||
const {repository:{object:{oid}}} = await graphql(`
|
||||
const {repository:{object:{oid}}} = await graphql(
|
||||
`
|
||||
query Sha {
|
||||
repository(owner: "${github.context.repo.owner}", name: "${github.context.repo.repo}") {
|
||||
object(expression: "${committer.head}:${filename}") { ... on Blob { oid } }
|
||||
}
|
||||
}
|
||||
`, {headers:{authorization:`token ${committer.token}`}})
|
||||
`,
|
||||
{headers:{authorization:`token ${committer.token}`}},
|
||||
)
|
||||
committer.sha = oid
|
||||
}
|
||||
catch (error) {
|
||||
@@ -200,6 +225,7 @@
|
||||
else
|
||||
info("Dry-run", true)
|
||||
|
||||
|
||||
//SVG file
|
||||
conf.settings.optimize = optimize
|
||||
info("SVG output", filename)
|
||||
@@ -297,13 +323,16 @@
|
||||
console.debug(`Processing ${path}`)
|
||||
let sha = null
|
||||
try {
|
||||
const {repository:{object:{oid}}} = await graphql(`
|
||||
const {repository:{object:{oid}}} = await graphql(
|
||||
`
|
||||
query Sha {
|
||||
repository(owner: "${github.context.repo.owner}", name: "${github.context.repo.repo}") {
|
||||
object(expression: "${committer.head}:${path}") { ... on Blob { oid } }
|
||||
}
|
||||
}
|
||||
`, {headers:{authorization:`token ${committer.token}`}})
|
||||
`,
|
||||
{headers:{authorization:`token ${committer.token}`}},
|
||||
)
|
||||
sha = oid
|
||||
}
|
||||
catch (error) {
|
||||
@@ -311,8 +340,11 @@
|
||||
}
|
||||
finally {
|
||||
await committer.rest.repos.createOrUpdateFileContents({
|
||||
...github.context.repo, path, content,
|
||||
message:`${committer.message} (cache)`, ...(sha ? {sha} : {}),
|
||||
...github.context.repo,
|
||||
path,
|
||||
content,
|
||||
message:`${committer.message} (cache)`,
|
||||
...(sha ? {sha} : {}),
|
||||
branch:committer.pr ? committer.head : committer.branch,
|
||||
})
|
||||
rendered = rendered.replace(match, `<img src="https://github.com/${github.context.repo.owner}/${github.context.repo.repo}/blob/${committer.branch}/${path}">`)
|
||||
@@ -342,7 +374,9 @@
|
||||
//Commit metrics
|
||||
if (committer.commit) {
|
||||
await committer.rest.repos.createOrUpdateFileContents({
|
||||
...github.context.repo, path:filename, message:committer.message,
|
||||
...github.context.repo,
|
||||
path:filename,
|
||||
message:committer.message,
|
||||
content:Buffer.from(rendered).toString("base64"),
|
||||
branch:committer.pr ? committer.head : committer.branch,
|
||||
...(committer.sha ? {sha:committer.sha} : {}),
|
||||
@@ -379,6 +413,7 @@
|
||||
}
|
||||
else
|
||||
throw error
|
||||
|
||||
}
|
||||
info("Pull request number", number)
|
||||
//Merge pull request
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
//Imports
|
||||
import * as utils from "./utils.mjs"
|
||||
import ejs from "ejs"
|
||||
import util from "util"
|
||||
import SVGO from "svgo"
|
||||
import util from "util"
|
||||
import xmlformat from "xml-formatter"
|
||||
import * as utils from "./utils.mjs"
|
||||
|
||||
//Setup
|
||||
export default async function metrics({login, q}, {graphql, rest, plugins, conf, die = false, verify = false, convert = null}, {Plugins, Templates}) {
|
||||
//Compute rendering
|
||||
try {
|
||||
|
||||
//Debug
|
||||
login = login.replace(/[\n\r]/g, "")
|
||||
console.debug(`metrics/compute/${login} > start`)
|
||||
@@ -28,9 +27,19 @@
|
||||
const pending = []
|
||||
const {queries} = conf
|
||||
const data = {animated:true, base:{}, config:{}, errors:[], plugins:{}, computed:{}}
|
||||
const imports = {plugins:Plugins, templates:Templates, metadata:conf.metadata, ...utils, ...(/markdown/.test(convert) ? {imgb64(url, options) {
|
||||
const imports = {
|
||||
plugins:Plugins,
|
||||
templates:Templates,
|
||||
metadata:conf.metadata,
|
||||
...utils,
|
||||
...(/markdown/.test(convert)
|
||||
? {
|
||||
imgb64(url, options) {
|
||||
return options?.force ? utils.imgb64(...arguments) : url
|
||||
}} : null)}
|
||||
},
|
||||
}
|
||||
: null),
|
||||
}
|
||||
const experimental = new Set(decodeURIComponent(q["experimental.features"] ?? "").split(" ").map(x => x.trim().toLocaleLowerCase()).filter(x => x))
|
||||
if (conf.settings["debug.headless"])
|
||||
imports.puppeteer.headless = false
|
||||
@@ -94,7 +103,7 @@
|
||||
}
|
||||
//Translate action syntax to web syntax
|
||||
let parts = []
|
||||
if (q.base === true)
|
||||
if (q.base === true);
|
||||
({parts} = conf.settings.plugins.base)
|
||||
if (typeof q.base === "string")
|
||||
parts = q.base.split(",").map(x => x.trim())
|
||||
@@ -147,7 +156,9 @@
|
||||
if ((conf.settings?.optimize) && (!q.raw)) {
|
||||
console.debug(`metrics/compute/${login} > optimize`)
|
||||
if (experimental.has("--optimize")) {
|
||||
const {error, data:optimized} = await SVGO.optimize(rendered, {multipass:true, plugins:SVGO.extendDefaultPlugins([
|
||||
const {error, data:optimized} = await SVGO.optimize(rendered, {
|
||||
multipass:true,
|
||||
plugins:SVGO.extendDefaultPlugins([
|
||||
//Additional cleanup
|
||||
{name:"cleanupListOfValues"},
|
||||
{name:"removeRasterImages"},
|
||||
@@ -155,7 +166,8 @@
|
||||
//Force CSS style consistency
|
||||
{name:"inlineStyles", active:false},
|
||||
{name:"removeViewBox", active:false},
|
||||
])})
|
||||
]),
|
||||
})
|
||||
if (error)
|
||||
throw new Error(`Could not optimize SVG: \n${error}`)
|
||||
rendered = optimized
|
||||
@@ -163,6 +175,7 @@
|
||||
}
|
||||
else
|
||||
console.debug(`metrics/compute/${login} > optimize > this feature is currently disabled due to display issues (use --optimize flag in experimental features to force enable it)`)
|
||||
|
||||
}
|
||||
//Verify svg
|
||||
if (verify) {
|
||||
@@ -190,4 +203,3 @@
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
//Imports
|
||||
import fs from "fs"
|
||||
import yaml from "js-yaml"
|
||||
import path from "path"
|
||||
import url from "url"
|
||||
import yaml from "js-yaml"
|
||||
|
||||
//Defined categories
|
||||
const categories = ["core", "github", "social", "other"]
|
||||
@@ -76,7 +76,8 @@
|
||||
throw {error:{message:`Not supported for: ${context}`, instance:new Error()}}
|
||||
}
|
||||
//Inputs checks
|
||||
const result = Object.fromEntries(Object.entries(inputs).map(([key, {type, format, default:defaulted, min, max, values}]) => [
|
||||
const result = Object.fromEntries(
|
||||
Object.entries(inputs).map(([key, {type, format, default:defaulted, min, max, values}]) => [
|
||||
//Format key
|
||||
metadata.to.query(key, {name}),
|
||||
//Format value
|
||||
@@ -153,7 +154,8 @@
|
||||
}
|
||||
}
|
||||
})(defaults[key] ?? defaulted),
|
||||
]))
|
||||
]),
|
||||
)
|
||||
logger(`metrics/inputs > ${name} > ${JSON.stringify(result)}`)
|
||||
return result
|
||||
}
|
||||
@@ -174,13 +176,15 @@
|
||||
})
|
||||
|
||||
//Action descriptor
|
||||
meta.action = Object.fromEntries(Object.entries(inputs).map(([key, value]) => [
|
||||
meta.action = Object.fromEntries(
|
||||
Object.entries(inputs).map(([key, value]) => [
|
||||
key,
|
||||
{
|
||||
comment:comments[key] ?? "",
|
||||
descriptor:yaml.dump({[key]:Object.fromEntries(Object.entries(value).filter(([key]) => ["description", "default", "required"].includes(key)))}, {quotingType:'"', noCompatMode:true}),
|
||||
},
|
||||
]))
|
||||
]),
|
||||
)
|
||||
|
||||
//Action inputs
|
||||
meta.inputs.action = function({core}) {
|
||||
@@ -202,7 +206,8 @@
|
||||
|
||||
//Web metadata
|
||||
{
|
||||
meta.web = Object.fromEntries(Object.entries(inputs).map(([key, {type, description:text, example, default:defaulted, min = 0, max = 9999, values}]) => [
|
||||
meta.web = Object.fromEntries(
|
||||
Object.entries(inputs).map(([key, {type, description:text, example, default:defaulted, min = 0, max = 9999, values}]) => [
|
||||
//Format key
|
||||
metadata.to.query(key),
|
||||
//Value descriptor
|
||||
@@ -225,7 +230,8 @@
|
||||
return null
|
||||
}
|
||||
})(),
|
||||
]).filter(([key, value]) => (value)&&(key !== name)))
|
||||
]).filter(([key, value]) => (value) && (key !== name)),
|
||||
)
|
||||
}
|
||||
|
||||
//Readme metadata
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
//Imports
|
||||
import fs from "fs"
|
||||
import metadata from "./metadata.mjs"
|
||||
import path from "path"
|
||||
import processes from "child_process"
|
||||
import util from "util"
|
||||
import url from "url"
|
||||
import yaml from "js-yaml"
|
||||
import OctokitRest from "@octokit/rest"
|
||||
import processes from "child_process"
|
||||
import fs from "fs"
|
||||
import yaml from "js-yaml"
|
||||
import path from "path"
|
||||
import url from "url"
|
||||
import util from "util"
|
||||
import metadata from "./metadata.mjs"
|
||||
|
||||
//Templates and plugins
|
||||
const Templates = {}
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
/**Setup */
|
||||
export default async function({log = true, nosettings = false, community = {}} = {}) {
|
||||
|
||||
//Paths
|
||||
const __metrics = path.join(path.dirname(url.fileURLToPath(import.meta.url)), "../../..")
|
||||
const __statics = path.join(__metrics, "source/app/web/statics")
|
||||
@@ -52,6 +51,8 @@
|
||||
}
|
||||
else
|
||||
logger("metrics/setup > load settings.json > (missing)")
|
||||
|
||||
|
||||
if (!conf.settings.templates)
|
||||
conf.settings.templates = {default:"classic", enabled:[]}
|
||||
if (!conf.settings.plugins)
|
||||
@@ -104,10 +105,13 @@
|
||||
}
|
||||
else
|
||||
logger(`metrics/setup > @${name} could not extends ${inherit} as it does not exist`)
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
logger(`metrics/setup > @${name}/template.mjs does not exist`)
|
||||
|
||||
|
||||
//Clean remote repository
|
||||
logger(`metrics/setup > clean ${repo}@${branch}`)
|
||||
await fs.promises.rmdir(path.join(__templates, ".community"), {recursive:true})
|
||||
@@ -122,6 +126,7 @@
|
||||
else
|
||||
logger("metrics/setup > no community templates to install")
|
||||
|
||||
|
||||
//Load templates
|
||||
for (const name of await fs.promises.readdir(__templates)) {
|
||||
//Search for templates
|
||||
@@ -201,7 +206,8 @@
|
||||
for (const [key, value] of Object.entries(vars))
|
||||
queried = queried.replace(new RegExp(`[$]${key}`, "g"), value)
|
||||
return queried
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,12 +226,13 @@
|
||||
}
|
||||
|
||||
//Set no token property
|
||||
Object.defineProperty(conf.settings, "notoken", {get() {
|
||||
Object.defineProperty(conf.settings, "notoken", {
|
||||
get() {
|
||||
return conf.settings.token === "NOT_NEEDED"
|
||||
}})
|
||||
},
|
||||
})
|
||||
|
||||
//Conf
|
||||
logger("metrics/setup > setup > success")
|
||||
return {Templates, Plugins, conf}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
//Imports
|
||||
import fs from "fs/promises"
|
||||
import prism_lang from "prismjs/components/index.js"
|
||||
import axios from "axios"
|
||||
import processes from "child_process"
|
||||
import fss from "fs"
|
||||
import GIFEncoder from "gifencoder"
|
||||
import jimp from "jimp"
|
||||
import marked from "marked"
|
||||
import nodechartist from "node-chartist"
|
||||
import opengraph from "open-graph-scraper"
|
||||
import os from "os"
|
||||
import paths from "path"
|
||||
import url from "url"
|
||||
import util from "util"
|
||||
import processes from "child_process"
|
||||
import axios from "axios"
|
||||
import PNG from "png-js"
|
||||
import prism from "prismjs"
|
||||
import _puppeteer from "puppeteer"
|
||||
import rss from "rss-parser"
|
||||
import htmlsanitize from "sanitize-html"
|
||||
import git from "simple-git"
|
||||
import twemojis from "twemoji-parser"
|
||||
import jimp from "jimp"
|
||||
import opengraph from "open-graph-scraper"
|
||||
import rss from "rss-parser"
|
||||
import nodechartist from "node-chartist"
|
||||
import GIFEncoder from "gifencoder"
|
||||
import PNG from "png-js"
|
||||
import marked from "marked"
|
||||
import htmlsanitize from "sanitize-html"
|
||||
import prism from "prismjs"
|
||||
import prism_lang from "prismjs/components/index.js"
|
||||
import url from "url"
|
||||
import util from "util"
|
||||
prism_lang()
|
||||
|
||||
//Exports
|
||||
export {fs, os, paths, url, util, processes, axios, git, opengraph, jimp, rss}
|
||||
export {axios, fs, git, jimp, opengraph, os, paths, processes, rss, url, util}
|
||||
|
||||
/**Returns module __dirname */
|
||||
export function __module(module) {
|
||||
@@ -71,9 +71,11 @@
|
||||
|
||||
/**Percentage formatter */
|
||||
export function percentage(n, {rescale = true} = {}) {
|
||||
return `${(n*(rescale ? 100 : 1)).toFixed(2)
|
||||
return `${
|
||||
(n * (rescale ? 100 : 1)).toFixed(2)
|
||||
.replace(/(?<=[.])(?<decimal>[1-9]*)0+$/, "$<decimal>")
|
||||
.replace(/[.]$/, "")}%`
|
||||
.replace(/[.]$/, "")
|
||||
}%`
|
||||
}
|
||||
format.percentage = percentage
|
||||
|
||||
@@ -173,13 +175,16 @@
|
||||
//Markdown mode
|
||||
switch (mode) {
|
||||
case "inline": {
|
||||
rendered = htmlsanitize(htmlsanitize(rendered, {
|
||||
rendered = htmlsanitize(
|
||||
htmlsanitize(rendered, {
|
||||
allowedTags:["h1", "h2", "h3", "h4", "h5", "h6", "br", "blockquote", "code", "span"],
|
||||
allowedAttributes:{code:["class"], span:["class"]},
|
||||
}), {
|
||||
}),
|
||||
{
|
||||
allowedAttributes:{code:["class"], span:["class"]},
|
||||
transformTags:{h1:"b", h2:"b", h3:"b", h4:"b", h5:"b", h6:"b", blockquote:"i"},
|
||||
})
|
||||
},
|
||||
)
|
||||
break
|
||||
}
|
||||
default:
|
||||
@@ -257,11 +262,13 @@
|
||||
page.on("console", ({_text:text}) => console.debug(`metrics/svg/pdf > puppeteer > ${text}`))
|
||||
await page.setContent(`<main class="markdown-body">${rendered}</main>`, {waitUntil:["load", "domcontentloaded", "networkidle2"]})
|
||||
console.debug("metrics/svg/pdf > loaded svg successfully")
|
||||
await page.addStyleTag({content:`
|
||||
await page.addStyleTag({
|
||||
content:`
|
||||
main { margin: ${(Array.isArray(paddings) ? paddings : paddings.split(",")).join(" ")}; }
|
||||
main svg { height: 1em; width: 1em; }
|
||||
${await fs.readFile(paths.join(__module(import.meta.url), "../../../node_modules", "@primer/css/dist/markdown.css")).catch(_ => "")}${style}
|
||||
`})
|
||||
`,
|
||||
})
|
||||
rendered = await page.pdf()
|
||||
//Result
|
||||
await page.close()
|
||||
|
||||
@@ -11,9 +11,11 @@
|
||||
get digital() {
|
||||
return `${this.hours}:${this.minutes}`
|
||||
},
|
||||
hours:faker.datatype.number(1000), minutes:faker.datatype.number(1000),
|
||||
hours:faker.datatype.number(1000),
|
||||
minutes:faker.datatype.number(1000),
|
||||
name:array ? faker.random.arrayElement(array) : faker.random.words(2).replace(/ /g, "-").toLocaleLowerCase(),
|
||||
percent:0, total_seconds:faker.datatype.number(1000000),
|
||||
percent:0,
|
||||
total_seconds:faker.datatype.number(1000000),
|
||||
}))
|
||||
results = results.filter(({name}) => elements.includes(name) ? false : (elements.push(name), true))
|
||||
let percents = 100
|
||||
|
||||
@@ -118,6 +118,5 @@
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > base/repositories")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
repositories:{
|
||||
edges:[],
|
||||
nodes:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
repositories:{
|
||||
edges:[
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > gists/default")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
gists:{
|
||||
edges:[],
|
||||
nodes:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
gists:{
|
||||
edges:[
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > notable/contributions")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
repositoriesContributedTo:{
|
||||
edges:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
repositoriesContributedTo:{
|
||||
edges:[
|
||||
|
||||
@@ -2,13 +2,15 @@
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > people/default")
|
||||
const type = query.match(/(?<type>followers|following)[(]/)?.groups?.type ?? "(unknown type)"
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
[type]:{
|
||||
edges:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
[type]:{
|
||||
edges:new Array(Math.ceil(20 + 80 * Math.random())).fill(null).map((login = faker.internet.userName()) => ({
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > people/repository")
|
||||
const type = query.match(/(?<type>stargazers|watchers)[(]/)?.groups?.type ?? "(unknown type)"
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
repository:{
|
||||
[type]:{
|
||||
@@ -10,7 +11,8 @@
|
||||
},
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
repository:{
|
||||
[type]:{
|
||||
|
||||
@@ -2,14 +2,16 @@
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > people/sponsors")
|
||||
const type = query.match(/(?<type>sponsorshipsAsSponsor|sponsorshipsAsMaintainer)[(]/)?.groups?.type ?? "(unknown type)"
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
login,
|
||||
[type]:{
|
||||
edges:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
login,
|
||||
[type]:{
|
||||
|
||||
@@ -2,14 +2,16 @@
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > reactions/default")
|
||||
const type = query.match(/(?<type>issues|issueComments)[(]/)?.groups?.type ?? "(unknown type)"
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
[type]:{
|
||||
edges:[],
|
||||
nodes:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
[type]:{
|
||||
edges:new Array(100).fill(null).map(_ => ({
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > stargazers/default")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query) ? ({
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
repository:{
|
||||
stargazers:{
|
||||
edges:[],
|
||||
},
|
||||
},
|
||||
}) : ({
|
||||
})
|
||||
: ({
|
||||
repository:{
|
||||
stargazers:{
|
||||
edges:new Array(faker.datatype.number({min:50, max:100})).fill(null).map(() => ({
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
status:"200 OK",
|
||||
"x-oauth-scopes":"repo",
|
||||
},
|
||||
data:page < 2 ? new Array(per_page).fill(null).map(() => ({
|
||||
data:page < 2
|
||||
? new Array(per_page).fill(null).map(() => ({
|
||||
sha:"MOCKED_SHA",
|
||||
get author() {
|
||||
return this.commit.author
|
||||
@@ -29,6 +30,7 @@
|
||||
date:`${faker.date.recent(14)}`,
|
||||
},
|
||||
},
|
||||
})) : [],
|
||||
}))
|
||||
: [],
|
||||
})
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
{
|
||||
sha:"MOCKED_SHA",
|
||||
filename:faker.system.fileName(),
|
||||
patch:"@@ -0,0 +1,5 @@\n+//Imports\n+ import app from \"./src/app.mjs\"\n+\n+//Start app\n+ await app()\n\\ No newline at end of file",
|
||||
patch:'@@ -0,0 +1,5 @@\n+//Imports\n+ import app from "./src/app.mjs"\n+\n+//Start app\n+ await app()\n\\ No newline at end of file',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
//Imports
|
||||
import fs from "fs/promises"
|
||||
import axios from "axios"
|
||||
import faker from "faker"
|
||||
import paths from "path"
|
||||
import urls from "url"
|
||||
import rss from "rss-parser"
|
||||
import fs from "fs/promises"
|
||||
import urls from "url"
|
||||
|
||||
//Mocked state
|
||||
let mocked = false
|
||||
|
||||
//Mocking
|
||||
export default async function({graphql, rest}) {
|
||||
|
||||
//Check if already mocked
|
||||
if (mocked)
|
||||
return {graphql, rest}
|
||||
@@ -29,6 +28,7 @@
|
||||
}
|
||||
else
|
||||
mocks[entry.replace(/[.]mjs$/, "")] = (await import(urls.pathToFileURL(paths.join(directory, entry)).href)).default
|
||||
|
||||
}
|
||||
return mocks
|
||||
}
|
||||
@@ -73,6 +73,7 @@
|
||||
}
|
||||
else
|
||||
mocker({path:`${path}.${key}`, mocks:mocks[key], mocked:mocked[key]})
|
||||
|
||||
}
|
||||
}
|
||||
mocker({mocks:mocks.github.rest, mocked:rest})
|
||||
@@ -147,4 +148,3 @@
|
||||
//Return mocked elements
|
||||
return {graphql, rest}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
//Imports
|
||||
import octokit from "@octokit/graphql"
|
||||
import OctokitRest from "@octokit/rest"
|
||||
import compression from "compression"
|
||||
import express from "express"
|
||||
import ratelimit from "express-rate-limit"
|
||||
import compression from "compression"
|
||||
import cache from "memory-cache"
|
||||
import util from "util"
|
||||
import metrics from "../metrics/index.mjs"
|
||||
import setup from "../metrics/setup.mjs"
|
||||
import mocks from "../mocks/index.mjs"
|
||||
import metrics from "../metrics/index.mjs"
|
||||
|
||||
/**App */
|
||||
export default async function({mock, nosettings} = {}) {
|
||||
|
||||
//Load configuration settings
|
||||
const {conf, Plugins, Templates} = await setup({nosettings})
|
||||
const {token, maxusers = 0, restricted = [], debug = false, cached = 30 * 60 * 1000, port = 3000, ratelimiter = null, plugins = null} = conf.settings
|
||||
@@ -80,9 +79,11 @@
|
||||
|
||||
//Base routes
|
||||
const limiter = ratelimit({max:debug ? Number.MAX_SAFE_INTEGER : 60, windowMs:60 * 1000, headers:false})
|
||||
const metadata = Object.fromEntries(Object.entries(conf.metadata.plugins)
|
||||
const metadata = Object.fromEntries(
|
||||
Object.entries(conf.metadata.plugins)
|
||||
.map(([key, value]) => [key, Object.fromEntries(Object.entries(value).filter(([key]) => ["name", "icon", "categorie", "web", "supports"].includes(key)))])
|
||||
.map(([key, value]) => [key, key === "core" ? {...value, web:Object.fromEntries(Object.entries(value.web).filter(([key]) => /^config[.]/.test(key)).map(([key, value]) => [key.replace(/^config[.]/, ""), value]))} : value]))
|
||||
.map(([key, value]) => [key, key === "core" ? {...value, web:Object.fromEntries(Object.entries(value.web).filter(([key]) => /^config[.]/.test(key)).map(([key, value]) => [key.replace(/^config[.]/, ""), value]))} : value]),
|
||||
)
|
||||
const enabled = Object.entries(metadata).filter(([_name, {categorie}]) => categorie !== "core").map(([name]) => ({name, enabled:plugins[name]?.enabled ?? false}))
|
||||
const templates = Object.entries(Templates).map(([name]) => ({name, enabled:(conf.settings.templates.enabled.length ? conf.settings.templates.enabled.includes(name) : true) ?? false}))
|
||||
const actions = {flush:new Map()}
|
||||
@@ -172,16 +173,26 @@
|
||||
}
|
||||
//Compute metrics
|
||||
console.debug(`metrics/app/${login}/insights > compute insights`)
|
||||
const json = await metrics({
|
||||
login, q:{
|
||||
const json = await metrics(
|
||||
{
|
||||
login,
|
||||
q:{
|
||||
template:"classic",
|
||||
achievements:true, "achievements.threshold":"X",
|
||||
isocalendar:true, "isocalendar.duration":"full-year",
|
||||
languages:true, "languages.limit":0,
|
||||
activity:true, "activity.limit":100, "activity.days":0,
|
||||
achievements:true,
|
||||
"achievements.threshold":"X",
|
||||
isocalendar:true,
|
||||
"isocalendar.duration":"full-year",
|
||||
languages:true,
|
||||
"languages.limit":0,
|
||||
activity:true,
|
||||
"activity.limit":100,
|
||||
"activity.days":0,
|
||||
notable:true,
|
||||
},
|
||||
}, {graphql, rest, plugins:{achievements:{enabled:true}, isocalendar:{enabled:true}, languages:{enabled:true}, activity:{enabled:true, markdown:"extended"}, notable:{enabled:true}}, conf, convert:"json"}, {Plugins, Templates})
|
||||
},
|
||||
{graphql, rest, plugins:{achievements:{enabled:true}, isocalendar:{enabled:true}, languages:{enabled:true}, activity:{enabled:true, markdown:"extended"}, notable:{enabled:true}}, conf, convert:"json"},
|
||||
{Plugins, Templates},
|
||||
)
|
||||
//Cache
|
||||
if ((!debug) && (cached)) {
|
||||
const maxage = Math.round(Number(req.query.cache))
|
||||
@@ -232,6 +243,8 @@
|
||||
}
|
||||
else
|
||||
pending.set(login, new Promise(_solve => solve = _solve))
|
||||
|
||||
|
||||
//Read cached data if possible
|
||||
if ((!debug) && (cached) && (cache.get(login))) {
|
||||
console.debug(`metrics/app/${login} > using cached image`)
|
||||
@@ -258,7 +271,10 @@
|
||||
const q = req.query
|
||||
console.debug(`metrics/app/${login} > ${util.inspect(q, {depth:Infinity, maxStringLength:256})}`)
|
||||
const {rendered, mime} = await metrics({login, q}, {
|
||||
graphql, rest, plugins, conf,
|
||||
graphql,
|
||||
rest,
|
||||
plugins,
|
||||
conf,
|
||||
die:q["plugins.errors.fatal"] ?? false,
|
||||
verify:q.verify ?? false,
|
||||
convert:["svg", "jpeg", "png", "json", "markdown", "markdown-pdf"].includes(q["config.output"]) ? q["config.output"] : null,
|
||||
@@ -299,8 +315,9 @@
|
||||
console.error(error)
|
||||
return res.status(500).send("Internal Server Error: failed to process metrics correctly")
|
||||
}
|
||||
//After rendering
|
||||
finally {
|
||||
//After rendering
|
||||
|
||||
solve?.()
|
||||
}
|
||||
})
|
||||
|
||||
@@ -7,15 +7,17 @@
|
||||
//Palette
|
||||
try {
|
||||
this.palette = (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light")
|
||||
} catch (error) {}
|
||||
}
|
||||
catch (error) {}
|
||||
//User
|
||||
const user = location.pathname.split("/").pop()
|
||||
if ((user) && (user !== "about")) {
|
||||
this.user = user
|
||||
await this.search()
|
||||
}
|
||||
else
|
||||
else {
|
||||
this.searchable = true
|
||||
}
|
||||
//Embed
|
||||
this.embed = !!(new URLSearchParams(location.search).get("embed"))
|
||||
//Init
|
||||
@@ -44,8 +46,8 @@
|
||||
handler(current, previous) {
|
||||
document.querySelector("body").classList.remove(previous)
|
||||
document.querySelector("body").classList.add(current)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
//Methods
|
||||
methods: {
|
||||
@@ -59,16 +61,16 @@
|
||||
const baseUrl = String.raw`https?:\/\/(?:www\.)?github.com\/([\w.-]+\/[\w.-]+)\/`
|
||||
return value
|
||||
.replace(
|
||||
RegExp(baseUrl + String.raw`(?:issues|pull|discussions)\/(\d+)(?:\?\S+)?(#\S+)?`, 'g'),
|
||||
(_, repo, id, comment) => (options?.repo === repo ? '' : repo) + `#${id}` + (comment ? ` (comment)` : '')
|
||||
RegExp(baseUrl + String.raw`(?:issues|pull|discussions)\/(\d+)(?:\?\S+)?(#\S+)?`, "g"),
|
||||
(_, repo, id, comment) => (options?.repo === repo ? "" : repo) + `#${id}` + (comment ? ` (comment)` : ""),
|
||||
) // -> 'lowlighter/metrics#123'
|
||||
.replace(
|
||||
RegExp(baseUrl + String.raw`commit\/([\da-f]+)`, 'g'),
|
||||
(_, repo, sha) => (options?.repo === repo ? '' : repo + '@') + sha
|
||||
RegExp(baseUrl + String.raw`commit\/([\da-f]+)`, "g"),
|
||||
(_, repo, sha) => (options?.repo === repo ? "" : repo + "@") + sha,
|
||||
) // -> 'lowlighter/metrics@123abc'
|
||||
.replace(
|
||||
RegExp(baseUrl + String.raw`compare\/(\S+...\S+)`, 'g'),
|
||||
(_, repo, tags) => (options?.repo === repo ? '' : repo + '@') + tags
|
||||
RegExp(baseUrl + String.raw`compare\/(\S+...\S+)`, "g"),
|
||||
(_, repo, tags) => (options?.repo === repo ? "" : repo + "@") + tags,
|
||||
) // -> 'lowlighter/metrics@1.0...1.1'
|
||||
}
|
||||
return value
|
||||
@@ -86,7 +88,7 @@
|
||||
finally {
|
||||
this.pending = false
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
//Computed properties
|
||||
computed: {
|
||||
@@ -124,7 +126,7 @@
|
||||
},
|
||||
preview() {
|
||||
return /-preview$/.test(this.version)
|
||||
}
|
||||
},
|
||||
},
|
||||
//Data initialization
|
||||
data: {
|
||||
@@ -138,6 +140,6 @@
|
||||
metrics: null,
|
||||
pending: false,
|
||||
error: null,
|
||||
}
|
||||
},
|
||||
})
|
||||
})()
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
try {
|
||||
this.config.timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
|
||||
this.palette = (window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light")
|
||||
} catch (error) {}
|
||||
}
|
||||
catch (error) {}
|
||||
//Init
|
||||
await Promise.all([
|
||||
//GitHub limit tracker
|
||||
@@ -67,8 +68,8 @@
|
||||
handler(current, previous) {
|
||||
document.querySelector("body").classList.remove(previous)
|
||||
document.querySelector("body").classList.add(current)
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
//Data initialization
|
||||
data: {
|
||||
@@ -93,14 +94,16 @@
|
||||
"base.community": "Community stats",
|
||||
"base.repositories": "Repositories metrics",
|
||||
"base.metadata": "Metadata",
|
||||
...Object.fromEntries(Object.entries(metadata).map(([key, {name}]) => [key, name]))
|
||||
...Object.fromEntries(Object.entries(metadata).map(([key, { name }]) => [key, name])),
|
||||
},
|
||||
options: {
|
||||
descriptions: { ...(Object.assign({}, ...Object.entries(metadata).flatMap(([key, { web }]) => web))) },
|
||||
...(Object.fromEntries(Object.entries(
|
||||
Object.assign({}, ...Object.entries(metadata).flatMap(([key, {web}]) => web)))
|
||||
.map(([key, {defaulted}]) => [key, defaulted])
|
||||
))
|
||||
...(Object.fromEntries(
|
||||
Object.entries(
|
||||
Object.assign({}, ...Object.entries(metadata).flatMap(([key, { web }]) => web)),
|
||||
)
|
||||
.map(([key, { defaulted }]) => [key, defaulted]),
|
||||
)),
|
||||
},
|
||||
},
|
||||
templates: {
|
||||
@@ -108,7 +111,7 @@
|
||||
selected: "classic",
|
||||
placeholder: {
|
||||
timeout: null,
|
||||
image:""
|
||||
image: "",
|
||||
},
|
||||
descriptions: {
|
||||
classic: "Classic template",
|
||||
@@ -188,9 +191,13 @@
|
||||
` template: ${this.templates.selected}`,
|
||||
` base: ${Object.entries(this.plugins.enabled.base).filter(([key, value]) => value).map(([key]) => key).join(", ") || '""'}`,
|
||||
...[
|
||||
...Object.entries(this.plugins.options).filter(([key, value]) => (key in metadata.base.web)&&(value !== metadata.base.web[key]?.defaulted)).map(([key, value]) => ` ${key.replace(/[.]/, "_")}: ${typeof value === "boolean" ? {true:"yes", false:"no"}[value] : value}`),
|
||||
...Object.entries(this.plugins.options).filter(([key, value]) => (key in metadata.base.web) && (value !== metadata.base.web[key]?.defaulted)).map(([key, value]) =>
|
||||
` ${key.replace(/[.]/, "_")}: ${typeof value === "boolean" ? { true: "yes", false: "no" }[value] : value}`
|
||||
),
|
||||
...Object.entries(this.plugins.enabled).filter(([key, value]) => (key !== "base") && (value)).map(([key]) => ` plugin_${key}: yes`),
|
||||
...Object.entries(this.plugins.options).filter(([key, value]) => value).filter(([key, value]) => this.plugins.enabled[key.split(".")[0]]).map(([key, value]) => ` plugin_${key.replace(/[.]/, "_")}: ${typeof value === "boolean" ? {true:"yes", false:"no"}[value] : value}`),
|
||||
...Object.entries(this.plugins.options).filter(([key, value]) => value).filter(([key, value]) => this.plugins.enabled[key.split(".")[0]]).map(([key, value]) =>
|
||||
` plugin_${key.replace(/[.]/, "_")}: ${typeof value === "boolean" ? { true: "yes", false: "no" }[value] : value}`
|
||||
),
|
||||
...Object.entries(this.config).filter(([key, value]) => (value) && (value !== metadata.core.web[key]?.defaulted)).map(([key, value]) => ` config_${key.replace(/[.]/, "_")}: ${typeof value === "boolean" ? { true: "yes", false: "no" }[value] : value}`),
|
||||
].sort(),
|
||||
].join("\n")
|
||||
@@ -211,7 +218,7 @@
|
||||
//Is in preview mode
|
||||
preview() {
|
||||
return /-preview$/.test(this.version)
|
||||
}
|
||||
},
|
||||
},
|
||||
//Methods
|
||||
methods: {
|
||||
@@ -244,7 +251,8 @@
|
||||
await axios.get(`/.uncache?&token=${(await axios.get(`/.uncache?user=${this.user}`)).data.token}`)
|
||||
this.generated.content = (await axios.get(this.url)).data
|
||||
this.generated.error = null
|
||||
} catch (error) {
|
||||
}
|
||||
catch (error) {
|
||||
this.generated.error = { code: error.response.status, message: error.response.data }
|
||||
}
|
||||
finally {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(function ({axios, faker, ejs} = {axios:globalThis.axios, faker:globalThis.faker, ejs:globalThis.ejs}) {
|
||||
;(function({ axios, faker, ejs } = { axios: globalThis.axios, faker: globalThis.faker, ejs: globalThis.ejs }) {
|
||||
//Load assets
|
||||
const cached = new Map()
|
||||
async function load(url) {
|
||||
@@ -29,7 +29,9 @@
|
||||
const options = set.plugins.options
|
||||
const data = {
|
||||
//Template elements
|
||||
style, fonts, errors:[],
|
||||
style,
|
||||
fonts,
|
||||
errors: [],
|
||||
partials: new Set([...(set.config.order || "").split(",").map(x => x.trim()).filter(x => partials.includes(x)), ...partials]),
|
||||
//Plural helper
|
||||
s(value, end = "") {
|
||||
@@ -37,9 +39,10 @@
|
||||
},
|
||||
//Formatter helper
|
||||
f(n, { sign = false } = {}) {
|
||||
for (const {u, v} of [{u:"b", v:10**9}, {u:"m", v:10**6}, {u:"k", v:10**3}])
|
||||
for (const { u, v } of [{ u: "b", v: 10 ** 9 }, { u: "m", v: 10 ** 6 }, { u: "k", v: 10 ** 3 }]) {
|
||||
if (n / v >= 1)
|
||||
return `${(sign) && (n > 0) ? "+" : ""}${(n / v).toFixed(2).substr(0, 4).replace(/[.]0*$/, "")}${u}`
|
||||
}
|
||||
return `${(sign) && (n > 0) ? "+" : ""}${n}`
|
||||
},
|
||||
//Trap for includes
|
||||
@@ -76,7 +79,7 @@
|
||||
registration: `${faker.datatype.number({ min: 2, max: 10 })} years ago`,
|
||||
cakeday: false,
|
||||
calendar: new Array(14).fill(null).map(_ => ({ color: faker.random.arrayElement(["#ebedf0", "#9be9a8", "#40c463", "#30a14e", "#216e39"]) })),
|
||||
avatar:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg=="
|
||||
avatar: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==",
|
||||
},
|
||||
//User data
|
||||
account: "user",
|
||||
@@ -108,12 +111,13 @@
|
||||
followers: { totalCount: faker.datatype.number(1000) },
|
||||
following: { totalCount: faker.datatype.number(1000) },
|
||||
issueComments: { totalCount: faker.datatype.number(1000) },
|
||||
organizations:{totalCount:faker.datatype.number(10)}
|
||||
organizations: { totalCount: faker.datatype.number(10) },
|
||||
},
|
||||
//Plugins
|
||||
plugins: {
|
||||
//Tweets
|
||||
...(set.plugins.enabled.tweets ? ({
|
||||
...(set.plugins.enabled.tweets
|
||||
? ({
|
||||
tweets: {
|
||||
username: options["tweets.user"] || "(attached Twitter account)",
|
||||
profile: {
|
||||
@@ -129,90 +133,179 @@
|
||||
id: faker.datatype.number(100000000000000).toString(),
|
||||
created_at: faker.date.recent(),
|
||||
entities: {
|
||||
mentions: [ {start:22, end:33, username:"lowlighter"} ]
|
||||
mentions: [{ start: 22, end: 33, username: "lowlighter" }],
|
||||
},
|
||||
text: 'Checkout metrics from <span class="mention">@lowlighter</span> ! <span class="hashtag">#GitHub</span> ',
|
||||
mentions: ["lowlighter"]
|
||||
mentions: ["lowlighter"],
|
||||
},
|
||||
...new Array(Number(options["tweets.limit"]) - 1).fill(null).map(_ => ({
|
||||
id: faker.datatype.number(100000000000000).toString(),
|
||||
created_at: faker.date.recent(),
|
||||
text: faker.lorem.paragraph(),
|
||||
mentions:[]
|
||||
mentions: [],
|
||||
})),
|
||||
]
|
||||
}
|
||||
}) : null),
|
||||
],
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Lines
|
||||
...(set.plugins.enabled.lines ? ({
|
||||
...(set.plugins.enabled.lines
|
||||
? ({
|
||||
lines: {
|
||||
added: `${faker.datatype.number(100)}.${faker.datatype.number(9)}k`,
|
||||
deleted: `${faker.datatype.number(100)}.${faker.datatype.number(9)}k`,
|
||||
}
|
||||
}) : null),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Traffic
|
||||
...(set.plugins.enabled.traffic ? ({
|
||||
...(set.plugins.enabled.traffic
|
||||
? ({
|
||||
traffic: {
|
||||
views: {
|
||||
count: `${faker.datatype.number({ min: 10, max: 100 })}.${faker.datatype.number(9)}k`,
|
||||
uniques: `${faker.datatype.number(10)}.${faker.datatype.number(9)}k`,
|
||||
}
|
||||
}
|
||||
}) : null),
|
||||
},
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Follow-up
|
||||
...(set.plugins.enabled.followup ? ({
|
||||
...(set.plugins.enabled.followup
|
||||
? ({
|
||||
followup: {
|
||||
sections: options["followup.sections"].split(",").map(x => x.trim()).filter(x => ["user", "repositories"].includes(x)),
|
||||
issues:{get count() { return this.open + this.closed }, open:faker.datatype.number(1000), closed:faker.datatype.number(1000)},
|
||||
pr:{get count() { return this.open + this.merged }, open:faker.datatype.number(1000), closed:faker.datatype.number(1000), merged:faker.datatype.number(1000)},
|
||||
issues: {
|
||||
get count() {
|
||||
return this.open + this.closed
|
||||
},
|
||||
open: faker.datatype.number(1000),
|
||||
closed: faker.datatype.number(1000),
|
||||
},
|
||||
pr: {
|
||||
get count() {
|
||||
return this.open + this.merged
|
||||
},
|
||||
open: faker.datatype.number(1000),
|
||||
closed: faker.datatype.number(1000),
|
||||
merged: faker.datatype.number(1000),
|
||||
},
|
||||
user: {
|
||||
issues:{get count() { return this.open + this.closed }, open:faker.datatype.number(1000), closed:faker.datatype.number(1000)},
|
||||
pr:{get count() { return this.open + this.merged }, open:faker.datatype.number(1000), closed:faker.datatype.number(1000), merged:faker.datatype.number(1000)},
|
||||
}
|
||||
}
|
||||
}) : null),
|
||||
issues: {
|
||||
get count() {
|
||||
return this.open + this.closed
|
||||
},
|
||||
open: faker.datatype.number(1000),
|
||||
closed: faker.datatype.number(1000),
|
||||
},
|
||||
pr: {
|
||||
get count() {
|
||||
return this.open + this.merged
|
||||
},
|
||||
open: faker.datatype.number(1000),
|
||||
closed: faker.datatype.number(1000),
|
||||
merged: faker.datatype.number(1000),
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Notable
|
||||
...(set.plugins.enabled.notable ? ({
|
||||
...(set.plugins.enabled.notable
|
||||
? ({
|
||||
notable: {
|
||||
contributions: new Array(2 + faker.datatype.number(2)).fill(null).map(_ => ({ name: faker.lorem.slug(), avatar: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==" })),
|
||||
}
|
||||
}) : null),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Gists
|
||||
...(set.plugins.enabled.gists ? ({
|
||||
...(set.plugins.enabled.gists
|
||||
? ({
|
||||
gists: {
|
||||
totalCount: faker.datatype.number(100),
|
||||
stargazers: faker.datatype.number(1000),
|
||||
forks: faker.datatype.number(100),
|
||||
files: faker.datatype.number(100),
|
||||
comments:faker.datatype.number(1000)
|
||||
}
|
||||
}) : null),
|
||||
comments: faker.datatype.number(1000),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Reactions
|
||||
...(set.plugins.enabled.reactions ? ({
|
||||
...(set.plugins.enabled.reactions
|
||||
? ({
|
||||
reactions: {
|
||||
list: {
|
||||
HEART:{value:faker.datatype.number(100), get percentage() { return this.score }, score:faker.datatype.number(100)/100},
|
||||
THUMBS_UP:{value:faker.datatype.number(100), get percentage() { return this.score }, score:faker.datatype.number(100)/100},
|
||||
THUMBS_DOWN:{value:faker.datatype.number(100), get percentage() { return this.score }, score:faker.datatype.number(100)/100},
|
||||
LAUGH:{value:faker.datatype.number(100), get percentage() { return this.score }, score:faker.datatype.number(100)/100},
|
||||
CONFUSED:{value:faker.datatype.number(100), get percentage() { return this.score }, score:faker.datatype.number(100)/100},
|
||||
EYES:{value:faker.datatype.number(100), get percentage() { return this.score }, score:faker.datatype.number(100)/100},
|
||||
ROCKET:{value:faker.datatype.number(100), get percentage() { return this.score }, score:faker.datatype.number(100)/100},
|
||||
HOORAY:{value:faker.datatype.number(100), get percentage() { return this.score }, score:faker.datatype.number(100)/100},
|
||||
HEART: {
|
||||
value: faker.datatype.number(100),
|
||||
get percentage() {
|
||||
return this.score
|
||||
},
|
||||
score: faker.datatype.number(100) / 100,
|
||||
},
|
||||
THUMBS_UP: {
|
||||
value: faker.datatype.number(100),
|
||||
get percentage() {
|
||||
return this.score
|
||||
},
|
||||
score: faker.datatype.number(100) / 100,
|
||||
},
|
||||
THUMBS_DOWN: {
|
||||
value: faker.datatype.number(100),
|
||||
get percentage() {
|
||||
return this.score
|
||||
},
|
||||
score: faker.datatype.number(100) / 100,
|
||||
},
|
||||
LAUGH: {
|
||||
value: faker.datatype.number(100),
|
||||
get percentage() {
|
||||
return this.score
|
||||
},
|
||||
score: faker.datatype.number(100) / 100,
|
||||
},
|
||||
CONFUSED: {
|
||||
value: faker.datatype.number(100),
|
||||
get percentage() {
|
||||
return this.score
|
||||
},
|
||||
score: faker.datatype.number(100) / 100,
|
||||
},
|
||||
EYES: {
|
||||
value: faker.datatype.number(100),
|
||||
get percentage() {
|
||||
return this.score
|
||||
},
|
||||
score: faker.datatype.number(100) / 100,
|
||||
},
|
||||
ROCKET: {
|
||||
value: faker.datatype.number(100),
|
||||
get percentage() {
|
||||
return this.score
|
||||
},
|
||||
score: faker.datatype.number(100) / 100,
|
||||
},
|
||||
HOORAY: {
|
||||
value: faker.datatype.number(100),
|
||||
get percentage() {
|
||||
return this.score
|
||||
},
|
||||
score: faker.datatype.number(100) / 100,
|
||||
},
|
||||
},
|
||||
comments: options["reactions.limit"],
|
||||
details: options["reactions.details"],
|
||||
days:options["reactions.days"]
|
||||
}
|
||||
}) : null),
|
||||
days: options["reactions.days"],
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Achievements
|
||||
...(set.plugins.enabled.achievements ? ({
|
||||
...(set.plugins.enabled.achievements
|
||||
? ({
|
||||
achievements: {
|
||||
list: new Array(8).fill(null).map(_ => ({
|
||||
title: faker.lorem.word(),
|
||||
unlock: null,
|
||||
text: faker.lorem.sentence(),
|
||||
icon:`<g xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-width="2" fill="none" fill-rule="evenodd"><g stroke-linejoin="round"><g stroke="#79B8FF"><path d="M8 43a3 3 0 100 6 3 3 0 000-6zm40 0a3.001 3.001 0 10.002 6.002A3.001 3.001 0 0048 43zm-18 3h-4.971m-11.045 0H11M45 46h-4"/></g><path stroke="#2088FF" d="M13 51h28M36.992 45.276l6.375-8.017c1.488.63 3.272.29 4.414-.977a3.883 3.883 0 00.658-4.193l-1.96 2.174-1.936-.151-.406-1.955 1.96-2.173a3.898 3.898 0 00-4.107 1.092 3.886 3.886 0 00-.512 4.485l-7.317 7.169c-1.32 1.314-.807 2.59-.236 3.105.67.601 1.888.845 3.067-.56z"/><g stroke="#2088FF"><path d="M12.652 31.063l9.442 12.578a.512.512 0 01-.087.716l-2.396 1.805a.512.512 0 01-.712-.114L9.46 33.47l-.176-3.557 3.37 1.15zM17.099 43.115l2.395-1.806"/></g></g><path d="M25.68 36.927v-2.54a2.227 2.227 0 01.37-1.265c-.526-.04-3.84-.371-3.84-4.302 0-1.013.305-1.839.915-2.477a4.989 4.989 0 01-.146-1.86c.087-.882.946-.823 2.577.178 1.277-.47 2.852-.47 4.725 0 .248-.303 2.434-1.704 2.658-.268.047.296.016.946-.093 1.95.516.524.776 1.358.78 2.501.007 2.261-1.26 3.687-3.8 4.278.24.436.355.857.346 1.264a117.57 117.57 0 000 2.614c2.43-.744 4.228-2.06 5.395-3.95.837-1.356 1.433-2.932 1.433-4.865 0-2.886-1.175-4.984-2.5-6.388C32.714 19.903 30.266 19 28 19a9.094 9.094 0 00-6.588 2.897C20.028 23.393 19 25.507 19 28.185c0 2.026.701 3.945 1.773 5.38 1.228 1.643 2.864 2.764 4.907 3.362zM52.98 25.002l-3.07 3.065-1.49-1.485M6.98 25.002l-3.07 3.065-1.49-1.485" stroke="#2088FF" stroke-linejoin="round"/><path d="M19.001 11V9a2 2 0 012-2h14a2 2 0 012 2v2m-21 12.028v-10.03a2 2 0 012-1.998h20a2 2 0 012 2v10.028" stroke="#79B8FF" stroke-linejoin="round"/><path stroke="#79B8FF" d="M28.001 7V3M15.039 7.797c-5.297 3.406-9.168 8.837-10.517 15.2m46.737-.936c-1.514-5.949-5.25-11.01-10.273-14.248"/></g>`,
|
||||
icon:
|
||||
`<g xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-width="2" fill="none" fill-rule="evenodd"><g stroke-linejoin="round"><g stroke="#79B8FF"><path d="M8 43a3 3 0 100 6 3 3 0 000-6zm40 0a3.001 3.001 0 10.002 6.002A3.001 3.001 0 0048 43zm-18 3h-4.971m-11.045 0H11M45 46h-4"/></g><path stroke="#2088FF" d="M13 51h28M36.992 45.276l6.375-8.017c1.488.63 3.272.29 4.414-.977a3.883 3.883 0 00.658-4.193l-1.96 2.174-1.936-.151-.406-1.955 1.96-2.173a3.898 3.898 0 00-4.107 1.092 3.886 3.886 0 00-.512 4.485l-7.317 7.169c-1.32 1.314-.807 2.59-.236 3.105.67.601 1.888.845 3.067-.56z"/><g stroke="#2088FF"><path d="M12.652 31.063l9.442 12.578a.512.512 0 01-.087.716l-2.396 1.805a.512.512 0 01-.712-.114L9.46 33.47l-.176-3.557 3.37 1.15zM17.099 43.115l2.395-1.806"/></g></g><path d="M25.68 36.927v-2.54a2.227 2.227 0 01.37-1.265c-.526-.04-3.84-.371-3.84-4.302 0-1.013.305-1.839.915-2.477a4.989 4.989 0 01-.146-1.86c.087-.882.946-.823 2.577.178 1.277-.47 2.852-.47 4.725 0 .248-.303 2.434-1.704 2.658-.268.047.296.016.946-.093 1.95.516.524.776 1.358.78 2.501.007 2.261-1.26 3.687-3.8 4.278.24.436.355.857.346 1.264a117.57 117.57 0 000 2.614c2.43-.744 4.228-2.06 5.395-3.95.837-1.356 1.433-2.932 1.433-4.865 0-2.886-1.175-4.984-2.5-6.388C32.714 19.903 30.266 19 28 19a9.094 9.094 0 00-6.588 2.897C20.028 23.393 19 25.507 19 28.185c0 2.026.701 3.945 1.773 5.38 1.228 1.643 2.864 2.764 4.907 3.362zM52.98 25.002l-3.07 3.065-1.49-1.485M6.98 25.002l-3.07 3.065-1.49-1.485" stroke="#2088FF" stroke-linejoin="round"/><path d="M19.001 11V9a2 2 0 012-2h14a2 2 0 012 2v2m-21 12.028v-10.03a2 2 0 012-1.998h20a2 2 0 012 2v10.028" stroke="#79B8FF" stroke-linejoin="round"/><path stroke="#79B8FF" d="M28.001 7V3M15.039 7.797c-5.297 3.406-9.168 8.837-10.517 15.2m46.737-.936c-1.514-5.949-5.25-11.01-10.273-14.248"/></g>`,
|
||||
rank: faker.random.arrayElement(["A", "B", "C", "X", "$"]),
|
||||
progress: faker.datatype.number(100) / 100,
|
||||
value: faker.datatype.number(1000),
|
||||
@@ -220,61 +313,78 @@
|
||||
.filter(({ rank }) => options["achievements.secrets"] ? true : rank !== "$")
|
||||
.filter(({ rank }) => ({ S: 5, A: 4, B: 3, C: 2, $: 1, X: 0 }[rank] >= { S: 5, A: 4, B: 3, C: 2, $: 1, X: 0 }[options["achievements.threshold"]]))
|
||||
.sort((a, b) => ({ S: 5, A: 4, B: 3, C: 2, $: 1, X: 0 }[b.rank] + b.progress * 0.99) - ({ S: 5, A: 4, B: 3, C: 2, $: 1, X: 0 }[a.rank] + a.progress * 0.99))
|
||||
.slice(0, options["achievements.limit"] || Infinity)
|
||||
,
|
||||
}
|
||||
}) : null),
|
||||
.slice(0, options["achievements.limit"] || Infinity),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Introduction
|
||||
...(set.plugins.enabled.introduction ? ({
|
||||
...(set.plugins.enabled.introduction
|
||||
? ({
|
||||
introduction: {
|
||||
mode: "user",
|
||||
title: options["introduction.title"],
|
||||
text: faker.lorem.sentences(),
|
||||
}
|
||||
}) : null),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Languages
|
||||
...(set.plugins.enabled.languages ? ({
|
||||
...(set.plugins.enabled.languages
|
||||
? ({
|
||||
languages: {
|
||||
details: options["languages.details"].split(",").map(x => x.trim()).filter(x => x),
|
||||
get colors() { return Object.fromEntries(Object.entries(this.favorites).map(([key, {color}]) => [key, color])) },
|
||||
get colors() {
|
||||
return Object.fromEntries(Object.entries(this.favorites).map(([key, { color }]) => [key, color]))
|
||||
},
|
||||
total: faker.datatype.number(10000),
|
||||
get stats() { return Object.fromEntries(Object.entries(this.favorites).map(([key, {value}]) => [key, value])) },
|
||||
favorites:distribution(7).map((value, index, array) => ({name:faker.lorem.word(), color:faker.internet.color(), value, size:faker.datatype.number(1000000), x:array.slice(0, index).reduce((a, b) => a + b, 0)}))
|
||||
}
|
||||
}) : null),
|
||||
get stats() {
|
||||
return Object.fromEntries(Object.entries(this.favorites).map(([key, { value }]) => [key, value]))
|
||||
},
|
||||
favorites: distribution(7).map((value, index, array) => ({ name: faker.lorem.word(), color: faker.internet.color(), value, size: faker.datatype.number(1000000), x: array.slice(0, index).reduce((a, b) => a + b, 0) })),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//RSS
|
||||
...(set.plugins.enabled.rss ? ({
|
||||
...(set.plugins.enabled.rss
|
||||
? ({
|
||||
rss: {
|
||||
source: faker.lorem.words(),
|
||||
description: faker.lorem.paragraph(),
|
||||
link: options["rss.source"],
|
||||
feed: new Array(Number(options["rss.limit"])).fill(null).map(_ => ({
|
||||
title: faker.lorem.sentence(),
|
||||
date:faker.date.recent()
|
||||
date: faker.date.recent(),
|
||||
})),
|
||||
}
|
||||
}) : null),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Stock price
|
||||
...(set.plugins.enabled.stock ? ({
|
||||
...(set.plugins.enabled.stock
|
||||
? ({
|
||||
stock: {
|
||||
chart: "(stock chart is not displayed in placeholder)",
|
||||
currency: "USD",
|
||||
price: faker.datatype.number(10000) / 100,
|
||||
previous: faker.datatype.number(10000) / 100,
|
||||
get delta() { return this.price-this.previous },
|
||||
get delta() {
|
||||
return this.price - this.previous
|
||||
},
|
||||
symbol: options["stock.symbol"],
|
||||
company: faker.company.companyName(),
|
||||
interval: options["stock.interval"],
|
||||
duration: options["stock.duration"],
|
||||
}
|
||||
}) : null),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Habits
|
||||
...(set.plugins.enabled.habits ? ({
|
||||
...(set.plugins.enabled.habits
|
||||
? ({
|
||||
habits: {
|
||||
facts: options["habits.facts"],
|
||||
charts: options["habits.charts"],
|
||||
commits: {
|
||||
get hour() { return Object.keys(this.hours).filter(key => /^\d+$/.test(key)).map(key => [key, this.hours[key]]).sort((a, b) => b[1] - a[1]).shift()?.[0] },
|
||||
get hour() {
|
||||
return Object.keys(this.hours).filter(key => /^\d+$/.test(key)).map(key => [key, this.hours[key]]).sort((a, b) => b[1] - a[1]).shift()?.[0]
|
||||
},
|
||||
hours: {
|
||||
[faker.datatype.number(24)]: faker.datatype.number(10),
|
||||
[faker.datatype.number(24)]: faker.datatype.number(10),
|
||||
@@ -283,9 +393,13 @@
|
||||
[faker.datatype.number(24)]: faker.datatype.number(10),
|
||||
[faker.datatype.number(24)]: faker.datatype.number(10),
|
||||
[faker.datatype.number(24)]: faker.datatype.number(10),
|
||||
get max() { return Object.keys(this).filter(key => /^\d+$/.test(key)).map(key => [key, this[key]]).sort((a, b) => b[1] - a[1]).shift()?.[1] }
|
||||
get max() {
|
||||
return Object.keys(this).filter(key => /^\d+$/.test(key)).map(key => [key, this[key]]).sort((a, b) => b[1] - a[1]).shift()?.[1]
|
||||
},
|
||||
},
|
||||
get day() {
|
||||
return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][Object.keys(this.days).filter(key => /^\d+$/.test(key)).map(key => [key, this.days[key]]).sort((a, b) => b[1] - a[1]).shift()?.[0]]
|
||||
},
|
||||
get day() { return ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"][Object.keys(this.days).filter(key => /^\d+$/.test(key)).map(key => [key, this.days[key]]).sort((a, b) => b[1] - a[1]).shift()?.[0]] },
|
||||
days: {
|
||||
"0": faker.datatype.number(10),
|
||||
"1": faker.datatype.number(10),
|
||||
@@ -294,19 +408,27 @@
|
||||
"4": faker.datatype.number(10),
|
||||
"5": faker.datatype.number(10),
|
||||
"6": faker.datatype.number(10),
|
||||
get max() { return Object.keys(this).filter(key => /^\d+$/.test(key)).map(key => [key, this[key]]).sort((a, b) => b[1] - a[1]).shift()?.[1] }
|
||||
get max() {
|
||||
return Object.keys(this).filter(key => /^\d+$/.test(key)).map(key => [key, this[key]]).sort((a, b) => b[1] - a[1]).shift()?.[1]
|
||||
},
|
||||
},
|
||||
},
|
||||
indents: { style: "spaces", spaces: 1, tabs: 0 },
|
||||
linguist: {
|
||||
available: true,
|
||||
get ordered() { return Object.entries(this.languages) },
|
||||
get languages() { return Object.fromEntries(distribution(4).map(value => [faker.lorem.word(), value])) },
|
||||
}
|
||||
}
|
||||
}) : null),
|
||||
get ordered() {
|
||||
return Object.entries(this.languages)
|
||||
},
|
||||
get languages() {
|
||||
return Object.fromEntries(distribution(4).map(value => [faker.lorem.word(), value]))
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//People
|
||||
...(set.plugins.enabled.people ? ({
|
||||
...(set.plugins.enabled.people
|
||||
? ({
|
||||
get people() {
|
||||
const types = options["people.types"].split(",").map(x => x.trim())
|
||||
.map(x => ({ followed: "following", sponsors: "sponsorshipsAsMaintainer", sponsored: "sponsorshipsAsSponsor", sponsoring: "sponsorshipsAsSponsor" })[x] ?? x)
|
||||
@@ -319,17 +441,19 @@
|
||||
new Array(Number(options["people.limit"])).fill(null).map(_ => ({
|
||||
login: faker.internet.userName(),
|
||||
avatar: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==",
|
||||
}))
|
||||
})),
|
||||
]))),
|
||||
thanks: options["people.thanks"].split(",").map(x => x.trim()).map(login => ({
|
||||
login,
|
||||
avatar: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==",
|
||||
}))
|
||||
})),
|
||||
}
|
||||
}
|
||||
}) : null),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Music
|
||||
...(set.plugins.enabled.music ? ({
|
||||
...(set.plugins.enabled.music
|
||||
? ({
|
||||
music: {
|
||||
provider: "(music provider)",
|
||||
mode: "Suggested tracks",
|
||||
@@ -337,11 +461,13 @@
|
||||
name: faker.random.words(5),
|
||||
artist: faker.random.words(),
|
||||
artwork: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==",
|
||||
}))
|
||||
}
|
||||
}) : null),
|
||||
})),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Nightscout
|
||||
...(set.plugins.enabled.nightscout ? ({
|
||||
...(set.plugins.enabled.nightscout
|
||||
? ({
|
||||
nightscout: {
|
||||
url: options["nightscout.url"] != null && options["nightscout.url"] != "https://example.herokuapp.com" ? options["nightscout.url"] : "https://testapp.herokuapp.com/",
|
||||
data: new Array(12).fill(null).map(_ => ({
|
||||
@@ -353,10 +479,12 @@
|
||||
alert: faker.random.arrayElement(["Normal", "Urgent High", "Urgent Low", "High", "Low"]),
|
||||
arrowHumanReadable: faker.random.arrayElement(["↑↑", "↑", "↗", "→", "↘", "↓", "↓↓"]),
|
||||
})),
|
||||
}
|
||||
}) : null),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Pagespeed
|
||||
...(set.plugins.enabled.pagespeed ? ({
|
||||
...(set.plugins.enabled.pagespeed
|
||||
? ({
|
||||
pagespeed: {
|
||||
url: options["pagespeed.url"] || "(attached website url)",
|
||||
detailed: options["pagespeed.detailed"] || false,
|
||||
@@ -364,7 +492,7 @@
|
||||
{ score: faker.datatype.float({ max: 1 }), title: "Performance" },
|
||||
{ score: faker.datatype.float({ max: 1 }), title: "Accessibility" },
|
||||
{ score: faker.datatype.float({ max: 1 }), title: "Best Practices" },
|
||||
{score:faker.datatype.float({max:1}), title:"SEO"}
|
||||
{ score: faker.datatype.float({ max: 1 }), title: "SEO" },
|
||||
],
|
||||
metrics: {
|
||||
observedFirstContentfulPaint: faker.datatype.number(500),
|
||||
@@ -401,13 +529,15 @@
|
||||
interactive: faker.datatype.number(1000),
|
||||
observedNavigationStartTs: faker.time.recent(),
|
||||
observedNavigationStart: faker.datatype.number(10),
|
||||
observedFirstMeaningfulPaintTs:faker.time.recent()
|
||||
observedFirstMeaningfulPaintTs: faker.time.recent(),
|
||||
},
|
||||
screenshot:options["pagespeed.screenshot"] ? "data:image/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==" : null
|
||||
}
|
||||
}) : null),
|
||||
screenshot: options["pagespeed.screenshot"] ? "data:image/jpg;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==" : null,
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Projects
|
||||
...(set.plugins.enabled.projects ? ({
|
||||
...(set.plugins.enabled.projects
|
||||
? ({
|
||||
projects: {
|
||||
totalCount: options["projects.limit"] + faker.datatype.number(10),
|
||||
descriptions: options["projects.descriptions"],
|
||||
@@ -415,12 +545,22 @@
|
||||
name: faker.lorem.sentence(),
|
||||
description: faker.lorem.paragraph(),
|
||||
updated: `${2 + faker.datatype.number(8)} days ago`,
|
||||
progress:{enabled:true, todo:faker.datatype.number(50), doing:faker.datatype.number(50), done:faker.datatype.number(50), get total() { return this.todo + this.doing + this.done } }
|
||||
}))
|
||||
}
|
||||
}) : null),
|
||||
progress: {
|
||||
enabled: true,
|
||||
todo: faker.datatype.number(50),
|
||||
doing: faker.datatype.number(50),
|
||||
done: faker.datatype.number(50),
|
||||
get total() {
|
||||
return this.todo + this.doing + this.done
|
||||
},
|
||||
},
|
||||
})),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Posts
|
||||
...(set.plugins.enabled.posts ? ({
|
||||
...(set.plugins.enabled.posts
|
||||
? ({
|
||||
posts: {
|
||||
source: options["posts.source"],
|
||||
descriptions: options["posts.descriptions"],
|
||||
@@ -430,22 +570,26 @@
|
||||
description: faker.lorem.paragraph(),
|
||||
date: faker.date.recent(),
|
||||
image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==",
|
||||
}))
|
||||
}
|
||||
}) : null),
|
||||
})),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Topics
|
||||
...(set.plugins.enabled.topics ? ({
|
||||
...(set.plugins.enabled.topics
|
||||
? ({
|
||||
topics: {
|
||||
mode: options["topics.mode"],
|
||||
list: new Array(Number(options["topics.limit"]) || 20).fill(null).map(_ => ({
|
||||
name: faker.lorem.words(2),
|
||||
description: faker.lorem.sentence(),
|
||||
icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg=="
|
||||
}))
|
||||
}
|
||||
}) : null),
|
||||
icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==",
|
||||
})),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Stars
|
||||
...(set.plugins.enabled.stars ? ({
|
||||
...(set.plugins.enabled.stars
|
||||
? ({
|
||||
stars: {
|
||||
repositories: [
|
||||
{
|
||||
@@ -464,9 +608,9 @@
|
||||
},
|
||||
stargazerCount: faker.datatype.number(10000),
|
||||
licenseInfo: { nickname: null, name: "MIT License" },
|
||||
primaryLanguage:{color:"#f1e05a", name:"JavaScript"}
|
||||
primaryLanguage: { color: "#f1e05a", name: "JavaScript" },
|
||||
},
|
||||
starred:"1 day ago"
|
||||
starred: "1 day ago",
|
||||
},
|
||||
...new Array(Number(options["stars.limit"]) - 1).fill(null).map((_, i) => ({
|
||||
starredAt: faker.date.recent(),
|
||||
@@ -484,30 +628,40 @@
|
||||
},
|
||||
stargazerCount: faker.datatype.number(10000),
|
||||
licenseInfo: { nickname: null, name: "License" },
|
||||
primaryLanguage:{color:faker.internet.color(), name:faker.lorem.word()}
|
||||
primaryLanguage: { color: faker.internet.color(), name: faker.lorem.word() },
|
||||
},
|
||||
starred:`${i+2} days ago`
|
||||
starred: `${i + 2} days ago`,
|
||||
})),
|
||||
]
|
||||
}
|
||||
}) : null),
|
||||
],
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Stars
|
||||
...(set.plugins.enabled.stargazers ? ({
|
||||
...(set.plugins.enabled.stargazers
|
||||
? ({
|
||||
get stargazers() {
|
||||
const dates = []
|
||||
let total = faker.datatype.number(1000)
|
||||
const result = {
|
||||
total: {
|
||||
dates: {},
|
||||
get max() { return Math.max(...dates.map(date => this.dates[date])) },
|
||||
get min() { return Math.min(...dates.map(date => this.dates[date])) },
|
||||
get max() {
|
||||
return Math.max(...dates.map(date => this.dates[date]))
|
||||
},
|
||||
get min() {
|
||||
return Math.min(...dates.map(date => this.dates[date]))
|
||||
},
|
||||
},
|
||||
increments: {
|
||||
dates: {},
|
||||
get max() { return Math.max(...dates.map(date => this.dates[date])) },
|
||||
get min() { return Math.min(...dates.map(date => this.dates[date])) },
|
||||
get max() {
|
||||
return Math.max(...dates.map(date => this.dates[date]))
|
||||
},
|
||||
months:["", "Jan.", "Feb.", "Mar.", "Apr.", "May", "June", "July", "Aug.", "Sep.", "Oct.", "Nov.", "Dec."]
|
||||
get min() {
|
||||
return Math.min(...dates.map(date => this.dates[date]))
|
||||
},
|
||||
},
|
||||
months: ["", "Jan.", "Feb.", "Mar.", "Apr.", "May", "June", "July", "Aug.", "Sep.", "Oct.", "Nov.", "Dec."],
|
||||
}
|
||||
for (let d = -14; d <= 0; d++) {
|
||||
const date = new Date(Date.now() - d * 24 * 60 * 60 * 1000).toISOString().substring(0, 10)
|
||||
@@ -515,16 +669,19 @@
|
||||
result.total.dates[date] = (total += (result.increments.dates[date] = faker.datatype.number(100)))
|
||||
}
|
||||
return result
|
||||
}
|
||||
}) : null),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Wakatime
|
||||
...(set.plugins.enabled.wakatime ? ({
|
||||
...(set.plugins.enabled.wakatime
|
||||
? ({
|
||||
get wakatime() {
|
||||
const stats = (array) => {
|
||||
const stats = array => {
|
||||
const elements = []
|
||||
let results = new Array(4 + faker.datatype.number(2)).fill(null).map(_ => ({
|
||||
name: array ? faker.random.arrayElement(array) : faker.random.words(2).replace(/ /g, "-").toLocaleLowerCase(),
|
||||
percent:0, total_seconds:faker.datatype.number(1000000),
|
||||
percent: 0,
|
||||
total_seconds: faker.datatype.number(1000000),
|
||||
}))
|
||||
let percents = 100
|
||||
for (const result of results) {
|
||||
@@ -544,10 +701,12 @@
|
||||
projects: stats(),
|
||||
os: stats(["Mac", "Windows", "Linux"]),
|
||||
}
|
||||
}
|
||||
}) : null),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Anilist
|
||||
...(set.plugins.enabled.anilist ? ({
|
||||
...(set.plugins.enabled.anilist
|
||||
? ({
|
||||
anilist: {
|
||||
user: {
|
||||
stats: {
|
||||
@@ -567,7 +726,7 @@
|
||||
genres: new Array(4).fill(null).map(_ => ({ genre: faker.lorem.word() })),
|
||||
},
|
||||
get lists() {
|
||||
const media = (type) => ({
|
||||
const media = type => ({
|
||||
name: faker.lorem.words(),
|
||||
type,
|
||||
status: faker.random.arrayElement(["FINISHED", "RELEASING", "NOT_YET_RELEASED", "CANCELLED", "HIATUS"]),
|
||||
@@ -582,28 +741,39 @@
|
||||
const sections = options["anilist.sections"].split(",").map(x => x.trim()).filter(x => x)
|
||||
const medias = options["anilist.medias"].split(",").map(x => x.trim()).filter(x => x)
|
||||
return {
|
||||
...(medias.includes("anime") ? {anime:{
|
||||
...(medias.includes("anime")
|
||||
? {
|
||||
anime: {
|
||||
...(sections.includes("watching") ? { watching: new Array(Number(options["anilist.limit"]) || 4).fill(null).map(_ => media("ANIME")) } : {}),
|
||||
...(sections.includes("favorites") ? { favorites: new Array(Number(options["anilist.limit"]) || 4).fill(null).map(_ => media("ANIME")) } : {}),
|
||||
}} : {}),
|
||||
...(medias.includes("manga") ? {manga:{
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
...(medias.includes("manga")
|
||||
? {
|
||||
manga: {
|
||||
...(sections.includes("reading") ? { reading: new Array(Number(options["anilist.limit"]) || 4).fill(null).map(_ => media("MANGA")) } : {}),
|
||||
...(sections.includes("favorites") ? { favorites: new Array(Number(options["anilist.limit"]) || 4).fill(null).map(_ => media("MANGA")) } : {}),
|
||||
}} : {}),
|
||||
},
|
||||
}
|
||||
: {}),
|
||||
}
|
||||
},
|
||||
characters: new Array(11).fill(null).map(_ => ({
|
||||
name: faker.name.findName(),
|
||||
artwork: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==",
|
||||
})),
|
||||
sections:options["anilist.sections"].split(",").map(x => x.trim()).filter(x => x)
|
||||
}
|
||||
}) : null),
|
||||
sections: options["anilist.sections"].split(",").map(x => x.trim()).filter(x => x),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Activity
|
||||
...(set.plugins.enabled.activity ? ({
|
||||
...(set.plugins.enabled.activity
|
||||
? ({
|
||||
activity: {
|
||||
timestamps: options["activity.timestamps"],
|
||||
events:new Array(Number(options["activity.limit"])).fill(null).map(_ => [
|
||||
events: new Array(Number(options["activity.limit"])).fill(null).map(_ =>
|
||||
[
|
||||
{
|
||||
type: "push",
|
||||
repo: `${faker.random.word()}/${faker.random.word()}`,
|
||||
@@ -661,7 +831,8 @@
|
||||
user: set.user,
|
||||
number: faker.datatype.number(100),
|
||||
title: faker.lorem.sentence(),
|
||||
lines:{added:faker.datatype.number(1000), deleted:faker.datatype.number(1000)}, files:{changed:faker.datatype.number(10)},
|
||||
lines: { added: faker.datatype.number(1000), deleted: faker.datatype.number(1000) },
|
||||
files: { changed: faker.datatype.number(10) },
|
||||
timestamp: faker.date.recent(),
|
||||
},
|
||||
{
|
||||
@@ -721,21 +892,26 @@
|
||||
action: "started",
|
||||
timestamp: faker.date.recent(),
|
||||
},
|
||||
][Math.floor(Math.random()*15)])
|
||||
}
|
||||
}) : null),
|
||||
][Math.floor(Math.random() * 15)]
|
||||
),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Isocalendar
|
||||
...(set.plugins.enabled.isocalendar ? ({
|
||||
...(set.plugins.enabled.isocalendar
|
||||
? ({
|
||||
isocalendar: {
|
||||
streak: { max: 30 + faker.datatype.number(20), current: faker.datatype.number(30) },
|
||||
max: 10 + faker.datatype.number(40),
|
||||
average: faker.datatype.float(10),
|
||||
svg: "(isometric calendar is not displayed in placeholder)",
|
||||
duration:options["isocalendar.duration"]
|
||||
}
|
||||
}) : null),
|
||||
duration: options["isocalendar.duration"],
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Stackoverflow
|
||||
...(set.plugins.enabled.stackoverflow ? ({
|
||||
...(set.plugins.enabled.stackoverflow
|
||||
? ({
|
||||
stackoverflow: {
|
||||
sections: options["stackoverflow.sections"].split(",").map(x => x.trim()).filter(x => x),
|
||||
lines: options["stackoverflow.lines"],
|
||||
@@ -763,7 +939,7 @@
|
||||
question: {
|
||||
title: faker.lorem.sentence(),
|
||||
tags: [faker.lorem.slug(), faker.lorem.slug()],
|
||||
}
|
||||
},
|
||||
})),
|
||||
get ["answers-recent"]() {
|
||||
return this["answers-top"]
|
||||
@@ -791,21 +967,25 @@
|
||||
get ["questions-recent"]() {
|
||||
return this["questions-top"]
|
||||
},
|
||||
}
|
||||
}) : null),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
},
|
||||
}
|
||||
//Formatters
|
||||
data.f.bytes = function(n) {
|
||||
for (const {u, v} of [{u:"E", v:10**18}, {u:"P", v:10**15}, {u:"T", v:10**12}, {u:"G", v:10**9}, {u:"M", v:10**6}, {u:"k", v:10**3}])
|
||||
for (const { u, v } of [{ u: "E", v: 10 ** 18 }, { u: "P", v: 10 ** 15 }, { u: "T", v: 10 ** 12 }, { u: "G", v: 10 ** 9 }, { u: "M", v: 10 ** 6 }, { u: "k", v: 10 ** 3 }]) {
|
||||
if (n / v >= 1)
|
||||
return `${(n / v).toFixed(2).substr(0, 4).replace(/[.]0*$/, "")} ${u}B`
|
||||
}
|
||||
return `${n} byte${n > 1 ? "s" : ""}`
|
||||
}
|
||||
data.f.percentage = function(n, { rescale = true } = {}) {
|
||||
return `${(n*(rescale ? 100 : 1)).toFixed(2)
|
||||
return `${
|
||||
(n * (rescale ? 100 : 1)).toFixed(2)
|
||||
.replace(/[.]([1-9]*)(0+)$/, (m, a, b) => `.${a}`)
|
||||
.replace(/[.]$/, "")}%`
|
||||
.replace(/[.]$/, "")
|
||||
}%`
|
||||
}
|
||||
data.f.ellipsis = function(text, { length = 20 } = {}) {
|
||||
text = `${text}`
|
||||
|
||||
@@ -25,7 +25,11 @@
|
||||
.filter(a => (!only.length) || ((only.length) && (only.includes(a.title.toLocaleLowerCase()))))
|
||||
.filter(a => !ignored.includes(a.title.toLocaleLowerCase()))
|
||||
.sort((a, b) => (order[b.rank] + b.progress * 0.99) - (order[a.rank] + a.progress * 0.99))
|
||||
.map(({title, unlock, ...achievement}) => ({title:({S:`Master ${title.toLocaleLowerCase()}`, A:`Super ${title.toLocaleLowerCase()}`, B:`Great ${title.toLocaleLowerCase()}`}[achievement.rank] ?? title), unlock:!/invalid date/i.test(unlock) ? `${imports.date(unlock, {timeStyle:"short", timeZone:data.config.timezone?.name})} on ${imports.date(unlock, {dateStyle:"short", timeZone:data.config.timezone?.name})}` : null, ...achievement}))
|
||||
.map(({title, unlock, ...achievement}) => ({
|
||||
title:({S:`Master ${title.toLocaleLowerCase()}`, A:`Super ${title.toLocaleLowerCase()}`, B:`Great ${title.toLocaleLowerCase()}`}[achievement.rank] ?? title),
|
||||
unlock:!/invalid date/i.test(unlock) ? `${imports.date(unlock, {timeStyle:"short", timeZone:data.config.timezone?.name})} on ${imports.date(unlock, {dateStyle:"short", timeZone:data.config.timezone?.name})}` : null,
|
||||
...achievement,
|
||||
}))
|
||||
.map(({icon, ...achievement}) => ({icon:icon.replace(/#primary/g, colors[achievement.rank][0]).replace(/#secondary/g, colors[achievement.rank][1]), ...achievement}))
|
||||
.slice(0, limit || Infinity)
|
||||
return {list:achievements}
|
||||
@@ -49,7 +53,8 @@
|
||||
|
||||
/**Leaderboards */
|
||||
function leaderboard({user, type, requirement}) {
|
||||
return requirement ? {
|
||||
return requirement
|
||||
? {
|
||||
user:1 + user,
|
||||
total:total[type],
|
||||
type,
|
||||
@@ -59,7 +64,8 @@
|
||||
get percentile() {
|
||||
return 100 * (this.user / this.top)
|
||||
},
|
||||
} : null
|
||||
}
|
||||
: null
|
||||
}
|
||||
|
||||
/**Total extracter */
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
//Exports
|
||||
export {default as user} from "./users.mjs"
|
||||
export {default as organization} from "./organizations.mjs"
|
||||
export {default as user} from "./users.mjs"
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/**Achievements list for users accounts */
|
||||
export default async function({list, login, data, computed, imports, graphql, queries, rank, leaderboard}) {
|
||||
|
||||
//Initialization
|
||||
const {organization} = await graphql(queries.achievements.organizations({login}))
|
||||
const scores = {followers:0, created:organization.repositories.totalCount, stars:organization.popular.nodes?.[0]?.stargazers?.totalCount ?? 0, forks:Math.max(0, ...data.user.repositories.nodes.map(({forkCount}) => forkCount))}
|
||||
@@ -14,8 +13,10 @@
|
||||
list.push({
|
||||
title:"Developers",
|
||||
text:`Published ${value} public repositor${imports.s(value, "y")}`,
|
||||
icon:"<g stroke-linecap=\"round\" stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><g stroke=\"#primary\"><path d=\"M20 24l-3.397 3.398a.85.85 0 000 1.203L20.002 32M37.015 24l3.399 3.398a.85.85 0 010 1.203L37.014 32\" stroke-linejoin=\"round\"/><path d=\"M31.029 21.044L25.976 35.06\"/></g><path stroke=\"#secondary\" stroke-linejoin=\"round\" d=\"M23.018 10h8.984M26 47h5M8 16h16m9 0h15.725M8 41h13\"/><path d=\"M5.027 34.998c.673 2.157 1.726 4.396 2.81 6.02m43.38-19.095C50.7 19.921 49.866 17.796 48.79 16\" stroke=\"#secondary\"/><path stroke=\"#primary\" stroke-linejoin=\"round\" d=\"M26 41h17\"/><path d=\"M7.183 16C5.186 19.582 4 23.619 4 28M42.608 47.02c2.647-1.87 5.642-5.448 7.295-9.18C51.52 34.191 52.071 30.323 52 28\" stroke=\"#primary\"/><path stroke=\"#primary\" stroke-linejoin=\"round\" d=\"M7.226 16H28M13.343 47H21\"/><path d=\"M13.337 47.01a24.364 24.364 0 006.19 3.45 24.527 24.527 0 007.217 1.505c2.145.108 4.672-.05 7.295-.738\" stroke=\"#primary\"/><path stroke=\"#primary\" stroke-linejoin=\"round\" d=\"M36 47h6.647M12 10h6M37 10h6.858\"/><path d=\"M43.852 10c-4.003-3.667-9.984-6.054-16.047-6-2.367.021-4.658.347-6.81 1.045\" stroke=\"#primary\"/><path stroke=\"#secondary\" stroke-linejoin=\"round\" d=\"M5.041 35h4.962M47 22h4.191\"/></g>",
|
||||
...rank(value, [1, 50, 100, 200]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-linecap="round" stroke-width="2" fill="none" fill-rule="evenodd"><g stroke="#primary"><path d="M20 24l-3.397 3.398a.85.85 0 000 1.203L20.002 32M37.015 24l3.399 3.398a.85.85 0 010 1.203L37.014 32" stroke-linejoin="round"/><path d="M31.029 21.044L25.976 35.06"/></g><path stroke="#secondary" stroke-linejoin="round" d="M23.018 10h8.984M26 47h5M8 16h16m9 0h15.725M8 41h13"/><path d="M5.027 34.998c.673 2.157 1.726 4.396 2.81 6.02m43.38-19.095C50.7 19.921 49.866 17.796 48.79 16" stroke="#secondary"/><path stroke="#primary" stroke-linejoin="round" d="M26 41h17"/><path d="M7.183 16C5.186 19.582 4 23.619 4 28M42.608 47.02c2.647-1.87 5.642-5.448 7.295-9.18C51.52 34.191 52.071 30.323 52 28" stroke="#primary"/><path stroke="#primary" stroke-linejoin="round" d="M7.226 16H28M13.343 47H21"/><path d="M13.337 47.01a24.364 24.364 0 006.19 3.45 24.527 24.527 0 007.217 1.505c2.145.108 4.672-.05 7.295-.738" stroke="#primary"/><path stroke="#primary" stroke-linejoin="round" d="M36 47h6.647M12 10h6M37 10h6.858"/><path d="M43.852 10c-4.003-3.667-9.984-6.054-16.047-6-2.367.021-4.658.347-6.81 1.045" stroke="#primary"/><path stroke="#secondary" stroke-linejoin="round" d="M5.041 35h4.962M47 22h4.191"/></g>',
|
||||
...rank(value, [1, 50, 100, 200]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
leaderboard:leaderboard({user:ranks.created_rank.userCount, requirement:scores.created >= requirements.created, type:"users"}),
|
||||
})
|
||||
}
|
||||
@@ -27,8 +28,10 @@
|
||||
list.push({
|
||||
title:"Forkers",
|
||||
text:`Forked ${value} public repositor${imports.s(value, "y")}`,
|
||||
icon:"<g stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M37.303 21.591a5.84 5.84 0 00-1.877-1.177 6.138 6.138 0 00-4.432 0 5.822 5.822 0 00-1.879 1.177L28 22.638l-1.115-1.047c-1.086-1.018-2.559-1.59-4.094-1.59-1.536 0-3.008.572-4.094 1.59-1.086 1.02-1.696 2.4-1.696 3.84 0 1.441.61 2.823 1.696 3.841l1.115 1.046L28 38l8.189-7.682 1.115-1.046a5.422 5.422 0 001.256-1.761 5.126 5.126 0 000-4.157 5.426 5.426 0 00-1.256-1.763z\" stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M15.967 42.705A18.922 18.922 0 0028 47a18.92 18.92 0 0011.076-3.56m-.032-30.902A18.914 18.914 0 0028 9c-4.09 0-7.876 1.292-10.976 3.49\" stroke=\"#secondary\" stroke-linecap=\"round\"/><g transform=\"translate(7 10)\" stroke=\"#primary\"><path d=\"M6 0v7c0 2.21-1.343 3-3 3s-3-.79-3-3V0\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path stroke-linecap=\"round\" d=\"M3 0v19.675\"/><rect stroke-linejoin=\"round\" x=\"1\" y=\"20\" width=\"4\" height=\"16\" rx=\"2\"/></g><g transform=\"translate(43 10)\" stroke=\"#primary\"><path stroke-linecap=\"round\" d=\"M2 15.968v3.674\"/><path d=\"M4 15.642H0L.014 4.045A4.05 4.05 0 014.028 0L4 15.642z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><rect stroke-linejoin=\"round\" y=\"19.968\" width=\"4\" height=\"16\" rx=\"2\"/></g><path d=\"M41.364 8.062A23.888 23.888 0 0028 4a23.89 23.89 0 00-11.95 3.182M4.75 22.021A24.045 24.045 0 004 28c0 1.723.182 3.404.527 5.024m10.195 14.971A23.888 23.888 0 0028 52c4.893 0 9.444-1.464 13.239-3.979m9-10.98A23.932 23.932 0 0052 28c0-2.792-.477-5.472-1.353-7.964\" stroke=\"#secondary\" stroke-linecap=\"round\"/></g>",
|
||||
...rank(value, [1, 10, 30, 50]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-width="2" fill="none" fill-rule="evenodd"><path d="M37.303 21.591a5.84 5.84 0 00-1.877-1.177 6.138 6.138 0 00-4.432 0 5.822 5.822 0 00-1.879 1.177L28 22.638l-1.115-1.047c-1.086-1.018-2.559-1.59-4.094-1.59-1.536 0-3.008.572-4.094 1.59-1.086 1.02-1.696 2.4-1.696 3.84 0 1.441.61 2.823 1.696 3.841l1.115 1.046L28 38l8.189-7.682 1.115-1.046a5.422 5.422 0 001.256-1.761 5.126 5.126 0 000-4.157 5.426 5.426 0 00-1.256-1.763z" stroke="#primary" stroke-linecap="round" stroke-linejoin="round"/><path d="M15.967 42.705A18.922 18.922 0 0028 47a18.92 18.92 0 0011.076-3.56m-.032-30.902A18.914 18.914 0 0028 9c-4.09 0-7.876 1.292-10.976 3.49" stroke="#secondary" stroke-linecap="round"/><g transform="translate(7 10)" stroke="#primary"><path d="M6 0v7c0 2.21-1.343 3-3 3s-3-.79-3-3V0" stroke-linecap="round" stroke-linejoin="round"/><path stroke-linecap="round" d="M3 0v19.675"/><rect stroke-linejoin="round" x="1" y="20" width="4" height="16" rx="2"/></g><g transform="translate(43 10)" stroke="#primary"><path stroke-linecap="round" d="M2 15.968v3.674"/><path d="M4 15.642H0L.014 4.045A4.05 4.05 0 014.028 0L4 15.642z" stroke-linecap="round" stroke-linejoin="round"/><rect stroke-linejoin="round" y="19.968" width="4" height="16" rx="2"/></g><path d="M41.364 8.062A23.888 23.888 0 0028 4a23.89 23.89 0 00-11.95 3.182M4.75 22.021A24.045 24.045 0 004 28c0 1.723.182 3.404.527 5.024m10.195 14.971A23.888 23.888 0 0028 52c4.893 0 9.444-1.464 13.239-3.979m9-10.98A23.932 23.932 0 0052 28c0-2.792-.477-5.472-1.353-7.964" stroke="#secondary" stroke-linecap="round"/></g>',
|
||||
...rank(value, [1, 10, 30, 50]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -40,8 +43,10 @@
|
||||
list.push({
|
||||
title:"Managers",
|
||||
text:`Created ${value} user project${imports.s(value)}`,
|
||||
icon:"<g stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M29 16V8.867C29 7.705 29.627 7 30.692 7h18.616C50.373 7 51 7.705 51 8.867v38.266C51 48.295 50.373 49 49.308 49H30.692C29.627 49 29 48.295 29 47.133V39m-4-23V9c0-1.253-.737-2-2-2H7c-1.263 0-2 .747-2 2v34c0 1.253.737 2 2 2h16c1.263 0 2-.747 2-2v-4\" stroke=\"#secondary\" stroke-linecap=\"round\"/><path stroke=\"#secondary\" d=\"M51.557 12.005h-22M5 12.005h21\"/><path d=\"M14 33V22c0-1.246.649-2 1.73-2h28.54c1.081 0 1.73.754 1.73 2v11c0 1.246-.649 2-1.73 2H15.73c-1.081 0-1.73-.754-1.73-2z\" stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M19 29v-3c0-.508.492-1 1-1h3c.508 0 1 .492 1 1v3c0 .508-.492 1-1 1h-3c-.508-.082-1-.492-1-1z\" stroke=\"#primary\"/><path stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M28.996 27.998h12M9.065 20.04a7.062 7.062 0 00-.023 1.728m.775 2.517c.264.495.584.954.954 1.369\"/></g>",
|
||||
...rank(value, [1, 2, 4, 8]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-width="2" fill="none" fill-rule="evenodd"><path d="M29 16V8.867C29 7.705 29.627 7 30.692 7h18.616C50.373 7 51 7.705 51 8.867v38.266C51 48.295 50.373 49 49.308 49H30.692C29.627 49 29 48.295 29 47.133V39m-4-23V9c0-1.253-.737-2-2-2H7c-1.263 0-2 .747-2 2v34c0 1.253.737 2 2 2h16c1.263 0 2-.747 2-2v-4" stroke="#secondary" stroke-linecap="round"/><path stroke="#secondary" d="M51.557 12.005h-22M5 12.005h21"/><path d="M14 33V22c0-1.246.649-2 1.73-2h28.54c1.081 0 1.73.754 1.73 2v11c0 1.246-.649 2-1.73 2H15.73c-1.081 0-1.73-.754-1.73-2z" stroke="#primary" stroke-linecap="round" stroke-linejoin="round"/><path d="M19 29v-3c0-.508.492-1 1-1h3c.508 0 1 .492 1 1v3c0 .508-.492 1-1 1h-3c-.508-.082-1-.492-1-1z" stroke="#primary"/><path stroke="#primary" stroke-linecap="round" stroke-linejoin="round" d="M28.996 27.998h12M9.065 20.04a7.062 7.062 0 00-.023 1.728m.775 2.517c.264.495.584.954.954 1.369"/></g>',
|
||||
...rank(value, [1, 2, 4, 8]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -53,8 +58,10 @@
|
||||
list.push({
|
||||
title:"Packagers",
|
||||
text:`Created ${value} package${imports.s(value)}`,
|
||||
icon:"<g fill=\"none\"><path fill=\"#secondary\" d=\"M28.53 27.64l-11.2 6.49V21.15l11.23-6.48z\"/><path d=\"M40.4 34.84c-.17 0-.34-.04-.5-.13l-11.24-6.44a.99.99 0 01-.37-1.36.99.99 0 011.36-.37l11.24 6.44c.48.27.65.89.37 1.36-.17.32-.51.5-.86.5z\" fill=\"#primary\"/><path d=\"M29.16 28.4c-.56 0-1-.45-1-1.01l.08-12.47c0-.55.49-1 1.01-.99.55 0 1 .45.99 1.01l-.08 12.47c0 .55-.45.99-1 .99z\" fill=\"#primary\"/><path d=\"M18.25 34.65a.996.996 0 01-.5-1.86l10.91-6.25a.997.997 0 11.99 1.73l-10.91 6.25c-.15.09-.32.13-.49.13z\" fill=\"#primary\"/><path d=\"M29.19 41.37c-.17 0-.35-.04-.5-.13l-11.23-6.49c-.31-.18-.5-.51-.5-.87V20.91c0-.36.19-.69.5-.87l11.23-6.49c.31-.18.69-.18 1 0l11.23 6.49c.31.18.5.51.5.87v12.97c0 .36-.19.69-.5.87l-11.23 6.49c-.15.08-.32.13-.5.13zm-10.23-8.06l10.23 5.91 10.23-5.91V21.49l-10.23-5.91-10.23 5.91v11.82zM40.5 11.02c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm-23.19 4.36c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.42 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm23.37 43.8c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.42 3.18-3.18 3.18zm0-4.35c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm-23.06 4.11c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zM6.18 30.72C4.43 30.72 3 29.29 3 27.54c0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm45.64 4.36c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18z\" fill=\"#primary\"/><path d=\"M29.1 10.21c-.55 0-1-.45-1-1V3.52c0-.55.45-1 1-1s1 .45 1 1v5.69c0 .56-.45 1-1 1zM7.44 20.95c-.73 0-1.32-.59-1.32-1.32v-5.38l4.66-2.69c.63-.37 1.44-.15 1.8.48.36.63.15 1.44-.48 1.8l-3.34 1.93v3.86c0 .73-.59 1.32-1.32 1.32zm4 22.68c-.22 0-.45-.06-.66-.18l-4.66-2.69v-5.38c0-.73.59-1.32 1.32-1.32.73 0 1.32.59 1.32 1.32v3.86l3.34 1.93c.63.36.85 1.17.48 1.8-.24.42-.68.66-1.14.66zm17.64 10.39l-4.66-2.69c-.63-.36-.85-1.17-.48-1.8.36-.63 1.17-.85 1.8-.48l3.34 1.93 3.34-1.93a1.32 1.32 0 011.8.48c.36.63.15 1.44-.48 1.8l-4.66 2.69zm17.64-10.39a1.32 1.32 0 01-.66-2.46l3.34-1.93v-3.86c0-.73.59-1.32 1.32-1.32.73 0 1.32.59 1.32 1.32v5.38l-4.66 2.69c-.21.12-.44.18-.66.18zm4-22.68c-.73 0-1.32-.59-1.32-1.32v-3.86l-3.34-1.93c-.63-.36-.85-1.17-.48-1.8.36-.63 1.17-.85 1.8-.48l4.66 2.69v5.38c0 .73-.59 1.32-1.32 1.32z\" fill=\"#secondary\"/><path d=\"M33.08 6.15c-.22 0-.45-.06-.66-.18l-3.34-1.93-3.34 1.93c-.63.36-1.44.15-1.8-.48a1.32 1.32 0 01.48-1.8L29.08 1l4.66 2.69c.63.36.85 1.17.48 1.8a1.3 1.3 0 01-1.14.66zm-3.99 47.3c-.55 0-1-.45-1-1v-7.13c0-.55.45-1 1-1s1 .45 1 1v7.13c0 .55-.44 1-1 1zM13.86 19.71c-.17 0-.34-.04-.5-.13L7.2 16a1 1 0 011-1.73l6.17 3.58c.48.28.64.89.36 1.37-.19.31-.52.49-.87.49zm36.63 21.23c-.17 0-.34-.04-.5-.13l-6.17-3.57a.998.998 0 01-.36-1.37c.28-.48.89-.64 1.37-.36L51 39.08c.48.28.64.89.36 1.37-.19.31-.52.49-.87.49zM44.06 19.8c-.35 0-.68-.18-.87-.5-.28-.48-.11-1.09.36-1.37l6.17-3.57c.48-.28 1.09-.11 1.37.36.28.48.11 1.09-.36 1.37l-6.17 3.57c-.16.1-.33.14-.5.14zM7.43 41.03c-.35 0-.68-.18-.87-.5-.28-.48-.11-1.09.36-1.37l6.17-3.57c.48-.28 1.09-.11 1.37.36.28.48.11 1.09-.36 1.37l-6.17 3.57c-.15.09-.33.14-.5.14z\" fill=\"#secondary\"/></g>",
|
||||
...rank(value, [1, 20, 50, 100]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g fill="none"><path fill="#secondary" d="M28.53 27.64l-11.2 6.49V21.15l11.23-6.48z"/><path d="M40.4 34.84c-.17 0-.34-.04-.5-.13l-11.24-6.44a.99.99 0 01-.37-1.36.99.99 0 011.36-.37l11.24 6.44c.48.27.65.89.37 1.36-.17.32-.51.5-.86.5z" fill="#primary"/><path d="M29.16 28.4c-.56 0-1-.45-1-1.01l.08-12.47c0-.55.49-1 1.01-.99.55 0 1 .45.99 1.01l-.08 12.47c0 .55-.45.99-1 .99z" fill="#primary"/><path d="M18.25 34.65a.996.996 0 01-.5-1.86l10.91-6.25a.997.997 0 11.99 1.73l-10.91 6.25c-.15.09-.32.13-.49.13z" fill="#primary"/><path d="M29.19 41.37c-.17 0-.35-.04-.5-.13l-11.23-6.49c-.31-.18-.5-.51-.5-.87V20.91c0-.36.19-.69.5-.87l11.23-6.49c.31-.18.69-.18 1 0l11.23 6.49c.31.18.5.51.5.87v12.97c0 .36-.19.69-.5.87l-11.23 6.49c-.15.08-.32.13-.5.13zm-10.23-8.06l10.23 5.91 10.23-5.91V21.49l-10.23-5.91-10.23 5.91v11.82zM40.5 11.02c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm-23.19 4.36c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.42 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm23.37 43.8c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.42 3.18-3.18 3.18zm0-4.35c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm-23.06 4.11c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zM6.18 30.72C4.43 30.72 3 29.29 3 27.54c0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm45.64 4.36c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18z" fill="#primary"/><path d="M29.1 10.21c-.55 0-1-.45-1-1V3.52c0-.55.45-1 1-1s1 .45 1 1v5.69c0 .56-.45 1-1 1zM7.44 20.95c-.73 0-1.32-.59-1.32-1.32v-5.38l4.66-2.69c.63-.37 1.44-.15 1.8.48.36.63.15 1.44-.48 1.8l-3.34 1.93v3.86c0 .73-.59 1.32-1.32 1.32zm4 22.68c-.22 0-.45-.06-.66-.18l-4.66-2.69v-5.38c0-.73.59-1.32 1.32-1.32.73 0 1.32.59 1.32 1.32v3.86l3.34 1.93c.63.36.85 1.17.48 1.8-.24.42-.68.66-1.14.66zm17.64 10.39l-4.66-2.69c-.63-.36-.85-1.17-.48-1.8.36-.63 1.17-.85 1.8-.48l3.34 1.93 3.34-1.93a1.32 1.32 0 011.8.48c.36.63.15 1.44-.48 1.8l-4.66 2.69zm17.64-10.39a1.32 1.32 0 01-.66-2.46l3.34-1.93v-3.86c0-.73.59-1.32 1.32-1.32.73 0 1.32.59 1.32 1.32v5.38l-4.66 2.69c-.21.12-.44.18-.66.18zm4-22.68c-.73 0-1.32-.59-1.32-1.32v-3.86l-3.34-1.93c-.63-.36-.85-1.17-.48-1.8.36-.63 1.17-.85 1.8-.48l4.66 2.69v5.38c0 .73-.59 1.32-1.32 1.32z" fill="#secondary"/><path d="M33.08 6.15c-.22 0-.45-.06-.66-.18l-3.34-1.93-3.34 1.93c-.63.36-1.44.15-1.8-.48a1.32 1.32 0 01.48-1.8L29.08 1l4.66 2.69c.63.36.85 1.17.48 1.8a1.3 1.3 0 01-1.14.66zm-3.99 47.3c-.55 0-1-.45-1-1v-7.13c0-.55.45-1 1-1s1 .45 1 1v7.13c0 .55-.44 1-1 1zM13.86 19.71c-.17 0-.34-.04-.5-.13L7.2 16a1 1 0 011-1.73l6.17 3.58c.48.28.64.89.36 1.37-.19.31-.52.49-.87.49zm36.63 21.23c-.17 0-.34-.04-.5-.13l-6.17-3.57a.998.998 0 01-.36-1.37c.28-.48.89-.64 1.37-.36L51 39.08c.48.28.64.89.36 1.37-.19.31-.52.49-.87.49zM44.06 19.8c-.35 0-.68-.18-.87-.5-.28-.48-.11-1.09.36-1.37l6.17-3.57c.48-.28 1.09-.11 1.37.36.28.48.11 1.09-.36 1.37l-6.17 3.57c-.16.1-.33.14-.5.14zM7.43 41.03c-.35 0-.68-.18-.87-.5-.28-.48-.11-1.09.36-1.37l6.17-3.57c.48-.28 1.09-.11 1.37.36.28.48.11 1.09-.36 1.37l-6.17 3.57c-.15.09-.33.14-.5.14z" fill="#secondary"/></g>',
|
||||
...rank(value, [1, 20, 50, 100]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -66,8 +73,10 @@
|
||||
list.push({
|
||||
title:"Maintainers",
|
||||
text:`Maintaining a repository with ${value} star${imports.s(value)}`,
|
||||
icon:"<g transform=\"translate(4 4)\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M39 15h.96l4.038 3-.02-3H45a2 2 0 002-2V3a2 2 0 00-2-2H31a2 2 0 00-2 2v4.035\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M36 5.014l-3 3 3 3M40 5.014l3 3-3 3\"/><path d=\"M6 37a1 1 0 110 2 1 1 0 010-2m7 0a1 1 0 110 2 1 1 0 010-2m-2.448 1a1 1 0 11-2 0 1 1 0 012 0z\" fill=\"#primary\"/><path d=\"M1.724 15.05A23.934 23.934 0 000 24c0 .686.029 1.366.085 2.037m19.92 21.632c1.3.218 2.634.331 3.995.331a23.92 23.92 0 009.036-1.76m13.207-13.21A23.932 23.932 0 0048 24c0-1.363-.114-2.7-.332-4M25.064.022a23.932 23.932 0 00-10.073 1.725\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\"/><path d=\"M19 42.062V43a2 2 0 01-2 2H9.04l-4.038 3 .02-3H3a2 2 0 01-2-2V33a2 2 0 012-2h4.045\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M6 0a6 6 0 110 12A6 6 0 016 0z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" d=\"M6 3v6M3 6h6\"/><path d=\"M42 36a6 6 0 110 12 6 6 0 010-12z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M44.338 40.663l-3.336 3.331-1.692-1.686M31 31c-.716-2.865-3.578-5-7-5-3.423 0-6.287 2.14-7 5\"/><path d=\"M24 16a5 5 0 110 10 5 5 0 010-10z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\"/><circle stroke=\"#primary\" stroke-width=\"2\" cx=\"24\" cy=\"24\" r=\"14\"/></g>",
|
||||
...rank(value, [1, 5000, 10000, 30000]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g transform="translate(4 4)" fill="none" fill-rule="evenodd"><path d="M39 15h.96l4.038 3-.02-3H45a2 2 0 002-2V3a2 2 0 00-2-2H31a2 2 0 00-2 2v4.035" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M36 5.014l-3 3 3 3M40 5.014l3 3-3 3"/><path d="M6 37a1 1 0 110 2 1 1 0 010-2m7 0a1 1 0 110 2 1 1 0 010-2m-2.448 1a1 1 0 11-2 0 1 1 0 012 0z" fill="#primary"/><path d="M1.724 15.05A23.934 23.934 0 000 24c0 .686.029 1.366.085 2.037m19.92 21.632c1.3.218 2.634.331 3.995.331a23.92 23.92 0 009.036-1.76m13.207-13.21A23.932 23.932 0 0048 24c0-1.363-.114-2.7-.332-4M25.064.022a23.932 23.932 0 00-10.073 1.725" stroke="#secondary" stroke-width="2" stroke-linecap="round"/><path d="M19 42.062V43a2 2 0 01-2 2H9.04l-4.038 3 .02-3H3a2 2 0 01-2-2V33a2 2 0 012-2h4.045" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M6 0a6 6 0 110 12A6 6 0 016 0z" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path stroke="#primary" stroke-width="2" stroke-linecap="round" d="M6 3v6M3 6h6"/><path d="M42 36a6 6 0 110 12 6 6 0 010-12z" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M44.338 40.663l-3.336 3.331-1.692-1.686M31 31c-.716-2.865-3.578-5-7-5-3.423 0-6.287 2.14-7 5"/><path d="M24 16a5 5 0 110 10 5 5 0 010-10z" stroke="#primary" stroke-width="2" stroke-linecap="round"/><circle stroke="#primary" stroke-width="2" cx="24" cy="24" r="14"/></g>',
|
||||
...rank(value, [1, 5000, 10000, 30000]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
leaderboard:leaderboard({user:ranks.repo_rank.repositoryCount, requirement:scores.stars >= requirements.stars, type:"repositories"}),
|
||||
})
|
||||
}
|
||||
@@ -79,8 +88,10 @@
|
||||
list.push({
|
||||
title:"Inspirationers",
|
||||
text:`Maintaining a repository which has been forked ${value} time${imports.s(value)}`,
|
||||
icon:"<g transform=\"translate(4 4)\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M20.065 47.122c.44-.525.58-1.448.58-1.889 0-2.204-1.483-3.967-3.633-4.187.447-1.537.58-2.64.397-3.31-.25-.92-.745-1.646-1.409-2.235m-5.97-7.157c.371-.254.911-.748 1.62-1.48a8.662 8.662 0 001.432-2.366M47 22h-7c-1.538 0-2.749-.357-4-1h-5c-1.789.001-3-1.3-3-2.955 0-1.656 1.211-3.04 3-3.045h2c.027-1.129.513-2.17 1-3m3.082 32.004C34.545 43.028 34.02 40.569 34 39v-1h-1c-2.603-.318-5-2.913-5-5.997S30.397 26 33 26h9c2.384 0 4.326 1.024 5.27 3\" stroke=\"#secondary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"/><g transform=\"translate(36)\" stroke=\"#primary\" stroke-width=\"2\"><path fill=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M5.395 5.352L6.009 4l.598 1.348L8 5.408l-1.067 1.12.425 1.47-1.356-.908-1.35.91.404-1.469L4 5.41z\"/><circle cx=\"6\" cy=\"6\" r=\"6\"/></g><g transform=\"translate(0 31)\" stroke=\"#primary\" stroke-width=\"2\"><circle cx=\"6\" cy=\"6\" r=\"6\"/><g stroke-linecap=\"round\"><path d=\"M6 4v4M4 6h4\"/></g></g><circle stroke=\"#primary\" stroke-width=\"2\" cx=\"10.5\" cy=\"10.5\" r=\"10.5\"/><g stroke-linecap=\"round\"><path d=\"M32.01 1.37A23.96 23.96 0 0024 0c-.999 0-1.983.061-2.95.18M.32 20.072a24.21 24.21 0 00.015 7.948M12.42 45.025A23.892 23.892 0 0024 48c13.255 0 24-10.745 24-24 0-2.811-.483-5.51-1.371-8.016\" stroke=\"#secondary\" stroke-width=\"2\"/><path stroke=\"#primary\" stroke-width=\"2\" d=\"M8.999 7.151v5.865\"/><path d=\"M9 3a2 2 0 110 4 2 2 0 010-4zm0 10.8a2 2 0 11-.001 4 2 2 0 01.001-4z\" stroke=\"#primary\" stroke-width=\"1.8\"/><path d=\"M9.622 11.838c.138-.007.989.119 1.595-.05.607-.169 1.584-.539 1.829-1.337\" stroke=\"#primary\" stroke-width=\"2\"/><path d=\"M14.8 7.202a2 2 0 110 4 2 2 0 010-4z\" stroke=\"#primary\" stroke-width=\"1.8\"/></g></g>",
|
||||
...rank(value, [1, 500, 1000, 3000]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g transform="translate(4 4)" fill="none" fill-rule="evenodd"><path d="M20.065 47.122c.44-.525.58-1.448.58-1.889 0-2.204-1.483-3.967-3.633-4.187.447-1.537.58-2.64.397-3.31-.25-.92-.745-1.646-1.409-2.235m-5.97-7.157c.371-.254.911-.748 1.62-1.48a8.662 8.662 0 001.432-2.366M47 22h-7c-1.538 0-2.749-.357-4-1h-5c-1.789.001-3-1.3-3-2.955 0-1.656 1.211-3.04 3-3.045h2c.027-1.129.513-2.17 1-3m3.082 32.004C34.545 43.028 34.02 40.569 34 39v-1h-1c-2.603-.318-5-2.913-5-5.997S30.397 26 33 26h9c2.384 0 4.326 1.024 5.27 3" stroke="#secondary" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/><g transform="translate(36)" stroke="#primary" stroke-width="2"><path fill="#primary" stroke-linecap="round" stroke-linejoin="round" d="M5.395 5.352L6.009 4l.598 1.348L8 5.408l-1.067 1.12.425 1.47-1.356-.908-1.35.91.404-1.469L4 5.41z"/><circle cx="6" cy="6" r="6"/></g><g transform="translate(0 31)" stroke="#primary" stroke-width="2"><circle cx="6" cy="6" r="6"/><g stroke-linecap="round"><path d="M6 4v4M4 6h4"/></g></g><circle stroke="#primary" stroke-width="2" cx="10.5" cy="10.5" r="10.5"/><g stroke-linecap="round"><path d="M32.01 1.37A23.96 23.96 0 0024 0c-.999 0-1.983.061-2.95.18M.32 20.072a24.21 24.21 0 00.015 7.948M12.42 45.025A23.892 23.892 0 0024 48c13.255 0 24-10.745 24-24 0-2.811-.483-5.51-1.371-8.016" stroke="#secondary" stroke-width="2"/><path stroke="#primary" stroke-width="2" d="M8.999 7.151v5.865"/><path d="M9 3a2 2 0 110 4 2 2 0 010-4zm0 10.8a2 2 0 11-.001 4 2 2 0 01.001-4z" stroke="#primary" stroke-width="1.8"/><path d="M9.622 11.838c.138-.007.989.119 1.595-.05.607-.169 1.584-.539 1.829-1.337" stroke="#primary" stroke-width="2"/><path d="M14.8 7.202a2 2 0 110 4 2 2 0 010-4z" stroke="#primary" stroke-width="1.8"/></g></g>',
|
||||
...rank(value, [1, 500, 1000, 3000]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
leaderboard:leaderboard({user:ranks.forks_rank.repositoryCount, requirement:scores.forks >= requirements.forks, type:"repositories"}),
|
||||
})
|
||||
}
|
||||
@@ -93,8 +104,10 @@
|
||||
list.push({
|
||||
title:"Polyglots",
|
||||
text:`Using ${value} different programming language${imports.s(value)}`,
|
||||
icon:"<g stroke-linecap=\"round\" stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M17.135 7.988l-3.303.669a2 2 0 00-1.586 2.223l4.708 35.392a1.498 1.498 0 01-1.162 1.66 1.523 1.523 0 01-1.775-1.01L4.951 19.497a2 2 0 011.215-2.507l2.946-1.072\" stroke=\"#secondary\" stroke-linejoin=\"round\"/><path d=\"M36.8 48H23a2 2 0 01-2-2V7a2 2 0 012-2h26a2 2 0 012 2v32.766\" stroke=\"#primary\"/><path d=\"M29 20.955l-3.399 3.399a.85.85 0 000 1.202l3.399 3.4M43.014 20.955l3.399 3.399a.85.85 0 010 1.202l-3.4 3.4\" stroke=\"#primary\" stroke-linejoin=\"round\"/><path stroke=\"#primary\" d=\"M38.526 18l-5.053 14.016\"/><path d=\"M44 36a8 8 0 110 16 8 8 0 010-16z\" stroke=\"#primary\" stroke-linejoin=\"round\"/><path d=\"M43.068 40.749l3.846 2.396a1 1 0 01-.006 1.7l-3.846 2.36a1 1 0 01-1.523-.853v-4.755a1 1 0 011.529-.848z\" stroke=\"#primary\" stroke-linejoin=\"round\"/></g>",
|
||||
...rank(value, [1, 8, 16, 32]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-linecap="round" stroke-width="2" fill="none" fill-rule="evenodd"><path d="M17.135 7.988l-3.303.669a2 2 0 00-1.586 2.223l4.708 35.392a1.498 1.498 0 01-1.162 1.66 1.523 1.523 0 01-1.775-1.01L4.951 19.497a2 2 0 011.215-2.507l2.946-1.072" stroke="#secondary" stroke-linejoin="round"/><path d="M36.8 48H23a2 2 0 01-2-2V7a2 2 0 012-2h26a2 2 0 012 2v32.766" stroke="#primary"/><path d="M29 20.955l-3.399 3.399a.85.85 0 000 1.202l3.399 3.4M43.014 20.955l3.399 3.399a.85.85 0 010 1.202l-3.4 3.4" stroke="#primary" stroke-linejoin="round"/><path stroke="#primary" d="M38.526 18l-5.053 14.016"/><path d="M44 36a8 8 0 110 16 8 8 0 010-16z" stroke="#primary" stroke-linejoin="round"/><path d="M43.068 40.749l3.846 2.396a1 1 0 01-.006 1.7l-3.846 2.36a1 1 0 01-1.523-.853v-4.755a1 1 0 011.529-.848z" stroke="#primary" stroke-linejoin="round"/></g>',
|
||||
...rank(value, [1, 8, 16, 32]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -106,8 +119,10 @@
|
||||
list.push({
|
||||
title:"Sponsors",
|
||||
text:`Sponsoring ${value} user${imports.s(value)} or organization${imports.s(value)}`,
|
||||
icon:"<g xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M24 32c.267-1.727 1.973-3 4-3 2.08 0 3.787 1.318 4 3m-4-9a3 3 0 110 6 3 3 0 010-6z\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M28 18c5.523 0 10 4.477 10 10s-4.477 10-10 10-10-4.477-10-10 4.477-10 10-10z\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M46.138 15c-1.033 0-1.454.822-1.634 1.413-.019.06-.024.06-.042 0-.182-.591-.707-1.413-1.655-1.413C41.347 15 41 16.117 41 17.005c0 1.676 2.223 3.228 3.091 3.845.272.197.556.194.817 0 .798-.593 3.092-2.17 3.092-3.845 0-.888-.261-2.005-1.862-2.005zm-31-5c-1.033 0-1.454.822-1.634 1.413-.019.06-.024.06-.042 0-.182-.591-.707-1.413-1.655-1.413C10.347 10 10 11.117 10 12.005c0 1.676 2.223 3.228 3.091 3.845.272.197.556.194.817 0 .798-.593 3.092-2.17 3.092-3.845 0-.888-.261-2.005-1.862-2.005zm6 32c-1.033 0-1.454.822-1.634 1.413-.019.06-.024.06-.042 0-.182-.591-.707-1.413-1.655-1.413C16.347 42 16 43.117 16 44.005c0 1.676 2.223 3.228 3.091 3.845.272.197.556.194.817 0 .798-.593 3.092-2.17 3.092-3.845 0-.888-.261-2.005-1.862-2.005z\" fill=\"#secondary\"/><path d=\"M8.003 29a3 3 0 110 6 3 3 0 010-6zM32.018 5.005a3 3 0 110 6 3 3 0 010-6z\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\"/><path stroke=\"#secondary\" stroke-width=\"2\" d=\"M29.972 18.026L31.361 11M18.063 29.987l-7.004 1.401\"/><path d=\"M22.604 11.886l.746 2.164m-9.313 9.296l-2.156-.712\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M21.304 9a1 1 0 100-2 1 1 0 000 2zM8.076 22.346a1 1 0 100-2 1 1 0 000 2z\" fill=\"#primary\"/><path d=\"M33.267 44.17l-.722-2.146m9.38-9.206l2.147.743\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M34.544 49.031a1 1 0 100-2 1 1 0 000 2zm13.314-13.032a1 1 0 100-2 1 1 0 000 2z\" fill=\"#primary\"/><path d=\"M48.019 51.004a3 3 0 100-6 3 3 0 000 6zM35.194 35.33l10.812 11.019\" stroke=\"#secondary\" stroke-width=\"2\"/></g>",
|
||||
...rank(value, [1, 5, 10, 20]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g xmlns="http://www.w3.org/2000/svg" fill="none" fill-rule="evenodd"><path d="M24 32c.267-1.727 1.973-3 4-3 2.08 0 3.787 1.318 4 3m-4-9a3 3 0 110 6 3 3 0 010-6z" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M28 18c5.523 0 10 4.477 10 10s-4.477 10-10 10-10-4.477-10-10 4.477-10 10-10z" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M46.138 15c-1.033 0-1.454.822-1.634 1.413-.019.06-.024.06-.042 0-.182-.591-.707-1.413-1.655-1.413C41.347 15 41 16.117 41 17.005c0 1.676 2.223 3.228 3.091 3.845.272.197.556.194.817 0 .798-.593 3.092-2.17 3.092-3.845 0-.888-.261-2.005-1.862-2.005zm-31-5c-1.033 0-1.454.822-1.634 1.413-.019.06-.024.06-.042 0-.182-.591-.707-1.413-1.655-1.413C10.347 10 10 11.117 10 12.005c0 1.676 2.223 3.228 3.091 3.845.272.197.556.194.817 0 .798-.593 3.092-2.17 3.092-3.845 0-.888-.261-2.005-1.862-2.005zm6 32c-1.033 0-1.454.822-1.634 1.413-.019.06-.024.06-.042 0-.182-.591-.707-1.413-1.655-1.413C16.347 42 16 43.117 16 44.005c0 1.676 2.223 3.228 3.091 3.845.272.197.556.194.817 0 .798-.593 3.092-2.17 3.092-3.845 0-.888-.261-2.005-1.862-2.005z" fill="#secondary"/><path d="M8.003 29a3 3 0 110 6 3 3 0 010-6zM32.018 5.005a3 3 0 110 6 3 3 0 010-6z" stroke="#secondary" stroke-width="2" stroke-linecap="round"/><path stroke="#secondary" stroke-width="2" d="M29.972 18.026L31.361 11M18.063 29.987l-7.004 1.401"/><path d="M22.604 11.886l.746 2.164m-9.313 9.296l-2.156-.712" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M21.304 9a1 1 0 100-2 1 1 0 000 2zM8.076 22.346a1 1 0 100-2 1 1 0 000 2z" fill="#primary"/><path d="M33.267 44.17l-.722-2.146m9.38-9.206l2.147.743" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M34.544 49.031a1 1 0 100-2 1 1 0 000 2zm13.314-13.032a1 1 0 100-2 1 1 0 000 2z" fill="#primary"/><path d="M48.019 51.004a3 3 0 100-6 3 3 0 000 6zM35.194 35.33l10.812 11.019" stroke="#secondary" stroke-width="2"/></g>',
|
||||
...rank(value, [1, 5, 10, 20]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -119,8 +134,10 @@
|
||||
list.push({
|
||||
title:"Organization",
|
||||
text:`Has ${value} member${imports.s(value)}`,
|
||||
icon:"<g xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M6 42c.45-3.415 3.34-6 7-6 1.874 0 3.752.956 5 3m-6-13a5 5 0 110 10 5 5 0 010-10zm38 16c-.452-3.415-3.34-6-7-6-1.874 0-3.752.956-5 3m6-13a5 5 0 100 10 5 5 0 000-10z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\"/><path d=\"M37 51c-.92-4.01-4.6-7-9-7-4.401 0-8.083 2.995-9 7\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M28.01 31.004a6.5 6.5 0 110 13 6.5 6.5 0 010-13z\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\"/><path d=\"M28 14.011a5 5 0 11-5 4.998 5 5 0 015-4.998z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\"/><path d=\"M22 26c1.558-1.25 3.665-2 6-2 2.319 0 4.439.761 6 2\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M51 9V8c0-1.3-1.574-3-3-3h-8c-1.426 0-3 1.7-3 3v13l4-4h6c2.805-.031 4-1.826 4-4V9zM5 9V8c0-1.3 1.574-3 3-3h8c1.426 0 3 1.7 3 3v13l-4-4H9c-2.805-.031-4-1.826-4-4V9z\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M43 11a1 1 0 11-2 0 1 1 0 012 0zm4 0a1 1 0 11-2 0 1 1 0 012 0zm-36 0a1 1 0 11-2 0 1 1 0 012 0zm4 0a1 1 0 11-2 0 1 1 0 012 0z\" fill=\"#secondary\"/></g>",
|
||||
...rank(value, [1, 100, 500, 1000]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g xmlns="http://www.w3.org/2000/svg" fill="none" fill-rule="evenodd"><path d="M6 42c.45-3.415 3.34-6 7-6 1.874 0 3.752.956 5 3m-6-13a5 5 0 110 10 5 5 0 010-10zm38 16c-.452-3.415-3.34-6-7-6-1.874 0-3.752.956-5 3m6-13a5 5 0 100 10 5 5 0 000-10z" stroke="#primary" stroke-width="2" stroke-linecap="round"/><path d="M37 51c-.92-4.01-4.6-7-9-7-4.401 0-8.083 2.995-9 7" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M28.01 31.004a6.5 6.5 0 110 13 6.5 6.5 0 010-13z" stroke="#secondary" stroke-width="2" stroke-linecap="round"/><path d="M28 14.011a5 5 0 11-5 4.998 5 5 0 015-4.998z" stroke="#primary" stroke-width="2" stroke-linecap="round"/><path d="M22 26c1.558-1.25 3.665-2 6-2 2.319 0 4.439.761 6 2" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M51 9V8c0-1.3-1.574-3-3-3h-8c-1.426 0-3 1.7-3 3v13l4-4h6c2.805-.031 4-1.826 4-4V9zM5 9V8c0-1.3 1.574-3 3-3h8c1.426 0 3 1.7 3 3v13l-4-4H9c-2.805-.031-4-1.826-4-4V9z" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M43 11a1 1 0 11-2 0 1 1 0 012 0zm4 0a1 1 0 11-2 0 1 1 0 012 0zm-36 0a1 1 0 11-2 0 1 1 0 012 0zm4 0a1 1 0 11-2 0 1 1 0 012 0z" fill="#secondary"/></g>',
|
||||
...rank(value, [1, 100, 500, 1000]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -132,9 +149,10 @@
|
||||
list.push({
|
||||
title:"Member",
|
||||
text:`Registered ${Math.floor(value)} year${imports.s(Math.floor(value))} ago`,
|
||||
icon:"<g xmlns=\"http://www.w3.org/2000/svg\" transform=\"translate(5 4)\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M46 44.557v1a2 2 0 01-2 2H2a2 2 0 01-2-2v-1\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M.75 40.993l.701.561a2.323 2.323 0 002.903 0l1.675-1.34a3 3 0 013.748 0l1.282 1.026a3 3 0 003.71.03l1.4-1.085a3 3 0 013.75.061l1.103.913a3 3 0 003.787.031l1.22-.976a3 3 0 013.748 0l1.282 1.026a3 3 0 003.71.03l1.4-1.085a3 3 0 013.75.061l1.429 1.182a2.427 2.427 0 003.103-.008l.832-.695A2 2 0 0046 39.191v-1.634a2 2 0 00-2-2H2a2 2 0 00-2 2v1.875a2 2 0 00.75 1.561z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M42 31.609v.948m-38 0v-.992m25.04-15.008H35a2 2 0 012 2v1m-28 0v-1a2 2 0 012-2h6.007\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M22 8.557h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6a1 1 0 011-1z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linejoin=\"round\"/><path d=\"M4.7 10.557c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689zm35-8c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M23 5.557a2 2 0 002-2C25 2.452 24.433 0 22.273 0c-.463 0 .21 1.424-.502 1.979A2 2 0 0023 5.557z\" stroke=\"#primary\" stroke-width=\"2\"/><path d=\"M4.78 27.982l1.346 1.076a3 3 0 003.748 0l1.252-1.002a3 3 0 013.748 0l1.282 1.026a3 3 0 003.711.03l1.4-1.085a3 3 0 013.75.061l1.102.913a3 3 0 003.787.031l1.22-.976a3 3 0 013.748 0l1.281 1.025a3 3 0 003.712.029l1.358-1.053a2 2 0 00.775-1.58v-.97a1.95 1.95 0 00-1.95-1.95H5.942a1.912 1.912 0 00-1.912 1.912v.951a2 2 0 00.75 1.562z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><circle stroke=\"#secondary\" cx=\"16.5\" cy=\"2.057\" r=\"1\"/><circle stroke=\"#secondary\" cx=\"14.5\" cy=\"12.057\" r=\"1\"/><circle stroke=\"#secondary\" cx=\"31.5\" cy=\"9.057\" r=\"1\"/></g>",
|
||||
...rank(value, [1, 3, 5, 10]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g xmlns="http://www.w3.org/2000/svg" transform="translate(5 4)" fill="none" fill-rule="evenodd"><path d="M46 44.557v1a2 2 0 01-2 2H2a2 2 0 01-2-2v-1" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M.75 40.993l.701.561a2.323 2.323 0 002.903 0l1.675-1.34a3 3 0 013.748 0l1.282 1.026a3 3 0 003.71.03l1.4-1.085a3 3 0 013.75.061l1.103.913a3 3 0 003.787.031l1.22-.976a3 3 0 013.748 0l1.282 1.026a3 3 0 003.71.03l1.4-1.085a3 3 0 013.75.061l1.429 1.182a2.427 2.427 0 003.103-.008l.832-.695A2 2 0 0046 39.191v-1.634a2 2 0 00-2-2H2a2 2 0 00-2 2v1.875a2 2 0 00.75 1.561z" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M42 31.609v.948m-38 0v-.992m25.04-15.008H35a2 2 0 012 2v1m-28 0v-1a2 2 0 012-2h6.007" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M22 8.557h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6a1 1 0 011-1z" stroke="#primary" stroke-width="2" stroke-linejoin="round"/><path d="M4.7 10.557c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689zm35-8c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689z" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M23 5.557a2 2 0 002-2C25 2.452 24.433 0 22.273 0c-.463 0 .21 1.424-.502 1.979A2 2 0 0023 5.557z" stroke="#primary" stroke-width="2"/><path d="M4.78 27.982l1.346 1.076a3 3 0 003.748 0l1.252-1.002a3 3 0 013.748 0l1.282 1.026a3 3 0 003.711.03l1.4-1.085a3 3 0 013.75.061l1.102.913a3 3 0 003.787.031l1.22-.976a3 3 0 013.748 0l1.281 1.025a3 3 0 003.712.029l1.358-1.053a2 2 0 00.775-1.58v-.97a1.95 1.95 0 00-1.95-1.95H5.942a1.912 1.912 0 00-1.912 1.912v.951a2 2 0 00.75 1.562z" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle stroke="#secondary" cx="16.5" cy="2.057" r="1"/><circle stroke="#secondary" cx="14.5" cy="12.057" r="1"/><circle stroke="#secondary" cx="31.5" cy="9.057" r="1"/></g>',
|
||||
...rank(value, [1, 3, 5, 10]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
/**Achievements list for users accounts */
|
||||
export default async function({list, login, data, computed, imports, graphql, queries, rank, leaderboard}) {
|
||||
|
||||
//Initialization
|
||||
const {user} = await graphql(queries.achievements({login}))
|
||||
const scores = {followers:user.followers.totalCount, created:user.repositories.totalCount, stars:user.popular.nodes?.[0]?.stargazers?.totalCount ?? 0, forks:Math.max(0, ...data.user.repositories.nodes.map(({forkCount}) => forkCount))}
|
||||
@@ -14,8 +13,10 @@
|
||||
list.push({
|
||||
title:"Developer",
|
||||
text:`Published ${value} public repositor${imports.s(value, "y")}`,
|
||||
icon:"<g stroke-linecap=\"round\" stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><g stroke=\"#primary\"><path d=\"M20 24l-3.397 3.398a.85.85 0 000 1.203L20.002 32M37.015 24l3.399 3.398a.85.85 0 010 1.203L37.014 32\" stroke-linejoin=\"round\"/><path d=\"M31.029 21.044L25.976 35.06\"/></g><path stroke=\"#secondary\" stroke-linejoin=\"round\" d=\"M23.018 10h8.984M26 47h5M8 16h16m9 0h15.725M8 41h13\"/><path d=\"M5.027 34.998c.673 2.157 1.726 4.396 2.81 6.02m43.38-19.095C50.7 19.921 49.866 17.796 48.79 16\" stroke=\"#secondary\"/><path stroke=\"#primary\" stroke-linejoin=\"round\" d=\"M26 41h17\"/><path d=\"M7.183 16C5.186 19.582 4 23.619 4 28M42.608 47.02c2.647-1.87 5.642-5.448 7.295-9.18C51.52 34.191 52.071 30.323 52 28\" stroke=\"#primary\"/><path stroke=\"#primary\" stroke-linejoin=\"round\" d=\"M7.226 16H28M13.343 47H21\"/><path d=\"M13.337 47.01a24.364 24.364 0 006.19 3.45 24.527 24.527 0 007.217 1.505c2.145.108 4.672-.05 7.295-.738\" stroke=\"#primary\"/><path stroke=\"#primary\" stroke-linejoin=\"round\" d=\"M36 47h6.647M12 10h6M37 10h6.858\"/><path d=\"M43.852 10c-4.003-3.667-9.984-6.054-16.047-6-2.367.021-4.658.347-6.81 1.045\" stroke=\"#primary\"/><path stroke=\"#secondary\" stroke-linejoin=\"round\" d=\"M5.041 35h4.962M47 22h4.191\"/></g>",
|
||||
...rank(value, [1, 20, 50, 100]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-linecap="round" stroke-width="2" fill="none" fill-rule="evenodd"><g stroke="#primary"><path d="M20 24l-3.397 3.398a.85.85 0 000 1.203L20.002 32M37.015 24l3.399 3.398a.85.85 0 010 1.203L37.014 32" stroke-linejoin="round"/><path d="M31.029 21.044L25.976 35.06"/></g><path stroke="#secondary" stroke-linejoin="round" d="M23.018 10h8.984M26 47h5M8 16h16m9 0h15.725M8 41h13"/><path d="M5.027 34.998c.673 2.157 1.726 4.396 2.81 6.02m43.38-19.095C50.7 19.921 49.866 17.796 48.79 16" stroke="#secondary"/><path stroke="#primary" stroke-linejoin="round" d="M26 41h17"/><path d="M7.183 16C5.186 19.582 4 23.619 4 28M42.608 47.02c2.647-1.87 5.642-5.448 7.295-9.18C51.52 34.191 52.071 30.323 52 28" stroke="#primary"/><path stroke="#primary" stroke-linejoin="round" d="M7.226 16H28M13.343 47H21"/><path d="M13.337 47.01a24.364 24.364 0 006.19 3.45 24.527 24.527 0 007.217 1.505c2.145.108 4.672-.05 7.295-.738" stroke="#primary"/><path stroke="#primary" stroke-linejoin="round" d="M36 47h6.647M12 10h6M37 10h6.858"/><path d="M43.852 10c-4.003-3.667-9.984-6.054-16.047-6-2.367.021-4.658.347-6.81 1.045" stroke="#primary"/><path stroke="#secondary" stroke-linejoin="round" d="M5.041 35h4.962M47 22h4.191"/></g>',
|
||||
...rank(value, [1, 20, 50, 100]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
leaderboard:leaderboard({user:ranks.created_rank.userCount, requirement:scores.created >= requirements.created, type:"users"}),
|
||||
})
|
||||
}
|
||||
@@ -27,8 +28,10 @@
|
||||
list.push({
|
||||
title:"Forker",
|
||||
text:`Forked ${value} public repositor${imports.s(value, "y")}`,
|
||||
icon:"<g stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M37.303 21.591a5.84 5.84 0 00-1.877-1.177 6.138 6.138 0 00-4.432 0 5.822 5.822 0 00-1.879 1.177L28 22.638l-1.115-1.047c-1.086-1.018-2.559-1.59-4.094-1.59-1.536 0-3.008.572-4.094 1.59-1.086 1.02-1.696 2.4-1.696 3.84 0 1.441.61 2.823 1.696 3.841l1.115 1.046L28 38l8.189-7.682 1.115-1.046a5.422 5.422 0 001.256-1.761 5.126 5.126 0 000-4.157 5.426 5.426 0 00-1.256-1.763z\" stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M15.967 42.705A18.922 18.922 0 0028 47a18.92 18.92 0 0011.076-3.56m-.032-30.902A18.914 18.914 0 0028 9c-4.09 0-7.876 1.292-10.976 3.49\" stroke=\"#secondary\" stroke-linecap=\"round\"/><g transform=\"translate(7 10)\" stroke=\"#primary\"><path d=\"M6 0v7c0 2.21-1.343 3-3 3s-3-.79-3-3V0\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path stroke-linecap=\"round\" d=\"M3 0v19.675\"/><rect stroke-linejoin=\"round\" x=\"1\" y=\"20\" width=\"4\" height=\"16\" rx=\"2\"/></g><g transform=\"translate(43 10)\" stroke=\"#primary\"><path stroke-linecap=\"round\" d=\"M2 15.968v3.674\"/><path d=\"M4 15.642H0L.014 4.045A4.05 4.05 0 014.028 0L4 15.642z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><rect stroke-linejoin=\"round\" y=\"19.968\" width=\"4\" height=\"16\" rx=\"2\"/></g><path d=\"M41.364 8.062A23.888 23.888 0 0028 4a23.89 23.89 0 00-11.95 3.182M4.75 22.021A24.045 24.045 0 004 28c0 1.723.182 3.404.527 5.024m10.195 14.971A23.888 23.888 0 0028 52c4.893 0 9.444-1.464 13.239-3.979m9-10.98A23.932 23.932 0 0052 28c0-2.792-.477-5.472-1.353-7.964\" stroke=\"#secondary\" stroke-linecap=\"round\"/></g>",
|
||||
...rank(value, [1, 5, 10, 20]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-width="2" fill="none" fill-rule="evenodd"><path d="M37.303 21.591a5.84 5.84 0 00-1.877-1.177 6.138 6.138 0 00-4.432 0 5.822 5.822 0 00-1.879 1.177L28 22.638l-1.115-1.047c-1.086-1.018-2.559-1.59-4.094-1.59-1.536 0-3.008.572-4.094 1.59-1.086 1.02-1.696 2.4-1.696 3.84 0 1.441.61 2.823 1.696 3.841l1.115 1.046L28 38l8.189-7.682 1.115-1.046a5.422 5.422 0 001.256-1.761 5.126 5.126 0 000-4.157 5.426 5.426 0 00-1.256-1.763z" stroke="#primary" stroke-linecap="round" stroke-linejoin="round"/><path d="M15.967 42.705A18.922 18.922 0 0028 47a18.92 18.92 0 0011.076-3.56m-.032-30.902A18.914 18.914 0 0028 9c-4.09 0-7.876 1.292-10.976 3.49" stroke="#secondary" stroke-linecap="round"/><g transform="translate(7 10)" stroke="#primary"><path d="M6 0v7c0 2.21-1.343 3-3 3s-3-.79-3-3V0" stroke-linecap="round" stroke-linejoin="round"/><path stroke-linecap="round" d="M3 0v19.675"/><rect stroke-linejoin="round" x="1" y="20" width="4" height="16" rx="2"/></g><g transform="translate(43 10)" stroke="#primary"><path stroke-linecap="round" d="M2 15.968v3.674"/><path d="M4 15.642H0L.014 4.045A4.05 4.05 0 014.028 0L4 15.642z" stroke-linecap="round" stroke-linejoin="round"/><rect stroke-linejoin="round" y="19.968" width="4" height="16" rx="2"/></g><path d="M41.364 8.062A23.888 23.888 0 0028 4a23.89 23.89 0 00-11.95 3.182M4.75 22.021A24.045 24.045 0 004 28c0 1.723.182 3.404.527 5.024m10.195 14.971A23.888 23.888 0 0028 52c4.893 0 9.444-1.464 13.239-3.979m9-10.98A23.932 23.932 0 0052 28c0-2.792-.477-5.472-1.353-7.964" stroke="#secondary" stroke-linecap="round"/></g>',
|
||||
...rank(value, [1, 5, 10, 20]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -40,8 +43,10 @@
|
||||
list.push({
|
||||
title:"Contributor",
|
||||
text:`Opened ${value} pull request${imports.s(value)}`,
|
||||
icon:"<g stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><path stroke=\"#secondary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M26.022 5.014h6M26.012 53.005h6M27.003 47.003h12M44.01 20.005h5M19.01 11.003h12\"/><path stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M38.005 11.008h6M41 14.013v-6M14.007 47.003h6M17.002 50.004v-6\"/><path d=\"M29.015 5.01l-5.003 5.992 5.003-5.992zM33.015 47.01l-5.003 5.992 5.003-5.992z\" stroke=\"#secondary\"/><path stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M8.01 19.002h6\"/><path stroke=\"#secondary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M47.011 29h6\"/><path stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M44.012 39.003h6\"/><g stroke=\"#secondary\"><path d=\"M5.36 29c4.353 0 6.4 4.472 6.4 8\"/><path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M13.99 37.995h-5M10.989 29h-6\"/></g><path d=\"M24.503 22c1.109 0 2.007.895 2.007 2 0 1.104-.898 2-2.007 2a2.004 2.004 0 01-2.008-2c0-1.105.9-2 2.008-2zM24.5 32a2 2 0 110 4 2 2 0 010-4zm9.5 0a2 2 0 110 4 2 2 0 010-4z\" stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path stroke=\"#primary\" d=\"M24.5 26.004v6.001\"/><path d=\"M31.076 23.988l1.027-.023a1.998 1.998 0 011.932 2.01L34 31\" stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M31.588 26.222l-2.194-2.046 2.046-2.194\"/><path d=\"M29.023 43c7.732 0 14-6.268 14-14s-6.268-14-14-14-14 6.268-14 14 6.268 14 14 14z\" stroke=\"#primary\"/></g>",
|
||||
...rank(value, [1, 200, 500, 1000]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-width="2" fill="none" fill-rule="evenodd"><path stroke="#secondary" stroke-linecap="round" stroke-linejoin="round" d="M26.022 5.014h6M26.012 53.005h6M27.003 47.003h12M44.01 20.005h5M19.01 11.003h12"/><path stroke="#primary" stroke-linecap="round" stroke-linejoin="round" d="M38.005 11.008h6M41 14.013v-6M14.007 47.003h6M17.002 50.004v-6"/><path d="M29.015 5.01l-5.003 5.992 5.003-5.992zM33.015 47.01l-5.003 5.992 5.003-5.992z" stroke="#secondary"/><path stroke="#primary" stroke-linecap="round" stroke-linejoin="round" d="M8.01 19.002h6"/><path stroke="#secondary" stroke-linecap="round" stroke-linejoin="round" d="M47.011 29h6"/><path stroke="#primary" stroke-linecap="round" stroke-linejoin="round" d="M44.012 39.003h6"/><g stroke="#secondary"><path d="M5.36 29c4.353 0 6.4 4.472 6.4 8"/><path stroke-linecap="round" stroke-linejoin="round" d="M13.99 37.995h-5M10.989 29h-6"/></g><path d="M24.503 22c1.109 0 2.007.895 2.007 2 0 1.104-.898 2-2.007 2a2.004 2.004 0 01-2.008-2c0-1.105.9-2 2.008-2zM24.5 32a2 2 0 110 4 2 2 0 010-4zm9.5 0a2 2 0 110 4 2 2 0 010-4z" stroke="#primary" stroke-linecap="round" stroke-linejoin="round"/><path stroke="#primary" d="M24.5 26.004v6.001"/><path d="M31.076 23.988l1.027-.023a1.998 1.998 0 011.932 2.01L34 31" stroke="#primary" stroke-linecap="round" stroke-linejoin="round"/><path stroke="#primary" stroke-linecap="round" stroke-linejoin="round" d="M31.588 26.222l-2.194-2.046 2.046-2.194"/><path d="M29.023 43c7.732 0 14-6.268 14-14s-6.268-14-14-14-14 6.268-14 14 6.268 14 14 14z" stroke="#primary"/></g>',
|
||||
...rank(value, [1, 200, 500, 1000]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -53,8 +58,10 @@
|
||||
list.push({
|
||||
title:"Manager",
|
||||
text:`Created ${value} user project${imports.s(value)}`,
|
||||
icon:"<g stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M29 16V8.867C29 7.705 29.627 7 30.692 7h18.616C50.373 7 51 7.705 51 8.867v38.266C51 48.295 50.373 49 49.308 49H30.692C29.627 49 29 48.295 29 47.133V39m-4-23V9c0-1.253-.737-2-2-2H7c-1.263 0-2 .747-2 2v34c0 1.253.737 2 2 2h16c1.263 0 2-.747 2-2v-4\" stroke=\"#secondary\" stroke-linecap=\"round\"/><path stroke=\"#secondary\" d=\"M51.557 12.005h-22M5 12.005h21\"/><path d=\"M14 33V22c0-1.246.649-2 1.73-2h28.54c1.081 0 1.73.754 1.73 2v11c0 1.246-.649 2-1.73 2H15.73c-1.081 0-1.73-.754-1.73-2z\" stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M19 29v-3c0-.508.492-1 1-1h3c.508 0 1 .492 1 1v3c0 .508-.492 1-1 1h-3c-.508-.082-1-.492-1-1z\" stroke=\"#primary\"/><path stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M28.996 27.998h12M9.065 20.04a7.062 7.062 0 00-.023 1.728m.775 2.517c.264.495.584.954.954 1.369\"/></g>",
|
||||
...rank(value, [1, 2, 3, 4]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-width="2" fill="none" fill-rule="evenodd"><path d="M29 16V8.867C29 7.705 29.627 7 30.692 7h18.616C50.373 7 51 7.705 51 8.867v38.266C51 48.295 50.373 49 49.308 49H30.692C29.627 49 29 48.295 29 47.133V39m-4-23V9c0-1.253-.737-2-2-2H7c-1.263 0-2 .747-2 2v34c0 1.253.737 2 2 2h16c1.263 0 2-.747 2-2v-4" stroke="#secondary" stroke-linecap="round"/><path stroke="#secondary" d="M51.557 12.005h-22M5 12.005h21"/><path d="M14 33V22c0-1.246.649-2 1.73-2h28.54c1.081 0 1.73.754 1.73 2v11c0 1.246-.649 2-1.73 2H15.73c-1.081 0-1.73-.754-1.73-2z" stroke="#primary" stroke-linecap="round" stroke-linejoin="round"/><path d="M19 29v-3c0-.508.492-1 1-1h3c.508 0 1 .492 1 1v3c0 .508-.492 1-1 1h-3c-.508-.082-1-.492-1-1z" stroke="#primary"/><path stroke="#primary" stroke-linecap="round" stroke-linejoin="round" d="M28.996 27.998h12M9.065 20.04a7.062 7.062 0 00-.023 1.728m.775 2.517c.264.495.584.954.954 1.369"/></g>',
|
||||
...rank(value, [1, 2, 3, 4]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -66,8 +73,10 @@
|
||||
list.push({
|
||||
title:"Reviewer",
|
||||
text:`Reviewed ${value} pull request${imports.s(value)}`,
|
||||
icon:"<g stroke-linecap=\"round\" stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><g stroke=\"#secondary\"><path d=\"M26.009 34.01c.444-.004.9.141 1.228.414.473.394.766.959.76 1.54-.01.735-.333 1.413-.97 2.037.66.718.985 1.4.976 2.048-.012.828-.574 1.58-1.687 2.258.624.788.822 1.549.596 2.28-.225.733-.789 1.219-1.69 1.459.703.833.976 1.585.82 2.256-.178.763-.313 1.716-2.492 1.711\" stroke-linejoin=\"round\"/><g stroke-linejoin=\"round\"><path d=\"M18.548 28.422c1.184-4.303-2.132-5.292-2.132-5.292-.873 2.296-1.438 3.825-4.231 8.108-1.285 1.97-1.926 3.957-1.877 5.796M18.391 34.011L24.993 34c2.412-.009.211-.005-6.602.012zM5.004 37.017l5.234-.014-5.234.014z\"/></g><g stroke-linejoin=\"round\"><path d=\"M18.548 28.422c1.184-4.303-2.132-5.292-2.132-5.292-.873 2.296-1.438 3.825-4.231 8.108-1.285 1.97-1.926 3.957-1.877 5.796M5.004 37.017l5.234-.014-5.234.014zM7 48.012h4.01c1.352 1.333 2.672 2 3.961 2.001 0 0 .485-.005 5.46-.005h3.536\"/></g><path d=\"M18.793 27.022c-.062.933-.373 2.082-.933 3.446-.561 1.364-.433 2.547.383 3.547\"/></g><path d=\"M45 16.156V23a2 2 0 01-2 2H31l-6 4v-4h-1.934M12 23V8a2 2 0 012-2h29a2 2 0 012 2v10\" stroke=\"#primary\" stroke-linejoin=\"round\"/><path stroke=\"#primary\" stroke-linejoin=\"round\" d=\"M23 12.014l-3 3 3 3M34 12.014l3 3-3 3\"/><path stroke=\"#primary\" d=\"M30.029 10l-3.015 10.027\"/><path d=\"M32 39h3l6 4v-4h8a2 2 0 002-2V22a2 2 0 00-2-2h.138\" stroke=\"#secondary\" stroke-linejoin=\"round\"/><path stroke=\"#primary\" stroke-linejoin=\"round\" d=\"M33 29h12M33 34h6M43 34h2\"/></g>",
|
||||
...rank(value, [1, 200, 500, 1000]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-linecap="round" stroke-width="2" fill="none" fill-rule="evenodd"><g stroke="#secondary"><path d="M26.009 34.01c.444-.004.9.141 1.228.414.473.394.766.959.76 1.54-.01.735-.333 1.413-.97 2.037.66.718.985 1.4.976 2.048-.012.828-.574 1.58-1.687 2.258.624.788.822 1.549.596 2.28-.225.733-.789 1.219-1.69 1.459.703.833.976 1.585.82 2.256-.178.763-.313 1.716-2.492 1.711" stroke-linejoin="round"/><g stroke-linejoin="round"><path d="M18.548 28.422c1.184-4.303-2.132-5.292-2.132-5.292-.873 2.296-1.438 3.825-4.231 8.108-1.285 1.97-1.926 3.957-1.877 5.796M18.391 34.011L24.993 34c2.412-.009.211-.005-6.602.012zM5.004 37.017l5.234-.014-5.234.014z"/></g><g stroke-linejoin="round"><path d="M18.548 28.422c1.184-4.303-2.132-5.292-2.132-5.292-.873 2.296-1.438 3.825-4.231 8.108-1.285 1.97-1.926 3.957-1.877 5.796M5.004 37.017l5.234-.014-5.234.014zM7 48.012h4.01c1.352 1.333 2.672 2 3.961 2.001 0 0 .485-.005 5.46-.005h3.536"/></g><path d="M18.793 27.022c-.062.933-.373 2.082-.933 3.446-.561 1.364-.433 2.547.383 3.547"/></g><path d="M45 16.156V23a2 2 0 01-2 2H31l-6 4v-4h-1.934M12 23V8a2 2 0 012-2h29a2 2 0 012 2v10" stroke="#primary" stroke-linejoin="round"/><path stroke="#primary" stroke-linejoin="round" d="M23 12.014l-3 3 3 3M34 12.014l3 3-3 3"/><path stroke="#primary" d="M30.029 10l-3.015 10.027"/><path d="M32 39h3l6 4v-4h8a2 2 0 002-2V22a2 2 0 00-2-2h.138" stroke="#secondary" stroke-linejoin="round"/><path stroke="#primary" stroke-linejoin="round" d="M33 29h12M33 34h6M43 34h2"/></g>',
|
||||
...rank(value, [1, 200, 500, 1000]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -79,8 +88,10 @@
|
||||
list.push({
|
||||
title:"Packager",
|
||||
text:`Created ${value} package${imports.s(value)}`,
|
||||
icon:"<g fill=\"none\"><path fill=\"#secondary\" d=\"M28.53 27.64l-11.2 6.49V21.15l11.23-6.48z\"/><path d=\"M40.4 34.84c-.17 0-.34-.04-.5-.13l-11.24-6.44a.99.99 0 01-.37-1.36.99.99 0 011.36-.37l11.24 6.44c.48.27.65.89.37 1.36-.17.32-.51.5-.86.5z\" fill=\"#primary\"/><path d=\"M29.16 28.4c-.56 0-1-.45-1-1.01l.08-12.47c0-.55.49-1 1.01-.99.55 0 1 .45.99 1.01l-.08 12.47c0 .55-.45.99-1 .99z\" fill=\"#primary\"/><path d=\"M18.25 34.65a.996.996 0 01-.5-1.86l10.91-6.25a.997.997 0 11.99 1.73l-10.91 6.25c-.15.09-.32.13-.49.13z\" fill=\"#primary\"/><path d=\"M29.19 41.37c-.17 0-.35-.04-.5-.13l-11.23-6.49c-.31-.18-.5-.51-.5-.87V20.91c0-.36.19-.69.5-.87l11.23-6.49c.31-.18.69-.18 1 0l11.23 6.49c.31.18.5.51.5.87v12.97c0 .36-.19.69-.5.87l-11.23 6.49c-.15.08-.32.13-.5.13zm-10.23-8.06l10.23 5.91 10.23-5.91V21.49l-10.23-5.91-10.23 5.91v11.82zM40.5 11.02c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm-23.19 4.36c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.42 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm23.37 43.8c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.42 3.18-3.18 3.18zm0-4.35c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm-23.06 4.11c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zM6.18 30.72C4.43 30.72 3 29.29 3 27.54c0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm45.64 4.36c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18z\" fill=\"#primary\"/><path d=\"M29.1 10.21c-.55 0-1-.45-1-1V3.52c0-.55.45-1 1-1s1 .45 1 1v5.69c0 .56-.45 1-1 1zM7.44 20.95c-.73 0-1.32-.59-1.32-1.32v-5.38l4.66-2.69c.63-.37 1.44-.15 1.8.48.36.63.15 1.44-.48 1.8l-3.34 1.93v3.86c0 .73-.59 1.32-1.32 1.32zm4 22.68c-.22 0-.45-.06-.66-.18l-4.66-2.69v-5.38c0-.73.59-1.32 1.32-1.32.73 0 1.32.59 1.32 1.32v3.86l3.34 1.93c.63.36.85 1.17.48 1.8-.24.42-.68.66-1.14.66zm17.64 10.39l-4.66-2.69c-.63-.36-.85-1.17-.48-1.8.36-.63 1.17-.85 1.8-.48l3.34 1.93 3.34-1.93a1.32 1.32 0 011.8.48c.36.63.15 1.44-.48 1.8l-4.66 2.69zm17.64-10.39a1.32 1.32 0 01-.66-2.46l3.34-1.93v-3.86c0-.73.59-1.32 1.32-1.32.73 0 1.32.59 1.32 1.32v5.38l-4.66 2.69c-.21.12-.44.18-.66.18zm4-22.68c-.73 0-1.32-.59-1.32-1.32v-3.86l-3.34-1.93c-.63-.36-.85-1.17-.48-1.8.36-.63 1.17-.85 1.8-.48l4.66 2.69v5.38c0 .73-.59 1.32-1.32 1.32z\" fill=\"#secondary\"/><path d=\"M33.08 6.15c-.22 0-.45-.06-.66-.18l-3.34-1.93-3.34 1.93c-.63.36-1.44.15-1.8-.48a1.32 1.32 0 01.48-1.8L29.08 1l4.66 2.69c.63.36.85 1.17.48 1.8a1.3 1.3 0 01-1.14.66zm-3.99 47.3c-.55 0-1-.45-1-1v-7.13c0-.55.45-1 1-1s1 .45 1 1v7.13c0 .55-.44 1-1 1zM13.86 19.71c-.17 0-.34-.04-.5-.13L7.2 16a1 1 0 011-1.73l6.17 3.58c.48.28.64.89.36 1.37-.19.31-.52.49-.87.49zm36.63 21.23c-.17 0-.34-.04-.5-.13l-6.17-3.57a.998.998 0 01-.36-1.37c.28-.48.89-.64 1.37-.36L51 39.08c.48.28.64.89.36 1.37-.19.31-.52.49-.87.49zM44.06 19.8c-.35 0-.68-.18-.87-.5-.28-.48-.11-1.09.36-1.37l6.17-3.57c.48-.28 1.09-.11 1.37.36.28.48.11 1.09-.36 1.37l-6.17 3.57c-.16.1-.33.14-.5.14zM7.43 41.03c-.35 0-.68-.18-.87-.5-.28-.48-.11-1.09.36-1.37l6.17-3.57c.48-.28 1.09-.11 1.37.36.28.48.11 1.09-.36 1.37l-6.17 3.57c-.15.09-.33.14-.5.14z\" fill=\"#secondary\"/></g>",
|
||||
...rank(value, [1, 5, 10, 20]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g fill="none"><path fill="#secondary" d="M28.53 27.64l-11.2 6.49V21.15l11.23-6.48z"/><path d="M40.4 34.84c-.17 0-.34-.04-.5-.13l-11.24-6.44a.99.99 0 01-.37-1.36.99.99 0 011.36-.37l11.24 6.44c.48.27.65.89.37 1.36-.17.32-.51.5-.86.5z" fill="#primary"/><path d="M29.16 28.4c-.56 0-1-.45-1-1.01l.08-12.47c0-.55.49-1 1.01-.99.55 0 1 .45.99 1.01l-.08 12.47c0 .55-.45.99-1 .99z" fill="#primary"/><path d="M18.25 34.65a.996.996 0 01-.5-1.86l10.91-6.25a.997.997 0 11.99 1.73l-10.91 6.25c-.15.09-.32.13-.49.13z" fill="#primary"/><path d="M29.19 41.37c-.17 0-.35-.04-.5-.13l-11.23-6.49c-.31-.18-.5-.51-.5-.87V20.91c0-.36.19-.69.5-.87l11.23-6.49c.31-.18.69-.18 1 0l11.23 6.49c.31.18.5.51.5.87v12.97c0 .36-.19.69-.5.87l-11.23 6.49c-.15.08-.32.13-.5.13zm-10.23-8.06l10.23 5.91 10.23-5.91V21.49l-10.23-5.91-10.23 5.91v11.82zM40.5 11.02c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm-23.19 4.36c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.42 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm23.37 43.8c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.42 3.18-3.18 3.18zm0-4.35c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm-23.06 4.11c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zM6.18 30.72C4.43 30.72 3 29.29 3 27.54c0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18zm45.64 4.36c-1.75 0-3.18-1.43-3.18-3.18 0-1.75 1.43-3.18 3.18-3.18 1.75 0 3.18 1.43 3.18 3.18 0 1.75-1.43 3.18-3.18 3.18zm0-4.36c-.65 0-1.18.53-1.18 1.18 0 .65.53 1.18 1.18 1.18.65 0 1.18-.53 1.18-1.18 0-.65-.53-1.18-1.18-1.18z" fill="#primary"/><path d="M29.1 10.21c-.55 0-1-.45-1-1V3.52c0-.55.45-1 1-1s1 .45 1 1v5.69c0 .56-.45 1-1 1zM7.44 20.95c-.73 0-1.32-.59-1.32-1.32v-5.38l4.66-2.69c.63-.37 1.44-.15 1.8.48.36.63.15 1.44-.48 1.8l-3.34 1.93v3.86c0 .73-.59 1.32-1.32 1.32zm4 22.68c-.22 0-.45-.06-.66-.18l-4.66-2.69v-5.38c0-.73.59-1.32 1.32-1.32.73 0 1.32.59 1.32 1.32v3.86l3.34 1.93c.63.36.85 1.17.48 1.8-.24.42-.68.66-1.14.66zm17.64 10.39l-4.66-2.69c-.63-.36-.85-1.17-.48-1.8.36-.63 1.17-.85 1.8-.48l3.34 1.93 3.34-1.93a1.32 1.32 0 011.8.48c.36.63.15 1.44-.48 1.8l-4.66 2.69zm17.64-10.39a1.32 1.32 0 01-.66-2.46l3.34-1.93v-3.86c0-.73.59-1.32 1.32-1.32.73 0 1.32.59 1.32 1.32v5.38l-4.66 2.69c-.21.12-.44.18-.66.18zm4-22.68c-.73 0-1.32-.59-1.32-1.32v-3.86l-3.34-1.93c-.63-.36-.85-1.17-.48-1.8.36-.63 1.17-.85 1.8-.48l4.66 2.69v5.38c0 .73-.59 1.32-1.32 1.32z" fill="#secondary"/><path d="M33.08 6.15c-.22 0-.45-.06-.66-.18l-3.34-1.93-3.34 1.93c-.63.36-1.44.15-1.8-.48a1.32 1.32 0 01.48-1.8L29.08 1l4.66 2.69c.63.36.85 1.17.48 1.8a1.3 1.3 0 01-1.14.66zm-3.99 47.3c-.55 0-1-.45-1-1v-7.13c0-.55.45-1 1-1s1 .45 1 1v7.13c0 .55-.44 1-1 1zM13.86 19.71c-.17 0-.34-.04-.5-.13L7.2 16a1 1 0 011-1.73l6.17 3.58c.48.28.64.89.36 1.37-.19.31-.52.49-.87.49zm36.63 21.23c-.17 0-.34-.04-.5-.13l-6.17-3.57a.998.998 0 01-.36-1.37c.28-.48.89-.64 1.37-.36L51 39.08c.48.28.64.89.36 1.37-.19.31-.52.49-.87.49zM44.06 19.8c-.35 0-.68-.18-.87-.5-.28-.48-.11-1.09.36-1.37l6.17-3.57c.48-.28 1.09-.11 1.37.36.28.48.11 1.09-.36 1.37l-6.17 3.57c-.16.1-.33.14-.5.14zM7.43 41.03c-.35 0-.68-.18-.87-.5-.28-.48-.11-1.09.36-1.37l6.17-3.57c.48-.28 1.09-.11 1.37.36.28.48.11 1.09-.36 1.37l-6.17 3.57c-.15.09-.33.14-.5.14z" fill="#secondary"/></g>',
|
||||
...rank(value, [1, 5, 10, 20]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -92,8 +103,10 @@
|
||||
list.push({
|
||||
title:"Scripter",
|
||||
text:`Published ${value} gist${imports.s(value)}`,
|
||||
icon:"<g stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M20 48.875v-12.75c0-1.33.773-2.131 2.385-2.125h26.23c1.612-.006 2.385.795 2.385 2.125v12.75C51 50.198 50.227 51 48.615 51h-26.23C20.773 51 20 50.198 20 48.875zM37 40.505h9M37 44.492h6\" stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path stroke=\"#secondary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M14 30h-4M16 35h-3M47 10H5M42 15H24M19 15h-9M16 25h-3M42 20h-2M42 20h-2M42 25h-2M16 20h-3\"/><path stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M31.974 25H24\"/><path d=\"M22 20h12a2 2 0 012 2v6a2 2 0 01-2 2H22a2 2 0 01-2-2v-6a2 2 0 012-2z\" stroke=\"#primary\"/><path d=\"M5 33V7a2 2 0 012-2h38a2 2 0 012 2v23\" stroke=\"#secondary\" stroke-linecap=\"round\"/><path d=\"M5 30v8c0 1.105.892 2 1.993 2H16\" stroke=\"#secondary\" stroke-linecap=\"round\"/><g stroke=\"#primary\" stroke-linecap=\"round\"><path d=\"M26.432 37.933v7.07M26.432 37.933v9.07M24.432 40.433h7.07M24.432 40.433h8.07M24.432 44.433h7.07M24.432 44.433h8.07M30.432 37.933v9.07\"/></g></g>",
|
||||
...rank(value, [1, 20, 50, 100]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-width="2" fill="none" fill-rule="evenodd"><path d="M20 48.875v-12.75c0-1.33.773-2.131 2.385-2.125h26.23c1.612-.006 2.385.795 2.385 2.125v12.75C51 50.198 50.227 51 48.615 51h-26.23C20.773 51 20 50.198 20 48.875zM37 40.505h9M37 44.492h6" stroke="#primary" stroke-linecap="round" stroke-linejoin="round"/><path stroke="#secondary" stroke-linecap="round" stroke-linejoin="round" d="M14 30h-4M16 35h-3M47 10H5M42 15H24M19 15h-9M16 25h-3M42 20h-2M42 20h-2M42 25h-2M16 20h-3"/><path stroke="#primary" stroke-linecap="round" stroke-linejoin="round" d="M31.974 25H24"/><path d="M22 20h12a2 2 0 012 2v6a2 2 0 01-2 2H22a2 2 0 01-2-2v-6a2 2 0 012-2z" stroke="#primary"/><path d="M5 33V7a2 2 0 012-2h38a2 2 0 012 2v23" stroke="#secondary" stroke-linecap="round"/><path d="M5 30v8c0 1.105.892 2 1.993 2H16" stroke="#secondary" stroke-linecap="round"/><g stroke="#primary" stroke-linecap="round"><path d="M26.432 37.933v7.07M26.432 37.933v9.07M24.432 40.433h7.07M24.432 40.433h8.07M24.432 44.433h7.07M24.432 44.433h8.07M30.432 37.933v9.07"/></g></g>',
|
||||
...rank(value, [1, 20, 50, 100]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -105,8 +118,10 @@
|
||||
list.push({
|
||||
title:"Worker",
|
||||
text:`Joined ${value} organization${imports.s(value)}`,
|
||||
icon:"<g stroke-linecap=\"round\" stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><g stroke=\"#secondary\" stroke-linejoin=\"round\"><path d=\"M30 51H16.543v-2.998h-4v2.976l-5.537.016a2 2 0 01-2.006-2v-8.032a2 2 0 01.75-1.562l9.261-7.406 5.984 5.143m29.992 3.864v10h-6v-3h-5v3h-6m-.987-33c.133-1.116.793-2.106 1.978-2.968.44-.32 5.776-3.664 16.01-10.032v36\"/><path d=\"M19 34.994v-8.982m16 0V49a2 2 0 01-2 2h-8.987l.011-6.957\"/></g><path stroke=\"#secondary\" d=\"M40 38h5M40 34h5\"/><path stroke=\"#primary\" d=\"M25 30h5M25 34h5M25 26h5\"/><path d=\"M35.012 22.003H9.855a4.843 4.843 0 010-9.686h1.479c1.473-4.268 4.277-6.674 8.41-7.219 6.493-.856 9.767 4.27 10.396 5.9.734-.83 2.137-2.208 4.194-1.964a4.394 4.394 0 011.685.533\" stroke=\"#primary\" stroke-linejoin=\"round\"/></g>",
|
||||
...rank(value, [1, 2, 4, 8]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-linecap="round" stroke-width="2" fill="none" fill-rule="evenodd"><g stroke="#secondary" stroke-linejoin="round"><path d="M30 51H16.543v-2.998h-4v2.976l-5.537.016a2 2 0 01-2.006-2v-8.032a2 2 0 01.75-1.562l9.261-7.406 5.984 5.143m29.992 3.864v10h-6v-3h-5v3h-6m-.987-33c.133-1.116.793-2.106 1.978-2.968.44-.32 5.776-3.664 16.01-10.032v36"/><path d="M19 34.994v-8.982m16 0V49a2 2 0 01-2 2h-8.987l.011-6.957"/></g><path stroke="#secondary" d="M40 38h5M40 34h5"/><path stroke="#primary" d="M25 30h5M25 34h5M25 26h5"/><path d="M35.012 22.003H9.855a4.843 4.843 0 010-9.686h1.479c1.473-4.268 4.277-6.674 8.41-7.219 6.493-.856 9.767 4.27 10.396 5.9.734-.83 2.137-2.208 4.194-1.964a4.394 4.394 0 011.685.533" stroke="#primary" stroke-linejoin="round"/></g>',
|
||||
...rank(value, [1, 2, 4, 8]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -118,8 +133,10 @@
|
||||
list.push({
|
||||
title:"Stargazer",
|
||||
text:`Starred ${value} repositor${imports.s(value, "y")}`,
|
||||
icon:"<g stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><path stroke=\"#primary\" d=\"M28.017 5v3M36.006 7.013l-1.987 2.024M20.021 7.011l1.988 2.011M28.806 30.23c-2.206-3.88-5.25-2.234-5.25-2.234 1.007 2.24 1.688 3.72 2.742 8.724.957 4.551 3.785 7.409 7.687 7.293l5.028 6.003M29.03 34.057L29 20.007m4.012 9.004V17.005m4.006 11.99l-.003-9.353\"/><path d=\"M18.993 50.038l4.045-5.993s1.03-.262 1.954-.984m-6.983.96c-4.474-.016-6.986-5.558-6.986-9.979 0-1.764-.439-4.997-1.997-8.004 0 0 3.268-1.24 5.747 3.6.904 1.768.458 5.267.642 5.388.185.121 1.336.554 2.637 2.01m4.955-18.92a976.92 976.92 0 010 5.91m-7.995-4.986l-.003 10.97M10.031 48.021l2.369-3.003\" stroke=\"#secondary\"/><path d=\"M45.996 47.026l-1.99-2.497-1.993-2.5s2.995-1.485 2.995-6.46V24.033\" stroke=\"#primary\"/><path d=\"M41 29v-6a2 2 0 114 0v2m-8-4v-4a2 2 0 114 0v7m-8-7v-2a2 2 0 114 0v2m-8 4v-2a2 2 0 114 0v2\" stroke=\"#primary\"/><path d=\"M23 20v-2a2 2 0 013.043-1.707M19 19v-4a2 2 0 114 0v3m-8 3v-2a2 2 0 114 0v10\" stroke=\"#secondary\"/><path d=\"M6.7 12c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.316-1.121-.572-1.372-1.71-1.678 1.135-.314 1.389-.567 1.7-1.69zm42 0c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689zM28.021 47.627c.317 1.122.573 1.372 1.71 1.678-1.135.314-1.389.566-1.699 1.69-.318-1.121-.573-1.372-1.71-1.679 1.134-.313 1.389-.566 1.699-1.689z\" stroke=\"#primary\"/></g>",
|
||||
...rank(value, [1, 200, 500, 1000]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-linecap="round" stroke-linejoin="round" stroke-width="2" fill="none" fill-rule="evenodd"><path stroke="#primary" d="M28.017 5v3M36.006 7.013l-1.987 2.024M20.021 7.011l1.988 2.011M28.806 30.23c-2.206-3.88-5.25-2.234-5.25-2.234 1.007 2.24 1.688 3.72 2.742 8.724.957 4.551 3.785 7.409 7.687 7.293l5.028 6.003M29.03 34.057L29 20.007m4.012 9.004V17.005m4.006 11.99l-.003-9.353"/><path d="M18.993 50.038l4.045-5.993s1.03-.262 1.954-.984m-6.983.96c-4.474-.016-6.986-5.558-6.986-9.979 0-1.764-.439-4.997-1.997-8.004 0 0 3.268-1.24 5.747 3.6.904 1.768.458 5.267.642 5.388.185.121 1.336.554 2.637 2.01m4.955-18.92a976.92 976.92 0 010 5.91m-7.995-4.986l-.003 10.97M10.031 48.021l2.369-3.003" stroke="#secondary"/><path d="M45.996 47.026l-1.99-2.497-1.993-2.5s2.995-1.485 2.995-6.46V24.033" stroke="#primary"/><path d="M41 29v-6a2 2 0 114 0v2m-8-4v-4a2 2 0 114 0v7m-8-7v-2a2 2 0 114 0v2m-8 4v-2a2 2 0 114 0v2" stroke="#primary"/><path d="M23 20v-2a2 2 0 013.043-1.707M19 19v-4a2 2 0 114 0v3m-8 3v-2a2 2 0 114 0v10" stroke="#secondary"/><path d="M6.7 12c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.316-1.121-.572-1.372-1.71-1.678 1.135-.314 1.389-.567 1.7-1.69zm42 0c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689zM28.021 47.627c.317 1.122.573 1.372 1.71 1.678-1.135.314-1.389.566-1.699 1.69-.318-1.121-.573-1.372-1.71-1.679 1.134-.313 1.389-.566 1.699-1.689z" stroke="#primary"/></g>',
|
||||
...rank(value, [1, 200, 500, 1000]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -131,8 +148,10 @@
|
||||
list.push({
|
||||
title:"Follower",
|
||||
text:`Following ${value} user${imports.s(value)}`,
|
||||
icon:"<g fill=\"none\" fill-rule=\"evenodd\"><path d=\"M35 31a7 7 0 1114 0 7 7 0 01-14 0zm12-13a3 3 0 116 0 3 3 0 01-6 0zM33 49a3 3 0 116 0 3 3 0 01-6 0zM4 15a3 3 0 116 0 3 3 0 01-6 0zm37-8.5a2.5 2.5 0 115 0 2.5 2.5 0 01-5 0zM10 14l4.029-.576M19.008 26.016L21 19M29.019 34.001l5.967-1.948M36.997 46.003l2.977-8.02M46.05 24.031L48 21M28.787 18.012l7.248 8.009\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M43.62 29.004c-1.157 0-1.437.676-1.62 1.173-.19-.498-.494-1.167-1.629-1.167-.909 0-1.355.777-1.371 1.632-.022 1.145 1.309 2.365 3 3.358 1.669-.983 3-2.23 3-3.358 0-.89-.54-1.638-1.38-1.638z\" fill=\"#primary\"/><path stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M48.043 15.003L45 9\"/><path d=\"M21 12a3 3 0 116 0 3 3 0 01-6 0zM27 12h3M18 12h3M21 43c-.267-1.727-1.973-3-4-3-2.08 0-3.787 1.318-4 3m4-9a3 3 0 100 6 3 3 0 000-6z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M17 30a9 9 0 110 18 9 9 0 110-18z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></g>",
|
||||
...rank(value, [1, 200, 500, 1000]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g fill="none" fill-rule="evenodd"><path d="M35 31a7 7 0 1114 0 7 7 0 01-14 0zm12-13a3 3 0 116 0 3 3 0 01-6 0zM33 49a3 3 0 116 0 3 3 0 01-6 0zM4 15a3 3 0 116 0 3 3 0 01-6 0zm37-8.5a2.5 2.5 0 115 0 2.5 2.5 0 01-5 0zM10 14l4.029-.576M19.008 26.016L21 19M29.019 34.001l5.967-1.948M36.997 46.003l2.977-8.02M46.05 24.031L48 21M28.787 18.012l7.248 8.009" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M43.62 29.004c-1.157 0-1.437.676-1.62 1.173-.19-.498-.494-1.167-1.629-1.167-.909 0-1.355.777-1.371 1.632-.022 1.145 1.309 2.365 3 3.358 1.669-.983 3-2.23 3-3.358 0-.89-.54-1.638-1.38-1.638z" fill="#primary"/><path stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M48.043 15.003L45 9"/><path d="M21 12a3 3 0 116 0 3 3 0 01-6 0zM27 12h3M18 12h3M21 43c-.267-1.727-1.973-3-4-3-2.08 0-3.787 1.318-4 3m4-9a3 3 0 100 6 3 3 0 000-6z" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M17 30a9 9 0 110 18 9 9 0 110-18z" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></g>',
|
||||
...rank(value, [1, 200, 500, 1000]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -144,8 +163,10 @@
|
||||
list.push({
|
||||
title:"Influencer",
|
||||
text:`Followed by ${value} user${imports.s(value)}`,
|
||||
icon:"<g transform=\"translate(4 4)\" stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M33.432 1.924A23.922 23.922 0 0024 0c-3.945 0-7.668.952-10.95 2.638m-9.86 9.398A23.89 23.89 0 000 24a23.9 23.9 0 002.274 10.21m3.45 5.347a23.992 23.992 0 0012.929 7.845m13.048-.664c4.43-1.5 8.28-4.258 11.123-7.848m3.16-5.245A23.918 23.918 0 0048 24c0-1.87-.214-3.691-.619-5.439M40.416 6.493a24.139 24.139 0 00-1.574-1.355\" stroke=\"#secondary\" stroke-linecap=\"round\"/><path stroke=\"#secondary\" d=\"M4.582 33.859l1.613-7.946\"/><circle stroke=\"#secondary\" cx=\"6.832\" cy=\"23\" r=\"3\"/><path stroke=\"#primary\" d=\"M17.444 39.854l4.75 3.275\"/><path stroke=\"#secondary\" stroke-linecap=\"round\" d=\"M7.647 14.952l-.433 4.527\"/><circle stroke=\"#primary\" cx=\"15\" cy=\"38\" r=\"3\"/><path stroke=\"#primary\" d=\"M22.216 9.516l.455 4.342\"/><path stroke=\"#secondary\" stroke-linecap=\"round\" d=\"M34.272 6.952l-2.828 5.25\"/><path stroke=\"#primary\" stroke-linecap=\"square\" d=\"M11.873 7.235l6.424-.736\"/><path stroke=\"#secondary\" stroke-linecap=\"round\" d=\"M28.811 5.445l3.718-.671\"/><path stroke=\"#primary\" d=\"M42.392 22.006l.456-5.763M34.349 24.426l4.374.447\"/><path d=\"M20 28c.267-1.727 1.973-3 4-3 2.08 0 3.787 1.318 4 3m-4-9a3 3 0 110 6 3 3 0 010-6z\" stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M24 14c5.523 0 10 4.477 10 10s-4.477 10-10 10-10-4.477-10-10 4.477-10 10-10z\" stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><circle stroke=\"#secondary\" cx=\"35.832\" cy=\"4\" r=\"3\"/><circle stroke=\"#secondary\" cx=\"44\" cy=\"36\" r=\"3\"/><circle stroke=\"#secondary\" cx=\"34.832\" cy=\"37\" r=\"3\"/><circle stroke=\"#primary\" cx=\"21.654\" cy=\"6.437\" r=\"3\"/><path d=\"M25.083 48.102a3 3 0 100-6 3 3 0 000 6z\" stroke=\"#primary\"/><path d=\"M8.832 5a3 3 0 110 6 3 3 0 010-6z\" stroke=\"#primary\" stroke-linecap=\"round\"/><circle stroke=\"#secondary\" cx=\"4\" cy=\"37\" r=\"3\"/><path d=\"M42.832 10a3 3 0 110 6 3 3 0 010-6z\" stroke=\"#primary\" stroke-linecap=\"round\"/><path stroke=\"#secondary\" stroke-linecap=\"round\" d=\"M32.313 38.851l-1.786 1.661\"/><circle stroke=\"#primary\" cx=\"42\" cy=\"25\" r=\"3\"/><path stroke=\"#primary\" stroke-linecap=\"square\" d=\"M18.228 32.388l-1.562 2.66\"/><path stroke=\"#secondary\" d=\"M37.831 36.739l2.951-.112\"/></g>",
|
||||
...rank(value, [1, 200, 500, 1000]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g transform="translate(4 4)" stroke-width="2" fill="none" fill-rule="evenodd"><path d="M33.432 1.924A23.922 23.922 0 0024 0c-3.945 0-7.668.952-10.95 2.638m-9.86 9.398A23.89 23.89 0 000 24a23.9 23.9 0 002.274 10.21m3.45 5.347a23.992 23.992 0 0012.929 7.845m13.048-.664c4.43-1.5 8.28-4.258 11.123-7.848m3.16-5.245A23.918 23.918 0 0048 24c0-1.87-.214-3.691-.619-5.439M40.416 6.493a24.139 24.139 0 00-1.574-1.355" stroke="#secondary" stroke-linecap="round"/><path stroke="#secondary" d="M4.582 33.859l1.613-7.946"/><circle stroke="#secondary" cx="6.832" cy="23" r="3"/><path stroke="#primary" d="M17.444 39.854l4.75 3.275"/><path stroke="#secondary" stroke-linecap="round" d="M7.647 14.952l-.433 4.527"/><circle stroke="#primary" cx="15" cy="38" r="3"/><path stroke="#primary" d="M22.216 9.516l.455 4.342"/><path stroke="#secondary" stroke-linecap="round" d="M34.272 6.952l-2.828 5.25"/><path stroke="#primary" stroke-linecap="square" d="M11.873 7.235l6.424-.736"/><path stroke="#secondary" stroke-linecap="round" d="M28.811 5.445l3.718-.671"/><path stroke="#primary" d="M42.392 22.006l.456-5.763M34.349 24.426l4.374.447"/><path d="M20 28c.267-1.727 1.973-3 4-3 2.08 0 3.787 1.318 4 3m-4-9a3 3 0 110 6 3 3 0 010-6z" stroke="#primary" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 14c5.523 0 10 4.477 10 10s-4.477 10-10 10-10-4.477-10-10 4.477-10 10-10z" stroke="#primary" stroke-linecap="round" stroke-linejoin="round"/><circle stroke="#secondary" cx="35.832" cy="4" r="3"/><circle stroke="#secondary" cx="44" cy="36" r="3"/><circle stroke="#secondary" cx="34.832" cy="37" r="3"/><circle stroke="#primary" cx="21.654" cy="6.437" r="3"/><path d="M25.083 48.102a3 3 0 100-6 3 3 0 000 6z" stroke="#primary"/><path d="M8.832 5a3 3 0 110 6 3 3 0 010-6z" stroke="#primary" stroke-linecap="round"/><circle stroke="#secondary" cx="4" cy="37" r="3"/><path d="M42.832 10a3 3 0 110 6 3 3 0 010-6z" stroke="#primary" stroke-linecap="round"/><path stroke="#secondary" stroke-linecap="round" d="M32.313 38.851l-1.786 1.661"/><circle stroke="#primary" cx="42" cy="25" r="3"/><path stroke="#primary" stroke-linecap="square" d="M18.228 32.388l-1.562 2.66"/><path stroke="#secondary" d="M37.831 36.739l2.951-.112"/></g>',
|
||||
...rank(value, [1, 200, 500, 1000]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
leaderboard:leaderboard({user:ranks.user_rank.userCount, requirement:scores.followers >= requirements.followers, type:"users"}),
|
||||
})
|
||||
}
|
||||
@@ -158,8 +179,10 @@
|
||||
list.push({
|
||||
title:"Maintainer",
|
||||
text:`Maintaining a repository with ${value} star${imports.s(value)}`,
|
||||
icon:"<g transform=\"translate(4 4)\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M39 15h.96l4.038 3-.02-3H45a2 2 0 002-2V3a2 2 0 00-2-2H31a2 2 0 00-2 2v4.035\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M36 5.014l-3 3 3 3M40 5.014l3 3-3 3\"/><path d=\"M6 37a1 1 0 110 2 1 1 0 010-2m7 0a1 1 0 110 2 1 1 0 010-2m-2.448 1a1 1 0 11-2 0 1 1 0 012 0z\" fill=\"#primary\"/><path d=\"M1.724 15.05A23.934 23.934 0 000 24c0 .686.029 1.366.085 2.037m19.92 21.632c1.3.218 2.634.331 3.995.331a23.92 23.92 0 009.036-1.76m13.207-13.21A23.932 23.932 0 0048 24c0-1.363-.114-2.7-.332-4M25.064.022a23.932 23.932 0 00-10.073 1.725\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\"/><path d=\"M19 42.062V43a2 2 0 01-2 2H9.04l-4.038 3 .02-3H3a2 2 0 01-2-2V33a2 2 0 012-2h4.045\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M6 0a6 6 0 110 12A6 6 0 016 0z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" d=\"M6 3v6M3 6h6\"/><path d=\"M42 36a6 6 0 110 12 6 6 0 010-12z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M44.338 40.663l-3.336 3.331-1.692-1.686M31 31c-.716-2.865-3.578-5-7-5-3.423 0-6.287 2.14-7 5\"/><path d=\"M24 16a5 5 0 110 10 5 5 0 010-10z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\"/><circle stroke=\"#primary\" stroke-width=\"2\" cx=\"24\" cy=\"24\" r=\"14\"/></g>",
|
||||
...rank(value, [1, 1000, 5000, 10000]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g transform="translate(4 4)" fill="none" fill-rule="evenodd"><path d="M39 15h.96l4.038 3-.02-3H45a2 2 0 002-2V3a2 2 0 00-2-2H31a2 2 0 00-2 2v4.035" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M36 5.014l-3 3 3 3M40 5.014l3 3-3 3"/><path d="M6 37a1 1 0 110 2 1 1 0 010-2m7 0a1 1 0 110 2 1 1 0 010-2m-2.448 1a1 1 0 11-2 0 1 1 0 012 0z" fill="#primary"/><path d="M1.724 15.05A23.934 23.934 0 000 24c0 .686.029 1.366.085 2.037m19.92 21.632c1.3.218 2.634.331 3.995.331a23.92 23.92 0 009.036-1.76m13.207-13.21A23.932 23.932 0 0048 24c0-1.363-.114-2.7-.332-4M25.064.022a23.932 23.932 0 00-10.073 1.725" stroke="#secondary" stroke-width="2" stroke-linecap="round"/><path d="M19 42.062V43a2 2 0 01-2 2H9.04l-4.038 3 .02-3H3a2 2 0 01-2-2V33a2 2 0 012-2h4.045" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M6 0a6 6 0 110 12A6 6 0 016 0z" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path stroke="#primary" stroke-width="2" stroke-linecap="round" d="M6 3v6M3 6h6"/><path d="M42 36a6 6 0 110 12 6 6 0 010-12z" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M44.338 40.663l-3.336 3.331-1.692-1.686M31 31c-.716-2.865-3.578-5-7-5-3.423 0-6.287 2.14-7 5"/><path d="M24 16a5 5 0 110 10 5 5 0 010-10z" stroke="#primary" stroke-width="2" stroke-linecap="round"/><circle stroke="#primary" stroke-width="2" cx="24" cy="24" r="14"/></g>',
|
||||
...rank(value, [1, 1000, 5000, 10000]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
leaderboard:leaderboard({user:ranks.repo_rank.repositoryCount, requirement:scores.stars >= requirements.stars, type:"repositories"}),
|
||||
})
|
||||
}
|
||||
@@ -171,8 +194,10 @@
|
||||
list.push({
|
||||
title:"Inspirationer",
|
||||
text:`Maintaining a repository which has been forked ${value} time${imports.s(value)}`,
|
||||
icon:"<g transform=\"translate(4 4)\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M20.065 47.122c.44-.525.58-1.448.58-1.889 0-2.204-1.483-3.967-3.633-4.187.447-1.537.58-2.64.397-3.31-.25-.92-.745-1.646-1.409-2.235m-5.97-7.157c.371-.254.911-.748 1.62-1.48a8.662 8.662 0 001.432-2.366M47 22h-7c-1.538 0-2.749-.357-4-1h-5c-1.789.001-3-1.3-3-2.955 0-1.656 1.211-3.04 3-3.045h2c.027-1.129.513-2.17 1-3m3.082 32.004C34.545 43.028 34.02 40.569 34 39v-1h-1c-2.603-.318-5-2.913-5-5.997S30.397 26 33 26h9c2.384 0 4.326 1.024 5.27 3\" stroke=\"#secondary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\"/><g transform=\"translate(36)\" stroke=\"#primary\" stroke-width=\"2\"><path fill=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M5.395 5.352L6.009 4l.598 1.348L8 5.408l-1.067 1.12.425 1.47-1.356-.908-1.35.91.404-1.469L4 5.41z\"/><circle cx=\"6\" cy=\"6\" r=\"6\"/></g><g transform=\"translate(0 31)\" stroke=\"#primary\" stroke-width=\"2\"><circle cx=\"6\" cy=\"6\" r=\"6\"/><g stroke-linecap=\"round\"><path d=\"M6 4v4M4 6h4\"/></g></g><circle stroke=\"#primary\" stroke-width=\"2\" cx=\"10.5\" cy=\"10.5\" r=\"10.5\"/><g stroke-linecap=\"round\"><path d=\"M32.01 1.37A23.96 23.96 0 0024 0c-.999 0-1.983.061-2.95.18M.32 20.072a24.21 24.21 0 00.015 7.948M12.42 45.025A23.892 23.892 0 0024 48c13.255 0 24-10.745 24-24 0-2.811-.483-5.51-1.371-8.016\" stroke=\"#secondary\" stroke-width=\"2\"/><path stroke=\"#primary\" stroke-width=\"2\" d=\"M8.999 7.151v5.865\"/><path d=\"M9 3a2 2 0 110 4 2 2 0 010-4zm0 10.8a2 2 0 11-.001 4 2 2 0 01.001-4z\" stroke=\"#primary\" stroke-width=\"1.8\"/><path d=\"M9.622 11.838c.138-.007.989.119 1.595-.05.607-.169 1.584-.539 1.829-1.337\" stroke=\"#primary\" stroke-width=\"2\"/><path d=\"M14.8 7.202a2 2 0 110 4 2 2 0 010-4z\" stroke=\"#primary\" stroke-width=\"1.8\"/></g></g>",
|
||||
...rank(value, [1, 100, 500, 1000]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g transform="translate(4 4)" fill="none" fill-rule="evenodd"><path d="M20.065 47.122c.44-.525.58-1.448.58-1.889 0-2.204-1.483-3.967-3.633-4.187.447-1.537.58-2.64.397-3.31-.25-.92-.745-1.646-1.409-2.235m-5.97-7.157c.371-.254.911-.748 1.62-1.48a8.662 8.662 0 001.432-2.366M47 22h-7c-1.538 0-2.749-.357-4-1h-5c-1.789.001-3-1.3-3-2.955 0-1.656 1.211-3.04 3-3.045h2c.027-1.129.513-2.17 1-3m3.082 32.004C34.545 43.028 34.02 40.569 34 39v-1h-1c-2.603-.318-5-2.913-5-5.997S30.397 26 33 26h9c2.384 0 4.326 1.024 5.27 3" stroke="#secondary" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/><g transform="translate(36)" stroke="#primary" stroke-width="2"><path fill="#primary" stroke-linecap="round" stroke-linejoin="round" d="M5.395 5.352L6.009 4l.598 1.348L8 5.408l-1.067 1.12.425 1.47-1.356-.908-1.35.91.404-1.469L4 5.41z"/><circle cx="6" cy="6" r="6"/></g><g transform="translate(0 31)" stroke="#primary" stroke-width="2"><circle cx="6" cy="6" r="6"/><g stroke-linecap="round"><path d="M6 4v4M4 6h4"/></g></g><circle stroke="#primary" stroke-width="2" cx="10.5" cy="10.5" r="10.5"/><g stroke-linecap="round"><path d="M32.01 1.37A23.96 23.96 0 0024 0c-.999 0-1.983.061-2.95.18M.32 20.072a24.21 24.21 0 00.015 7.948M12.42 45.025A23.892 23.892 0 0024 48c13.255 0 24-10.745 24-24 0-2.811-.483-5.51-1.371-8.016" stroke="#secondary" stroke-width="2"/><path stroke="#primary" stroke-width="2" d="M8.999 7.151v5.865"/><path d="M9 3a2 2 0 110 4 2 2 0 010-4zm0 10.8a2 2 0 11-.001 4 2 2 0 01.001-4z" stroke="#primary" stroke-width="1.8"/><path d="M9.622 11.838c.138-.007.989.119 1.595-.05.607-.169 1.584-.539 1.829-1.337" stroke="#primary" stroke-width="2"/><path d="M14.8 7.202a2 2 0 110 4 2 2 0 010-4z" stroke="#primary" stroke-width="1.8"/></g></g>',
|
||||
...rank(value, [1, 100, 500, 1000]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
leaderboard:leaderboard({user:ranks.forks_rank.repositoryCount, requirement:scores.forks >= requirements.forks, type:"repositories"}),
|
||||
})
|
||||
}
|
||||
@@ -185,8 +210,10 @@
|
||||
list.push({
|
||||
title:"Polyglot",
|
||||
text:`Using ${value} different programming language${imports.s(value)}`,
|
||||
icon:"<g stroke-linecap=\"round\" stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M17.135 7.988l-3.303.669a2 2 0 00-1.586 2.223l4.708 35.392a1.498 1.498 0 01-1.162 1.66 1.523 1.523 0 01-1.775-1.01L4.951 19.497a2 2 0 011.215-2.507l2.946-1.072\" stroke=\"#secondary\" stroke-linejoin=\"round\"/><path d=\"M36.8 48H23a2 2 0 01-2-2V7a2 2 0 012-2h26a2 2 0 012 2v32.766\" stroke=\"#primary\"/><path d=\"M29 20.955l-3.399 3.399a.85.85 0 000 1.202l3.399 3.4M43.014 20.955l3.399 3.399a.85.85 0 010 1.202l-3.4 3.4\" stroke=\"#primary\" stroke-linejoin=\"round\"/><path stroke=\"#primary\" d=\"M38.526 18l-5.053 14.016\"/><path d=\"M44 36a8 8 0 110 16 8 8 0 010-16z\" stroke=\"#primary\" stroke-linejoin=\"round\"/><path d=\"M43.068 40.749l3.846 2.396a1 1 0 01-.006 1.7l-3.846 2.36a1 1 0 01-1.523-.853v-4.755a1 1 0 011.529-.848z\" stroke=\"#primary\" stroke-linejoin=\"round\"/></g>",
|
||||
...rank(value, [1, 4, 8, 16]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-linecap="round" stroke-width="2" fill="none" fill-rule="evenodd"><path d="M17.135 7.988l-3.303.669a2 2 0 00-1.586 2.223l4.708 35.392a1.498 1.498 0 01-1.162 1.66 1.523 1.523 0 01-1.775-1.01L4.951 19.497a2 2 0 011.215-2.507l2.946-1.072" stroke="#secondary" stroke-linejoin="round"/><path d="M36.8 48H23a2 2 0 01-2-2V7a2 2 0 012-2h26a2 2 0 012 2v32.766" stroke="#primary"/><path d="M29 20.955l-3.399 3.399a.85.85 0 000 1.202l3.399 3.4M43.014 20.955l3.399 3.399a.85.85 0 010 1.202l-3.4 3.4" stroke="#primary" stroke-linejoin="round"/><path stroke="#primary" d="M38.526 18l-5.053 14.016"/><path d="M44 36a8 8 0 110 16 8 8 0 010-16z" stroke="#primary" stroke-linejoin="round"/><path d="M43.068 40.749l3.846 2.396a1 1 0 01-.006 1.7l-3.846 2.36a1 1 0 01-1.523-.853v-4.755a1 1 0 011.529-.848z" stroke="#primary" stroke-linejoin="round"/></g>',
|
||||
...rank(value, [1, 4, 8, 16]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -198,8 +225,10 @@
|
||||
list.push({
|
||||
title:"Member",
|
||||
text:`Registered ${Math.floor(value)} year${imports.s(Math.floor(value))} ago`,
|
||||
icon:"<g xmlns=\"http://www.w3.org/2000/svg\" transform=\"translate(5 4)\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M46 44.557v1a2 2 0 01-2 2H2a2 2 0 01-2-2v-1\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M.75 40.993l.701.561a2.323 2.323 0 002.903 0l1.675-1.34a3 3 0 013.748 0l1.282 1.026a3 3 0 003.71.03l1.4-1.085a3 3 0 013.75.061l1.103.913a3 3 0 003.787.031l1.22-.976a3 3 0 013.748 0l1.282 1.026a3 3 0 003.71.03l1.4-1.085a3 3 0 013.75.061l1.429 1.182a2.427 2.427 0 003.103-.008l.832-.695A2 2 0 0046 39.191v-1.634a2 2 0 00-2-2H2a2 2 0 00-2 2v1.875a2 2 0 00.75 1.561z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M42 31.609v.948m-38 0v-.992m25.04-15.008H35a2 2 0 012 2v1m-28 0v-1a2 2 0 012-2h6.007\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M22 8.557h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6a1 1 0 011-1z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linejoin=\"round\"/><path d=\"M4.7 10.557c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689zm35-8c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M23 5.557a2 2 0 002-2C25 2.452 24.433 0 22.273 0c-.463 0 .21 1.424-.502 1.979A2 2 0 0023 5.557z\" stroke=\"#primary\" stroke-width=\"2\"/><path d=\"M4.78 27.982l1.346 1.076a3 3 0 003.748 0l1.252-1.002a3 3 0 013.748 0l1.282 1.026a3 3 0 003.711.03l1.4-1.085a3 3 0 013.75.061l1.102.913a3 3 0 003.787.031l1.22-.976a3 3 0 013.748 0l1.281 1.025a3 3 0 003.712.029l1.358-1.053a2 2 0 00.775-1.58v-.97a1.95 1.95 0 00-1.95-1.95H5.942a1.912 1.912 0 00-1.912 1.912v.951a2 2 0 00.75 1.562z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><circle stroke=\"#secondary\" cx=\"16.5\" cy=\"2.057\" r=\"1\"/><circle stroke=\"#secondary\" cx=\"14.5\" cy=\"12.057\" r=\"1\"/><circle stroke=\"#secondary\" cx=\"31.5\" cy=\"9.057\" r=\"1\"/></g>",
|
||||
...rank(value, [1, 3, 5, 10]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g xmlns="http://www.w3.org/2000/svg" transform="translate(5 4)" fill="none" fill-rule="evenodd"><path d="M46 44.557v1a2 2 0 01-2 2H2a2 2 0 01-2-2v-1" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M.75 40.993l.701.561a2.323 2.323 0 002.903 0l1.675-1.34a3 3 0 013.748 0l1.282 1.026a3 3 0 003.71.03l1.4-1.085a3 3 0 013.75.061l1.103.913a3 3 0 003.787.031l1.22-.976a3 3 0 013.748 0l1.282 1.026a3 3 0 003.71.03l1.4-1.085a3 3 0 013.75.061l1.429 1.182a2.427 2.427 0 003.103-.008l.832-.695A2 2 0 0046 39.191v-1.634a2 2 0 00-2-2H2a2 2 0 00-2 2v1.875a2 2 0 00.75 1.561z" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M42 31.609v.948m-38 0v-.992m25.04-15.008H35a2 2 0 012 2v1m-28 0v-1a2 2 0 012-2h6.007" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M22 8.557h2a1 1 0 011 1v6a1 1 0 01-1 1h-2a1 1 0 01-1-1v-6a1 1 0 011-1z" stroke="#primary" stroke-width="2" stroke-linejoin="round"/><path d="M4.7 10.557c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689zm35-8c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689z" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M23 5.557a2 2 0 002-2C25 2.452 24.433 0 22.273 0c-.463 0 .21 1.424-.502 1.979A2 2 0 0023 5.557z" stroke="#primary" stroke-width="2"/><path d="M4.78 27.982l1.346 1.076a3 3 0 003.748 0l1.252-1.002a3 3 0 013.748 0l1.282 1.026a3 3 0 003.711.03l1.4-1.085a3 3 0 013.75.061l1.102.913a3 3 0 003.787.031l1.22-.976a3 3 0 013.748 0l1.281 1.025a3 3 0 003.712.029l1.358-1.053a2 2 0 00.775-1.58v-.97a1.95 1.95 0 00-1.95-1.95H5.942a1.912 1.912 0 00-1.912 1.912v.951a2 2 0 00.75 1.562z" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle stroke="#secondary" cx="16.5" cy="2.057" r="1"/><circle stroke="#secondary" cx="14.5" cy="12.057" r="1"/><circle stroke="#secondary" cx="31.5" cy="9.057" r="1"/></g>',
|
||||
...rank(value, [1, 3, 5, 10]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -211,8 +240,10 @@
|
||||
list.push({
|
||||
title:"Sponsor",
|
||||
text:`Sponsoring ${value} user${imports.s(value)} or organization${imports.s(value)}`,
|
||||
icon:"<g xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M24 32c.267-1.727 1.973-3 4-3 2.08 0 3.787 1.318 4 3m-4-9a3 3 0 110 6 3 3 0 010-6z\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M28 18c5.523 0 10 4.477 10 10s-4.477 10-10 10-10-4.477-10-10 4.477-10 10-10z\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M46.138 15c-1.033 0-1.454.822-1.634 1.413-.019.06-.024.06-.042 0-.182-.591-.707-1.413-1.655-1.413C41.347 15 41 16.117 41 17.005c0 1.676 2.223 3.228 3.091 3.845.272.197.556.194.817 0 .798-.593 3.092-2.17 3.092-3.845 0-.888-.261-2.005-1.862-2.005zm-31-5c-1.033 0-1.454.822-1.634 1.413-.019.06-.024.06-.042 0-.182-.591-.707-1.413-1.655-1.413C10.347 10 10 11.117 10 12.005c0 1.676 2.223 3.228 3.091 3.845.272.197.556.194.817 0 .798-.593 3.092-2.17 3.092-3.845 0-.888-.261-2.005-1.862-2.005zm6 32c-1.033 0-1.454.822-1.634 1.413-.019.06-.024.06-.042 0-.182-.591-.707-1.413-1.655-1.413C16.347 42 16 43.117 16 44.005c0 1.676 2.223 3.228 3.091 3.845.272.197.556.194.817 0 .798-.593 3.092-2.17 3.092-3.845 0-.888-.261-2.005-1.862-2.005z\" fill=\"#secondary\"/><path d=\"M8.003 29a3 3 0 110 6 3 3 0 010-6zM32.018 5.005a3 3 0 110 6 3 3 0 010-6z\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\"/><path stroke=\"#secondary\" stroke-width=\"2\" d=\"M29.972 18.026L31.361 11M18.063 29.987l-7.004 1.401\"/><path d=\"M22.604 11.886l.746 2.164m-9.313 9.296l-2.156-.712\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M21.304 9a1 1 0 100-2 1 1 0 000 2zM8.076 22.346a1 1 0 100-2 1 1 0 000 2z\" fill=\"#primary\"/><path d=\"M33.267 44.17l-.722-2.146m9.38-9.206l2.147.743\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M34.544 49.031a1 1 0 100-2 1 1 0 000 2zm13.314-13.032a1 1 0 100-2 1 1 0 000 2z\" fill=\"#primary\"/><path d=\"M48.019 51.004a3 3 0 100-6 3 3 0 000 6zM35.194 35.33l10.812 11.019\" stroke=\"#secondary\" stroke-width=\"2\"/></g>",
|
||||
...rank(value, [1, 3, 5, 10]), value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g xmlns="http://www.w3.org/2000/svg" fill="none" fill-rule="evenodd"><path d="M24 32c.267-1.727 1.973-3 4-3 2.08 0 3.787 1.318 4 3m-4-9a3 3 0 110 6 3 3 0 010-6z" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M28 18c5.523 0 10 4.477 10 10s-4.477 10-10 10-10-4.477-10-10 4.477-10 10-10z" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M46.138 15c-1.033 0-1.454.822-1.634 1.413-.019.06-.024.06-.042 0-.182-.591-.707-1.413-1.655-1.413C41.347 15 41 16.117 41 17.005c0 1.676 2.223 3.228 3.091 3.845.272.197.556.194.817 0 .798-.593 3.092-2.17 3.092-3.845 0-.888-.261-2.005-1.862-2.005zm-31-5c-1.033 0-1.454.822-1.634 1.413-.019.06-.024.06-.042 0-.182-.591-.707-1.413-1.655-1.413C10.347 10 10 11.117 10 12.005c0 1.676 2.223 3.228 3.091 3.845.272.197.556.194.817 0 .798-.593 3.092-2.17 3.092-3.845 0-.888-.261-2.005-1.862-2.005zm6 32c-1.033 0-1.454.822-1.634 1.413-.019.06-.024.06-.042 0-.182-.591-.707-1.413-1.655-1.413C16.347 42 16 43.117 16 44.005c0 1.676 2.223 3.228 3.091 3.845.272.197.556.194.817 0 .798-.593 3.092-2.17 3.092-3.845 0-.888-.261-2.005-1.862-2.005z" fill="#secondary"/><path d="M8.003 29a3 3 0 110 6 3 3 0 010-6zM32.018 5.005a3 3 0 110 6 3 3 0 010-6z" stroke="#secondary" stroke-width="2" stroke-linecap="round"/><path stroke="#secondary" stroke-width="2" d="M29.972 18.026L31.361 11M18.063 29.987l-7.004 1.401"/><path d="M22.604 11.886l.746 2.164m-9.313 9.296l-2.156-.712" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M21.304 9a1 1 0 100-2 1 1 0 000 2zM8.076 22.346a1 1 0 100-2 1 1 0 000 2z" fill="#primary"/><path d="M33.267 44.17l-.722-2.146m9.38-9.206l2.147.743" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M34.544 49.031a1 1 0 100-2 1 1 0 000 2zm13.314-13.032a1 1 0 100-2 1 1 0 000 2z" fill="#primary"/><path d="M48.019 51.004a3 3 0 100-6 3 3 0 000 6zM35.194 35.33l10.812 11.019" stroke="#secondary" stroke-width="2"/></g>',
|
||||
...rank(value, [1, 3, 5, 10]),
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -224,8 +255,11 @@
|
||||
list.push({
|
||||
title:"Verified",
|
||||
text:"Registered a GPG key to sign commits",
|
||||
icon:"<g stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M46 17.036v13.016c0 4.014-.587 8.94-4.751 13.67-5.787 5.911-12.816 8.279-13.243 8.283-.426.003-7.91-2.639-13.222-8.283C10.718 39.4 10 34.056 10 30.052V17.036a2 2 0 012-2h32a2 2 0 012 2zM16 15c0-6.616 5.384-12 12-12s12 5.384 12 12\" stroke=\"#secondary\"/><path d=\"M21 15c0-3.744 3.141-7 7-7 3.86 0 7 3.256 7 7m4.703 29.63l-3.672-3.647m-17.99-17.869l-7.127-7.081\" stroke=\"#secondary\"/><path d=\"M28 23a8 8 0 110 16 8 8 0 010-16z\" stroke=\"#primary\"/><path stroke=\"#primary\" d=\"M30.966 29.005l-4 3.994-2.002-1.995\"/></g>",
|
||||
rank:value ? "$" : "X", progress:value ? 1 : 0, value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-linecap="round" stroke-linejoin="round" stroke-width="2" fill="none" fill-rule="evenodd"><path d="M46 17.036v13.016c0 4.014-.587 8.94-4.751 13.67-5.787 5.911-12.816 8.279-13.243 8.283-.426.003-7.91-2.639-13.222-8.283C10.718 39.4 10 34.056 10 30.052V17.036a2 2 0 012-2h32a2 2 0 012 2zM16 15c0-6.616 5.384-12 12-12s12 5.384 12 12" stroke="#secondary"/><path d="M21 15c0-3.744 3.141-7 7-7 3.86 0 7 3.256 7 7m4.703 29.63l-3.672-3.647m-17.99-17.869l-7.127-7.081" stroke="#secondary"/><path d="M28 23a8 8 0 110 16 8 8 0 010-16z" stroke="#primary"/><path stroke="#primary" d="M30.966 29.005l-4 3.994-2.002-1.995"/></g>',
|
||||
rank:value ? "$" : "X",
|
||||
progress:value ? 1 : 0,
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -237,8 +271,11 @@
|
||||
list.push({
|
||||
title:"Explorer",
|
||||
text:"Starred a topic on GitHub Explore",
|
||||
icon:"<g transform=\"translate(3 4)\" fill=\"none\" fill-rule=\"evenodd\"><path d=\"M10 37.5l.049.073a2 2 0 002.506.705l24.391-11.324a2 2 0 00.854-2.874l-2.668-4.27a2 2 0 00-2.865-.562L10.463 34.947A1.869 1.869 0 0010 37.5zM33.028 28.592l-4.033-6.58\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path stroke=\"#primary\" stroke-width=\"2\" stroke-linejoin=\"round\" d=\"M15.52 37.004l-2.499-3.979\"/><path stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M25.008 48.011l.013-15.002M17.984 47.038l6.996-14.035M32.005 47.029l-6.987-14.016\"/><path d=\"M2.032 17.015A23.999 23.999 0 001 24c0 9.3 5.29 17.365 13.025 21.35m22-.027C43.734 41.33 49 33.28 49 24a24 24 0 00-1.025-6.96M34.022 1.754A23.932 23.932 0 0025 0c-2.429 0-4.774.36-6.983 1.032\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M40.64 8.472c-1.102-2.224-.935-4.764 1.382-6.465-.922-.087-2.209.326-3.004.784a6.024 6.024 0 00-2.674 7.229c.94 2.618 3.982 4.864 7.66 3.64 1.292-.429 2.615-1.508 2.996-2.665-1.8.625-5.258-.3-6.36-2.523zM21.013 6.015c-.22-.802-3.018-1.295-4.998-.919M4.998 8.006C2.25 9.22.808 11.146 1.011 12.009\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><circle stroke=\"#secondary\" stroke-width=\"2\" cx=\"11\" cy=\"9\" r=\"6\"/><path d=\"M.994 12.022c.351 1.38 5.069 1.25 10.713-.355 5.644-1.603 9.654-4.273 9.303-5.653\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M26.978 10.105c.318 1.123.573 1.373 1.71 1.679-1.135.314-1.388.566-1.698 1.69-.318-1.122-.573-1.373-1.711-1.679 1.135-.314 1.39-.566 1.7-1.69\" fill=\"#secondary\"/><path d=\"M26.978 10.105c.318 1.123.573 1.373 1.71 1.679-1.135.314-1.388.566-1.698 1.69-.318-1.122-.573-1.373-1.711-1.679 1.135-.314 1.39-.566 1.7-1.69z\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M9.929 22.737c.317 1.121.573 1.372 1.71 1.678-1.135.314-1.389.566-1.699 1.69-.318-1.121-.573-1.372-1.71-1.679 1.134-.313 1.389-.566 1.699-1.69\" fill=\"#secondary\"/><path d=\"M9.929 22.737c.317 1.121.573 1.372 1.71 1.678-1.135.314-1.389.566-1.699 1.69-.318-1.121-.573-1.372-1.71-1.679 1.134-.313 1.389-.566 1.699-1.69z\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M38.912 33.684c.318 1.122.573 1.373 1.711 1.679-1.136.313-1.39.565-1.7 1.69-.317-1.123-.573-1.372-1.71-1.68 1.136-.313 1.389-.565 1.7-1.689\" fill=\"#secondary\"/><path d=\"M38.912 33.684c.318 1.122.573 1.373 1.711 1.679-1.136.313-1.39.565-1.7 1.69-.317-1.123-.573-1.372-1.71-1.68 1.136-.313 1.389-.565 1.7-1.689z\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></g>",
|
||||
rank:value ? "$" : "X", progress:value ? 1 : 0, value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g transform="translate(3 4)" fill="none" fill-rule="evenodd"><path d="M10 37.5l.049.073a2 2 0 002.506.705l24.391-11.324a2 2 0 00.854-2.874l-2.668-4.27a2 2 0 00-2.865-.562L10.463 34.947A1.869 1.869 0 0010 37.5zM33.028 28.592l-4.033-6.58" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path stroke="#primary" stroke-width="2" stroke-linejoin="round" d="M15.52 37.004l-2.499-3.979"/><path stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" d="M25.008 48.011l.013-15.002M17.984 47.038l6.996-14.035M32.005 47.029l-6.987-14.016"/><path d="M2.032 17.015A23.999 23.999 0 001 24c0 9.3 5.29 17.365 13.025 21.35m22-.027C43.734 41.33 49 33.28 49 24a24 24 0 00-1.025-6.96M34.022 1.754A23.932 23.932 0 0025 0c-2.429 0-4.774.36-6.983 1.032" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M40.64 8.472c-1.102-2.224-.935-4.764 1.382-6.465-.922-.087-2.209.326-3.004.784a6.024 6.024 0 00-2.674 7.229c.94 2.618 3.982 4.864 7.66 3.64 1.292-.429 2.615-1.508 2.996-2.665-1.8.625-5.258-.3-6.36-2.523zM21.013 6.015c-.22-.802-3.018-1.295-4.998-.919M4.998 8.006C2.25 9.22.808 11.146 1.011 12.009" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle stroke="#secondary" stroke-width="2" cx="11" cy="9" r="6"/><path d="M.994 12.022c.351 1.38 5.069 1.25 10.713-.355 5.644-1.603 9.654-4.273 9.303-5.653" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M26.978 10.105c.318 1.123.573 1.373 1.71 1.679-1.135.314-1.388.566-1.698 1.69-.318-1.122-.573-1.373-1.711-1.679 1.135-.314 1.39-.566 1.7-1.69" fill="#secondary"/><path d="M26.978 10.105c.318 1.123.573 1.373 1.71 1.679-1.135.314-1.388.566-1.698 1.69-.318-1.122-.573-1.373-1.711-1.679 1.135-.314 1.39-.566 1.7-1.69z" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M9.929 22.737c.317 1.121.573 1.372 1.71 1.678-1.135.314-1.389.566-1.699 1.69-.318-1.121-.573-1.372-1.71-1.679 1.134-.313 1.389-.566 1.699-1.69" fill="#secondary"/><path d="M9.929 22.737c.317 1.121.573 1.372 1.71 1.678-1.135.314-1.389.566-1.699 1.69-.318-1.121-.573-1.372-1.71-1.679 1.134-.313 1.389-.566 1.699-1.69z" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M38.912 33.684c.318 1.122.573 1.373 1.711 1.679-1.136.313-1.39.565-1.7 1.69-.317-1.123-.573-1.372-1.71-1.68 1.136-.313 1.389-.565 1.7-1.689" fill="#secondary"/><path d="M38.912 33.684c.318 1.122.573 1.373 1.711 1.679-1.136.313-1.39.565-1.7 1.69-.317-1.123-.573-1.372-1.71-1.68 1.136-.313 1.389-.565 1.7-1.689z" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></g>',
|
||||
rank:value ? "$" : "X",
|
||||
progress:value ? 1 : 0,
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -250,8 +287,11 @@
|
||||
list.push({
|
||||
title:"Automater",
|
||||
text:"Use GitHub Actions to automate profile updates",
|
||||
icon:"<g transform=\"translate(4 5)\" stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><g stroke-linecap=\"round\" stroke-linejoin=\"round\"><path stroke=\"#primary\" d=\"M26.478 22l.696 2.087 3.478.696v2.782l-3.478 1.392-.696 1.39 1.392 3.48-1.392 1.39L23 33.827l-1.391.695L20.217 38h-2.782l-1.392-3.478-1.39-.696-3.48 1.391-1.39-1.39 1.39-3.48-.695-1.39L7 27.565v-2.782l3.478-1.392.696-1.391-1.391-3.478 1.39-1.392 3.48 1.392 1.39-.696 1.392-3.478h2.782l1.392 3.478 1.391.696 3.478-1.392 1.392 1.392z\"/><path stroke=\"#secondary\" d=\"M24.779 12.899l-1.475-2.212 1.475-1.475 2.95 1.475 1.474-.738.737-2.934h2.212l.737 2.934 1.475.738 2.95-1.475 1.474 1.475-1.475 2.949.738 1.475 2.949.737v2.212l-2.95.737-.737 1.475 1.475 2.949-1.475 1.475-2.949-1.475\"/></g><path stroke=\"#primary\" stroke-linecap=\"round\" d=\"M5.932 5.546l7.082 6.931\"/><path stroke=\"#secondary\" stroke-linecap=\"round\" d=\"M32.959 31.99l8.728 8.532\"/><circle stroke=\"#secondary\" cx=\"44\" cy=\"43\" r=\"3\"/><circle stroke=\"#primary\" cx=\"13\" cy=\"2\" r=\"2\"/><circle stroke=\"#secondary\" cx=\"35\" cy=\"44\" r=\"2\"/><circle stroke=\"#secondary\" cx=\"3\" cy=\"12\" r=\"2\"/><circle stroke=\"#primary\" cx=\"45\" cy=\"34\" r=\"2\"/><path d=\"M3.832 0a3 3 0 110 6 3 3 0 010-6zM8.04 10.613l2.1-.613M10.334 9.758l1.914-5.669\" stroke=\"#primary\" stroke-linecap=\"round\"/><path stroke=\"#secondary\" stroke-linecap=\"round\" d=\"M40.026 35.91l-2.025.591M35.695 41.965l1.843-5.326\"/><path d=\"M16 2h23.038a6 6 0 016 6v24.033\" stroke=\"#primary\" stroke-linecap=\"round\"/><path d=\"M32.038 44.033H9a6 6 0 01-6-6V14\" stroke=\"#secondary\" stroke-linecap=\"round\"/><path d=\"M17.533 22.154l5.113 3.22a1 1 0 01-.006 1.697l-5.113 3.17a1 1 0 01-1.527-.85V23a1 1 0 011.533-.846zm11.58-7.134v-.504a1 1 0 011.53-.85l3.845 2.397a1 1 0 01-.006 1.701l-3.846 2.358\" stroke=\"#primary\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></g>",
|
||||
rank:value ? "$" : "X", progress:value ? 1 : 0, value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g transform="translate(4 5)" stroke-width="2" fill="none" fill-rule="evenodd"><g stroke-linecap="round" stroke-linejoin="round"><path stroke="#primary" d="M26.478 22l.696 2.087 3.478.696v2.782l-3.478 1.392-.696 1.39 1.392 3.48-1.392 1.39L23 33.827l-1.391.695L20.217 38h-2.782l-1.392-3.478-1.39-.696-3.48 1.391-1.39-1.39 1.39-3.48-.695-1.39L7 27.565v-2.782l3.478-1.392.696-1.391-1.391-3.478 1.39-1.392 3.48 1.392 1.39-.696 1.392-3.478h2.782l1.392 3.478 1.391.696 3.478-1.392 1.392 1.392z"/><path stroke="#secondary" d="M24.779 12.899l-1.475-2.212 1.475-1.475 2.95 1.475 1.474-.738.737-2.934h2.212l.737 2.934 1.475.738 2.95-1.475 1.474 1.475-1.475 2.949.738 1.475 2.949.737v2.212l-2.95.737-.737 1.475 1.475 2.949-1.475 1.475-2.949-1.475"/></g><path stroke="#primary" stroke-linecap="round" d="M5.932 5.546l7.082 6.931"/><path stroke="#secondary" stroke-linecap="round" d="M32.959 31.99l8.728 8.532"/><circle stroke="#secondary" cx="44" cy="43" r="3"/><circle stroke="#primary" cx="13" cy="2" r="2"/><circle stroke="#secondary" cx="35" cy="44" r="2"/><circle stroke="#secondary" cx="3" cy="12" r="2"/><circle stroke="#primary" cx="45" cy="34" r="2"/><path d="M3.832 0a3 3 0 110 6 3 3 0 010-6zM8.04 10.613l2.1-.613M10.334 9.758l1.914-5.669" stroke="#primary" stroke-linecap="round"/><path stroke="#secondary" stroke-linecap="round" d="M40.026 35.91l-2.025.591M35.695 41.965l1.843-5.326"/><path d="M16 2h23.038a6 6 0 016 6v24.033" stroke="#primary" stroke-linecap="round"/><path d="M32.038 44.033H9a6 6 0 01-6-6V14" stroke="#secondary" stroke-linecap="round"/><path d="M17.533 22.154l5.113 3.22a1 1 0 01-.006 1.697l-5.113 3.17a1 1 0 01-1.527-.85V23a1 1 0 011.533-.846zm11.58-7.134v-.504a1 1 0 011.53-.85l3.845 2.397a1 1 0 01-.006 1.701l-3.846 2.358" stroke="#primary" stroke-linecap="round" stroke-linejoin="round"/></g>',
|
||||
rank:value ? "$" : "X",
|
||||
progress:value ? 1 : 0,
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -263,8 +303,11 @@
|
||||
list.push({
|
||||
title:"Infographile",
|
||||
text:"Fervent supporter of metrics",
|
||||
icon:"<g stroke-linejoin=\"round\" stroke-width=\"2\" fill=\"none\" fill-rule=\"evenodd\"><g stroke=\"#secondary\" stroke-linecap=\"round\"><path d=\"M22 31h20M22 36h10\"/></g><path d=\"M44.05 36.013a8 8 0 110 16 8 8 0 010-16z\" stroke=\"#primary\" stroke-linecap=\"round\"/><path d=\"M32 43H7c-1.228 0-2-.84-2-2V7c0-1.16.772-2 2-2h7.075M47 24.04V32\" stroke=\"#secondary\" stroke-linecap=\"round\"/><path stroke=\"#primary\" stroke-linecap=\"round\" d=\"M47.015 42.017l-4 3.994-2.001-1.995\"/><path stroke=\"#secondary\" d=\"M11 31h5v5h-5z\"/><path d=\"M11 14a2 2 0 012-2m28 12a2 2 0 01-2 2h-1m-5 0h-4m-6 0h-4m-5 0h-1a2 2 0 01-2-2m0-4v-2\" stroke=\"#secondary\" stroke-linecap=\"round\"/><path d=\"M18 18V7c0-1.246.649-2 1.73-2h28.54C49.351 5 50 5.754 50 7v11c0 1.246-.649 2-1.73 2H19.73c-1.081 0-1.73-.754-1.73-2z\" stroke=\"#primary\" stroke-linecap=\"round\"/><path stroke=\"#primary\" stroke-linecap=\"round\" d=\"M22 13h4l2-3 3 5 2-2h3.052l2.982-4 3.002 4H46\"/></g>",
|
||||
rank:(value)&&(login === _login) ? "$" : "X", progress:(value)&&(login === _login) ? 1 : 0, value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g stroke-linejoin="round" stroke-width="2" fill="none" fill-rule="evenodd"><g stroke="#secondary" stroke-linecap="round"><path d="M22 31h20M22 36h10"/></g><path d="M44.05 36.013a8 8 0 110 16 8 8 0 010-16z" stroke="#primary" stroke-linecap="round"/><path d="M32 43H7c-1.228 0-2-.84-2-2V7c0-1.16.772-2 2-2h7.075M47 24.04V32" stroke="#secondary" stroke-linecap="round"/><path stroke="#primary" stroke-linecap="round" d="M47.015 42.017l-4 3.994-2.001-1.995"/><path stroke="#secondary" d="M11 31h5v5h-5z"/><path d="M11 14a2 2 0 012-2m28 12a2 2 0 01-2 2h-1m-5 0h-4m-6 0h-4m-5 0h-1a2 2 0 01-2-2m0-4v-2" stroke="#secondary" stroke-linecap="round"/><path d="M18 18V7c0-1.246.649-2 1.73-2h28.54C49.351 5 50 5.754 50 7v11c0 1.246-.649 2-1.73 2H19.73c-1.081 0-1.73-.754-1.73-2z" stroke="#primary" stroke-linecap="round"/><path stroke="#primary" stroke-linecap="round" d="M22 13h4l2-3 3 5 2-2h3.052l2.982-4 3.002 4H46"/></g>',
|
||||
rank:(value) && (login === _login) ? "$" : "X",
|
||||
progress:(value) && (login === _login) ? 1 : 0,
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
@@ -276,9 +319,11 @@
|
||||
list.push({
|
||||
title:"Octonaut",
|
||||
text:"Following octocat",
|
||||
icon:"<g fill=\"none\" fill-rule=\"evenodd\"><path d=\"M14.7 8c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689zm26 0c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689zM28.021 5c.318 1.122.574 1.372 1.711 1.678-1.136.314-1.389.566-1.7 1.69-.317-1.121-.572-1.372-1.71-1.679 1.135-.313 1.39-.566 1.7-1.689z\" stroke=\"#primary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><g transform=\"translate(4 9)\" fill-rule=\"nonzero\"><path d=\"M14.05 9.195C10.327 7.065 7.46 6 5.453 6 4.92 6 4 6.164 3.5 6.653s-.572.741-.711 1.14c-.734 2.1-1.562 6.317.078 9.286-8.767 25.38 15.513 24.92 21.207 24.92 5.695 0 29.746.456 21.037-24.908 1.112-2.2 1.404-5.119.121-9.284-.863-2.802-4.646-2.341-11.35 1.384a27.38 27.38 0 00-9.802-1.81c-3.358 0-6.701.605-10.03 1.814z\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M10.323 40.074c-2.442-1.02-2.93-3.308-2.93-4.834 0-1.527.488-2.45.976-3.92.489-1.47.391-2.281-.976-5.711-1.368-3.43.976-7.535 4.884-7.535 3.908 0 7.088 3.005 11.723 2.956m0 0c4.635.05 7.815-2.956 11.723-2.956 3.908 0 6.252 4.105 4.884 7.535-1.367 3.43-1.465 4.241-.976 5.71.488 1.47.976 2.394.976 3.92 0 1.527-.488 3.816-2.93 4.835\" stroke=\"#secondary\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><circle fill=\"#primary\" cx=\"12\" cy=\"30\" r=\"1\"/><circle fill=\"#primary\" cx=\"13\" cy=\"28\" r=\"1\"/><circle fill=\"#primary\" cx=\"15\" cy=\"28\" r=\"1\"/><circle fill=\"#primary\" cx=\"23\" cy=\"35\" r=\"1\"/><circle fill=\"#primary\" cx=\"25\" cy=\"35\" r=\"1\"/><circle fill=\"#primary\" cx=\"17\" cy=\"28\" r=\"1\"/><circle fill=\"#primary\" cx=\"31\" cy=\"28\" r=\"1\"/><circle fill=\"#primary\" cx=\"33\" cy=\"28\" r=\"1\"/><circle fill=\"#primary\" cx=\"35\" cy=\"28\" r=\"1\"/><circle fill=\"#primary\" cx=\"12\" cy=\"32\" r=\"1\"/><circle fill=\"#primary\" cx=\"19\" cy=\"30\" r=\"1\"/><circle fill=\"#primary\" cx=\"19\" cy=\"32\" r=\"1\"/><circle fill=\"#primary\" cx=\"29\" cy=\"30\" r=\"1\"/><circle fill=\"#primary\" cx=\"29\" cy=\"32\" r=\"1\"/><circle fill=\"#primary\" cx=\"36\" cy=\"30\" r=\"1\"/><circle fill=\"#primary\" cx=\"36\" cy=\"32\" r=\"1\"/></g></g>",
|
||||
rank:(value)&&(login === _login) ? "$" : "X", progress:(value)&&(login === _login) ? 1 : 0, value, unlock:new Date(unlock?.createdAt),
|
||||
icon:'<g fill="none" fill-rule="evenodd"><path d="M14.7 8c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689zm26 0c.316 1.122.572 1.372 1.71 1.678-1.136.314-1.39.566-1.7 1.69-.317-1.121-.573-1.372-1.71-1.679 1.135-.313 1.389-.566 1.7-1.689zM28.021 5c.318 1.122.574 1.372 1.711 1.678-1.136.314-1.389.566-1.7 1.69-.317-1.121-.572-1.372-1.71-1.679 1.135-.313 1.39-.566 1.7-1.689z" stroke="#primary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><g transform="translate(4 9)" fill-rule="nonzero"><path d="M14.05 9.195C10.327 7.065 7.46 6 5.453 6 4.92 6 4 6.164 3.5 6.653s-.572.741-.711 1.14c-.734 2.1-1.562 6.317.078 9.286-8.767 25.38 15.513 24.92 21.207 24.92 5.695 0 29.746.456 21.037-24.908 1.112-2.2 1.404-5.119.121-9.284-.863-2.802-4.646-2.341-11.35 1.384a27.38 27.38 0 00-9.802-1.81c-3.358 0-6.701.605-10.03 1.814z" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M10.323 40.074c-2.442-1.02-2.93-3.308-2.93-4.834 0-1.527.488-2.45.976-3.92.489-1.47.391-2.281-.976-5.711-1.368-3.43.976-7.535 4.884-7.535 3.908 0 7.088 3.005 11.723 2.956m0 0c4.635.05 7.815-2.956 11.723-2.956 3.908 0 6.252 4.105 4.884 7.535-1.367 3.43-1.465 4.241-.976 5.71.488 1.47.976 2.394.976 3.92 0 1.527-.488 3.816-2.93 4.835" stroke="#secondary" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><circle fill="#primary" cx="12" cy="30" r="1"/><circle fill="#primary" cx="13" cy="28" r="1"/><circle fill="#primary" cx="15" cy="28" r="1"/><circle fill="#primary" cx="23" cy="35" r="1"/><circle fill="#primary" cx="25" cy="35" r="1"/><circle fill="#primary" cx="17" cy="28" r="1"/><circle fill="#primary" cx="31" cy="28" r="1"/><circle fill="#primary" cx="33" cy="28" r="1"/><circle fill="#primary" cx="35" cy="28" r="1"/><circle fill="#primary" cx="12" cy="32" r="1"/><circle fill="#primary" cx="19" cy="30" r="1"/><circle fill="#primary" cx="19" cy="32" r="1"/><circle fill="#primary" cx="29" cy="30" r="1"/><circle fill="#primary" cx="29" cy="32" r="1"/><circle fill="#primary" cx="36" cy="30" r="1"/><circle fill="#primary" cx="36" cy="32" r="1"/></g></g>',
|
||||
rank:(value) && (login === _login) ? "$" : "X",
|
||||
progress:(value) && (login === _login) ? 1 : 0,
|
||||
value,
|
||||
unlock:new Date(unlock?.createdAt),
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,7 +27,8 @@
|
||||
console.debug(`metrics/compute/${login}/plugins > activity > ${events.length} events loaded`)
|
||||
|
||||
//Extract activity events
|
||||
const activity = (await Promise.all(events
|
||||
const activity = (await Promise.all(
|
||||
events
|
||||
.filter(({actor}) => account === "organization" ? true : actor.login === login)
|
||||
.filter(({created_at}) => Number.isFinite(days) ? new Date(created_at) > new Date(Date.now() - days * 24 * 60 * 60 * 1000) : true)
|
||||
.filter(event => visibility === "public" ? event.public : true)
|
||||
@@ -133,7 +134,8 @@
|
||||
return null
|
||||
}
|
||||
}
|
||||
})))
|
||||
}),
|
||||
))
|
||||
.filter(event => event)
|
||||
.filter(event => filter.includes("all") || filter.includes(event.type))
|
||||
.slice(0, limit)
|
||||
|
||||
@@ -138,7 +138,11 @@
|
||||
const {progress, score:userScore, media:{title, description, status, startDate:{year:release}, genres, averageScore, episodes, chapters, type, coverImage:{medium:artwork}}} = media
|
||||
return {
|
||||
name:title.romaji,
|
||||
type, status, release, genres, progress,
|
||||
type,
|
||||
status,
|
||||
release,
|
||||
genres,
|
||||
progress,
|
||||
description:description.replace(/<br\s*\\?>/g, " "),
|
||||
scores:{user:userScore, community:averageScore},
|
||||
released:type === "ANIME" ? episodes : chapters,
|
||||
|
||||
@@ -37,9 +37,13 @@
|
||||
|
||||
//Retrieve edited files and filter edited lines (those starting with +/-) from patches
|
||||
console.debug(`metrics/compute/${login}/plugins > habits > loading patches`)
|
||||
const patches = [...await Promise.allSettled(commits
|
||||
const patches = [
|
||||
...await Promise.allSettled(
|
||||
commits
|
||||
.flatMap(({payload}) => payload.commits).map(commit => commit.url)
|
||||
.map(async commit => (await rest.request(commit)).data.files))]
|
||||
.map(async commit => (await rest.request(commit)).data.files),
|
||||
),
|
||||
]
|
||||
.filter(({status}) => status === "fulfilled")
|
||||
.map(({value}) => value)
|
||||
.flatMap(files => files.map(file => ({name:imports.paths.basename(file.filename), patch:file.patch ?? ""})))
|
||||
@@ -108,6 +112,7 @@
|
||||
}
|
||||
else
|
||||
console.debug(`metrics/compute/${login}/plugins > habits > linguist not available`)
|
||||
|
||||
}
|
||||
|
||||
//Results
|
||||
|
||||
@@ -56,13 +56,16 @@
|
||||
let i = 0, j = 0
|
||||
let svg = `
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" style="margin-top: -52px;" viewBox="0,0 480,${duration === "full-year" ? 270 : 170}">
|
||||
${[1, 2].map(k => `
|
||||
${
|
||||
[1, 2].map(k => `
|
||||
<filter id="brightness${k}">
|
||||
<feComponentTransfer>
|
||||
${[..."RGB"].map(channel => `<feFunc${channel} type="linear" slope="${1 - k * 0.4}" />`).join("")}
|
||||
</feComponentTransfer>
|
||||
</filter>`)
|
||||
.join("")}
|
||||
</filter>`
|
||||
)
|
||||
.join("")
|
||||
}
|
||||
<g transform="scale(4) translate(12, 0)">`
|
||||
//Iterate through weeks
|
||||
for (const week of calendar.weeks) {
|
||||
|
||||
@@ -43,12 +43,17 @@
|
||||
//Create configuration file if needed
|
||||
if (!(await imports.fs.stat(imports.paths.join(path, ".licensed.yml")).then(() => 1).catch(() => 0))) {
|
||||
console.debug(`metrics/compute/${login}/plugins > licenses > building .licensed.yml configuration file`)
|
||||
await imports.fs.writeFile(imports.paths.join(path, ".licensed.yml"), [
|
||||
await imports.fs.writeFile(
|
||||
imports.paths.join(path, ".licensed.yml"),
|
||||
[
|
||||
"cache_path: .licensed",
|
||||
].join("\n"))
|
||||
].join("\n"),
|
||||
)
|
||||
}
|
||||
else
|
||||
console.debug(`metrics/compute/${login}/plugins > licenses > a .licensed.yml configuration file already exists`)
|
||||
|
||||
|
||||
//Spawn licensed process
|
||||
console.debug(`metrics/compute/${login}/plugins > licenses > running licensed`)
|
||||
JSON.parse(await imports.run("licensed list --format=json --licenses", {cwd:path})).apps
|
||||
@@ -57,7 +62,9 @@
|
||||
result.dependencies.push(dependency)
|
||||
result.known += (license in licenses)
|
||||
result.unknown += !(license in licenses)
|
||||
})))
|
||||
})
|
||||
)
|
||||
)
|
||||
//Cleaning
|
||||
console.debug(`metrics/compute/${login}/plugins > licensed > cleaning temp dir ${path}`)
|
||||
await imports.fs.rmdir(path, {recursive:true})
|
||||
@@ -65,6 +72,7 @@
|
||||
else
|
||||
console.debug(`metrics/compute/${login}/plugins > licenses > licensed not available`)
|
||||
|
||||
|
||||
//List licenses properties
|
||||
console.debug(`metrics/compute/${login}/plugins > licenses > compute licenses properties`)
|
||||
const base = {permissions:new Set(), limitations:new Set(), conditions:new Set()}
|
||||
@@ -89,7 +97,10 @@
|
||||
console.debug(`metrics/compute/${login}/plugins > licenses > computing ratio`)
|
||||
const total = Object.values(used).reduce((a, b) => a + b, 0)
|
||||
//Format used licenses and compute positions
|
||||
const list = Object.entries(used).map(([key, count]) => ({name:licenses[key]?.spdxId ?? `${key.charAt(0).toLocaleUpperCase()}${key.substring(1)}`, key, count, value:count/total, x:0, color:licenses[key]?.color ?? "#6e7681", order:licenses[key]?.order ?? -1})).sort((a, b) => a.order === b.order ? b.count - a.count : b.order - a.order)
|
||||
const list = Object.entries(used).map(([key, count]) => ({name:licenses[key]?.spdxId ?? `${key.charAt(0).toLocaleUpperCase()}${key.substring(1)}`, key, count, value:count / total, x:0, color:licenses[key]?.color ?? "#6e7681", order:licenses[key]?.order ?? -1})).sort((
|
||||
a,
|
||||
b,
|
||||
) => a.order === b.order ? b.count - a.count : b.order - a.order)
|
||||
for (let i = 0; i < list.length; i++)
|
||||
list[i].x = (list[i - 1]?.x ?? 0) + (list[i - 1]?.value ?? 0)
|
||||
//Save ratios
|
||||
|
||||
@@ -44,4 +44,3 @@
|
||||
throw {error:{message:"An error occured", instance:error}}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -86,23 +86,29 @@
|
||||
case "apple": {
|
||||
//Parse tracklist
|
||||
await frame.waitForSelector(".tracklist.playlist")
|
||||
tracks = [...await frame.evaluate(() => [...document.querySelectorAll(".tracklist li")].map(li => ({
|
||||
tracks = [
|
||||
...await frame.evaluate(() => [...document.querySelectorAll(".tracklist li")].map(li => ({
|
||||
name:li.querySelector(".tracklist__track__name").innerText,
|
||||
artist:li.querySelector(".tracklist__track__sub").innerText,
|
||||
artwork:li.querySelector(".tracklist__track__artwork img").src,
|
||||
})))]
|
||||
}))
|
||||
),
|
||||
]
|
||||
break
|
||||
}
|
||||
//Spotify
|
||||
case "spotify": {
|
||||
//Parse tracklist
|
||||
await frame.waitForSelector("table")
|
||||
tracks = [...await frame.evaluate(() => [...document.querySelectorAll("table tr")].map(tr => ({
|
||||
tracks = [
|
||||
...await frame.evaluate(() => [...document.querySelectorAll("table tr")].map(tr => ({
|
||||
name:tr.querySelector("td:nth-child(2) div div:nth-child(1)").innerText,
|
||||
artist:tr.querySelector("td:nth-child(2) div div:nth-child(2)").innerText,
|
||||
//Spotify doesn't provide artworks so we fallback on playlist artwork instead
|
||||
artwork:window.getComputedStyle(document.querySelector("button[title=Play]").parentNode, null).backgroundImage.match(/^url\("(?<url>https:...+)"\)$/)?.groups?.url ?? null,
|
||||
})))]
|
||||
}))
|
||||
),
|
||||
]
|
||||
break
|
||||
}
|
||||
//Unsupported
|
||||
@@ -136,9 +142,11 @@
|
||||
try {
|
||||
//Request access token
|
||||
console.debug(`metrics/compute/${login}/plugins > music > requesting access token with spotify refresh token`)
|
||||
const {data:{access_token:access}} = await imports.axios.post("https://accounts.spotify.com/api/token", `${new imports.url.URLSearchParams({grant_type:"refresh_token", refresh_token, client_id, client_secret})}`, {headers:{
|
||||
const {data:{access_token:access}} = await imports.axios.post("https://accounts.spotify.com/api/token", `${new imports.url.URLSearchParams({grant_type:"refresh_token", refresh_token, client_id, client_secret})}`, {
|
||||
headers:{
|
||||
"Content-Type":"application/x-www-form-urlencoded",
|
||||
}})
|
||||
},
|
||||
})
|
||||
console.debug(`metrics/compute/${login}/plugins > music > got access token`)
|
||||
//Retrieve tracks
|
||||
console.debug(`metrics/compute/${login}/plugins > music > querying spotify api`)
|
||||
@@ -146,11 +154,13 @@
|
||||
for (let hours = .5; hours <= 24; hours++) {
|
||||
//Load track half-hour by half-hour
|
||||
const timestamp = Date.now() - hours * 60 * 60 * 1000
|
||||
const loaded = (await imports.axios.get(`https://api.spotify.com/v1/me/player/recently-played?after=${timestamp}`, {headers:{
|
||||
const loaded = (await imports.axios.get(`https://api.spotify.com/v1/me/player/recently-played?after=${timestamp}`, {
|
||||
headers:{
|
||||
"Content-Type":"application/json",
|
||||
Accept:"application/json",
|
||||
Authorization:`Bearer ${access}`,
|
||||
}})).data.items.map(({track, played_at}) => ({
|
||||
},
|
||||
})).data.items.map(({track, played_at}) => ({
|
||||
name:track.name,
|
||||
artist:track.artists[0].name,
|
||||
artwork:track.album.images[0].url,
|
||||
@@ -184,10 +194,12 @@
|
||||
//API call and parse tracklist
|
||||
try {
|
||||
console.debug(`metrics/compute/${login}/plugins > music > querying lastfm api`)
|
||||
tracks = (await imports.axios.get(`https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${user}&api_key=${token}&limit=${limit}&format=json`, {headers:{
|
||||
tracks = (await imports.axios.get(`https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=${user}&api_key=${token}&limit=${limit}&format=json`, {
|
||||
headers:{
|
||||
"User-Agent":"lowlighter/metrics",
|
||||
Accept:"application/json",
|
||||
}})).data.recenttracks.track.map(track => ({
|
||||
},
|
||||
})).data.recenttracks.track.map(track => ({
|
||||
name:track.name,
|
||||
artist:track.artist["#text"],
|
||||
artwork:track.image.reverse()[0]["#text"],
|
||||
|
||||
@@ -9,11 +9,16 @@
|
||||
//Load inputs
|
||||
let {url, datapoints, lowalert, highalert, urgentlowalert, urgenthighalert} = imports.metadata.plugins.nightscout.inputs({data, account, q})
|
||||
|
||||
if (!url || url === "https://example.herokuapp.com") throw {error:{message:"Nightscout site URL isn't set!"}}
|
||||
if (url.substring(url.length - 1) !== "/") url += "/"
|
||||
if (url.substring(0, 7) === "http://") url = `https://${url.substring(7)}`
|
||||
if (url.substring(0, 8) !== "https://") url = `https://${url}`
|
||||
if (datapoints <= 0) datapoints = 1
|
||||
if (!url || url === "https://example.herokuapp.com")
|
||||
throw {error:{message:"Nightscout site URL isn't set!"}}
|
||||
if (url.substring(url.length - 1) !== "/")
|
||||
url += "/"
|
||||
if (url.substring(0, 7) === "http://")
|
||||
url = `https://${url.substring(7)}`
|
||||
if (url.substring(0, 8) !== "https://")
|
||||
url = `https://${url}`
|
||||
if (datapoints <= 0)
|
||||
datapoints = 1
|
||||
//Get nightscout data from axios
|
||||
const resp = await imports.axios.get(`${url}api/v1/entries.json?count=${datapoints}`)
|
||||
for (let i = 0; i < resp.data.length; i++) {
|
||||
|
||||
@@ -53,9 +53,11 @@
|
||||
do {
|
||||
console.debug(`metrics/compute/${login}/plugins > people > retrieving ${type} after ${cursor}`)
|
||||
const {[type]:{edges}} = (
|
||||
type in context.sponsorships ? (await graphql(queries.people.sponsors({login:context.owner ?? login, type, size, after:cursor ? `after: "${cursor}"` : "", target:context.sponsorships[type], account})))[account] :
|
||||
context.mode === "repository" ? (await graphql(queries.people.repository({login:context.owner, repository:context.repo, type, size, after:cursor ? `after: "${cursor}"` : "", account})))[account].repository :
|
||||
(await graphql(queries.people({login, type, size, after:cursor ? `after: "${cursor}"` : "", account})))[account]
|
||||
type in context.sponsorships
|
||||
? (await graphql(queries.people.sponsors({login:context.owner ?? login, type, size, after:cursor ? `after: "${cursor}"` : "", target:context.sponsorships[type], account})))[account]
|
||||
: context.mode === "repository"
|
||||
? (await graphql(queries.people.repository({login:context.owner, repository:context.repo, type, size, after:cursor ? `after: "${cursor}"` : "", account})))[account].repository
|
||||
: (await graphql(queries.people({login, type, size, after:cursor ? `after: "${cursor}"` : "", account})))[account]
|
||||
)
|
||||
cursor = edges?.[edges?.length - 1]?.cursor
|
||||
result[type].push(...edges.map(({node}) => node[context.sponsorships[type]] ?? node))
|
||||
|
||||
@@ -23,7 +23,9 @@
|
||||
}
|
||||
//Hashnode
|
||||
case "hashnode": {
|
||||
posts = (await imports.axios.post("https://api.hashnode.com", {query:queries.posts.hashnode({user})}, {headers:{"Content-type":"application/json"}})).data.data.user.publication.posts.map(({title, brief:description, dateAdded:date, coverImage:image, slug}) => ({title, description, date, image, link:`https://hashnode.com/post/${slug}`}))
|
||||
posts = (await imports.axios.post("https://api.hashnode.com", {query:queries.posts.hashnode({user})}, {headers:{"Content-type":"application/json"}})).data.data.user.publication.posts.map((
|
||||
{title, brief:description, dateAdded:date, coverImage:image, slug},
|
||||
) => ({title, description, date, image, link:`https://hashnode.com/post/${slug}`}))
|
||||
link = `https://hashnode.com/@${user}`
|
||||
break
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
//Setup
|
||||
export default async function({login, q, imports, data, account}, {enabled = false} = {}) {
|
||||
//Plugin execution
|
||||
|
||||
@@ -45,5 +45,3 @@
|
||||
throw {error:{message:"An error occured", instance:error}}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -80,7 +80,19 @@
|
||||
},
|
||||
/**Format answers */
|
||||
async answer({body_markdown:body, score, up_vote_count:upvotes, down_vote_count:downvotes, is_accepted:accepted, comment_count:comments = 0, creation_date, owner:{display_name:author}, link, answer_id:id, question_id}, {imports, data, codelines}) {
|
||||
const formatted = {type:"answer", body:await imports.markdown(format.code(imports.htmlunescape(body)), {codelines}), score, upvotes, downvotes, accepted, comments, author, created:imports.date(creation_date*1000, {dateStyle:"short", timeZone:data.config.timezone?.name}), link, id, question_id,
|
||||
const formatted = {
|
||||
type:"answer",
|
||||
body:await imports.markdown(format.code(imports.htmlunescape(body)), {codelines}),
|
||||
score,
|
||||
upvotes,
|
||||
downvotes,
|
||||
accepted,
|
||||
comments,
|
||||
author,
|
||||
created:imports.date(creation_date * 1000, {dateStyle:"short", timeZone:data.config.timezone?.name}),
|
||||
link,
|
||||
id,
|
||||
question_id,
|
||||
get question() {
|
||||
return format.cached.get(`q${this.question_id}`) ?? null
|
||||
},
|
||||
@@ -89,8 +101,45 @@
|
||||
return formatted
|
||||
},
|
||||
/**Format questions */
|
||||
async question({title, body_markdown:body, score, up_vote_count:upvotes, down_vote_count:downvotes, favorite_count:favorites, tags, is_answered:answered, answer_count:answers, comment_count:comments, view_count:views, creation_date, owner:{display_name:author}, link, question_id:id, accepted_answer_id = null}, {imports, data, codelines}) {
|
||||
const formatted = {type:"question", title:await imports.markdown(title), body:await imports.markdown(format.code(imports.htmlunescape(body)), {codelines}), score, upvotes, downvotes, favorites, tags, answered, answers, comments, views, author, created:imports.date(creation_date*1000, {dateStyle:"short", timeZone:data.config.timezone?.name}), link, id, accepted_answer_id,
|
||||
async question(
|
||||
{
|
||||
title,
|
||||
body_markdown:body,
|
||||
score,
|
||||
up_vote_count:upvotes,
|
||||
down_vote_count:downvotes,
|
||||
favorite_count:favorites,
|
||||
tags,
|
||||
is_answered:answered,
|
||||
answer_count:answers,
|
||||
comment_count:comments,
|
||||
view_count:views,
|
||||
creation_date,
|
||||
owner:{display_name:author},
|
||||
link,
|
||||
question_id:id,
|
||||
accepted_answer_id = null,
|
||||
},
|
||||
{imports, data, codelines},
|
||||
) {
|
||||
const formatted = {
|
||||
type:"question",
|
||||
title:await imports.markdown(title),
|
||||
body:await imports.markdown(format.code(imports.htmlunescape(body)), {codelines}),
|
||||
score,
|
||||
upvotes,
|
||||
downvotes,
|
||||
favorites,
|
||||
tags,
|
||||
answered,
|
||||
answers,
|
||||
comments,
|
||||
views,
|
||||
author,
|
||||
created:imports.date(creation_date * 1000, {dateStyle:"short", timeZone:data.config.timezone?.name}),
|
||||
link,
|
||||
id,
|
||||
accepted_answer_id,
|
||||
get answer() {
|
||||
return format.cached.get(`a${this.accepted_answer_id}`) ?? null
|
||||
},
|
||||
|
||||
@@ -33,10 +33,14 @@
|
||||
await page.goto(`https://github.community/u/${login}/summary`)
|
||||
const frame = page.mainFrame()
|
||||
await frame.waitForSelector(".stats-section")
|
||||
Object.assign(result.stats, Object.fromEntries((await frame.evaluate(() => [...document.querySelectorAll(".stats-section li")].map(el => [
|
||||
Object.assign(
|
||||
result.stats,
|
||||
Object.fromEntries(
|
||||
(await frame.evaluate(() => [...document.querySelectorAll(".stats-section li")].map(el => [
|
||||
el.querySelector(".label").innerText.trim().toLocaleLowerCase(),
|
||||
el.querySelector(".value").innerText.trim().toLocaleLowerCase(),
|
||||
]))).map(([key, value]) => {
|
||||
])
|
||||
)).map(([key, value]) => {
|
||||
switch (true) {
|
||||
case /solutions?/.test(key):
|
||||
return ["solutions", Number(value)]
|
||||
@@ -49,7 +53,9 @@
|
||||
default:
|
||||
return null
|
||||
}
|
||||
}).filter(kv => kv)))
|
||||
}).filter(kv => kv),
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
//Badges
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
name:li.querySelector(".f3").innerText,
|
||||
description:li.querySelector(".f5").innerText,
|
||||
icon:li.querySelector("img")?.src ?? null,
|
||||
})))
|
||||
}))
|
||||
)
|
||||
console.debug(`metrics/compute/${login}/plugins > topics > extracted ${starred.length} starred topics`)
|
||||
//Check if next page exists
|
||||
if (!starred.length) {
|
||||
|
||||
@@ -21,7 +21,10 @@
|
||||
|
||||
//Load tweets
|
||||
console.debug(`metrics/compute/${login}/plugins > tweets > querying api`)
|
||||
const {data:{data:tweets = [], includes:{media = []} = {}}} = await imports.axios.get(`https://api.twitter.com/2/tweets/search/recent?query=from:${username}&tweet.fields=created_at,entities&media.fields=preview_image_url,url,type&expansions=entities.mentions.username,attachments.media_keys`, {headers:{Authorization:`Bearer ${token}`}})
|
||||
const {data:{data:tweets = [], includes:{media = []} = {}}} = await imports.axios.get(
|
||||
`https://api.twitter.com/2/tweets/search/recent?query=from:${username}&tweet.fields=created_at,entities&media.fields=preview_image_url,url,type&expansions=entities.mentions.username,attachments.media_keys`,
|
||||
{headers:{Authorization:`Bearer ${token}`}},
|
||||
)
|
||||
const medias = new Map(media.map(({media_key, type, url, preview_image_url}) => [media_key, (type === "photo") || (type === "animated_gif") ? url : type === "video" ? preview_image_url : null]))
|
||||
|
||||
//Limit tweets
|
||||
@@ -57,10 +60,13 @@
|
||||
}
|
||||
else
|
||||
tweet.text = `${tweet.text}\n${linked}`
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
tweet.attachments = null
|
||||
|
||||
|
||||
//Format text
|
||||
console.debug(`metrics/compute/${login}/plugins > tweets > formatting tweet ${tweet.id}`)
|
||||
tweet.createdAt = `${imports.date(tweet.created_at, {timeStyle:"short", timeZone:data.config.timezone?.name})} on ${imports.date(tweet.created_at, {dateStyle:"short", timeZone:data.config.timezone?.name})}`
|
||||
@@ -70,11 +76,16 @@
|
||||
//Mentions
|
||||
.replace(new RegExp(`@(${tweet.mentions.join("|")})`, "gi"), '<span class="mention">@$1</span>')
|
||||
//Hashtags (this regex comes from the twitter source code)
|
||||
.replace(/(?<!&)[#|#]([a-z0-9_\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0100-\u024f\u0253-\u0254\u0256-\u0257\u0300-\u036f\u1e00-\u1eff\u0400-\u04ff\u0500-\u0527\u2de0-\u2dff\ua640-\ua69f\u0591-\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05d0-\u05ea\u05f0-\u05f4\ufb12-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4f\u0610-\u061a\u0620-\u065f\u066e-\u06d3\u06d5-\u06dc\u06de-\u06e8\u06ea-\u06ef\u06fa-\u06fc\u0750-\u077f\u08a2-\u08ac\u08e4-\u08fe\ufb50-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\u200c-\u200c\u0e01-\u0e3a\u0e40-\u0e4e\u1100-\u11ff\u3130-\u3185\ua960-\ua97f\uac00-\ud7af\ud7b0-\ud7ff\uffa1-\uffdc\u30a1-\u30fa\u30fc-\u30fe\uff66-\uff9f\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\u3041-\u3096\u3099-\u309e\u3400-\u4dbf\u4e00-\u9fff\u20000-\u2a6df\u2a700-\u2b73f\u2b740-\u2b81f\u2f800-\u2fa1f]*[a-z_\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0100-\u024f\u0253-\u0254\u0256-\u0257\u0300-\u036f\u1e00-\u1eff\u0400-\u04ff\u0500-\u0527\u2de0-\u2dff\ua640-\ua69f\u0591-\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05d0-\u05ea\u05f0-\u05f4\ufb12-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4f\u0610-\u061a\u0620-\u065f\u066e-\u06d3\u06d5-\u06dc\u06de-\u06e8\u06ea-\u06ef\u06fa-\u06fc\u0750-\u077f\u08a2-\u08ac\u08e4-\u08fe\ufb50-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\u200c-\u200c\u0e01-\u0e3a\u0e40-\u0e4e\u1100-\u11ff\u3130-\u3185\ua960-\ua97f\uac00-\ud7af\ud7b0-\ud7ff\uffa1-\uffdc\u30a1-\u30fa\u30fc-\u30fe\uff66-\uff9f\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\u3041-\u3096\u3099-\u309e\u3400-\u4dbf\u4e00-\u9fff\u20000-\u2a6df\u2a700-\u2b73f\u2b740-\u2b81f\u2f800-\u2fa1f][a-z0-9_\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0100-\u024f\u0253-\u0254\u0256-\u0257\u0300-\u036f\u1e00-\u1eff\u0400-\u04ff\u0500-\u0527\u2de0-\u2dff\ua640-\ua69f\u0591-\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05d0-\u05ea\u05f0-\u05f4\ufb12-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4f\u0610-\u061a\u0620-\u065f\u066e-\u06d3\u06d5-\u06dc\u06de-\u06e8\u06ea-\u06ef\u06fa-\u06fc\u0750-\u077f\u08a2-\u08ac\u08e4-\u08fe\ufb50-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\u200c-\u200c\u0e01-\u0e3a\u0e40-\u0e4e\u1100-\u11ff\u3130-\u3185\ua960-\ua97f\uac00-\ud7af\ud7b0-\ud7ff\uffa1-\uffdc\u30a1-\u30fa\u30fc-\u30fe\uff66-\uff9f\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\u3041-\u3096\u3099-\u309e\u3400-\u4dbf\u4e00-\u9fff\u20000-\u2a6df\u2a700-\u2b73f\u2b740-\u2b81f\u2f800-\u2fa1f]*)/gi, ' <span class="hashtag">#$1</span> ')
|
||||
.replace(
|
||||
/(?<!&)[#|#]([a-z0-9_\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0100-\u024f\u0253-\u0254\u0256-\u0257\u0300-\u036f\u1e00-\u1eff\u0400-\u04ff\u0500-\u0527\u2de0-\u2dff\ua640-\ua69f\u0591-\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05d0-\u05ea\u05f0-\u05f4\ufb12-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4f\u0610-\u061a\u0620-\u065f\u066e-\u06d3\u06d5-\u06dc\u06de-\u06e8\u06ea-\u06ef\u06fa-\u06fc\u0750-\u077f\u08a2-\u08ac\u08e4-\u08fe\ufb50-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\u200c-\u200c\u0e01-\u0e3a\u0e40-\u0e4e\u1100-\u11ff\u3130-\u3185\ua960-\ua97f\uac00-\ud7af\ud7b0-\ud7ff\uffa1-\uffdc\u30a1-\u30fa\u30fc-\u30fe\uff66-\uff9f\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\u3041-\u3096\u3099-\u309e\u3400-\u4dbf\u4e00-\u9fff\u20000-\u2a6df\u2a700-\u2b73f\u2b740-\u2b81f\u2f800-\u2fa1f]*[a-z_\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0100-\u024f\u0253-\u0254\u0256-\u0257\u0300-\u036f\u1e00-\u1eff\u0400-\u04ff\u0500-\u0527\u2de0-\u2dff\ua640-\ua69f\u0591-\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05d0-\u05ea\u05f0-\u05f4\ufb12-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4f\u0610-\u061a\u0620-\u065f\u066e-\u06d3\u06d5-\u06dc\u06de-\u06e8\u06ea-\u06ef\u06fa-\u06fc\u0750-\u077f\u08a2-\u08ac\u08e4-\u08fe\ufb50-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\u200c-\u200c\u0e01-\u0e3a\u0e40-\u0e4e\u1100-\u11ff\u3130-\u3185\ua960-\ua97f\uac00-\ud7af\ud7b0-\ud7ff\uffa1-\uffdc\u30a1-\u30fa\u30fc-\u30fe\uff66-\uff9f\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\u3041-\u3096\u3099-\u309e\u3400-\u4dbf\u4e00-\u9fff\u20000-\u2a6df\u2a700-\u2b73f\u2b740-\u2b81f\u2f800-\u2fa1f][a-z0-9_\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u00ff\u0100-\u024f\u0253-\u0254\u0256-\u0257\u0300-\u036f\u1e00-\u1eff\u0400-\u04ff\u0500-\u0527\u2de0-\u2dff\ua640-\ua69f\u0591-\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05d0-\u05ea\u05f0-\u05f4\ufb12-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4f\u0610-\u061a\u0620-\u065f\u066e-\u06d3\u06d5-\u06dc\u06de-\u06e8\u06ea-\u06ef\u06fa-\u06fc\u0750-\u077f\u08a2-\u08ac\u08e4-\u08fe\ufb50-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\u200c-\u200c\u0e01-\u0e3a\u0e40-\u0e4e\u1100-\u11ff\u3130-\u3185\ua960-\ua97f\uac00-\ud7af\ud7b0-\ud7ff\uffa1-\uffdc\u30a1-\u30fa\u30fc-\u30fe\uff66-\uff9f\uff10-\uff19\uff21-\uff3a\uff41-\uff5a\u3041-\u3096\u3099-\u309e\u3400-\u4dbf\u4e00-\u9fff\u20000-\u2a6df\u2a700-\u2b73f\u2b740-\u2b81f\u2f800-\u2fa1f]*)/gi,
|
||||
' <span class="hashtag">#$1</span> ',
|
||||
)
|
||||
//Line breaks
|
||||
.replace(/\n/g, "<br/>")
|
||||
//Links
|
||||
.replace(new RegExp(`${tweet.urls.size ? "" : "noop^"}(${[...tweet.urls.keys()].map(url => `(?:${url})`).join("|")})`, "gi"), (_, url) => `<a href="${url}" class="link">${tweet.urls.get(url)}</a>`), {"&":true})
|
||||
.replace(new RegExp(`${tweet.urls.size ? "" : "noop^"}(${[...tweet.urls.keys()].map(url => `(?:${url})`).join("|")})`, "gi"), (_, url) => `<a href="${url}" class="link">${tweet.urls.get(url)}</a>`),
|
||||
{"&":true},
|
||||
)
|
||||
}))
|
||||
|
||||
//Result
|
||||
|
||||
@@ -8,9 +8,9 @@ export default async function ({ login, q, imports, data, account }, { enabled =
|
||||
|
||||
//Load inputs
|
||||
let {sections, days, limit, url, user} = imports.metadata.plugins.wakatime.inputs({data, account, q})
|
||||
if (!limit) limit = void limit
|
||||
const range =
|
||||
{
|
||||
if (!limit)
|
||||
limit = void limit
|
||||
const range = {
|
||||
"7":"last_7_days",
|
||||
"30":"last_30_days",
|
||||
"180":"last_6_months",
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
const {repo} = q
|
||||
if (!repo) {
|
||||
console.debug(`metrics/compute/${login}/${repo} > error, repo was undefined`)
|
||||
data.errors.push({error:{message:"You must pass a \"repo\" argument to use this template"}})
|
||||
data.errors.push({error:{message:'You must pass a "repo" argument to use this template'}})
|
||||
return imports.plugins.core(...arguments)
|
||||
}
|
||||
console.debug(`metrics/compute/${login}/${repo} > switching to mode ${account}`)
|
||||
|
||||
Reference in New Issue
Block a user