forked from mirrored/github-readme-stats
Compare commits
21
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f776264f37 | ||
|
|
d32acd9d23 | ||
|
|
320ad3dc95 | ||
|
|
cdf14dbbfb | ||
|
|
d60d53cdb4 | ||
|
|
252c2b419d | ||
|
|
d5fbfb4345 | ||
|
|
82224fa68a | ||
|
|
1d528da1dc | ||
|
|
2ab8b85ae3 | ||
|
|
a3c6f874af | ||
|
|
8898d013b6 | ||
|
|
91345ed55f | ||
|
|
55a303b4a6 | ||
|
|
f3f7a4837d | ||
|
|
a6ff0fa521 | ||
|
|
5f20e6c97a | ||
|
|
ba7c2f8b55 | ||
|
|
888663a477 | ||
|
|
112000667c | ||
|
|
7aa502d453 |
@@ -1,3 +1,4 @@
|
|||||||
themes: themes/index.js
|
themes: themes/index.js
|
||||||
doc-translation: docs/*
|
doc-translation: docs/*
|
||||||
card-i18n: src/translations.js
|
card-i18n: src/translations.js
|
||||||
|
documentation: readme.md
|
||||||
|
|||||||
@@ -23,6 +23,10 @@ jobs:
|
|||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
cache: npm
|
cache: npm
|
||||||
|
|
||||||
|
# Fix the unsafe repo error which was introduced by the CVE-2022-24765 git patches.
|
||||||
|
- name: Fix unsafe repo error
|
||||||
|
run: git config --global --add safe.directory ${{ github.workspace }}
|
||||||
|
|
||||||
- name: npm install, generate readme
|
- name: npm install, generate readme
|
||||||
run: |
|
run: |
|
||||||
npm ci
|
npm ci
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
name: Update supported languages
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 */30 * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
updateLanguages:
|
||||||
|
if: github.repository == 'anuraghazra/github-readme-stats'
|
||||||
|
name: Update supported languages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [16.x]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Setup Node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
cache: npm
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
|
|
||||||
|
- name: Run update-languages-json.js script
|
||||||
|
run: npm run generate-langs-json
|
||||||
|
|
||||||
|
- name: Create Pull Request if upstream language file is changed
|
||||||
|
uses: peter-evans/create-pull-request@v4
|
||||||
|
with:
|
||||||
|
commit-message: "refactor: update languages JSON"
|
||||||
|
branch: "update_langs/patch"
|
||||||
|
delete-branch: true
|
||||||
|
title: Update languages JSON
|
||||||
|
body:
|
||||||
|
"The
|
||||||
|
[update-langs](https://github.com/anuraghazra/github-readme-stats/actions/workflows/update-langs.yaml)
|
||||||
|
action found new/updated languages in the [upstream languages JSON
|
||||||
|
file](https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml)."
|
||||||
|
labels: "ci, lang-card"
|
||||||
@@ -10,3 +10,5 @@ vercel_token
|
|||||||
# IDE
|
# IDE
|
||||||
.vscode
|
.vscode
|
||||||
*.code-workspace
|
*.code-workspace
|
||||||
|
|
||||||
|
.vercel
|
||||||
|
|||||||
+5
-1
@@ -47,7 +47,11 @@ All you need to do is edit the [themes/index.js](./themes/index.js) file and add
|
|||||||
|
|
||||||
While creating the Pull request to add a new theme **don't forget to add a screenshot of how your theme looks**, you can also test how it looks using custom URL parameters like `title_color`, `icon_color`, `bg_color`, `text_color`, `border_color`
|
While creating the Pull request to add a new theme **don't forget to add a screenshot of how your theme looks**, you can also test how it looks using custom URL parameters like `title_color`, `icon_color`, `bg_color`, `text_color`, `border_color`
|
||||||
|
|
||||||
> NOTE: If you are contributing your theme just because you are using it personally, then you can [customize the looks](./readme.md#customization) of your card with URL params instead.
|
> **Note**
|
||||||
|
> If you are contributing your theme just because you are using it personally, then you can [customize the looks](./readme.md#customization) of your card with URL params instead.
|
||||||
|
|
||||||
|
> **Note**
|
||||||
|
> If your theme name contains multiple words (ie, hyphenated or underscor-ed theme names), please add two versions of theme: one with hyphens and one with underscores. This is to ensure backward-compatability with when we had hyphens for some themes and underscores for others.
|
||||||
|
|
||||||
## Any contributions you make will be under the MIT Software License
|
## Any contributions you make will be under the MIT Software License
|
||||||
|
|
||||||
|
|||||||
+11
-3
@@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { logger, request, dateDiff } from "../../src/common/utils.js";
|
import { logger, request, dateDiff } from "../../src/common/utils.js";
|
||||||
export const RATE_LIMIT_SECONDS = 60 * 10; // 1 request per 10 minutes
|
export const RATE_LIMIT_SECONDS = 60 * 5; // 1 request per 10 minutes
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple uptime check fetcher for the PATs.
|
* Simple uptime check fetcher for the PATs.
|
||||||
@@ -98,12 +98,20 @@ const getPATInfo = async (fetcher, variables) => {
|
|||||||
return Object.keys(details).filter((pat) => details[pat].status === status);
|
return Object.keys(details).filter((pat) => details[pat].status === status);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const sortedDetails = Object.keys(details)
|
||||||
|
.sort()
|
||||||
|
.reduce((obj, key) => {
|
||||||
|
obj[key] = details[key];
|
||||||
|
return obj;
|
||||||
|
}, {});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
validPATs: filterPATsByStatus("valid"),
|
validPATs: filterPATsByStatus("valid"),
|
||||||
expiredPATs: filterPATsByStatus("expired"),
|
expiredPATs: filterPATsByStatus("expired"),
|
||||||
exhaustedPATS: filterPATsByStatus("exhausted"),
|
exhaustedPATs: filterPATsByStatus("exhausted"),
|
||||||
|
suspendedPATs: filterPATsByStatus("suspended"),
|
||||||
errorPATs: filterPATsByStatus("error"),
|
errorPATs: filterPATsByStatus("error"),
|
||||||
details,
|
details: sortedDetails,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ export default async (req, res) => {
|
|||||||
border_radius,
|
border_radius,
|
||||||
border_color,
|
border_color,
|
||||||
disable_animations,
|
disable_animations,
|
||||||
|
hide_progress,
|
||||||
} = req.query;
|
} = req.query;
|
||||||
res.setHeader("Content-Type", "image/svg+xml");
|
res.setHeader("Content-Type", "image/svg+xml");
|
||||||
|
|
||||||
@@ -77,6 +78,7 @@ export default async (req, res) => {
|
|||||||
border_color,
|
border_color,
|
||||||
locale: locale ? locale.toLowerCase() : null,
|
locale: locale ? locale.toLowerCase() : null,
|
||||||
disable_animations: parseBoolean(disable_animations),
|
disable_animations: parseBoolean(disable_animations),
|
||||||
|
hide_progress: parseBoolean(hide_progress),
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
import statsCard from "./api/index.js";
|
||||||
|
import repoCard from "./api/pin.js";
|
||||||
|
import langCard from "./api/top-langs.js";
|
||||||
|
import wakatimeCard from "./api/wakatime.js";
|
||||||
|
import express from "express";
|
||||||
|
import dotenv from "dotenv";
|
||||||
|
|
||||||
|
dotenv.config();
|
||||||
|
const app = express();
|
||||||
|
app.listen(process.env.port || 9000);
|
||||||
|
|
||||||
|
app.get("/", statsCard);
|
||||||
|
app.get("/pin", repoCard);
|
||||||
|
app.get("/top-langs", langCard);
|
||||||
|
app.get("/wakatime", wakatimeCard);
|
||||||
@@ -92,7 +92,9 @@ Visit <https://indiafightscorona.giveindia.org> and make a small donation to hel
|
|||||||
- [Repo Card Exclusive Options](#repo-card-exclusive-options)
|
- [Repo Card Exclusive Options](#repo-card-exclusive-options)
|
||||||
- [Language Card Exclusive Options](#language-card-exclusive-options)
|
- [Language Card Exclusive Options](#language-card-exclusive-options)
|
||||||
- [Wakatime Card Exclusive Option](#wakatime-card-exclusive-options)
|
- [Wakatime Card Exclusive Option](#wakatime-card-exclusive-options)
|
||||||
- [Deploy Yourself](#deploy-on-your-own-vercel-instance)
|
- [Deploy Yourself](#deploy-on-your-own)
|
||||||
|
- [On Vercel](#on-vercel)
|
||||||
|
- [On other platforms](#on-other-platforms)
|
||||||
- [Keep your fork up to date](#keep-your-fork-up-to-date)
|
- [Keep your fork up to date](#keep-your-fork-up-to-date)
|
||||||
|
|
||||||
# GitHub Stats Card
|
# GitHub Stats Card
|
||||||
@@ -133,7 +135,7 @@ You can add the count of all your private contributions to the total commits cou
|
|||||||
|
|
||||||
### Showing icons
|
### Showing icons
|
||||||
|
|
||||||
To enable icons, you can pass `show_icons=true` in the query param, like so:
|
To enable icons, you can pass `&show_icons=true` in the query param, like so:
|
||||||
|
|
||||||
```md
|
```md
|
||||||

|

|
||||||
@@ -305,6 +307,7 @@ You can provide multiple comma-separated values in the bg_color option to render
|
|||||||
- `exclude_repo` - Exclude specified repositories _(Comma-separated values)_. Default: `[] (blank array)`.
|
- `exclude_repo` - Exclude specified repositories _(Comma-separated values)_. Default: `[] (blank array)`.
|
||||||
- `custom_title` - Sets a custom title for the card _(string)_. Default `Most Used Languages`.
|
- `custom_title` - Sets a custom title for the card _(string)_. Default `Most Used Languages`.
|
||||||
- `disable_animations` - Disables all animations in the card _(boolean)_. Default: `false`.
|
- `disable_animations` - Disables all animations in the card _(boolean)_. Default: `false`.
|
||||||
|
- `hide_progress` - It uses the compact layout option, hides percentages, and removes the bars. Default: `false`.
|
||||||
|
|
||||||
> **Warning**
|
> **Warning**
|
||||||
> Language names should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding)
|
> Language names should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding)
|
||||||
@@ -398,6 +401,14 @@ You can use the `&layout=compact` option to change the card design.
|
|||||||
[](https://github.com/anuraghazra/github-readme-stats)
|
[](https://github.com/anuraghazra/github-readme-stats)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Hide Progress Bars
|
||||||
|
|
||||||
|
You can use the `&hide_progress=true` option to hide the percentages and the progress bars (layout will be automatically set to `compact`).
|
||||||
|
|
||||||
|
```md
|
||||||
|
[](https://github.com/anuraghazra/github-readme-stats)
|
||||||
|
```
|
||||||
|
|
||||||
### Demo
|
### Demo
|
||||||
|
|
||||||
[](https://github.com/anuraghazra/github-readme-stats)
|
[](https://github.com/anuraghazra/github-readme-stats)
|
||||||
@@ -406,6 +417,10 @@ You can use the `&layout=compact` option to change the card design.
|
|||||||
|
|
||||||
[](https://github.com/anuraghazra/github-readme-stats)
|
[](https://github.com/anuraghazra/github-readme-stats)
|
||||||
|
|
||||||
|
- Hidden progress bars
|
||||||
|
|
||||||
|
[](https://github.com/anuraghazra/github-readme-stats)
|
||||||
|
|
||||||
# Wakatime Week Stats
|
# Wakatime Week Stats
|
||||||
|
|
||||||
Change the `?username=` value to your [Wakatime](https://wakatime.com) username.
|
Change the `?username=` value to your [Wakatime](https://wakatime.com) username.
|
||||||
@@ -496,7 +511,9 @@ By default, GitHub does not lay out the cards side by side. To do that, you can
|
|||||||
</a>
|
</a>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Deploy on your own Vercel instance
|
## Deploy on your own
|
||||||
|
|
||||||
|
### On Vercel
|
||||||
|
|
||||||
#### :film_projector: [Check Out Step By Step Video Tutorial By @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)
|
#### :film_projector: [Check Out Step By Step Video Tutorial By @codeSTACKr](https://youtu.be/n6d4KHSKqGk?t=107)
|
||||||
|
|
||||||
@@ -533,6 +550,23 @@ Since the GitHub API only allows 5k requests per hour, my `https://github-readme
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
### On other platforms
|
||||||
|
|
||||||
|
> **Warning**
|
||||||
|
> This way of using GRS is not officially supported and was added to cater to some particular use cases where Vercel could not be used (e.g. #2341). The support for this method, therefore, is limited.
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><b>:hammer_and_wrench: Step-by-step guide for deploying on other platforms</b></summary>
|
||||||
|
|
||||||
|
1. Fork or clone this repo as per your needs
|
||||||
|
2. Add `express` to the dependencies section of `package.json`
|
||||||
|
https://github.com/anuraghazra/github-readme-stats/blob/ba7c2f8b55eac8452e479c8bd38b044d204d0424/package.json#L54-L61
|
||||||
|
3. Run `npm i` if needed (initial setup)
|
||||||
|
4. Run `node express.js` to start the server, or set the entry point to `express.js` in `package.json` if you're deploying on a managed service
|
||||||
|
https://github.com/anuraghazra/github-readme-stats/blob/ba7c2f8b55eac8452e479c8bd38b044d204d0424/package.json#L11
|
||||||
|
5. You're done 🎉
|
||||||
|
</details>
|
||||||
|
|
||||||
### Keep your fork up to date
|
### Keep your fork up to date
|
||||||
|
|
||||||
You can keep your fork, and thus your private Vercel instance up to date with the upstream using GitHubs' [Sync Fork button](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork). You can also use the [pull](https://github.com/wei/pull) package created by [@wei](https://github.com/wei) to automate this process.
|
You can keep your fork, and thus your private Vercel instance up to date with the upstream using GitHubs' [Sync Fork button](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork). You can also use the [pull](https://github.com/wei/pull) package created by [@wei](https://github.com/wei) to automate this process.
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ const createStatMdLink = (theme) => {
|
|||||||
const generateLinks = (fn) => {
|
const generateLinks = (fn) => {
|
||||||
return Object.keys(themes)
|
return Object.keys(themes)
|
||||||
.map((name) => fn(name))
|
.map((name) => fn(name))
|
||||||
|
.filter((name) => !name.includes('-'))
|
||||||
.join("");
|
.join("");
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -67,7 +68,7 @@ const generateTable = ({ isRepoCard }) => {
|
|||||||
const rows = [];
|
const rows = [];
|
||||||
const themesFiltered = Object.keys(themes).filter(
|
const themesFiltered = Object.keys(themes).filter(
|
||||||
(name) => name !== (!isRepoCard ? "default_repocard" : "default"),
|
(name) => name !== (!isRepoCard ? "default_repocard" : "default"),
|
||||||
);
|
).filter((name) => !name.includes('-'));
|
||||||
|
|
||||||
for (let i = 0; i < themesFiltered.length; i += 3) {
|
for (let i = 0; i < themesFiltered.length; i += 3) {
|
||||||
const one = themesFiltered[i];
|
const one = themesFiltered[i];
|
||||||
|
|||||||
@@ -298,12 +298,13 @@ const themeNameAlreadyExists = (name) => {
|
|||||||
return themes[name] !== undefined;
|
return themes[name] !== undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const DRY_RUN = process.env.DRY_RUN === "true" || false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main function.
|
* Main function.
|
||||||
*/
|
*/
|
||||||
export const run = async (prNumber) => {
|
export const run = async (prNumber) => {
|
||||||
try {
|
try {
|
||||||
const dryRun = process.env.DRY_RUN === "true" || false;
|
|
||||||
debug("Retrieve action information from context...");
|
debug("Retrieve action information from context...");
|
||||||
debug(`Context: ${inspect(github.context)}`);
|
debug(`Context: ${inspect(github.context)}`);
|
||||||
let commentBody = `
|
let commentBody = `
|
||||||
@@ -513,7 +514,7 @@ export const run = async (prNumber) => {
|
|||||||
// Create or update theme-preview comment.
|
// Create or update theme-preview comment.
|
||||||
debug("Create or update theme-preview comment...");
|
debug("Create or update theme-preview comment...");
|
||||||
let comment_url;
|
let comment_url;
|
||||||
if (!dryRun) {
|
if (!DRY_RUN) {
|
||||||
comment_url = await upsertComment(octokit, {
|
comment_url = await upsertComment(octokit, {
|
||||||
comment_id: comment?.id,
|
comment_id: comment?.id,
|
||||||
issue_number: pullRequestId,
|
issue_number: pullRequestId,
|
||||||
@@ -535,7 +536,7 @@ export const run = async (prNumber) => {
|
|||||||
const reviewReason = themesValid
|
const reviewReason = themesValid
|
||||||
? undefined
|
? undefined
|
||||||
: INVALID_REVIEW_COMMENT(comment_url);
|
: INVALID_REVIEW_COMMENT(comment_url);
|
||||||
if (!dryRun) {
|
if (!DRY_RUN) {
|
||||||
await addReview(
|
await addReview(
|
||||||
octokit,
|
octokit,
|
||||||
pullRequestId,
|
pullRequestId,
|
||||||
@@ -558,7 +559,7 @@ export const run = async (prNumber) => {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
debug("Set review state to `REQUEST_CHANGES` and add `invalid` label...");
|
debug("Set review state to `REQUEST_CHANGES` and add `invalid` label...");
|
||||||
if (!dryRun) {
|
if (!DRY_RUN) {
|
||||||
await addReview(
|
await addReview(
|
||||||
octokit,
|
octokit,
|
||||||
pullRequestId,
|
pullRequestId,
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
import { langCardLocales } from "../translations.js";
|
import { langCardLocales } from "../translations.js";
|
||||||
|
|
||||||
const DEFAULT_CARD_WIDTH = 300;
|
const DEFAULT_CARD_WIDTH = 300;
|
||||||
const MIN_CARD_WIDTH = 230;
|
const MIN_CARD_WIDTH = 280;
|
||||||
const DEFAULT_LANGS_COUNT = 5;
|
const DEFAULT_LANGS_COUNT = 5;
|
||||||
const DEFAULT_LANG_COLOR = "#858585";
|
const DEFAULT_LANG_COLOR = "#858585";
|
||||||
const CARD_PADDING = 25;
|
const CARD_PADDING = 25;
|
||||||
@@ -76,10 +76,11 @@ const createProgressTextNode = ({ width, color, name, progress, index }) => {
|
|||||||
* @param {object} props Function properties.
|
* @param {object} props Function properties.
|
||||||
* @param {Lang} props.lang Programming language object.
|
* @param {Lang} props.lang Programming language object.
|
||||||
* @param {number} props.totalSize Total size of all languages.
|
* @param {number} props.totalSize Total size of all languages.
|
||||||
|
* @param {boolean} props.hideProgress Whether to hide percentage.
|
||||||
* @param {number} props.index Index of the programming language.
|
* @param {number} props.index Index of the programming language.
|
||||||
* @returns {string} Compact layout programming language SVG node.
|
* @returns {string} Compact layout programming language SVG node.
|
||||||
*/
|
*/
|
||||||
const createCompactLangNode = ({ lang, totalSize, index }) => {
|
const createCompactLangNode = ({ lang, totalSize, hideProgress, index }) => {
|
||||||
const percentage = ((lang.size / totalSize) * 100).toFixed(2);
|
const percentage = ((lang.size / totalSize) * 100).toFixed(2);
|
||||||
const staggerDelay = (index + 3) * 150;
|
const staggerDelay = (index + 3) * 150;
|
||||||
const color = lang.color || "#858585";
|
const color = lang.color || "#858585";
|
||||||
@@ -88,7 +89,7 @@ const createCompactLangNode = ({ lang, totalSize, index }) => {
|
|||||||
<g class="stagger" style="animation-delay: ${staggerDelay}ms">
|
<g class="stagger" style="animation-delay: ${staggerDelay}ms">
|
||||||
<circle cx="5" cy="6" r="5" fill="${color}" />
|
<circle cx="5" cy="6" r="5" fill="${color}" />
|
||||||
<text data-testid="lang-name" x="15" y="10" class='lang-name'>
|
<text data-testid="lang-name" x="15" y="10" class='lang-name'>
|
||||||
${lang.name} ${percentage}%
|
${lang.name} ${hideProgress ? "" : percentage + "%"}
|
||||||
</text>
|
</text>
|
||||||
</g>
|
</g>
|
||||||
`;
|
`;
|
||||||
@@ -100,9 +101,10 @@ const createCompactLangNode = ({ lang, totalSize, index }) => {
|
|||||||
* @param {object[]} props Function properties.
|
* @param {object[]} props Function properties.
|
||||||
* @param {Lang[]} props.langs Array of programming languages.
|
* @param {Lang[]} props.langs Array of programming languages.
|
||||||
* @param {number} props.totalSize Total size of all languages.
|
* @param {number} props.totalSize Total size of all languages.
|
||||||
|
* @param {boolean} props.hideProgress Whether to hide percentage.
|
||||||
* @returns {string} Programming languages SVG node.
|
* @returns {string} Programming languages SVG node.
|
||||||
*/
|
*/
|
||||||
const createLanguageTextNode = ({ langs, totalSize }) => {
|
const createLanguageTextNode = ({ langs, totalSize, hideProgress }) => {
|
||||||
const longestLang = getLongestLang(langs);
|
const longestLang = getLongestLang(langs);
|
||||||
const chunked = chunkArray(langs, langs.length / 2);
|
const chunked = chunkArray(langs, langs.length / 2);
|
||||||
const layouts = chunked.map((array) => {
|
const layouts = chunked.map((array) => {
|
||||||
@@ -111,6 +113,7 @@ const createLanguageTextNode = ({ langs, totalSize }) => {
|
|||||||
createCompactLangNode({
|
createCompactLangNode({
|
||||||
lang,
|
lang,
|
||||||
totalSize,
|
totalSize,
|
||||||
|
hideProgress,
|
||||||
index,
|
index,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@@ -160,9 +163,10 @@ const renderNormalLayout = (langs, width, totalLanguageSize) => {
|
|||||||
* @param {Lang[]} langs Array of programming languages.
|
* @param {Lang[]} langs Array of programming languages.
|
||||||
* @param {number} width Card width.
|
* @param {number} width Card width.
|
||||||
* @param {number} totalLanguageSize Total size of all languages.
|
* @param {number} totalLanguageSize Total size of all languages.
|
||||||
|
* @param {boolean} hideProgress Whether to hide progress bar.
|
||||||
* @returns {string} Compact layout card SVG object.
|
* @returns {string} Compact layout card SVG object.
|
||||||
*/
|
*/
|
||||||
const renderCompactLayout = (langs, width, totalLanguageSize) => {
|
const renderCompactLayout = (langs, width, totalLanguageSize, hideProgress) => {
|
||||||
const paddingRight = 50;
|
const paddingRight = 50;
|
||||||
const offsetWidth = width - paddingRight;
|
const offsetWidth = width - paddingRight;
|
||||||
// progressOffset holds the previous language's width and used to offset the next language
|
// progressOffset holds the previous language's width and used to offset the next language
|
||||||
@@ -193,15 +197,21 @@ const renderCompactLayout = (langs, width, totalLanguageSize) => {
|
|||||||
.join("");
|
.join("");
|
||||||
|
|
||||||
return `
|
return `
|
||||||
<mask id="rect-mask">
|
${
|
||||||
|
!hideProgress
|
||||||
|
? `
|
||||||
|
<mask id="rect-mask">
|
||||||
<rect x="0" y="0" width="${offsetWidth}" height="8" fill="white" rx="5"/>
|
<rect x="0" y="0" width="${offsetWidth}" height="8" fill="white" rx="5"/>
|
||||||
</mask>
|
</mask>
|
||||||
${compactProgressBar}
|
${compactProgressBar}
|
||||||
|
`
|
||||||
<g transform="translate(0, 25)">
|
: ""
|
||||||
|
}
|
||||||
|
<g transform="translate(0, ${hideProgress ? "0" : "25"})">
|
||||||
${createLanguageTextNode({
|
${createLanguageTextNode({
|
||||||
langs,
|
langs,
|
||||||
totalSize: totalLanguageSize,
|
totalSize: totalLanguageSize,
|
||||||
|
hideProgress: hideProgress,
|
||||||
})}
|
})}
|
||||||
</g>
|
</g>
|
||||||
`;
|
`;
|
||||||
@@ -276,6 +286,7 @@ const renderTopLanguages = (topLangs, options = {}) => {
|
|||||||
text_color,
|
text_color,
|
||||||
bg_color,
|
bg_color,
|
||||||
hide,
|
hide,
|
||||||
|
hide_progress,
|
||||||
theme,
|
theme,
|
||||||
layout,
|
layout,
|
||||||
custom_title,
|
custom_title,
|
||||||
@@ -305,11 +316,16 @@ const renderTopLanguages = (topLangs, options = {}) => {
|
|||||||
let height = calculateNormalLayoutHeight(langs.length);
|
let height = calculateNormalLayoutHeight(langs.length);
|
||||||
|
|
||||||
let finalLayout = "";
|
let finalLayout = "";
|
||||||
if (layout === "compact") {
|
if (layout === "compact" || hide_progress == true) {
|
||||||
width = width + 50; // padding
|
height =
|
||||||
height = calculateCompactLayoutHeight(langs.length);
|
calculateCompactLayoutHeight(langs.length) + (hide_progress ? -25 : 0);
|
||||||
|
|
||||||
finalLayout = renderCompactLayout(langs, width, totalLanguageSize);
|
finalLayout = renderCompactLayout(
|
||||||
|
langs,
|
||||||
|
width,
|
||||||
|
totalLanguageSize,
|
||||||
|
hide_progress,
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
finalLayout = renderNormalLayout(langs, width, totalLanguageSize);
|
finalLayout = renderNormalLayout(langs, width, totalLanguageSize);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
@@ -38,6 +38,7 @@ export type TopLangOptions = CommonOptions & {
|
|||||||
custom_title: string;
|
custom_title: string;
|
||||||
langs_count: number;
|
langs_count: number;
|
||||||
disable_animations: boolean;
|
disable_animations: boolean;
|
||||||
|
hide_progress: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type WakaTimeOptions = CommonOptions & {
|
type WakaTimeOptions = CommonOptions & {
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ const createTextNode = ({
|
|||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
name: label,
|
name: label,
|
||||||
progressBarBackgroundColor,
|
progressBarBackgroundColor,
|
||||||
|
delay: staggerDelay + 300,
|
||||||
});
|
});
|
||||||
|
|
||||||
return `
|
return `
|
||||||
@@ -276,11 +277,12 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
|
|||||||
} else {
|
} else {
|
||||||
finalLayout = flexLayout({
|
finalLayout = flexLayout({
|
||||||
items: filteredLanguages.length
|
items: filteredLanguages.length
|
||||||
? filteredLanguages.map((language) => {
|
? filteredLanguages.map((language, index) => {
|
||||||
return createTextNode({
|
return createTextNode({
|
||||||
id: language.name,
|
id: language.name,
|
||||||
label: language.name,
|
label: language.name,
|
||||||
value: language.text,
|
value: language.text,
|
||||||
|
index: index,
|
||||||
percent: language.percent,
|
percent: language.percent,
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
progressBarColor: titleColor,
|
progressBarColor: titleColor,
|
||||||
@@ -321,7 +323,29 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
|
|||||||
card.setCSS(
|
card.setCSS(
|
||||||
`
|
`
|
||||||
${cssStyles}
|
${cssStyles}
|
||||||
|
@keyframes slideInAnimation {
|
||||||
|
from {
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
width: calc(100%-100px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes growWidthAnimation {
|
||||||
|
from {
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: ${textColor} }
|
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: ${textColor} }
|
||||||
|
#rect-mask rect{
|
||||||
|
animation: slideInAnimation 1s ease-in-out forwards;
|
||||||
|
}
|
||||||
|
.lang-progress{
|
||||||
|
animation: growWidthAnimation 0.6s ease-in-out forwards;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,7 @@
|
|||||||
"Ceylon": "#dfa535",
|
"Ceylon": "#dfa535",
|
||||||
"Chapel": "#8dc63f",
|
"Chapel": "#8dc63f",
|
||||||
"ChucK": "#3f8000",
|
"ChucK": "#3f8000",
|
||||||
|
"Circom": "#707575",
|
||||||
"Cirru": "#ccccff",
|
"Cirru": "#ccccff",
|
||||||
"Clarion": "#db901e",
|
"Clarion": "#db901e",
|
||||||
"Clarity": "#5546ff",
|
"Clarity": "#5546ff",
|
||||||
@@ -102,6 +103,7 @@
|
|||||||
"Csound Score": "#1a1a1a",
|
"Csound Score": "#1a1a1a",
|
||||||
"Cuda": "#3A4E3A",
|
"Cuda": "#3A4E3A",
|
||||||
"Curry": "#531242",
|
"Curry": "#531242",
|
||||||
|
"Cypher": "#34c0eb",
|
||||||
"Cython": "#fedf5b",
|
"Cython": "#fedf5b",
|
||||||
"D": "#ba595e",
|
"D": "#ba595e",
|
||||||
"DM": "#447265",
|
"DM": "#447265",
|
||||||
@@ -115,6 +117,7 @@
|
|||||||
"DirectX 3D File": "#aace60",
|
"DirectX 3D File": "#aace60",
|
||||||
"Dockerfile": "#384d54",
|
"Dockerfile": "#384d54",
|
||||||
"Dogescript": "#cca760",
|
"Dogescript": "#cca760",
|
||||||
|
"Dotenv": "#e5d559",
|
||||||
"Dylan": "#6c616e",
|
"Dylan": "#6c616e",
|
||||||
"E": "#ccce35",
|
"E": "#ccce35",
|
||||||
"ECL": "#8a1267",
|
"ECL": "#8a1267",
|
||||||
@@ -124,6 +127,7 @@
|
|||||||
"Earthly": "#2af0ff",
|
"Earthly": "#2af0ff",
|
||||||
"Easybuild": "#069406",
|
"Easybuild": "#069406",
|
||||||
"Ecere Projects": "#913960",
|
"Ecere Projects": "#913960",
|
||||||
|
"Ecmarkup": "#eb8131",
|
||||||
"EditorConfig": "#fff1f2",
|
"EditorConfig": "#fff1f2",
|
||||||
"Eiffel": "#4d6977",
|
"Eiffel": "#4d6977",
|
||||||
"Elixir": "#6e4a7e",
|
"Elixir": "#6e4a7e",
|
||||||
@@ -147,7 +151,7 @@
|
|||||||
"Forth": "#341708",
|
"Forth": "#341708",
|
||||||
"Fortran": "#4d41b1",
|
"Fortran": "#4d41b1",
|
||||||
"Fortran Free Form": "#4d41b1",
|
"Fortran Free Form": "#4d41b1",
|
||||||
"FreeBasic": "#867db1",
|
"FreeBasic": "#141AC9",
|
||||||
"FreeMarker": "#0050b2",
|
"FreeMarker": "#0050b2",
|
||||||
"Frege": "#00cafe",
|
"Frege": "#00cafe",
|
||||||
"Futhark": "#5f021f",
|
"Futhark": "#5f021f",
|
||||||
@@ -180,6 +184,7 @@
|
|||||||
"Go": "#00ADD8",
|
"Go": "#00ADD8",
|
||||||
"Go Checksums": "#00ADD8",
|
"Go Checksums": "#00ADD8",
|
||||||
"Go Module": "#00ADD8",
|
"Go Module": "#00ADD8",
|
||||||
|
"Godot Resource": "#355570",
|
||||||
"Golo": "#88562A",
|
"Golo": "#88562A",
|
||||||
"Gosu": "#82937f",
|
"Gosu": "#82937f",
|
||||||
"Grace": "#615f8b",
|
"Grace": "#615f8b",
|
||||||
@@ -190,6 +195,7 @@
|
|||||||
"Groovy": "#4298b8",
|
"Groovy": "#4298b8",
|
||||||
"Groovy Server Pages": "#4298b8",
|
"Groovy Server Pages": "#4298b8",
|
||||||
"HAProxy": "#106da9",
|
"HAProxy": "#106da9",
|
||||||
|
"HCL": "#844FBA",
|
||||||
"HLSL": "#aace60",
|
"HLSL": "#aace60",
|
||||||
"HOCON": "#9ff8ee",
|
"HOCON": "#9ff8ee",
|
||||||
"HTML": "#e34c26",
|
"HTML": "#e34c26",
|
||||||
@@ -215,6 +221,7 @@
|
|||||||
"Idris": "#b30000",
|
"Idris": "#b30000",
|
||||||
"Ignore List": "#000000",
|
"Ignore List": "#000000",
|
||||||
"ImageJ Macro": "#99AAFF",
|
"ImageJ Macro": "#99AAFF",
|
||||||
|
"Imba": "#16cec6",
|
||||||
"Inno Setup": "#264b99",
|
"Inno Setup": "#264b99",
|
||||||
"Io": "#a9188d",
|
"Io": "#a9188d",
|
||||||
"Ioke": "#078193",
|
"Ioke": "#078193",
|
||||||
@@ -222,6 +229,7 @@
|
|||||||
"Isabelle ROOT": "#FEFE00",
|
"Isabelle ROOT": "#FEFE00",
|
||||||
"J": "#9EEDFF",
|
"J": "#9EEDFF",
|
||||||
"JAR Manifest": "#b07219",
|
"JAR Manifest": "#b07219",
|
||||||
|
"JCL": "#d90e09",
|
||||||
"JFlex": "#DBCA00",
|
"JFlex": "#DBCA00",
|
||||||
"JSON": "#292929",
|
"JSON": "#292929",
|
||||||
"JSON with Comments": "#292929",
|
"JSON with Comments": "#292929",
|
||||||
@@ -244,9 +252,11 @@
|
|||||||
"Jsonnet": "#0064bd",
|
"Jsonnet": "#0064bd",
|
||||||
"Julia": "#a270ba",
|
"Julia": "#a270ba",
|
||||||
"Jupyter Notebook": "#DA5B0B",
|
"Jupyter Notebook": "#DA5B0B",
|
||||||
|
"Just": "#384d54",
|
||||||
"KRL": "#28430A",
|
"KRL": "#28430A",
|
||||||
"Kaitai Struct": "#773b37",
|
"Kaitai Struct": "#773b37",
|
||||||
"KakouneScript": "#6f8042",
|
"KakouneScript": "#6f8042",
|
||||||
|
"KerboScript": "#41adf0",
|
||||||
"KiCad Layout": "#2f4aab",
|
"KiCad Layout": "#2f4aab",
|
||||||
"KiCad Legacy Layout": "#2f4aab",
|
"KiCad Legacy Layout": "#2f4aab",
|
||||||
"KiCad Schematic": "#2f4aab",
|
"KiCad Schematic": "#2f4aab",
|
||||||
@@ -286,6 +296,7 @@
|
|||||||
"Mathematica": "#dd1100",
|
"Mathematica": "#dd1100",
|
||||||
"Max": "#c4a79c",
|
"Max": "#c4a79c",
|
||||||
"Mercury": "#ff2b2b",
|
"Mercury": "#ff2b2b",
|
||||||
|
"Mermaid": "#ff3670",
|
||||||
"Meson": "#007800",
|
"Meson": "#007800",
|
||||||
"Metal": "#8f14e9",
|
"Metal": "#8f14e9",
|
||||||
"MiniYAML": "#ff1111",
|
"MiniYAML": "#ff1111",
|
||||||
@@ -318,6 +329,10 @@
|
|||||||
"Nu": "#c9df40",
|
"Nu": "#c9df40",
|
||||||
"NumPy": "#9C8AF9",
|
"NumPy": "#9C8AF9",
|
||||||
"Nunjucks": "#3d8137",
|
"Nunjucks": "#3d8137",
|
||||||
|
"OASv2-json": "#85ea2d",
|
||||||
|
"OASv2-yaml": "#85ea2d",
|
||||||
|
"OASv3-json": "#85ea2d",
|
||||||
|
"OASv3-yaml": "#85ea2d",
|
||||||
"OCaml": "#3be133",
|
"OCaml": "#3be133",
|
||||||
"ObjectScript": "#424893",
|
"ObjectScript": "#424893",
|
||||||
"Objective-C": "#438eff",
|
"Objective-C": "#438eff",
|
||||||
@@ -327,14 +342,18 @@
|
|||||||
"Omgrofl": "#cabbff",
|
"Omgrofl": "#cabbff",
|
||||||
"Opal": "#f7ede0",
|
"Opal": "#f7ede0",
|
||||||
"Open Policy Agent": "#7d9199",
|
"Open Policy Agent": "#7d9199",
|
||||||
|
"OpenAPI Specification v2": "#85ea2d",
|
||||||
|
"OpenAPI Specification v3": "#85ea2d",
|
||||||
"OpenCL": "#ed2e2d",
|
"OpenCL": "#ed2e2d",
|
||||||
"OpenEdge ABL": "#5ce600",
|
"OpenEdge ABL": "#5ce600",
|
||||||
"OpenQASM": "#AA70FF",
|
"OpenQASM": "#AA70FF",
|
||||||
"OpenSCAD": "#e5cd45",
|
"OpenSCAD": "#e5cd45",
|
||||||
|
"Option List": "#476732",
|
||||||
"Org": "#77aa99",
|
"Org": "#77aa99",
|
||||||
"Oxygene": "#cdd0e3",
|
"Oxygene": "#cdd0e3",
|
||||||
"Oz": "#fab738",
|
"Oz": "#fab738",
|
||||||
"P4": "#7055b5",
|
"P4": "#7055b5",
|
||||||
|
"PDDL": "#0d00ff",
|
||||||
"PEG.js": "#234d6b",
|
"PEG.js": "#234d6b",
|
||||||
"PHP": "#4F5D95",
|
"PHP": "#4F5D95",
|
||||||
"PLSQL": "#dad8d8",
|
"PLSQL": "#dad8d8",
|
||||||
@@ -350,7 +369,9 @@
|
|||||||
"PicoLisp": "#6067af",
|
"PicoLisp": "#6067af",
|
||||||
"PigLatin": "#fcd7de",
|
"PigLatin": "#fcd7de",
|
||||||
"Pike": "#005390",
|
"Pike": "#005390",
|
||||||
|
"PlantUML": "#fbbd16",
|
||||||
"PogoScript": "#d80074",
|
"PogoScript": "#d80074",
|
||||||
|
"Polar": "#ae81ff",
|
||||||
"Portugol": "#f8bd00",
|
"Portugol": "#f8bd00",
|
||||||
"PostCSS": "#dc3a0c",
|
"PostCSS": "#dc3a0c",
|
||||||
"PostScript": "#da291c",
|
"PostScript": "#da291c",
|
||||||
@@ -366,6 +387,7 @@
|
|||||||
"Puppet": "#302B6D",
|
"Puppet": "#302B6D",
|
||||||
"PureBasic": "#5a6986",
|
"PureBasic": "#5a6986",
|
||||||
"PureScript": "#1D222D",
|
"PureScript": "#1D222D",
|
||||||
|
"Pyret": "#ee1e10",
|
||||||
"Python": "#3572A5",
|
"Python": "#3572A5",
|
||||||
"Python console": "#3572A5",
|
"Python console": "#3572A5",
|
||||||
"Python traceback": "#3572A5",
|
"Python traceback": "#3572A5",
|
||||||
@@ -414,6 +436,7 @@
|
|||||||
"Sass": "#a53b70",
|
"Sass": "#a53b70",
|
||||||
"Scala": "#c22d40",
|
"Scala": "#c22d40",
|
||||||
"Scaml": "#bd181a",
|
"Scaml": "#bd181a",
|
||||||
|
"Scenic": "#fdc700",
|
||||||
"Scheme": "#1e4aec",
|
"Scheme": "#1e4aec",
|
||||||
"Scilab": "#ca0f21",
|
"Scilab": "#ca0f21",
|
||||||
"Self": "#0579aa",
|
"Self": "#0579aa",
|
||||||
@@ -421,6 +444,7 @@
|
|||||||
"Shell": "#89e051",
|
"Shell": "#89e051",
|
||||||
"ShellCheck Config": "#cecfcb",
|
"ShellCheck Config": "#cecfcb",
|
||||||
"Shen": "#120F14",
|
"Shen": "#120F14",
|
||||||
|
"Simple File Verification": "#C9BFED",
|
||||||
"Singularity": "#64E6AD",
|
"Singularity": "#64E6AD",
|
||||||
"Slash": "#007eff",
|
"Slash": "#007eff",
|
||||||
"Slice": "#003fa2",
|
"Slice": "#003fa2",
|
||||||
@@ -428,6 +452,7 @@
|
|||||||
"SmPL": "#c94949",
|
"SmPL": "#c94949",
|
||||||
"Smalltalk": "#596706",
|
"Smalltalk": "#596706",
|
||||||
"Smarty": "#f0c040",
|
"Smarty": "#f0c040",
|
||||||
|
"Smithy": "#c44536",
|
||||||
"Solidity": "#AA6746",
|
"Solidity": "#AA6746",
|
||||||
"SourcePawn": "#f69e1d",
|
"SourcePawn": "#f69e1d",
|
||||||
"Squirrel": "#800000",
|
"Squirrel": "#800000",
|
||||||
@@ -478,6 +503,7 @@
|
|||||||
"Vim Script": "#199f4b",
|
"Vim Script": "#199f4b",
|
||||||
"Vim Snippet": "#199f4b",
|
"Vim Snippet": "#199f4b",
|
||||||
"Visual Basic .NET": "#945db7",
|
"Visual Basic .NET": "#945db7",
|
||||||
|
"Visual Basic 6.0": "#2c6353",
|
||||||
"Volt": "#1F1F1F",
|
"Volt": "#1F1F1F",
|
||||||
"Vue": "#41b883",
|
"Vue": "#41b883",
|
||||||
"Vyper": "#2980b9",
|
"Vyper": "#2980b9",
|
||||||
|
|||||||
@@ -69,7 +69,29 @@ exports[`Test Render Wakatime Card should render correctly with compact layout 1
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@keyframes slideInAnimation {
|
||||||
|
from {
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
width: calc(100%-100px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes growWidthAnimation {
|
||||||
|
from {
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
|
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
|
||||||
|
#rect-mask rect{
|
||||||
|
animation: slideInAnimation 1s ease-in-out forwards;
|
||||||
|
}
|
||||||
|
.lang-progress{
|
||||||
|
animation: growWidthAnimation 0.6s ease-in-out forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -227,7 +249,29 @@ exports[`Test Render Wakatime Card should render correctly with compact layout w
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@keyframes slideInAnimation {
|
||||||
|
from {
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
width: calc(100%-100px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@keyframes growWidthAnimation {
|
||||||
|
from {
|
||||||
|
width: 0;
|
||||||
|
}
|
||||||
|
to {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
|
.lang-name { font: 400 11px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
|
||||||
|
#rect-mask rect{
|
||||||
|
animation: slideInAnimation 1s ease-in-out forwards;
|
||||||
|
}
|
||||||
|
.lang-progress{
|
||||||
|
animation: growWidthAnimation 0.6s ease-in-out forwards;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,14 +15,14 @@ const REPO = "curly-fiesta";
|
|||||||
const USER = "catelinemnemosyne";
|
const USER = "catelinemnemosyne";
|
||||||
const STATS_DATA = {
|
const STATS_DATA = {
|
||||||
name: "Cateline Mnemosyne",
|
name: "Cateline Mnemosyne",
|
||||||
totalPRs: 1,
|
totalPRs: 2,
|
||||||
totalCommits: 7,
|
totalCommits: 8,
|
||||||
totalIssues: 1,
|
totalIssues: 1,
|
||||||
totalStars: 1,
|
totalStars: 1,
|
||||||
contributedTo: 1,
|
contributedTo: 1,
|
||||||
rank: {
|
rank: {
|
||||||
level: "A+",
|
level: "A+",
|
||||||
score: 50.893750297869225,
|
score: 50.88831151384285,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -88,7 +88,8 @@ describe("Test /api/status/pat-info", () => {
|
|||||||
{
|
{
|
||||||
validPATs: ["PAT_2", "PAT_3", "PAT_4"],
|
validPATs: ["PAT_2", "PAT_3", "PAT_4"],
|
||||||
expiredPATs: [],
|
expiredPATs: [],
|
||||||
exhaustedPATS: ["PAT_1"],
|
exhaustedPATs: ["PAT_1"],
|
||||||
|
suspendedPATs: [],
|
||||||
errorPATs: [],
|
errorPATs: [],
|
||||||
details: {
|
details: {
|
||||||
PAT_1: {
|
PAT_1: {
|
||||||
@@ -132,7 +133,8 @@ describe("Test /api/status/pat-info", () => {
|
|||||||
{
|
{
|
||||||
validPATs: ["PAT_2", "PAT_3", "PAT_4"],
|
validPATs: ["PAT_2", "PAT_3", "PAT_4"],
|
||||||
expiredPATs: [],
|
expiredPATs: [],
|
||||||
exhaustedPATS: [],
|
exhaustedPATs: [],
|
||||||
|
suspendedPATs: [],
|
||||||
errorPATs: ["PAT_1"],
|
errorPATs: ["PAT_1"],
|
||||||
details: {
|
details: {
|
||||||
PAT_1: {
|
PAT_1: {
|
||||||
@@ -178,7 +180,8 @@ describe("Test /api/status/pat-info", () => {
|
|||||||
{
|
{
|
||||||
validPATs: ["PAT_2", "PAT_3", "PAT_4"],
|
validPATs: ["PAT_2", "PAT_3", "PAT_4"],
|
||||||
expiredPATs: ["PAT_1"],
|
expiredPATs: ["PAT_1"],
|
||||||
exhaustedPATS: [],
|
exhaustedPATs: [],
|
||||||
|
suspendedPATs: [],
|
||||||
errorPATs: [],
|
errorPATs: [],
|
||||||
details: {
|
details: {
|
||||||
PAT_1: {
|
PAT_1: {
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ describe("Test renderTopLanguages", () => {
|
|||||||
);
|
);
|
||||||
expect(queryAllByTestId(document.body, "lang-progress")[0]).toHaveAttribute(
|
expect(queryAllByTestId(document.body, "lang-progress")[0]).toHaveAttribute(
|
||||||
"width",
|
"width",
|
||||||
"120",
|
"100",
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(queryAllByTestId(document.body, "lang-name")[1]).toHaveTextContent(
|
expect(queryAllByTestId(document.body, "lang-name")[1]).toHaveTextContent(
|
||||||
@@ -224,7 +224,7 @@ describe("Test renderTopLanguages", () => {
|
|||||||
);
|
);
|
||||||
expect(queryAllByTestId(document.body, "lang-progress")[1]).toHaveAttribute(
|
expect(queryAllByTestId(document.body, "lang-progress")[1]).toHaveAttribute(
|
||||||
"width",
|
"width",
|
||||||
"120",
|
"100",
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(queryAllByTestId(document.body, "lang-name")[2]).toHaveTextContent(
|
expect(queryAllByTestId(document.body, "lang-name")[2]).toHaveTextContent(
|
||||||
@@ -232,7 +232,7 @@ describe("Test renderTopLanguages", () => {
|
|||||||
);
|
);
|
||||||
expect(queryAllByTestId(document.body, "lang-progress")[2]).toHaveAttribute(
|
expect(queryAllByTestId(document.body, "lang-progress")[2]).toHaveAttribute(
|
||||||
"width",
|
"width",
|
||||||
"60",
|
"50",
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+174
@@ -12,6 +12,12 @@ export const themes = {
|
|||||||
text_color: "434d58",
|
text_color: "434d58",
|
||||||
bg_color: "fffefe",
|
bg_color: "fffefe",
|
||||||
},
|
},
|
||||||
|
"default-repocard": {
|
||||||
|
title_color: "2f80ed",
|
||||||
|
icon_color: "586069", // icon color is different
|
||||||
|
text_color: "434d58",
|
||||||
|
bg_color: "fffefe",
|
||||||
|
},
|
||||||
transparent: {
|
transparent: {
|
||||||
title_color: "006AFF",
|
title_color: "006AFF",
|
||||||
icon_color: "0579C3",
|
icon_color: "0579C3",
|
||||||
@@ -48,6 +54,12 @@ export const themes = {
|
|||||||
text_color: "427b58",
|
text_color: "427b58",
|
||||||
bg_color: "fbf1c7",
|
bg_color: "fbf1c7",
|
||||||
},
|
},
|
||||||
|
"gruvbox-light": {
|
||||||
|
title_color: "b57614",
|
||||||
|
icon_color: "af3a03",
|
||||||
|
text_color: "427b58",
|
||||||
|
bg_color: "fbf1c7",
|
||||||
|
},
|
||||||
tokyonight: {
|
tokyonight: {
|
||||||
title_color: "70a5fd",
|
title_color: "70a5fd",
|
||||||
icon_color: "bf91f3",
|
icon_color: "bf91f3",
|
||||||
@@ -108,12 +120,24 @@ export const themes = {
|
|||||||
text_color: "fffefe",
|
text_color: "fffefe",
|
||||||
bg_color: "273849",
|
bg_color: "273849",
|
||||||
},
|
},
|
||||||
|
vue_dark: {
|
||||||
|
title_color: "41b883",
|
||||||
|
icon_color: "41b883",
|
||||||
|
text_color: "fffefe",
|
||||||
|
bg_color: "273849",
|
||||||
|
},
|
||||||
"shades-of-purple": {
|
"shades-of-purple": {
|
||||||
title_color: "fad000",
|
title_color: "fad000",
|
||||||
icon_color: "b362ff",
|
icon_color: "b362ff",
|
||||||
text_color: "a599e9",
|
text_color: "a599e9",
|
||||||
bg_color: "2d2b55",
|
bg_color: "2d2b55",
|
||||||
},
|
},
|
||||||
|
shades_of_purple: {
|
||||||
|
title_color: "fad000",
|
||||||
|
icon_color: "b362ff",
|
||||||
|
text_color: "a599e9",
|
||||||
|
bg_color: "2d2b55",
|
||||||
|
},
|
||||||
nightowl: {
|
nightowl: {
|
||||||
title_color: "c792ea",
|
title_color: "c792ea",
|
||||||
icon_color: "ffeb95",
|
icon_color: "ffeb95",
|
||||||
@@ -132,6 +156,12 @@ export const themes = {
|
|||||||
text_color: "0cf574",
|
text_color: "0cf574",
|
||||||
bg_color: "040f0f",
|
bg_color: "040f0f",
|
||||||
},
|
},
|
||||||
|
blue_green: {
|
||||||
|
title_color: "2f97c1",
|
||||||
|
icon_color: "f5b700",
|
||||||
|
text_color: "0cf574",
|
||||||
|
bg_color: "040f0f",
|
||||||
|
},
|
||||||
algolia: {
|
algolia: {
|
||||||
title_color: "00AEFF",
|
title_color: "00AEFF",
|
||||||
icon_color: "2DDE98",
|
icon_color: "2DDE98",
|
||||||
@@ -144,6 +174,12 @@ export const themes = {
|
|||||||
text_color: "ffd95b",
|
text_color: "ffd95b",
|
||||||
bg_color: "000000",
|
bg_color: "000000",
|
||||||
},
|
},
|
||||||
|
great_gatsby: {
|
||||||
|
title_color: "ffa726",
|
||||||
|
icon_color: "ffb74d",
|
||||||
|
text_color: "ffd95b",
|
||||||
|
bg_color: "000000",
|
||||||
|
},
|
||||||
darcula: {
|
darcula: {
|
||||||
title_color: "BA5F17",
|
title_color: "BA5F17",
|
||||||
icon_color: "84628F",
|
icon_color: "84628F",
|
||||||
@@ -174,6 +210,24 @@ export const themes = {
|
|||||||
text_color: "fff",
|
text_color: "fff",
|
||||||
bg_color: "000",
|
bg_color: "000",
|
||||||
},
|
},
|
||||||
|
solarized_dark: {
|
||||||
|
title_color: "268bd2",
|
||||||
|
icon_color: "b58900",
|
||||||
|
text_color: "859900",
|
||||||
|
bg_color: "002b36",
|
||||||
|
},
|
||||||
|
solarized_light: {
|
||||||
|
title_color: "268bd2",
|
||||||
|
icon_color: "b58900",
|
||||||
|
text_color: "859900",
|
||||||
|
bg_color: "fdf6e3",
|
||||||
|
},
|
||||||
|
chartreuse_dark: {
|
||||||
|
title_color: "7fff00",
|
||||||
|
icon_color: "00AEFF",
|
||||||
|
text_color: "fff",
|
||||||
|
bg_color: "000",
|
||||||
|
},
|
||||||
nord: {
|
nord: {
|
||||||
title_color: "81a1c1",
|
title_color: "81a1c1",
|
||||||
text_color: "d8dee9",
|
text_color: "d8dee9",
|
||||||
@@ -192,6 +246,12 @@ export const themes = {
|
|||||||
text_color: "a6accd",
|
text_color: "a6accd",
|
||||||
bg_color: "292d3e",
|
bg_color: "292d3e",
|
||||||
},
|
},
|
||||||
|
material_palenight: {
|
||||||
|
title_color: "c792ea",
|
||||||
|
icon_color: "89ddff",
|
||||||
|
text_color: "a6accd",
|
||||||
|
bg_color: "292d3e",
|
||||||
|
},
|
||||||
graywhite: {
|
graywhite: {
|
||||||
title_color: "24292e",
|
title_color: "24292e",
|
||||||
icon_color: "24292e",
|
icon_color: "24292e",
|
||||||
@@ -216,6 +276,24 @@ export const themes = {
|
|||||||
text_color: "ffffff",
|
text_color: "ffffff",
|
||||||
bg_color: "000000",
|
bg_color: "000000",
|
||||||
},
|
},
|
||||||
|
vision_friendly_dark: {
|
||||||
|
title_color: "ffb000",
|
||||||
|
icon_color: "785ef0",
|
||||||
|
text_color: "ffffff",
|
||||||
|
bg_color: "000000",
|
||||||
|
},
|
||||||
|
ayu_mirage: {
|
||||||
|
title_color: "f4cd7c",
|
||||||
|
icon_color: "73d0ff",
|
||||||
|
text_color: "c7c8c2",
|
||||||
|
bg_color: "1f2430",
|
||||||
|
},
|
||||||
|
midnight_purple: {
|
||||||
|
title_color: "9745f5",
|
||||||
|
icon_color: "9f4bff",
|
||||||
|
text_color: "ffffff",
|
||||||
|
bg_color: "000000",
|
||||||
|
},
|
||||||
calm: {
|
calm: {
|
||||||
title_color: "e07a5f",
|
title_color: "e07a5f",
|
||||||
icon_color: "edae49",
|
icon_color: "edae49",
|
||||||
@@ -228,6 +306,12 @@ export const themes = {
|
|||||||
text_color: "509E2F",
|
text_color: "509E2F",
|
||||||
bg_color: "ffffff",
|
bg_color: "ffffff",
|
||||||
},
|
},
|
||||||
|
flag_india: {
|
||||||
|
title_color: "ff8f1c",
|
||||||
|
icon_color: "250E62",
|
||||||
|
text_color: "509E2F",
|
||||||
|
bg_color: "ffffff",
|
||||||
|
},
|
||||||
omni: {
|
omni: {
|
||||||
title_color: "FF79C6",
|
title_color: "FF79C6",
|
||||||
icon_color: "e7de79",
|
icon_color: "e7de79",
|
||||||
@@ -276,6 +360,12 @@ export const themes = {
|
|||||||
text_color: "d9c8a9",
|
text_color: "d9c8a9",
|
||||||
bg_color: "402b23",
|
bg_color: "402b23",
|
||||||
},
|
},
|
||||||
|
"kacho-ga": {
|
||||||
|
title_color: "bf4a3f",
|
||||||
|
icon_color: "a64833",
|
||||||
|
text_color: "d9c8a9",
|
||||||
|
bg_color: "402b23",
|
||||||
|
},
|
||||||
outrun: {
|
outrun: {
|
||||||
title_color: "ffcc00",
|
title_color: "ffcc00",
|
||||||
icon_color: "ff1aff",
|
icon_color: "ff1aff",
|
||||||
@@ -294,6 +384,18 @@ export const themes = {
|
|||||||
text_color: "718CA1",
|
text_color: "718CA1",
|
||||||
bg_color: "1D252C",
|
bg_color: "1D252C",
|
||||||
},
|
},
|
||||||
|
"ocean-dark": {
|
||||||
|
title_color: "8957B2",
|
||||||
|
icon_color: "FFFFFF",
|
||||||
|
text_color: "92D534",
|
||||||
|
bg_color: "151A28",
|
||||||
|
},
|
||||||
|
"city-lights": {
|
||||||
|
title_color: "5D8CB3",
|
||||||
|
icon_color: "4798FF",
|
||||||
|
text_color: "718CA1",
|
||||||
|
bg_color: "1D252C",
|
||||||
|
},
|
||||||
github_dark: {
|
github_dark: {
|
||||||
title_color: "58A6FF",
|
title_color: "58A6FF",
|
||||||
icon_color: "1F6FEB",
|
icon_color: "1F6FEB",
|
||||||
@@ -312,6 +414,24 @@ export const themes = {
|
|||||||
text_color: "dbdbdb",
|
text_color: "dbdbdb",
|
||||||
bg_color: "252334",
|
bg_color: "252334",
|
||||||
},
|
},
|
||||||
|
"github-dark": {
|
||||||
|
title_color: "58A6FF",
|
||||||
|
icon_color: "1F6FEB",
|
||||||
|
text_color: "C3D1D9",
|
||||||
|
bg_color: "0D1117",
|
||||||
|
},
|
||||||
|
"discord-old-blurple": {
|
||||||
|
title_color: "7289DA",
|
||||||
|
icon_color: "7289DA",
|
||||||
|
text_color: "FFFFFF",
|
||||||
|
bg_color: "2C2F33",
|
||||||
|
},
|
||||||
|
"aura-dark": {
|
||||||
|
title_color: "ff7372",
|
||||||
|
icon_color: "6cffd0",
|
||||||
|
text_color: "dbdbdb",
|
||||||
|
bg_color: "252334",
|
||||||
|
},
|
||||||
panda: {
|
panda: {
|
||||||
title_color: "19f9d899",
|
title_color: "19f9d899",
|
||||||
icon_color: "19f9d899",
|
icon_color: "19f9d899",
|
||||||
@@ -324,6 +444,12 @@ export const themes = {
|
|||||||
text_color: "c5cdd3",
|
text_color: "c5cdd3",
|
||||||
bg_color: "1b2932",
|
bg_color: "1b2932",
|
||||||
},
|
},
|
||||||
|
"noctis-minimus": {
|
||||||
|
title_color: "d3b692",
|
||||||
|
icon_color: "72b7c0",
|
||||||
|
text_color: "c5cdd3",
|
||||||
|
bg_color: "1b2932",
|
||||||
|
},
|
||||||
cobalt2: {
|
cobalt2: {
|
||||||
title_color: "ffc600",
|
title_color: "ffc600",
|
||||||
icon_color: "ffffff",
|
icon_color: "ffffff",
|
||||||
@@ -374,6 +500,54 @@ export const themes = {
|
|||||||
border_color: "170F0C",
|
border_color: "170F0C",
|
||||||
bg_color: "170F0C",
|
bg_color: "170F0C",
|
||||||
},
|
},
|
||||||
|
one_dark_pro: {
|
||||||
|
title_color: "61AFEF",
|
||||||
|
text_color: "E5C06E",
|
||||||
|
icon_color: "C678DD",
|
||||||
|
border_color: "3B4048",
|
||||||
|
bg_color: "23272E",
|
||||||
|
},
|
||||||
|
"rose-pine": {
|
||||||
|
title_color: "9ccfd8",
|
||||||
|
icon_color: "ebbcba",
|
||||||
|
text_color: "e0def4",
|
||||||
|
bg_color: "191724",
|
||||||
|
},
|
||||||
|
"date-night": {
|
||||||
|
title_color: "DA7885",
|
||||||
|
text_color: "E1B2A2",
|
||||||
|
icon_color: "BB8470",
|
||||||
|
border_color: "170F0C",
|
||||||
|
bg_color: "170F0C",
|
||||||
|
},
|
||||||
|
"one-dark-pro": {
|
||||||
|
title_color: "61AFEF",
|
||||||
|
text_color: "E5C06E",
|
||||||
|
icon_color: "C678DD",
|
||||||
|
border_color: "3B4048",
|
||||||
|
bg_color: "23272E",
|
||||||
|
},
|
||||||
|
rose: {
|
||||||
|
title_color: "8d192b",
|
||||||
|
text_color: "862931",
|
||||||
|
icon_color: "B71F36",
|
||||||
|
border_color: "e9d8d4",
|
||||||
|
bg_color: "e9d8d4",
|
||||||
|
},
|
||||||
|
holi_theme: {
|
||||||
|
title_color: "5FABEE",
|
||||||
|
text_color: "D6E7FF",
|
||||||
|
icon_color: "5FABEE",
|
||||||
|
border_color: "85A4C0",
|
||||||
|
bg_color: "030314",
|
||||||
|
},
|
||||||
|
"holi-theme": {
|
||||||
|
title_color: "5FABEE",
|
||||||
|
text_color: "D6E7FF",
|
||||||
|
icon_color: "5FABEE",
|
||||||
|
border_color: "85A4C0",
|
||||||
|
bg_color: "030314",
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export default themes;
|
export default themes;
|
||||||
|
|||||||
Reference in New Issue
Block a user