step 1: hardcode remaining cards, fix logged out step 2, try manually adjusting layout

This commit is contained in:
martin-mfg
2025-11-16 18:20:50 +01:00
parent 52049e1cbf
commit 2724cb4445
7 changed files with 789 additions and 11 deletions
@@ -14,6 +14,10 @@ import { default as router } from '../../backend/.vercel/output/functions/api.fu
import axios from 'axios';
import { HOST } from '../../constants';
import { DEMO_STATS_CARD } from './demoData/statsCard';
import { DEMO_TOPLANGS_CARD } from './demoData/topLangsCard';
import { DEMO_PIN_CARD } from './demoData/pinCard';
import { DEMO_GIST_CARD } from './demoData/gistCard';
import { DEMO_WAKATIME_CARD } from './demoData/wakatimeCard';
const SvgInline = (props) => {
const [svg, setSvg] = useState(null);
@@ -37,6 +41,22 @@ const SvgInline = (props) => {
status = 200;
body = DEMO_STATS_CARD;
break;
case `https://${HOST}/api/top-langs?username=anuraghazra&langs_count=4&client=wizard`:
status = 200;
body = DEMO_TOPLANGS_CARD;
break;
case `https://${HOST}/api/pin?repo=anuraghazra/github-readme-stats&client=wizard`:
status = 200;
body = DEMO_PIN_CARD;
break;
case `https://${HOST}/api/gist?id=bbfce31e0217a3689c8d961a356cb10d&client=wizard`:
status = 200;
body = DEMO_GIST_CARD;
break;
case `https://${HOST}/api/wakatime?username=ffflabs&langs_count=6&card_width=450&client=wizard`:
status = 200;
body = DEMO_WAKATIME_CARD;
break;
default:
const isAuthenticated = userId && userId.length > 0;
@@ -0,0 +1,135 @@
export const DEMO_GIST_CARD = `
<svg
width="400"
height="192"
viewBox="0 0 400 192"
fill="none"
xmlns="http://www.w3.org/2000/svg"
role="img"
aria-labelledby="descId"
>
<title id="titleId"></title>
<desc id="descId"></desc>
<style>
.header {
font: 600 18px 'Segoe UI', Ubuntu, Sans-Serif;
fill: #2f80ed;
animation: fadeInAnimation 0.8s ease-in-out forwards;
}
@supports(-moz-appearance: auto) {
/* Selector detects Firefox */
.header { font-size: 15.5px; }
}
.description { font: 400 13px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
.gray { font: 400 12px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
.icon { fill: #586069 }
/* Animations */
@keyframes scaleInAnimation {
from {
transform: translate(-5px, 5px) scale(0);
}
to {
transform: translate(-5px, 5px) scale(1);
}
}
@keyframes fadeInAnimation {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>
<rect
data-testid="card-bg"
x="0.5"
y="0.5"
rx="4.5"
height="99%"
stroke="#e4e2e2"
width="399"
fill="#fffefe"
stroke-opacity="1"
/>
<g
data-testid="card-title"
transform="translate(25, 35)"
>
<g transform="translate(0, 0)">
<svg
class="icon"
x="0"
y="-13"
viewBox="0 0 16 16"
version="1.1"
width="16"
height="16"
>
<path fill-rule="evenodd" d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v12.5A1.75 1.75 0 0 1 14.25 16H1.75A1.75 1.75 0 0 1 0 14.25Zm1.75-.25a.25.25 0 0 0-.25.25v12.5c0 .138.112.25.25.25h12.5a.25.25 0 0 0 .25-.25V1.75a.25.25 0 0 0-.25-.25Zm7.47 3.97a.75.75 0 0 1 1.06 0l2 2a.75.75 0 0 1 0 1.06l-2 2a.749.749 0 0 1-1.275-.326.749.749 0 0 1 .215-.734L10.69 8 9.22 6.53a.75.75 0 0 1 0-1.06ZM6.78 6.53 5.31 8l1.47 1.47a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215l-2-2a.75.75 0 0 1 0-1.06l2-2a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042Z" />
</svg>
</g><g transform="translate(25, 0)">
<text
x="0"
y="0"
class="header"
data-testid="header"
>countries.json</text>
</g>
</g>
<g
data-testid="main-card-body"
transform="translate(0, 55)"
>
<text class="description" x="25" y="-5">
<tspan dy="1.2em" x="25">List of countries and territories in English and Spanish:</tspan><tspan dy="1.2em" x="25">name, continent, capital, dial code, country codes, TLD,</tspan><tspan dy="1.2em" x="25">and area in sq km. Lista de pa&#237;ses y territorios en</tspan><tspan dy="1.2em" x="25">Ingl&#233;s y Espa&#241;ol: nombre, continente, capital,</tspan><tspan dy="1.2em" x="25">c&#243;digo de tel&#233;fono, c&#243;digos de pa&#237;s,</tspan><tspan dy="1.2em" x="25">dominio y &#225;rea en km cuadrados. Updated 2024</tspan>
</text>
<g transform="translate(30, 117)">
<g transform="translate(0, 0)">
<g data-testid="primary-lang">
<circle data-testid="lang-color" cx="0" cy="-5" r="6" fill="#292929" />
<text data-testid="lang-name" class="gray" x="15">JSON</text>
</g>
</g><g transform="translate(56.96875, 0)"><g transform="translate(0, 0)">
<svg
class="icon"
y="-12"
viewBox="0 0 16 16"
version="1.1"
width="16"
height="16"
>
<path fill-rule="evenodd" d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z"/>
</svg>
</g><g transform="translate(20, 0)"><text data-testid="starsCount" class="gray">41</text></g></g><g transform="translate(111.28125, 0)"><g transform="translate(0, 0)">
<svg
class="icon"
y="-12"
viewBox="0 0 16 16"
version="1.1"
width="16"
height="16"
>
<path fill-rule="evenodd" d="M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"></path>
</svg>
</g><g transform="translate(20, 0)"><text data-testid="forksCount" class="gray">14</text></g></g>
</g>
</g>
</svg>
`;
@@ -0,0 +1,155 @@
export const DEMO_PIN_CARD = `
<svg
width="400"
height="120"
viewBox="0 0 400 120"
fill="none"
xmlns="http://www.w3.org/2000/svg"
role="img"
aria-labelledby="descId"
>
<title id="titleId"></title>
<desc id="descId"></desc>
<style>
.header {
font: 600 18px 'Segoe UI', Ubuntu, Sans-Serif;
fill: #2f80ed;
animation: fadeInAnimation 0.8s ease-in-out forwards;
}
@supports(-moz-appearance: auto) {
/* Selector detects Firefox */
.header { font-size: 15.5px; }
}
.description { font: 400 13px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
.gray { font: 400 12px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
.badge { font: 600 11px 'Segoe UI', Ubuntu, Sans-Serif; }
.badge rect { opacity: 0.2 }
.stat { font: 400 12px 'Segoe UI', Ubuntu, Sans-Serif; fill: #434d58 }
.stagger {
opacity: 0;
animation: fadeInAnimation 0.3s ease-in-out forwards;
}
.not_bold { font-weight: 400 }
.bold { font-weight: 700 }
.icon {
fill: #586069;
display: block;
}
/* Animations */
@keyframes scaleInAnimation {
from {
transform: translate(-5px, 5px) scale(0);
}
to {
transform: translate(-5px, 5px) scale(1);
}
}
@keyframes fadeInAnimation {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
* { animation-duration: 0s !important; animation-delay: 0s !important; }
</style>
<rect
data-testid="card-bg"
x="0.5"
y="0.5"
rx="4.5"
height="99%"
stroke="#e4e2e2"
width="399"
fill="#fffefe"
stroke-opacity="1"
/>
<g
data-testid="card-title"
transform="translate(25, 35)"
>
<g transform="translate(0, 0)">
<svg
class="icon"
x="0"
y="-13"
viewBox="0 0 16 16"
version="1.1"
width="16"
height="16"
>
<path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"/>
</svg>
</g><g transform="translate(25, 0)">
<text
x="0"
y="0"
class="header"
data-testid="header"
>github-readme-stats</text>
</g>
</g>
<g
data-testid="main-card-body"
transform="translate(0, 55)"
>
<text class="description" x="25" y="-5">
<tspan dy="1.2em" x="25">&#9889; Dynamically generated stats for your github readmes</tspan>
</text>
<g transform="translate(30, 45)">
<g transform="translate(0, 0)">
<g data-testid="primary-lang">
<circle data-testid="lang-color" cx="0" cy="-5" r="6" fill="#f1e05a" />
<text data-testid="lang-name" class="gray" x="15">JavaScript</text>
</g>
</g><g transform="translate(80.93125, 0)"><g transform="translate(0, 0)">
<svg
class="icon"
y="-12"
viewBox="0 0 16 16"
version="1.1"
width="16"
height="16"
>
<path fill-rule="evenodd" d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z"/>
</svg>
</g><g transform="translate(20, 0)"><text data-testid="stargazers" class="gray">76.9k</text></g></g><g transform="translate(151.21875, 0)"><g transform="translate(0, 0)">
<svg
class="icon"
y="-12"
viewBox="0 0 16 16"
version="1.1"
width="16"
height="16"
>
<path fill-rule="evenodd" d="M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"></path>
</svg>
</g><g transform="translate(20, 0)"><text data-testid="forkcount" class="gray">26.8k</text></g></g>
</g>
<svg x="0" y="0"><g transform="translate(-3, 68)">
</g></svg>
</g>
</svg>
`;
@@ -0,0 +1,203 @@
export const DEMO_TOPLANGS_CARD = `
<svg
width="300"
height="245"
viewBox="0 0 300 245"
fill="none"
xmlns="http://www.w3.org/2000/svg"
role="img"
aria-labelledby="descId"
>
<title id="titleId"></title>
<desc id="descId"></desc>
<style>
.header {
font: 600 18px 'Segoe UI', Ubuntu, Sans-Serif;
fill: #2f80ed;
animation: fadeInAnimation 0.8s ease-in-out forwards;
}
@supports(-moz-appearance: auto) {
/* Selector detects Firefox */
.header { font-size: 15.5px; }
}
@keyframes slideInAnimation {
from {
width: 0;
}
to {
width: calc(100%-100px);
}
}
@keyframes growWidthAnimation {
from {
width: 0;
}
to {
width: 100%;
}
}
.stat {
font: 600 14px 'Segoe UI', Ubuntu, "Helvetica Neue", Sans-Serif; fill: #434d58;
}
@supports(-moz-appearance: auto) {
/* Selector detects Firefox */
.stat { font-size:12px; }
}
.bold { font-weight: 700 }
.lang-name {
font: 400 11px "Segoe UI", Ubuntu, Sans-Serif;
fill: #434d58;
}
.stagger {
opacity: 0;
animation: fadeInAnimation 0.3s ease-in-out forwards;
}
#rect-mask rect{
animation: slideInAnimation 1s ease-in-out forwards;
}
.lang-progress{
animation: growWidthAnimation 0.6s ease-in-out forwards;
}
/* Animations */
@keyframes scaleInAnimation {
from {
transform: translate(-5px, 5px) scale(0);
}
to {
transform: translate(-5px, 5px) scale(1);
}
}
@keyframes fadeInAnimation {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>
<rect
data-testid="card-bg"
x="0.5"
y="0.5"
rx="4.5"
height="99%"
stroke="#e4e2e2"
width="299"
fill="#fffefe"
stroke-opacity="1"
/>
<g
data-testid="card-title"
transform="translate(25, 35)"
>
<g transform="translate(0, 0)">
<text
x="0"
y="0"
class="header"
data-testid="header"
>Most Used Languages</text>
</g>
</g>
<g
data-testid="main-card-body"
transform="translate(0, 55)"
>
<svg data-testid="lang-items" x="25">
<g transform="translate(0, 0)">
<g class="stagger" style="animation-delay: 450ms">
<text data-testid="lang-name" x="2" y="15" class="lang-name">JavaScript</text>
<text x="215" y="34" class="lang-name">72.12%</text>
<svg width="205" x="0" y="25">
<rect rx="5" ry="5" x="0" y="0" width="205" height="8" fill="#ddd"></rect>
<svg data-testid="lang-progress" width="72.12085614682329%">
<rect
height="8"
fill="#f1e05a"
rx="5" ry="5" x="0" y="0"
class="lang-progress"
style="animation-delay: 750ms;"
/>
</svg>
</svg>
</g>
</g><g transform="translate(0, 40)">
<g class="stagger" style="animation-delay: 600ms">
<text data-testid="lang-name" x="2" y="15" class="lang-name">HTML</text>
<text x="215" y="34" class="lang-name">14.66%</text>
<svg width="205" x="0" y="25">
<rect rx="5" ry="5" x="0" y="0" width="205" height="8" fill="#ddd"></rect>
<svg data-testid="lang-progress" width="14.661710097224756%">
<rect
height="8"
fill="#e34c26"
rx="5" ry="5" x="0" y="0"
class="lang-progress"
style="animation-delay: 900ms;"
/>
</svg>
</svg>
</g>
</g><g transform="translate(0, 80)">
<g class="stagger" style="animation-delay: 750ms">
<text data-testid="lang-name" x="2" y="15" class="lang-name">TypeScript</text>
<text x="215" y="34" class="lang-name">9.43%</text>
<svg width="205" x="0" y="25">
<rect rx="5" ry="5" x="0" y="0" width="205" height="8" fill="#ddd"></rect>
<svg data-testid="lang-progress" width="9.42778724861599%">
<rect
height="8"
fill="#3178c6"
rx="5" ry="5" x="0" y="0"
class="lang-progress"
style="animation-delay: 1050ms;"
/>
</svg>
</svg>
</g>
</g><g transform="translate(0, 120)">
<g class="stagger" style="animation-delay: 900ms">
<text data-testid="lang-name" x="2" y="15" class="lang-name">CSS</text>
<text x="215" y="34" class="lang-name">3.79%</text>
<svg width="205" x="0" y="25">
<rect rx="5" ry="5" x="0" y="0" width="205" height="8" fill="#ddd"></rect>
<svg data-testid="lang-progress" width="3.7896465073359704%">
<rect
height="8"
fill="#663399"
rx="5" ry="5" x="0" y="0"
class="lang-progress"
style="animation-delay: 1200ms;"
/>
</svg>
</svg>
</g>
</g>
</svg>
</g>
</svg>
`;
@@ -0,0 +1,265 @@
export const DEMO_WAKATIME_CARD = `
<svg
width="450"
height="220"
viewBox="0 0 450 220"
fill="none"
xmlns="http://www.w3.org/2000/svg"
role="img"
aria-labelledby="descId"
>
<title id="titleId"></title>
<desc id="descId"></desc>
<style>
.header {
font: 600 18px 'Segoe UI', Ubuntu, Sans-Serif;
fill: #2f80ed;
animation: fadeInAnimation 0.8s ease-in-out forwards;
}
@supports(-moz-appearance: auto) {
/* Selector detects Firefox */
.header { font-size: 15.5px; }
}
.stat {
font: 600 14px 'Segoe UI', Ubuntu, "Helvetica Neue", Sans-Serif; fill: #434d58;
}
@supports(-moz-appearance: auto) {
/* Selector detects Firefox */
.stat { font-size:12px; }
}
.stagger {
opacity: 0;
animation: fadeInAnimation 0.3s ease-in-out forwards;
}
.not_bold { font-weight: 400 }
.bold { font-weight: 700 }
@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;
}
/* Animations */
@keyframes scaleInAnimation {
from {
transform: translate(-5px, 5px) scale(0);
}
to {
transform: translate(-5px, 5px) scale(1);
}
}
@keyframes fadeInAnimation {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
</style>
<rect
data-testid="card-bg"
x="0.5"
y="0.5"
rx="4.5"
height="99%"
stroke="#e4e2e2"
width="449"
fill="#fffefe"
stroke-opacity="1"
/>
<g
data-testid="card-title"
transform="translate(25, 35)"
>
<g transform="translate(0, 0)">
<text
x="0"
y="0"
class="header"
data-testid="header"
>WakaTime Stats (last year)</text>
</g>
</g>
<g
data-testid="main-card-body"
transform="translate(0, 55)"
>
<svg x="0" y="0" width="100%">
<g transform="translate(0, 0)">
<g class="stagger" style="animation-delay: 450ms" transform="translate(25, 0)">
<text class="stat bold" y="12.5" data-testid="Other">Other:</text>
<text
class="stat"
x="305"
y="12.5"
>143 hrs 35 mins</text>
<svg width="175" x="110" y="4">
<rect rx="5" ry="5" x="0" y="0" width="175" height="8" fill="#434d58"></rect>
<svg data-testid="lang-progress" width="67.3%">
<rect
height="8"
fill="#2f80ed"
rx="5" ry="5" x="0" y="0"
class="lang-progress"
style="animation-delay: 750ms;"
/>
</svg>
</svg>
</g>
</g><g transform="translate(0, 25)">
<g class="stagger" style="animation-delay: 600ms" transform="translate(25, 0)">
<text class="stat bold" y="12.5" data-testid="TypeScript">TypeScript:</text>
<text
class="stat"
x="305"
y="12.5"
>25 hrs 21 mins</text>
<svg width="175" x="110" y="4">
<rect rx="5" ry="5" x="0" y="0" width="175" height="8" fill="#434d58"></rect>
<svg data-testid="lang-progress" width="11.88%">
<rect
height="8"
fill="#2f80ed"
rx="5" ry="5" x="0" y="0"
class="lang-progress"
style="animation-delay: 900ms;"
/>
</svg>
</svg>
</g>
</g><g transform="translate(0, 50)">
<g class="stagger" style="animation-delay: 750ms" transform="translate(25, 0)">
<text class="stat bold" y="12.5" data-testid="PHP">PHP:</text>
<text
class="stat"
x="305"
y="12.5"
>18 hrs 56 mins</text>
<svg width="175" x="110" y="4">
<rect rx="5" ry="5" x="0" y="0" width="175" height="8" fill="#434d58"></rect>
<svg data-testid="lang-progress" width="8.88%">
<rect
height="8"
fill="#2f80ed"
rx="5" ry="5" x="0" y="0"
class="lang-progress"
style="animation-delay: 1050ms;"
/>
</svg>
</svg>
</g>
</g><g transform="translate(0, 75)">
<g class="stagger" style="animation-delay: 900ms" transform="translate(25, 0)">
<text class="stat bold" y="12.5" data-testid="Blade Template">Blade Template:</text>
<text
class="stat"
x="305"
y="12.5"
>10 hrs 58 mins</text>
<svg width="175" x="110" y="4">
<rect rx="5" ry="5" x="0" y="0" width="175" height="8" fill="#434d58"></rect>
<svg data-testid="lang-progress" width="5.14%">
<rect
height="8"
fill="#2f80ed"
rx="5" ry="5" x="0" y="0"
class="lang-progress"
style="animation-delay: 1200ms;"
/>
</svg>
</svg>
</g>
</g><g transform="translate(0, 100)">
<g class="stagger" style="animation-delay: 1050ms" transform="translate(25, 0)">
<text class="stat bold" y="12.5" data-testid="Vue.js">Vue.js:</text>
<text
class="stat"
x="305"
y="12.5"
>7 hrs 31 mins</text>
<svg width="175" x="110" y="4">
<rect rx="5" ry="5" x="0" y="0" width="175" height="8" fill="#434d58"></rect>
<svg data-testid="lang-progress" width="3.52%">
<rect
height="8"
fill="#2f80ed"
rx="5" ry="5" x="0" y="0"
class="lang-progress"
style="animation-delay: 1350ms;"
/>
</svg>
</svg>
</g>
</g><g transform="translate(0, 125)">
<g class="stagger" style="animation-delay: 1200ms" transform="translate(25, 0)">
<text class="stat bold" y="12.5" data-testid="JavaScript">JavaScript:</text>
<text
class="stat"
x="305"
y="12.5"
>7 hrs 28 mins</text>
<svg width="175" x="110" y="4">
<rect rx="5" ry="5" x="0" y="0" width="175" height="8" fill="#434d58"></rect>
<svg data-testid="lang-progress" width="3.51%">
<rect
height="8"
fill="#2f80ed"
rx="5" ry="5" x="0" y="0"
class="lang-progress"
style="animation-delay: 1500ms;"
/>
</svg>
</svg>
</g>
</g>
</svg>
</g>
</svg>
`;
@@ -4,7 +4,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { useDispatch, useSelector } from 'react-redux';
import { Button, Card, Image } from '../../../components';
import { Button, Image } from '../../../components';
import { classnames } from '../../../utils';
import {
GITHUB_PRIVATE_AUTH_URL,
@@ -226,9 +226,9 @@ const LoginStage = ({ setCurrItem }) => {
// Calculate arch position
// Arch center is far to the right (1500px to the right)
// Radius of the arch
const radius = 800;
const centerX = 1500;
const centerY = 300;
const radius = 40;
const centerX = 50;
const centerY = 50;
// Angle for each card (spreading them in an arch)
// Cards arranged from top-left to bottom-left
@@ -245,12 +245,12 @@ const LoginStage = ({ setCurrItem }) => {
return (
<div
key={index}
className="absolute"
// className="absolute"
style={{
left: `${x}px`,
top: `${y}px`,
left: `${x}%`,
top: `${y}%`,
transform: 'translate(-50%, -50%)',
width: '280px',
// width: '280px',
}}
>
<div
@@ -260,7 +260,7 @@ const LoginStage = ({ setCurrItem }) => {
<Image
imageSrc={card.imageSrc + card.demoCustomization}
compact={false}
extraClasses="rounded-md overflow-hidden"
extraClasses=""
/>
</div>
</div>
@@ -14,14 +14,14 @@ const SelectCardStage = ({ selectedCard, setSelectedCard, setImageSrc }) => {
{
title: 'GitHub Stats Card',
description: 'your overall GitHub statistics',
imageSrc: `?username=${userId}`,
imageSrc: `?username=${userId || 'anuraghazra'}`,
demoCustomization: '&include_all_commits=true',
cardType: 'stats',
},
{
title: 'Top Languages Card',
description: 'your most frequently used languages',
imageSrc: `/top-langs?username=${userId}`,
imageSrc: `/top-langs?username=${userId || 'anuraghazra'}`,
demoCustomization: '&langs_count=4',
cardType: 'top-langs',
},