Skip to content

Commit 6dcd371

Browse files
committed
mobile
1 parent d40b0ed commit 6dcd371

File tree

2 files changed

+44
-56
lines changed

2 files changed

+44
-56
lines changed

src/App.vue

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,21 @@
1616
<MoreSet />
1717
</section>
1818
</div>
19-
<!-- 移动端菜单按钮 -->
20-
<Icon
21-
class="menu"
22-
size="24"
23-
v-show="!store.backgroundShow"
24-
@click="store.mobileOpenState = !store.mobileOpenState"
25-
>
26-
<component :is="store.mobileOpenState ? CloseSmall : HamburgerButton" />
27-
</Icon>
28-
<!-- 页脚 -->
19+
<!-- 底部控制区:菜单按钮 + 页脚 -->
2920
<Transition name="fade" mode="out-in">
30-
<Footer class="f-ter" v-show="!store.backgroundShow && !store.setOpenState" />
21+
<div
22+
v-if="!store.backgroundShow && !store.setOpenState"
23+
class="bottom-stack"
24+
>
25+
<Icon
26+
class="menu-btn"
27+
size="24"
28+
@click="store.mobileOpenState = !store.mobileOpenState"
29+
>
30+
<component :is="store.mobileOpenState ? CloseSmall : HamburgerButton" />
31+
</Icon>
32+
<Footer class="bottom-footer" />
33+
</div>
3134
</Transition>
3235
</main>
3336
</Transition>
@@ -135,7 +138,7 @@ onBeforeUnmount(() => {
135138
width: 100%;
136139
height: 100vh;
137140
margin: 0 auto;
138-
padding: 0 0.5vw;
141+
padding: 0 0.5vw clamp(180px, 24vh, 240px);
139142
.all {
140143
width: 100%;
141144
height: 100%;
@@ -157,25 +160,40 @@ onBeforeUnmount(() => {
157160
animation: fade 0.5s;
158161
}
159162
@media (max-width: 1200px) {
160-
padding: 0 2vw;
163+
padding: 0 2vw clamp(180px, 24vh, 240px);
161164
}
162165
}
163-
.menu {
166+
.bottom-stack {
164167
position: absolute;
168+
left: 0;
169+
right: 0;
170+
bottom: calc(env(safe-area-inset-bottom, 0px) + 30px);
171+
display: flex;
172+
flex-direction: column;
173+
align-items: center;
174+
gap: 30px;
175+
pointer-events: none;
176+
padding: 0 clamp(12px, 3vw, 32px);
177+
}
178+
@media (min-width: 721px) {
179+
.bottom-stack {
180+
gap: 0;
181+
bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
182+
}
183+
}
184+
.menu-btn {
185+
position: relative;
165186
display: flex;
166187
justify-content: center;
167188
align-items: center;
168-
top: auto;
169-
bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(36px, 12vh, 88px));
170-
left: 50%;
171-
margin-left: -28px;
172189
width: 56px;
173190
height: 34px;
174191
background: rgb(0 0 0 / 20%);
175192
backdrop-filter: blur(10px);
176193
border-radius: 6px;
177194
transition: transform 0.3s;
178195
animation: fade 0.5s;
196+
pointer-events: auto;
179197
z-index: 5;
180198
&:active {
181199
transform: scale(0.95);
@@ -187,6 +205,10 @@ onBeforeUnmount(() => {
187205
display: none;
188206
}
189207
}
208+
.bottom-footer {
209+
pointer-events: auto;
210+
width: 100%;
211+
}
190212
@media (max-height: 720px) {
191213
overflow-y: auto;
192214
overflow-x: hidden;
@@ -218,28 +240,12 @@ onBeforeUnmount(() => {
218240
}
219241
}
220242
}
221-
.menu {
222-
bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(40px, 14vh, 96px));
223-
margin-left: -28px;
224-
}
225-
.f-ter {
226-
bottom: 16px;
227-
padding-left: 0;
228-
padding-right: 0;
229-
}
230243
}
231244
@media (max-width: 390px) {
232245
overflow-x: auto;
233246
.container {
234247
width: 391px;
235248
}
236-
.menu {
237-
left: 50%;
238-
margin-left: -28px;
239-
}
240-
.f-ter {
241-
width: 100%;
242-
}
243249
@media (min-height: 721px) {
244250
overflow-y: hidden;
245251
}

src/components/Footer.vue

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
import { MusicOne } from "@icon-park/vue-next";
4040
import { mainStore } from "@/store";
4141
import BeianFooter from "@/components/BeianFooter.vue";
42-
import config from "@/../package.json";
4342
4443
const store = mainStore();
4544
const fullYear = new Date().getFullYear();
@@ -69,7 +68,7 @@ const showStartYearRange = computed(
6968
() => startYearNumber.value !== null && startYearNumber.value < fullYear,
7069
);
7170
72-
const siteAuthor = ref(normalize(env.VITE_SITE_AUTHOR) || defaults.author);
71+
const siteAuthor = computed(() => normalize(env.VITE_SITE_AUTHOR) || defaults.author);
7372
7473
const siteCopyrightText = computed(
7574
() => normalize(env.VITE_SITE_COPYRIGHT) || defaults.copyright,
@@ -103,20 +102,13 @@ const policeIconSrc = computed(
103102

104103
<style lang="scss" scoped>
105104
#footer {
106-
position: absolute;
107-
left: 0;
108-
right: 0;
109-
bottom: 32px;
110-
display: flex;
111-
justify-content: center;
112-
padding: 0 clamp(12px, 2vw, 32px);
105+
width: 100%;
113106
color: #efefef;
114-
z-index: 3;
115107
}
116108
117109
.footer-shell {
118-
width: 100%;
119-
max-width: 1200px;
110+
width: min(100%, 1200px);
111+
margin: 0 auto;
120112
display: flex;
121113
justify-content: center;
122114
}
@@ -212,11 +204,6 @@ const policeIconSrc = computed(
212204
}
213205
214206
@media (max-width: 720px) {
215-
#footer {
216-
bottom: 16px;
217-
padding: 0 20px;
218-
}
219-
220207
.footer-panel {
221208
padding: 12px 16px;
222209
gap: 8px;
@@ -233,11 +220,6 @@ const policeIconSrc = computed(
233220
}
234221
235222
@media (max-width: 480px) {
236-
#footer {
237-
bottom: 12px;
238-
padding: 0 16px;
239-
}
240-
241223
.footer-panel {
242224
padding: 12px 14px;
243225
}

0 commit comments

Comments
 (0)