File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 53
53
position : relative;
54
54
width : 100% ;
55
55
height : 100% ;
56
- transform : translateY ( -3px ); /* account for the height of the clock hands */
56
+ transform : translate ( -3 px , -3px ); /* account for the height of the clock hands */
57
57
}
58
58
59
59
.hand {
60
60
width : 50% ;
61
61
height : 6px ;
62
62
background : black;
63
63
position : absolute;
64
- top : 50% ;
65
- transform-origin : 100% ;
66
- transform : rotate (90deg );
64
+ top : 50% ;
65
+ left : 50% ;
66
+ transform-origin : 0% ;
67
+ transform : rotate (-90deg );
67
68
transition : all 0.05s ;
68
69
transition-timing-function : cubic-bezier (0.1 , 2.7 , 0.58 , 1 );
69
70
}
78
79
const now = new Date ( ) ;
79
80
80
81
const seconds = now . getSeconds ( ) ;
81
- const secondsDegrees = ( ( seconds / 60 ) * 360 ) + 90 ;
82
+ const secondsDegrees = ( ( seconds / 60 ) * 360 ) - 90 ;
82
83
secondHand . style . transform = `rotate(${ secondsDegrees } deg)` ;
83
84
84
85
const mins = now . getMinutes ( ) ;
85
- const minsDegrees = ( ( mins / 60 ) * 360 ) + ( ( seconds / 60 ) * 6 ) + 90 ;
86
+ const minsDegrees = ( ( mins / 60 ) * 360 ) + ( ( seconds / 60 ) * 6 ) - 90 ;
86
87
minsHand . style . transform = `rotate(${ minsDegrees } deg)` ;
87
88
88
89
const hour = now . getHours ( ) ;
89
- const hourDegrees = ( ( hour / 12 ) * 360 ) + ( ( mins / 60 ) * 30 ) + 90 ;
90
+ const hourDegrees = ( ( hour / 12 ) * 360 ) + ( ( mins / 60 ) * 30 ) - 90 ;
90
91
hourHand . style . transform = `rotate(${ hourDegrees } deg)` ;
91
92
}
92
93
You can’t perform that action at this time.
0 commit comments