Skip to content

Commit f91b4a2

Browse files
committed
fix issue #56 #55
1 parent f55e0ab commit f91b4a2

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Diff for: 02 - JS + CSS Clock/index-SOYAINE.html

+6-7
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@
5353
position: relative;
5454
width: 100%;
5555
height: 100%;
56-
transform: translateY(-3px); /* account for the height of the clock hands */
56+
/* transform: translateY(-3px); /* account for the height of the clock hands */
57+
/* canceled according to https://github.com/soyaine/JavaScript30/issues/55 */
5758
}
5859

5960
.hand {
@@ -87,8 +88,6 @@
8788
0 0 0 2px rgba(0,0,0,0.1),
8889
0 0 10px rgba(0,0,0,0.2);
8990
transform: translate(-50%, -50%);
90-
/*transition: all .05s;*/
91-
9291
}
9392

9493
.hour-hand {
@@ -104,15 +103,15 @@
104103
width: 45%;
105104
height:5px;
106105
margin-top: -2.5px;
107-
transition: all .1s;
106+
transition: all .1s cubic-bezier(0.9, 0.54, 0.26, 1.68);
108107
}
109108

110109
.second-hand {
111110
height: 2px;
112111
margin-top: -1px;
113112
border-bottom-left-radius: 100%;
114113
border-top-left-radius: 100%;
115-
transition: all .05s;
114+
transition: all .05s cubic-bezier(0.9, 0.54, 0.26, 1.68);
116115
background-color: red;
117116
}
118117

@@ -141,10 +140,10 @@
141140
// 解决指针跳顿问题【第一种方法】
142141
// 在发生跳顿的角度值处,将 CSS 的 `transition` 属性去掉
143142
if (secondDeg === 90) secHand.style.transition = 'all 0s';
144-
else secHand.style.transition = 'all 0.05s';
143+
else secHand.style.transition = 'all 0.05s cubic-bezier(0.9, 0.54, 0.26, 1.68)';
145144

146145
if (minDeg === 90) minHand.style.transition = 'all 0s';
147-
else minHand.style.transition = 'all 0.1s';
146+
else minHand.style.transition = 'all 0.1s cubic-bezier(0.9, 0.54, 0.26, 1.68)';
148147

149148
// 时针间距过大不做处理
150149
// if (hourDeg === 116.5) hourHand.style.transition = 'all 0s';

0 commit comments

Comments
 (0)