File tree Expand file tree Collapse file tree 3 files changed +56
-6
lines changed Expand file tree Collapse file tree 3 files changed +56
-6
lines changed Original file line number Diff line number Diff line change 4949 text-transform : uppercase;
5050 letter-spacing : .1rem ;
5151 color : # ffc600 ;
52- }
52+ }
53+
54+ .rainbow-color {
55+ -webkit-animation : color-change-4x 0.8s linear alternate backwards;
56+ animation : color-change-4x 0.8s linear alternate backwards;
57+ }
58+
59+ /* ----------------------------------------------
60+ * Generated by Animista on 2018-11-14 20:52:57
61+ * w: http://animista.net, t: @cssanimista
62+ * ---------------------------------------------- */
63+
64+ /**
65+ * ----------------------------------------
66+ * animation color-change-4x
67+ * ----------------------------------------
68+ */
69+ @-webkit-keyframes color-change-4x {
70+ 0% {
71+ background : # 19dcea ;
72+ }
73+ 25% {
74+ background : # b22cff ;
75+ }
76+ 50% {
77+ background : # ea2222 ;
78+ }
79+ 75% {
80+ background : # f5be10 ;
81+ }
82+ 100% {
83+ background : transparent;
84+ }
85+ }
86+ @keyframes color-change-4x {
87+ 0% {
88+ background : # 19dcea ;
89+ }
90+ 25% {
91+ background : # b22cff ;
92+ }
93+ 50% {
94+ background : # ea2222 ;
95+ }
96+ 75% {
97+ background : # f5be10 ;
98+ }
99+ 100% {
100+ background : transparent;
101+ }
102+ }
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ handleKeyDown = e => {
1010 audio . currentTime = 0 ;
1111 audio . play ( ) ;
1212 key . classList . add ( 'playing' ) ;
13+ key . classList . add ( 'rainbow-color' ) ;
1314
1415 // listen for transionend so styles can be removed after the transition is done
15- key . addEventListener ( 'transitionend' , ( ) =>
16- key . classList . remove ( 'playing' )
17- ) ;
16+ key . addEventListener ( 'transitionend' , ( ) => key . classList . remove ( 'playing' ) ) ;
17+ key . addEventListener ( 'animationend' , ( ) => key . classList . remove ( 'rainbow-color' ) ) ;
1818 }
1919} ;
2020
21- window . addEventListener ( 'keydown' , handleKeyDown ) ;
21+ window . addEventListener ( 'keydown' , handleKeyDown ) ;
Original file line number Diff line number Diff line change 88 </ head >
99 < body >
1010 < div class ="keys ">
11- < div data-key ="a " class ="key ">
11+ < div data-key ="a " class ="key rgb-border ">
1212 < kbd > A</ kbd > < span class ="sound "> clap</ span >
1313 </ div >
1414 < div data-key ="s " class ="key ">
You can’t perform that action at this time.
0 commit comments