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 missing animations #671

Merged
254 changes: 127 additions & 127 deletions src/__tests__/__snapshots__/pages.spec.js.snap

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/components/GitmojiList/Gitmoji/index.js
Expand Up @@ -18,9 +18,11 @@ const Gitmoji = (props: Props): Element<'article'> => (
}`}
>
<div
className={`${styles.card} ${props.isListMode ? styles.cardList : ''}`}
className={`${styles.card} ${
props.isListMode ? styles.cardList : ''
} gitmoji-${props.name}`}
>
<header className={`${props.name} ${styles.cardHeader}`}>
<header className={`${styles.cardHeader}`}>
<button
type="button"
className={`gitmoji-clipboard-emoji ${styles.gitmoji}`}
Expand Down
31 changes: 31 additions & 0 deletions src/components/GitmojiList/Gitmoji/styles.module.css
Expand Up @@ -86,6 +86,7 @@
}

.gitmojiCode {
position: relative;
border-radius: 4px;
transition-duration: 0.3s;
cursor: pointer;
Expand All @@ -112,3 +113,33 @@
padding-bottom: 1em;
}
}

/*
This code has been obtained from:
https://github.com/daneden/animate.css/blob/master/source/attention_seekers/bounce.css
*/
@keyframes bounce {
from,
20%,
53%,
80%,
to {
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
transform: translate3d(0, 0, 0);
}

40%,
43% {
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
transform: translate3d(0, -9px, 0);
}

70% {
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
transform: translate3d(0, -5px, 0);
}

90% {
transform: translate3d(0, -2px, 0);
}
}

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/components/GitmojiList/index.js
Expand Up @@ -58,7 +58,8 @@ const GitmojiList = (props: Props): Element<'div'> => {
<style>
{Object.entries(emojiColorsMap)
.map(
([key, color]: Object) => `.${key} { background-color: ${color} }`
([key, color]: Object) =>
`.gitmoji-${key} header, .gitmoji-${key} .gitmoji-clipboard-code::after { background-color: ${color} }`
)
.reduce((memo, value) => memo + value, '')}
</style>
Expand Down
39 changes: 12 additions & 27 deletions src/utils/theme/theme.css
Expand Up @@ -135,34 +135,19 @@ main.wrap {
}
}

/*
This code has been obtained from:
https://github.com/daneden/animate.css/blob/master/source/attention_seekers/bounce.css
*/
@keyframes bounce {
from,
20%,
53%,
80%,
to {
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
transform: translate3d(0, 0, 0);
}

40%,
43% {
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
transform: translate3d(0, -9px, 0);
}

70% {
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
transform: translate3d(0, -5px, 0);
}
.gitmoji-clipboard-code::after {
content: '';
position: absolute;
left: 0;
bottom: 0;
width: 0;
height: 0.2em;
border-radius: 4px;
transition: width 0.15s;
}

90% {
transform: translate3d(0, -2px, 0);
}
.gitmoji-clipboard-code:hover::after {
width: 100%;
}

/* Flexboxgrid critical */
Expand Down