File tree Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change 75
75
keys . forEach ( key => {
76
76
key . addEventListener ( 'click' , function ( e ) {
77
77
var curKey = e . currentTarget . getAttribute ( 'data-key' ) ;
78
- playSoundForKey ( curKey ) ;
78
+ playSoundForKey ( cujhrKey ) ;
79
79
} ) ;
80
80
} ) ;
81
81
Original file line number Diff line number Diff line change 14
14
< div class ="hand second-hand "> </ div >
15
15
</ div >
16
16
</ div >
17
+ < div >
18
+
19
+ st ast </ div >
20
+ < script >
21
+ const secondHand = document . querySelector ( '.second-hand' ) ;
22
+ const minuteHand = document . querySelector ( '.min-hand' ) ;
23
+ const hourHand = document . querySelector ( '.hour-hand' ) ;
17
24
25
+ var transformCurrentTime = function ( ) {
26
+ let currentDate = new Date ( ) ;
27
+ const seconds = currentDate . getSeconds ( ) ;
28
+ const minutes = currentDate . getMinutes ( ) ;
29
+ const hours = currentDate . getHours ( ) - 12 ;
30
+ console . log ( seconds ) ;
31
+ secondHand . style . transform = "rotate(" + ( ( 6 * seconds ) + 90 ) + "deg)" ;
32
+ minuteHand . style . transform = "rotate(" + ( ( 6 * minutes ) + 90 ) + "deg)" ;
33
+ hourHand . style . transform = "rotate(" + ( ( 30 * hours ) + 90 ) + "deg)" ;
34
+ }
35
+ transformCurrentTime ( ) ;
36
+ window . setInterval ( transformCurrentTime , 1000 ) ;
18
37
38
+ </ script >
19
39
< style >
20
40
html {
21
41
background : # 018DED url (http://unsplash.it/1500/1000?image=881&blur=50);
61
81
background : black;
62
82
position : absolute;
63
83
top : 50% ;
84
+ transform-origin : 100% ;
85
+ transform : rotate (90deg );
64
86
}
65
87
66
88
</ style >
67
-
68
- < script >
69
-
70
-
71
- </ script >
72
89
</ body >
73
90
</ html >
You can’t perform that action at this time.
0 commit comments