Skip to content

Commit 5a486b1

Browse files
committed
update: add some transition and animation
1 parent 1dc83b9 commit 5a486b1

File tree

5 files changed

+85
-26
lines changed

5 files changed

+85
-26
lines changed

blog.css

+40-14
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
min-width: 375px;
6565
}
6666

67-
.logo {
67+
& .logo {
6868
width: auto;
6969
display: block;
7070

@@ -85,8 +85,13 @@
8585
}
8686
}
8787
}
88+
& a:hover {
89+
transition: all 0.3s ease;
90+
transform: scale(1.5);
91+
cursor: pointer;
92+
}
8893

89-
.nav-links {
94+
& .nav-links {
9095
display: flex;
9196
justify-content: center;
9297
align-items: center;
@@ -96,7 +101,7 @@
96101
flex-wrap: wrap;
97102
}
98103

99-
li {
104+
& li {
100105
font-size: 20px;
101106
line-height: 30px;
102107
padding-left: 50px;
@@ -114,13 +119,18 @@
114119
padding-block: 12px;
115120
}
116121

117-
a {
122+
& a {
118123
display: flex;
119124
align-items: center;
120125
justify-content: center;
121126
text-decoration: none;
122127
color: inherit;
123128
}
129+
& a:hover {
130+
transition: all 0.3s ease;
131+
transform: scale(1.5);
132+
cursor: pointer;
133+
}
124134
}
125135
}
126136
}
@@ -167,17 +177,31 @@
167177
line-height: 30px;
168178
margin-right: 48px;
169179
}
180+
& a:hover {
181+
transition: all 0.3s ease;
182+
transform: scale(1.5);
183+
cursor: pointer;
184+
}
170185
}
171186
}
172187

173188
& .icon-search {
174189
width: 40px;
175190
height: 40px;
176191
overflow: hidden;
177-
& img {
178-
width: 100%;
179-
height: 100%;
180-
display: block;
192+
193+
& a {
194+
& img {
195+
width: 100%;
196+
height: 100%;
197+
display: block;
198+
}
199+
}
200+
201+
& a:hover img {
202+
transition: all 0.3s ease;
203+
transform: scale(1.5);
204+
cursor: pointer;
181205
}
182206
}
183207
}
@@ -225,9 +249,11 @@
225249
gap: 60px;
226250

227251
& .card {
252+
width: 100%;
228253
display: flex;
229254
justify-content: space-between;
230255
gap: 24px;
256+
position: relative;
231257

232258
@media (max-width: 651px) {
233259
flex-direction: column;
@@ -342,18 +368,18 @@
342368
}
343369
}
344370
& .more:hover {
345-
animation: bounceScale 0.8s ease; /* 觸發動畫 */
371+
/* 觸發動畫 */
372+
animation-name: bounceScale;
373+
animation-duration: 0.8s;
374+
animation-timing-function: ease;
346375
}
347376

348377
@keyframes bounceScale {
349378
0% {
350-
transform: translateY(0);
351-
}
352-
50% {
353-
transform: translateY(-50px); /* 上移 50 px */
379+
transform: scale(1);
354380
}
355381
100% {
356-
transform: translateY(0); /* 落回原地,下移 50 px*/
382+
transform: scale(1.5);
357383
}
358384
}
359385
/* more END */

blog.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</li>
4545
</ul>
4646
<div class="icon-search">
47-
<img src="./img-blog/blog-search.png" alt="search">
47+
<a href="#"><img src="./img-blog/blog-search.png" alt="search"></a>
4848
</div>
4949
</nav>
5050
<!-- 頭部導航 END -->

blogPage.css

+31-8
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
min-width: 375px;
6262
}
6363

64-
.logo {
64+
& .logo {
6565
width: auto;
6666
display: block;
6767

@@ -82,8 +82,13 @@
8282
}
8383
}
8484
}
85+
& a:hover {
86+
transition: all 0.3s ease;
87+
transform: scale(1.5);
88+
cursor: pointer;
89+
}
8590

86-
.nav-links {
91+
& .nav-links {
8792
display: flex;
8893
justify-content: center;
8994
align-items: center;
@@ -93,7 +98,7 @@
9398
flex-wrap: wrap;
9499
}
95100

96-
li {
101+
& li {
97102
font-size: 20px;
98103
line-height: 30px;
99104
padding-left: 50px;
@@ -111,13 +116,18 @@
111116
padding-block: 12px;
112117
}
113118

114-
a {
119+
& a {
115120
display: flex;
116121
align-items: center;
117122
justify-content: center;
118123
text-decoration: none;
119124
color: inherit;
120125
}
126+
& a:hover {
127+
transition: all 0.3s ease;
128+
transform: scale(1.5);
129+
cursor: pointer;
130+
}
121131
}
122132
}
123133
}
@@ -188,6 +198,12 @@
188198
line-height: 24px;
189199
}
190200
}
201+
202+
& a:hover {
203+
transition: all 0.3s ease;
204+
transform: scale(1.3);
205+
cursor: pointer;
206+
}
191207
}
192208
}
193209

@@ -200,10 +216,17 @@
200216
display: none;
201217
}
202218

203-
& img {
204-
width: 100%;
205-
height: 100%;
206-
display: block;
219+
& a {
220+
& img {
221+
width: 100%;
222+
height: 100%;
223+
display: block;
224+
}
225+
}
226+
& a:hover img {
227+
transition: all 0.3s ease;
228+
transform: scale(1.5);
229+
cursor: pointer;
207230
}
208231
}
209232
}

blogPage.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<!-- 頂端導航 -->
1313
<header>
1414
<nav class="nav">
15-
<a href="#" class="logo">
15+
<a href="./index.html" class="logo">
1616
<picture>
1717
<!-- RWD圖 -->
1818
<source media="(min-width: 821px)" srcset="./img-imdex/sec-home/logo-new_工作區域 [email protected]">
@@ -44,7 +44,7 @@
4444
</li>
4545
</ul>
4646
<div class="icon-search">
47-
<img src="./img-blog/blog-search.png" alt="search">
47+
<a href="#"><img src="./img-blog/blog-search.png" alt="search"></a>
4848
</div>
4949
</div>
5050
</nav>

series.css

+11-1
Original file line numberDiff line numberDiff line change
@@ -313,24 +313,33 @@
313313
& .list {
314314
width: 100%;
315315
height: auto;
316-
316+
position: relative;
317317
& .items {
318+
position: relative;
318319
/* max-width: 306px; */
319320
width: auto;
320321
& .img-container {
321322
/* width: 306px; */
322323
height: 100%;
323324
/* 遮蓋圖片超出畫框的範圍 */
324325
overflow: hidden;
326+
position: relative;
325327
& img {
326328
width: 100%;
327329
height: 100%;
328330
object-fit: cover;
329331
/* 修飾圖片底部與畫框之間的白縫隙 */
330332
display: block;
331333
}
334+
/* & img:hover {
335+
transition: all 0.3s ease;
336+
border-radius: 50%;
337+
cursor: pointer;
338+
} */
332339
}
340+
333341
& .text {
342+
width: 100%;
334343
display: flex;
335344
justify-content: space-between;
336345
align-items: center;
@@ -347,6 +356,7 @@
347356
color: #aa0601;
348357
}
349358
}
359+
350360
& .color {
351361
display: flex;
352362

0 commit comments

Comments
 (0)