Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wakatime progress bars - #2434 #2519

Merged
merged 1 commit into from
Feb 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion src/cards/wakatime-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ const createTextNode = ({
// @ts-ignore
name: label,
progressBarBackgroundColor,
delay: staggerDelay + 300,
});

return `
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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;
}
`,
);

Expand Down
44 changes: 44 additions & 0 deletions tests/__snapshots__/renderWakatimeCard.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand Down