-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor swing animation and extract to a component * use `transparent` skin on help button * reduce background color intensity on search box
- Loading branch information
Arijus Šukys
authored
Oct 5, 2023
1 parent
4def08d
commit bff4b82
Showing
4 changed files
with
33 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import styled, { css, keyframes } from "styled-components" | ||
import { Notification2 } from "styled-icons/remix-line" | ||
|
||
const angle = "10deg" | ||
const swingFrames = keyframes` | ||
0%, 50%, 100% { | ||
transform: rotate(0); | ||
} | ||
10%, 20%, 30% { | ||
transform: rotate(-${angle}); | ||
} | ||
15%, 25%, 40% { | ||
transform: rotate(${angle}); | ||
} | ||
` | ||
|
||
const swing = css` | ||
animation: ${swingFrames} 2s infinite ease-in-out; | ||
transform-origin: 50% 0; | ||
` | ||
|
||
export const Bell = styled(Notification2)<{ unread: boolean }>` | ||
color: ${({ theme, unread }) => theme.color[unread ? "red" : "foreground"]}; | ||
${({ unread }) => unread && swing} | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters