Compare commits

..
Author SHA1 Message Date
Zohan Subhash d0cb83cfd2 Update wakatime.js 2023-03-01 13:03:51 +05:30
Zohan Subhash 7b87177734 Update top-langs.js 2023-03-01 13:03:38 +05:30
Zohan Subhash 7e30ca6cc0 Update pin.js 2023-03-01 13:03:26 +05:30
Zohan Subhash 22a201df41 Update index.js 2023-03-01 13:02:52 +05:30
github-actions[bot]andrickstaa d60d53cdb4 refactor: update languages JSON (#2554)
Co-authored-by: rickstaa <rickstaa@users.noreply.github.com>
2023-03-01 06:47:56 +05:30
Rick Staa 252c2b419d refactor: format code (#2550) 2023-02-26 08:14:42 +05:30
Rick Staa d5fbfb4345 ci: fix a bug in the theme preview action (#2549) 2023-02-25 19:44:47 +05:30
Rick Staa 82224fa68a ci: update e2e tests (#2548) 2023-02-25 19:42:11 +05:30
Zohan Subhash 1d528da1dc Add option to deploy using other services (#2525)
* Create express.js

* Update readme.md

* Update readme.md
2023-02-25 19:34:00 +05:30
Rehman 2ab8b85ae3 fix: for issue #2534 (#2536) 2023-02-25 14:31:49 +01:00
Rick Staa a3c6f874af test: update snapshots (#2519) 2023-02-25 13:32:08 +01:00
Raphael Gonçalves 8898d013b6 Update readme.md (#2414)
fix: missing "&" in show_icons=true in Showing icons section
2023-02-25 17:32:42 +05:30
Rick Staa 91345ed55f ci: fix unsafe directory bug (#2518)
This commit fixes a bug that was introduced due to a upstream change in
the git package. See https://stackoverflow.com/questions/71849415/i-cannot-add-the-parent-directory-to-safe-directory-in-git/71904131#71904131
for more information.
2023-02-25 17:21:54 +05:30
Zohan Subhash 55a303b4a6 Add auto-labelling for documentation updates (#2526) 2023-02-25 17:20:14 +05:30
Cateline Mnemosyne f3f7a4837d fix: fix JSON themes bug. (#2544)
This fixes a JSON bug that was introduced in https://github.com/anuraghazra/github-readme-stats/pull/2507.
2023-02-25 14:25:12 +05:30
Oleksandr PerlovandZohan Subhash a6ff0fa521 Add one_dark_pro (#2507)
This colors were taken from One Dark Pro theme in VSCode extention. Please add it and I will use it in my profile

Co-authored-by: Zohan Subhash <zohan.subhash@gmail.com>
2023-02-25 12:20:00 +05:30
Mohamed Hassan 5f20e6c97a add holi_theme (#2539)
* add holi_theme

* add holi_theme
2023-02-25 12:19:30 +05:30
17 changed files with 199 additions and 185 deletions
+1
View File
@@ -1,3 +1,4 @@
themes: themes/index.js
doc-translation: docs/*
card-i18n: src/translations.js
documentation: readme.md
+4
View File
@@ -23,6 +23,10 @@ jobs:
node-version: ${{ matrix.node-version }}
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
run: |
npm ci
+2
View File
@@ -10,3 +10,5 @@ vercel_token
# IDE
.vscode
*.code-workspace
.vercel
+2
View File
@@ -46,6 +46,8 @@ export default async (req, res) => {
if (locale && !isLocaleAvailable(locale)) {
return res.send(renderError("Something went wrong", "Language not found"));
}
theme = theme.replace(/-/g, "_")
try {
const stats = await fetchStats(
+2
View File
@@ -35,6 +35,8 @@ export default async (req, res) => {
if (locale && !isLocaleAvailable(locale)) {
return res.send(renderError("Something went wrong", "Language not found"));
}
theme = theme.replace(/-/g, "_")
try {
const repoData = await fetchRepo(username, repo);
+2
View File
@@ -41,6 +41,8 @@ export default async (req, res) => {
if (locale && !isLocaleAvailable(locale)) {
return res.send(renderError("Something went wrong", "Locale not found"));
}
theme = theme.replace(/-/g, "_")
try {
const topLangs = await fetchTopLanguages(
+2
View File
@@ -38,6 +38,8 @@ export default async (req, res) => {
if (locale && !isLocaleAvailable(locale)) {
return res.send(renderError("Something went wrong", "Language not found"));
}
theme = theme.replace(/-/g, "_")
try {
const stats = await fetchWakatimeStats({ username, api_domain, range });
+15
View File
@@ -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);
+64 -170
View File
@@ -80,9 +80,6 @@ Visit <https://indiafightscorona.giveindia.org> and make a small donation to hel
# Features
- [Getting Started](#getting-started)
- [GitHub Actions](#github-actions-recommended)
- [Community Deployment](#community-deployment)
- [GitHub Stats Card](#github-stats-card)
- [GitHub Extra Pins](#github-extra-pins)
- [Top Languages Card](#top-languages-card)
@@ -95,143 +92,21 @@ Visit <https://indiafightscorona.giveindia.org> and make a small donation to hel
- [Repo Card Exclusive Options](#repo-card-exclusive-options)
- [Language Card Exclusive Options](#language-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)
# Getting Started
## GitHub Actions (Recommended)
# GitHub Stats Card
Using GitHub Actions over the community deployment is recommended because it provides more accurate stats and 100% uptime. Simply copy-paste the following into the `/.github/workflows/grs.yml` file in your README repo (`USERNAME/USERNAME`).
Copy-paste this into your markdown content, and that is it. Simple!
```yml
name: GitHub Readme Stats
on:
workflow_dispatch:
schedule:
- cron: 0 * * * *
jobs:
grs:
permissions: write-all
runs-on: ubuntu-latest
name: Generate Stats
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Generate Stats
uses: Zo-Bro-23/grs-action@v1
id: generate
with:
token: ${{ secrets.GITHUB_TOKEN }}
options: 'username=${{ github.repository_owner }}'
- name: Push
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: grs
build_dir: grs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
If you want to generate multiple stats, such as top languages, wakatime, etc, you can use the following code.
```yml
name: GitHub Readme Stats
on:
workflow_dispatch:
schedule:
- cron: 0 * * * *
jobs:
stats:
permissions: write-all
runs-on: ubuntu-latest
name: Stats Card
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Generate Stats
uses: Zo-Bro-23/grs-action@v1
id: generate
with:
token: ${{ secrets.GITHUB_TOKEN }}
options: 'username=${{ github.repository_owner }}'
- uses: actions/upload-artifact@master
with:
name: stats
path: grs
top-langs:
permissions: write-all
runs-on: ubuntu-latest
name: Top Languages Card
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Generate Top Languages
uses: Zo-Bro-23/grs-action@v1
id: generate
with:
token: ${{ secrets.GITHUB_TOKEN }}
options: 'username=${{ github.repository_owner }}'
card: 'top-langs'
- uses: actions/upload-artifact@master
with:
name: top-langs
path: grs
push:
permissions: write-all
runs-on: ubuntu-latest
name: Push
needs: [stats, top-langs]
steps:
- uses: actions/download-artifact@master
with:
name: stats
path: grs
- uses: actions/download-artifact@master
with:
name: top-langs
path: grs
- name: Push
uses: crazy-max/ghaction-github-pages@v3
with:
target_branch: grs
build_dir: grs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
You can now include the stats in your README by using the following markdown code (replace `USERNAME` with your GitHub username).
```md
[![Your GitHub stats](https://github.com/USERNAME/USERNAME/raw/grs/stats.svg)](https://github.com/anuraghazra/github-readme-stats)
```
You can also enable GitHub Pages on the `grs` branch (root) and use that URL (replace `GH_PAGES_URL` with your GitHub Pages URL).
```md
[![Your GitHub stats](https://GH_PAGES_URL/stats.svg)](https://github.com/anuraghazra/github-readme-stats)
```
The GitHub Action accepts the following inputs:
- `token` - `REQUIRED` - Your GitHub Personal Access Token (PAT), or any other token that GitHub accepts.
- `options` - `REQUIRED` - Any customization options. More below. (This is the same as the query string you would pass to the API if using the community deployment)
- `card` - The type of card to generate. `repo`, `top-langs`, or `wakatime` (leave empty for stats card).
- `path` - Output path for SVG file. Relative path; include filename with `.svg`.
- `fetch_multipage` - Experimental feature that gives more accurate stats if you have >100 repos.
## Community Deployment
Copy-paste the following markdown code. Change the `?username=` value to your GitHub username.
Change the `?username=` value to your GitHub username.
```md
[![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats)
```
Other cards can be included by using `/api/top-langs`, `/api/pin`, or `/api/wakatime`. More customization options can be added by using query parameters (`&option1=value1&option2=value2&...`).
# GitHub Stats Card
> **Note**
> Available ranks are S+ (top 1%), S (top 25%), A++ (top 45%), A+ (top 60%), and B+ (everyone). The values are calculated by using the [cumulative distribution function](https://en.wikipedia.org/wiki/Cumulative_distribution_function) using commits, contributions, issues, stars, pull requests, followers, and owned repositories. The implementation can be investigated at [src/calculateRank.js](./src/calculateRank.js).
@@ -242,7 +117,7 @@ You can pass a query parameter `&hide=` to hide any specific stats with comma-se
> Options: `&hide=stars,commits,prs,issues,contribs`
```md
?username=anuraghazra&hide=contribs,prs
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&hide=contribs,prs)
```
### Adding private contributions count to total commits count
@@ -255,15 +130,15 @@ You can add the count of all your private contributions to the total commits cou
> Options: `&count_private=true`
```md
?username=anuraghazra&count_private=true
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&count_private=true)
```
### 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
?username=anuraghazra&show_icons=true
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true)
```
### Themes
@@ -273,7 +148,7 @@ With inbuilt themes, you can customize the look of the card without doing any [m
Use `&theme=THEME_NAME` parameter like so :
```md
?username=anuraghazra&show_icons=true&theme=radical
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=radical)
```
#### All inbuilt themes
@@ -296,7 +171,7 @@ Since GitHub will re-upload the cards and serve them from their [CDN](https://do
We have included a `transparent` theme that has a transparent background. This theme is optimized to look good on GitHub's dark and light default themes. You can enable this theme using the `&theme=transparent` parameter like so:
```md
?username=anuraghazra&show_icons=true&theme=transparent
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=transparent)
```
<details>
@@ -311,7 +186,7 @@ We have included a `transparent` theme that has a transparent background. This t
You can use the `bg_color` parameter to make any of [the available themes](./themes/README.md) transparent. This is done by setting the `bg_color` to a colour with a transparent alpha channel (i.e. `bg_color=00000000`):
```md
?username=anuraghazra&show_icons=true&bg_color=00000000
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&bg_color=00000000)
```
<details>
@@ -326,8 +201,8 @@ You can use the `bg_color` parameter to make any of [the available themes](./the
You can use [GitHub's theme context](https://github.blog/changelog/2021-11-24-specify-theme-context-for-images-in-markdown/) tags to switch the theme based on the user GitHub theme automatically. This is done by appending `#gh-dark-mode-only` or `#gh-light-mode-only` to the end of an image URL. This tag will define whether the image specified in the markdown is only shown to viewers using a light or a dark GitHub theme:
```md
[![Anurag's GitHub stats-Dark](https://DARK_SVG_URL/#gh-dark-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-dark-mode-only)
[![Anurag's GitHub stats-Light](https://LIGHT_SVG_URL/#gh-light-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-light-mode-only)
[![Anurag's GitHub stats-Dark](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark#gh-dark-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-dark-mode-only)
[![Anurag's GitHub stats-Light](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=default#gh-light-mode-only)](https://github.com/anuraghazra/github-readme-stats#gh-light-mode-only)
```
<details>
@@ -345,14 +220,14 @@ You can use [GitHub's new media feature](https://github.blog/changelog/2022-05-1
```html
<picture>
<source
srcset="https://DARK_SVG_URL/"
srcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=dark"
media="(prefers-color-scheme: dark)"
/>
<source
srcset="https://LIGHT_SVG_URL/"
srcset="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true"
media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)"
/>
<img src="https://DEFAULT_SVG_URL/" />
<img src="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true" />
</picture>
```
@@ -375,7 +250,7 @@ You can use [GitHub's new media feature](https://github.blog/changelog/2022-05-1
### Customization
You can customize the appearance of your cards however you wish with these parameters.
You can customize the appearance of your `Stats Card` or `Repo Card` however you wish with URL parameters.
#### Common Options
@@ -391,7 +266,7 @@ You can customize the appearance of your cards however you wish with these param
- `border_radius` - Corner rounding on the card. Default: `4.5`.
> **Warning**
> We use caching to decrease the load on our servers (see <https://github.com/anuraghazra/github-readme-stats/issues/1471#issuecomment-1271551425>). Our cards have a default cache of 4 hours (14400 seconds). Also, note that the cache is clamped to a minimum of 4 hours and a maximum of 24 hours. This is why we recommend using our GitHub Action :)
> We use caching to decrease the load on our servers (see <https://github.com/anuraghazra/github-readme-stats/issues/1471#issuecomment-1271551425>). Our cards have a default cache of 4 hours (14400 seconds). Also, note that the cache is clamped to a minimum of 4 hours and a maximum of 24 hours.
##### Gradient in bg_color
@@ -461,7 +336,13 @@ Yay! You are no longer limited to 6 pinned repositories.
### Usage
Use the `api/pin` endpoint with the API or the `card: 'repo'` option with the GitHub Action.
Copy-paste this code into your readme and change the links.
Endpoint: `api/pin?username=anuraghazra&repo=github-readme-stats`
```md
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats)
```
### Demo
@@ -476,18 +357,24 @@ Use [show_owner](#customization) variable to include the repo's owner username
The top languages card shows a GitHub user's most frequently used top language.
> **Note**
> Top Languages does not indicate skill level or anything like that; it's a GitHub metric to determine which languages have the most code on GitHub.
> Top Languages does not indicate my skill level or anything like that; it's a GitHub metric to determine which languages have the most code on GitHub. It is a new feature of github-readme-stats.
### Usage
Use the `api/top-langs` endpoint with the API or the `card: 'top-langs'` option with the GitHub Action.
Copy-paste this code into your readme and change the links.
Endpoint: `api/top-langs?username=anuraghazra`
```md
[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats)
```
### Exclude individual repositories
You can use the `&exclude_repo=repo1,repo2` parameter to exclude individual repositories.
```md
?username=anuraghazra&exclude_repo=github-readme-stats,anuraghazra.github.io
[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&exclude_repo=github-readme-stats,anuraghazra.github.io)](https://github.com/anuraghazra/github-readme-stats)
```
### Hide individual languages
@@ -495,7 +382,7 @@ You can use the `&exclude_repo=repo1,repo2` parameter to exclude individual repo
You can use `&hide=language1,language2` parameter to hide individual languages.
```md
?username=anuraghazra&hide=javascript,html
[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&hide=javascript,html)](https://github.com/anuraghazra/github-readme-stats)
```
### Show more languages
@@ -503,7 +390,7 @@ You can use `&hide=language1,language2` parameter to hide individual languages.
You can use the `&langs_count=` option to increase or decrease the number of languages shown on the card. Valid values are integers between 1 and 10 (inclusive), and the default is 5.
```md
?username=anuraghazra&langs_count=8
[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&langs_count=8)](https://github.com/anuraghazra/github-readme-stats)
```
### Compact Language Card Layout
@@ -511,7 +398,7 @@ You can use the `&langs_count=` option to increase or decrease the number of lan
You can use the `&layout=compact` option to change the card design.
```md
?username=anuraghazra&layout=compact
[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&layout=compact)](https://github.com/anuraghazra/github-readme-stats)
```
### Hide Progress Bars
@@ -519,7 +406,7 @@ You can use the `&layout=compact` option to change the card design.
You can use the `&hide_progress=true` option to hide the percentages and the progress bars (layout will be automatically set to `compact`).
```md
?username=anuraghazra&hide_progress=true
[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&hide_progress=true)](https://github.com/anuraghazra/github-readme-stats)
```
### Demo
@@ -536,27 +423,15 @@ You can use the `&hide_progress=true` option to hide the percentages and the pro
# Wakatime Week Stats
### Usage
Use the `api/wkatime` endpoint with the API or the `card: 'wakatime'` option with the GitHub Action.
Change the `?username=` value to your [Wakatime](https://wakatime.com) username.
```md
?username=willianrod
[![willianrod's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=willianrod)](https://github.com/anuraghazra/github-readme-stats)
```
> **Note**:
> Please be aware that we currently only show data from Wakatime profiles that are public.
### Compact Wakatime Card Layout
You can use the `&layout=compact` option to change the card design.
```md
?username=willianrod&layout=compact
```
### Demo
[![willianrod's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=willianrod)](https://github.com/anuraghazra/github-readme-stats)
@@ -629,14 +504,16 @@ By default, GitHub does not lay out the cards side by side. To do that, you can
```html
<a href="https://github.com/anuraghazra/github-readme-stats">
<img align="center" src="https://SVG_URL/" />
<img align="center" src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats" />
</a>
<a href="https://github.com/anuraghazra/convoychat">
<img align="center" src="https://SVG_URL/" />
<img align="center" src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=convoychat" />
</a>
```
## Deploy 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)
@@ -673,9 +550,26 @@ Since the GitHub API only allows 5k requests per hour, my `https://github-readme
</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
You can keep your fork, and thus your private Vercel instance up to date with the upstream using GitHub's [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.
## :sparkling_heart: Support the project
+5 -4
View File
@@ -298,12 +298,13 @@ const themeNameAlreadyExists = (name) => {
return themes[name] !== undefined;
};
const DRY_RUN = process.env.DRY_RUN === "true" || false;
/**
* Main function.
*/
export const run = async (prNumber) => {
try {
const dryRun = process.env.DRY_RUN === "true" || false;
debug("Retrieve action information from context...");
debug(`Context: ${inspect(github.context)}`);
let commentBody = `
@@ -513,7 +514,7 @@ export const run = async (prNumber) => {
// Create or update theme-preview comment.
debug("Create or update theme-preview comment...");
let comment_url;
if (!dryRun) {
if (!DRY_RUN) {
comment_url = await upsertComment(octokit, {
comment_id: comment?.id,
issue_number: pullRequestId,
@@ -535,7 +536,7 @@ export const run = async (prNumber) => {
const reviewReason = themesValid
? undefined
: INVALID_REVIEW_COMMENT(comment_url);
if (!dryRun) {
if (!DRY_RUN) {
await addReview(
octokit,
pullRequestId,
@@ -558,7 +559,7 @@ export const run = async (prNumber) => {
}
} catch (error) {
debug("Set review state to `REQUEST_CHANGES` and add `invalid` label...");
if (!dryRun) {
if (!DRY_RUN) {
await addReview(
octokit,
pullRequestId,
+1 -2
View File
@@ -13,7 +13,7 @@ import {
import { langCardLocales } from "../translations.js";
const DEFAULT_CARD_WIDTH = 300;
const MIN_CARD_WIDTH = 230;
const MIN_CARD_WIDTH = 280;
const DEFAULT_LANGS_COUNT = 5;
const DEFAULT_LANG_COLOR = "#858585";
const CARD_PADDING = 25;
@@ -317,7 +317,6 @@ const renderTopLanguages = (topLangs, options = {}) => {
let finalLayout = "";
if (layout === "compact" || hide_progress == true) {
width = width + 50; // padding
height =
calculateCompactLayoutHeight(langs.length) + (hide_progress ? -25 : 0);
+25 -1
View File
@@ -118,6 +118,7 @@ const createTextNode = ({
// @ts-ignore
name: label,
progressBarBackgroundColor,
delay: staggerDelay + 300,
});
return `
@@ -276,11 +277,12 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
} else {
finalLayout = flexLayout({
items: filteredLanguages.length
? filteredLanguages.map((language) => {
? filteredLanguages.map((language, index) => {
return createTextNode({
id: language.name,
label: language.name,
value: language.text,
index: index,
percent: language.percent,
// @ts-ignore
progressBarColor: titleColor,
@@ -321,7 +323,29 @@ const renderWakatimeCard = (stats = {}, options = { hide: [] }) => {
card.setCSS(
`
${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} }
#rect-mask rect{
animation: slideInAnimation 1s ease-in-out forwards;
}
.lang-progress{
animation: growWidthAnimation 0.6s ease-in-out forwards;
}
`,
);
+10 -2
View File
@@ -79,6 +79,7 @@
"Ceylon": "#dfa535",
"Chapel": "#8dc63f",
"ChucK": "#3f8000",
"Circom": "#707575",
"Cirru": "#ccccff",
"Clarion": "#db901e",
"Clarity": "#5546ff",
@@ -116,6 +117,7 @@
"DirectX 3D File": "#aace60",
"Dockerfile": "#384d54",
"Dogescript": "#cca760",
"Dotenv": "#e5d559",
"Dylan": "#6c616e",
"E": "#ccce35",
"ECL": "#8a1267",
@@ -149,7 +151,7 @@
"Forth": "#341708",
"Fortran": "#4d41b1",
"Fortran Free Form": "#4d41b1",
"FreeBasic": "#867db1",
"FreeBasic": "#141AC9",
"FreeMarker": "#0050b2",
"Frege": "#00cafe",
"Futhark": "#5f021f",
@@ -182,6 +184,7 @@
"Go": "#00ADD8",
"Go Checksums": "#00ADD8",
"Go Module": "#00ADD8",
"Godot Resource": "#355570",
"Golo": "#88562A",
"Gosu": "#82937f",
"Grace": "#615f8b",
@@ -192,6 +195,7 @@
"Groovy": "#4298b8",
"Groovy Server Pages": "#4298b8",
"HAProxy": "#106da9",
"HCL": "#844FBA",
"HLSL": "#aace60",
"HOCON": "#9ff8ee",
"HTML": "#e34c26",
@@ -225,6 +229,7 @@
"Isabelle ROOT": "#FEFE00",
"J": "#9EEDFF",
"JAR Manifest": "#b07219",
"JCL": "#d90e09",
"JFlex": "#DBCA00",
"JSON": "#292929",
"JSON with Comments": "#292929",
@@ -247,9 +252,11 @@
"Jsonnet": "#0064bd",
"Julia": "#a270ba",
"Jupyter Notebook": "#DA5B0B",
"Just": "#384d54",
"KRL": "#28430A",
"Kaitai Struct": "#773b37",
"KakouneScript": "#6f8042",
"KerboScript": "#41adf0",
"KiCad Layout": "#2f4aab",
"KiCad Legacy Layout": "#2f4aab",
"KiCad Schematic": "#2f4aab",
@@ -362,6 +369,7 @@
"PicoLisp": "#6067af",
"PigLatin": "#fcd7de",
"Pike": "#005390",
"PlantUML": "#fbbd16",
"PogoScript": "#d80074",
"Polar": "#ae81ff",
"Portugol": "#f8bd00",
@@ -379,6 +387,7 @@
"Puppet": "#302B6D",
"PureBasic": "#5a6986",
"PureScript": "#1D222D",
"Pyret": "#ee1e10",
"Python": "#3572A5",
"Python console": "#3572A5",
"Python traceback": "#3572A5",
@@ -531,7 +540,6 @@
"fish": "#4aae47",
"hoon": "#00b171",
"jq": "#c7254e",
"just": "#384d54",
"kvlang": "#1da6e0",
"mIRC Script": "#3d57c3",
"mcfunction": "#E22837",
@@ -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 }
#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 }
#rect-mask rect{
animation: slideInAnimation 1s ease-in-out forwards;
}
.lang-progress{
animation: growWidthAnimation 0.6s ease-in-out forwards;
}
+3 -3
View File
@@ -15,14 +15,14 @@ const REPO = "curly-fiesta";
const USER = "catelinemnemosyne";
const STATS_DATA = {
name: "Cateline Mnemosyne",
totalPRs: 1,
totalCommits: 7,
totalPRs: 2,
totalCommits: 8,
totalIssues: 1,
totalStars: 1,
contributedTo: 1,
rank: {
level: "A+",
score: 50.893750297869225,
score: 50.88831151384285,
},
};
+3 -3
View File
@@ -216,7 +216,7 @@ describe("Test renderTopLanguages", () => {
);
expect(queryAllByTestId(document.body, "lang-progress")[0]).toHaveAttribute(
"width",
"120",
"100",
);
expect(queryAllByTestId(document.body, "lang-name")[1]).toHaveTextContent(
@@ -224,7 +224,7 @@ describe("Test renderTopLanguages", () => {
);
expect(queryAllByTestId(document.body, "lang-progress")[1]).toHaveAttribute(
"width",
"120",
"100",
);
expect(queryAllByTestId(document.body, "lang-name")[2]).toHaveTextContent(
@@ -232,7 +232,7 @@ describe("Test renderTopLanguages", () => {
);
expect(queryAllByTestId(document.body, "lang-progress")[2]).toHaveAttribute(
"width",
"60",
"50",
);
});
+14
View File
@@ -374,6 +374,13 @@ export const themes = {
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",
@@ -381,6 +388,13 @@ export const themes = {
border_color: "e9d8d4",
bg_color: "e9d8d4",
},
holi_theme: {
title_color: "5FABEE",
text_color: "D6E7FF",
icon_color: "5FABEE",
border_color: "85A4C0",
bg_color: "030314",
},
};
export default themes;