Skip to content

Commit 0c528b7

Browse files
committed
update photos wall for favourite
1 parent 5fdd568 commit 0c528b7

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

deno.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"rehype-stringify": "https://esm.sh/[email protected]",
3131
"rehype-slug": "https://esm.sh/[email protected]",
3232
"rehype-autolink-headings": "https://esm.sh/[email protected]",
33-
"@shikijs/rehype": "https://esm.sh/@shikijs/rehype@1.11.1",
33+
"@shikijs/rehype": "https://esm.sh/@shikijs/rehype@1.12.0",
3434
"remark-gfm": "https://esm.sh/[email protected]",
3535
"yaml": "https://deno.land/[email protected]/yaml/mod.ts",
3636
"Command": "https://deno.land/x/[email protected]/command/mod.ts",

public/favourite/index.css

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ body {
4545
align-items: center;
4646
justify-content: center;
4747
height: 100%;
48-
padding-block-start: 4rem;
48+
padding-block: 4rem;
4949
color: var(--global-color);
5050

5151
& .text {
@@ -148,4 +148,50 @@ dialog::backdrop {
148148
text-decoration-thickness: 0.2rem;
149149
text-decoration-color: var(--global-color);
150150
text-underline-offset: 0.5rem;
151+
}
152+
153+
.photos-container {
154+
display: flex;
155+
justify-content: center;
156+
width: min(80vw, 32rem);
157+
overflow: hidden;
158+
position: relative;
159+
}
160+
161+
.photos-box {
162+
display: flex;
163+
transition: transform 0.5s ease;
164+
}
165+
166+
.photos-box img {
167+
width: 100%;
168+
height: 100%;
169+
background-color: white;
170+
object-fit: contain;
171+
flex-shrink: 0;
172+
}
173+
174+
@keyframes carousel {
175+
176+
0%,
177+
100% {
178+
transform: translateX(0);
179+
}
180+
181+
33.33% {
182+
transform: translateX(min(-80vw, -32rem));
183+
}
184+
185+
66.66% {
186+
transform: translateX(min(-160vw, -64rem));
187+
}
188+
}
189+
190+
.photos-box {
191+
animation: carousel 15s infinite;
192+
}
193+
194+
/* 可选:悬停时暂停动画 */
195+
.photos-container:hover .photos-box {
196+
animation-play-state: paused;
151197
}

public/favourite/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ <h2 class="h2-title animate__animated animate__backInDown">❤️记录我和小
6868
</div>
6969
<div class="container" id="photos-wall">
7070
<p class="text animate__animated animate__swing animate__infinite" id="hidden-button">我有好多话想对你说,你愿意听吗</p>
71+
<div class="photos-container">
72+
<div class="photos-box">
73+
<img src="https://remain.fwqaq.us/xiaochen_admission.jpg" alt="陈录取通知书">
74+
<img src="https://remain.fwqaq.us/sfo.jpg" alt="张 sfo">
75+
<img src="https://remain.fwqaq.us/chen_cat.jpg" alt="猫咪">
76+
<img src="https://remain.fwqaq.us/chen_heian.jpg" alt="黑暗料理">
77+
</div>
78+
</div>
7179

7280
<dialog close id="x-dialog">
7381
<p class="text">我有好多话想对你说,你愿意听吗</p>

0 commit comments

Comments
 (0)