fix: compact offline status indicator
This commit is contained in:
parent
d99ae4c25c
commit
c2b147259e
|
|
@ -1,5 +1,6 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onBeforeUnmount, onMounted } from "vue";
|
import { onBeforeUnmount, onMounted } from "vue";
|
||||||
|
import { WifiOff } from "@lucide/vue";
|
||||||
import { useAuthStore } from "./stores/auth";
|
import { useAuthStore } from "./stores/auth";
|
||||||
|
|
||||||
const auth = useAuthStore();
|
const auth = useAuthStore();
|
||||||
|
|
@ -13,7 +14,13 @@ onBeforeUnmount(() => window.removeEventListener("online", retrySession));
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<RouterView />
|
<RouterView />
|
||||||
<div v-if="auth.unavailable && auth.user" class="offline-status" role="status">
|
<div
|
||||||
服务暂不可用,当前显示本地数据
|
v-if="auth.unavailable && auth.user"
|
||||||
|
class="offline-status"
|
||||||
|
role="status"
|
||||||
|
aria-label="服务暂不可用,当前显示本地数据"
|
||||||
|
title="服务暂不可用,当前显示本地数据"
|
||||||
|
>
|
||||||
|
<WifiOff :size="16" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -14,19 +14,19 @@
|
||||||
|
|
||||||
.offline-status {
|
.offline-status {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: max(10px, env(safe-area-inset-top));
|
top: max(8px, env(safe-area-inset-top));
|
||||||
left: 50%;
|
right: 8px;
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
max-width: calc(100% - 32px);
|
width: 30px;
|
||||||
padding: 7px 12px;
|
height: 30px;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
padding: 0;
|
||||||
border: 1px solid #e9c98d;
|
border: 1px solid #e9c98d;
|
||||||
border-radius: 999px;
|
border-radius: 50%;
|
||||||
background: rgba(255, 248, 228, .96);
|
background: rgba(255, 248, 228, .96);
|
||||||
color: #795b19;
|
color: #795b19;
|
||||||
font-size: 11px;
|
box-shadow: 0 2px 8px rgba(74, 57, 18, .12);
|
||||||
line-height: 1.2;
|
|
||||||
pointer-events: none;
|
|
||||||
transform: translateX(-50%);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
html,
|
html,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue