Skip to content

Commit a437a8f

Browse files
committed
feat: update demo layout style
1 parent 0ddaf04 commit a437a8f

File tree

6 files changed

+54
-17
lines changed

6 files changed

+54
-17
lines changed

public/favicon.ico

10.9 KB
Binary file not shown.

src/assets/base.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,7 @@ body {
5858
opacity: .1;
5959
pointer-events: none;
6060
touch-action: none;
61+
top: 0;
62+
left: 0;
6163
}
6264
}

src/components/Footer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const currentYear = new Date().getFullYear()
44

55
<template>
66
<footer>
7-
<p>仅用于个人非商用</P>
7+
<p>仅限个人非商用</P>
88
<p>
99
© 2019 - {{ currentYear }}
1010
<a href="https://github.com/Lruihao/mmt-webfont/" target="_blank">沐目体</a>

src/components/SectionCover.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
width="80"
1111
height="80"
1212
viewBox="0 0 250 250"
13-
style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;"
1413
aria-hidden="true"
1514
>
1615
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z" />
@@ -34,6 +33,16 @@
3433
position: fixed;
3534
top: 0;
3635
right: 0;
36+
z-index: 100;
37+
38+
svg {
39+
fill: var(--github-corner-fill, #151513);
40+
color: var(--github-corner-color, #fff);
41+
position: absolute;
42+
top: 0;
43+
border: 0;
44+
right: 0;
45+
}
3746
}
3847
.github-corner:hover .octo-arm {
3948
animation: octocat-wave 560ms ease-in-out;
@@ -66,4 +75,11 @@
6675
animation: octocat-wave 560ms ease-in-out;
6776
}
6877
}
78+
79+
@media (prefers-color-scheme: dark) {
80+
.github-corner {
81+
--github-corner-fill: #fff;
82+
--github-corner-color: #151513;
83+
}
84+
}
6985
</style>

src/components/SectionMusic.vue

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ interface Comment {
1212
}
1313
1414
const mid = ref<string>('2280569152')
15+
const loading = ref<boolean>(false)
1516
const defaultComment: Comment = {
1617
musicName: '',
1718
musicUrl: '',
@@ -24,6 +25,7 @@ const defaultComment: Comment = {
2425
const comment = ref<Comment>(defaultComment)
2526
2627
function getRandomComment() {
28+
loading.value = true
2729
fetch(`https://api.lruihao.cn/netease/comment?mid=${mid.value}`)
2830
.then(response => response.json())
2931
.then((res) => {
@@ -43,6 +45,9 @@ function getRandomComment() {
4345
content: '获取评论失败,请稍后再试...',
4446
}
4547
})
48+
.finally(() => {
49+
loading.value = false
50+
})
4651
}
4752
4853
onMounted(() => {
@@ -52,7 +57,7 @@ onMounted(() => {
5257

5358
<template>
5459
<section class="section-music">
55-
<div class="comment-163" title="随机下一条" @click="getRandomComment">
60+
<div v-if="!loading" class="comment-163" title="随机下一条" @click="getRandomComment">
5661
<span class="pic-backdrop" :style="comment.picUrl ? `background-image: url(${comment.picUrl});` : ''" />
5762
<div class="commentator">
5863
<img
@@ -63,38 +68,38 @@ onMounted(() => {
6368
>
6469
<span class="comment-nickname">{{ comment.nickname }}</span>
6570
</div>
66-
<div v-if="comment.content" class="comment-content">
71+
<div class="comment-content">
6772
{{ comment.content }}
6873
</div>
69-
<div v-else class="loading-indicator-wrapper">
70-
<div class="aether-spinner">
71-
<div class="rect-one" />
72-
<div class="rect-two" />
73-
<div class="rect-three" />
74-
</div>
75-
</div>
7674
<div class="music-info">
77-
<span class="artists-name">{{ comment.artist }}</span>
7875
<span class="music-name">{{ comment.musicName }}</span>
76+
<span class="artists-name">{{ comment.artist }}</span>
77+
</div>
78+
</div>
79+
<div v-else class="loading-indicator-wrapper">
80+
<div class="aether-spinner">
81+
<div class="rect-one" />
82+
<div class="rect-two" />
83+
<div class="rect-three" />
7984
</div>
8085
</div>
8186
</section>
8287
</template>
8388

8489
<style scoped>
8590
.section-music {
91+
position: relative;
8692
z-index: 1;
8793
padding: 1rem;
8894
min-height: 185px;
89-
--color-comment: #272626;
9095
9196
.comment-163 {
9297
font-family: MMT, '沐目体';
9398
position: relative;
9499
border: 1px solid #f5f5f5;
95100
padding: 0.75em;
96101
border-radius: 0.75rem;
97-
color: var(--color-comment);
102+
color: var(--color-comment, #272626);
98103
cursor: pointer;
99104
height: 100%;
100105
}
@@ -146,13 +151,19 @@ onMounted(() => {
146151
.music-info {
147152
display: flex;
148153
align-items: center;
149-
flex-direction: row-reverse;
150-
font-weight: 500;
154+
justify-content: flex-end;
151155
font-size: 1.2rem;
152156
margin-top: 0.75em;
157+
text-shadow: 0 0 4px var(--color-text-shadow, rgba(0, 0, 0, .4));
158+
&:not(:empty)::before {
159+
content: '';
160+
}
161+
&:not(:empty)::after {
162+
content: '';
163+
}
153164
}
154165
.music-name:not(:empty)::after {
155-
content: '-';
166+
content: '·';
156167
margin-left: 0.25rem;
157168
margin-right: 0.25rem;
158169
}
@@ -164,10 +175,14 @@ onMounted(() => {
164175
margin-block: 0.5rem;
165176
}
166177
}
178+
167179
@media (prefers-color-scheme: dark) {
168180
.section-music {
169181
--color-comment: #f5f5f5;
170182
}
183+
.music-info {
184+
--color-text-shadow: rgba(255, 255, 255, .8);
185+
}
171186
}
172187
173188
.loading-indicator-wrapper {

src/components/SectionPreview.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ const style = computed(() => {
1414
}
1515
})
1616
17+
if (window.innerWidth < 768) {
18+
fontSize.value = 20
19+
}
20+
1721
// ————“沐目之,湘也。”
1822
// 取字于大学时初恋的名字,这个字体也是为她而写。
1923
// 沐目体和红人馆的那首《最甜情歌》有着类似的遭遇。

0 commit comments

Comments
 (0)