-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10d07e6
commit ae3d1b6
Showing
3 changed files
with
280 additions
and
71 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
@import "./home.scss"; | ||
#fridge { | ||
position: relative; | ||
} | ||
|
||
.fridgeWord { | ||
--word-color: rgba(50, 50, 50, 1); | ||
line-height: 1; | ||
margin: 4px; | ||
background-color: #efefef; | ||
color: $color-text-light; | ||
padding: 0.4em; | ||
box-shadow: 3px 3px 0px 0px var(--word-color); | ||
cursor: pointer; | ||
position: relative; | ||
|
||
&.custom { | ||
position: absolute; | ||
&::before { | ||
content: " "; | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
top: 0; | ||
left: 0; | ||
animation: dynamicGlow 2s; | ||
} | ||
} | ||
} | ||
|
||
.fridgeWordHolder { | ||
display: inline-block; | ||
|
||
// iPhone jiggle animation | ||
// inspo from https://www.kirupa.com/html5/creating_the_ios_icon_jiggle_wobble_effect_in_css.htm | ||
&:nth-child(2n) .fridgeWord:hover { | ||
animation-name: jiggle1; | ||
animation-iteration-count: infinite; | ||
transform-origin: 50% 10%; | ||
animation-duration: 0.25s; | ||
animation-delay: var(--jiggle-delay); | ||
} | ||
|
||
&:nth-child(2n-1) .fridgeWord:hover { | ||
animation-name: jiggle2; | ||
animation-iteration-count: infinite; | ||
animation-direction: alternate; | ||
transform-origin: 30% 5%; | ||
animation-duration: 0.45s; | ||
animation-delay: var(--jiggle-delay); | ||
} | ||
} | ||
|
||
@keyframes jiggle1 { | ||
0% { | ||
transform: rotate(-1deg); | ||
animation-timing-function: ease-in; | ||
} | ||
|
||
50% { | ||
transform: rotate(1.5deg); | ||
animation-timing-function: ease-out; | ||
} | ||
} | ||
|
||
@keyframes jiggle2 { | ||
0% { | ||
transform: rotate(1deg); | ||
animation-timing-function: ease-in; | ||
} | ||
|
||
50% { | ||
transform: rotate(-1.5deg); | ||
animation-timing-function: ease-out; | ||
} | ||
} | ||
|
||
@keyframes dynamicGlow { | ||
0% { | ||
box-shadow: 0 0 8px 2px hsla(139, 22%, 85%, 0.2); | ||
} | ||
50% { | ||
box-shadow: 0 0 12px 3px hsla(139, 32%, 65%, 0.6), | ||
0 0 20px 5px hsla(139, 42%, 45%, 0.4), | ||
0 0 30px 8px hsla(139, 52%, 35%, 0.3); | ||
} | ||
100% { | ||
box-shadow: 0 0 8px 2px hsla(139, 22%, 85%, 0.2); | ||
} | ||
} |
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