🐛 Fix(custom): fix guide page location issue

This commit is contained in:
Kuingsmile
2026-01-20 22:53:17 +08:00
parent 79808e7d39
commit 258ed48a92
4 changed files with 46 additions and 297 deletions

View File

@@ -1,45 +1,58 @@
<template> <template>
<TransitionRoot appear :show="isVisible" as="template"> <TransitionRoot appear :show="isVisible" as="template">
<div class="guide-overlay"> <div class="pointer-events-auto fixed inset-0 z-9999">
<div class="guide-backdrop" @click="handleClose" /> <div class="absolute inset-0 bg-black/15 transition-all duration-300 ease-apple" @click="handleClose" />
<div v-if="currentStepConfig.target" class="guide-spotlight" :style="spotlightStyle" /> <div
v-if="currentStepConfig.target"
class="pointer-events-none absolute z-10000 rounded-xl border-2 border-dashed border-accent shadow-sm transition-all duration-300 ease-apple"
:style="spotlightStyle"
/>
<!-- Guide Card --> <!-- Guide Card -->
<div class="guide-card" :style="cardStyle"> <div
<div class="guide-header"> class="absolute z-10001 max-h-[80vh] w-[420px] max-w-[90vw] overflow-auto rounded-lg border border-border bg-bg-tertiary shadow-2xl transition-all duration-300 ease-apple max-sm:w-[calc(100vw-32px)]"
<div class="guide-header-left"> :style="cardStyle"
<h3 class="guide-title">{{ t('guide.title') }}</h3> >
<span class="guide-step-indicator"> <div class="flex items-center justify-between border-b border-b-border px-4 py-3">
<div class="flex flex-col gap-0.5">
<h3 class="m-0 text-[16px] font-semibold text-main">{{ t('guide.title') }}</h3>
<span class="text-sm text-tertiary">
{{ t('guide.stepIndicator', { current: currentStep + 1, total: steps.length }) }} {{ t('guide.stepIndicator', { current: currentStep + 1, total: steps.length }) }}
</span> </span>
</div> </div>
<button class="guide-close" :title="t('guide.close')" @click="handleClose"> <button
class="flex cursor-pointer items-center justify-center rounded-sm border-none bg-transparent p-[4px] text-secondary transition-all duration-200 ease-apple hover:bg-accent-hover hover:text-main"
:title="t('guide.close')"
@click="handleClose"
>
<XIcon :size="20" /> <XIcon :size="20" />
</button> </button>
</div> </div>
<div class="guide-content"> <div class="flex items-start gap-4 px-5 py-4">
<div class="guide-icon"> <div
class="border-lg flex h-[40px] w-[40px] shrink-0 items-center justify-center rounded-lg bg-accent text-white"
>
<component :is="currentStepConfig.icon" :size="24" /> <component :is="currentStepConfig.icon" :size="24" />
</div> </div>
<div class="guide-text"> <div class="min-w-0 flex-1">
<h4 class="guide-content-title">{{ t(currentStepConfig.title) }}</h4> <h4 class="mb-1 text-base font-semibold text-main">{{ t(currentStepConfig.title) }}</h4>
<p class="guide-content-description">{{ t(currentStepConfig.description) }}</p> <p class="m-0 text-sm leading-[1.5] text-secondary">{{ t(currentStepConfig.description) }}</p>
</div> </div>
</div> </div>
<div class="guide-footer"> <div class="border-t border-t-border p-3">
<div class="guide-progress"> <div class="mb-2.5 flex justify-center gap-1.5">
<div <div
v-for="(_, index) in steps" v-for="(_, index) in steps"
:key="index" :key="index"
class="progress-dot" class="h-[6px] w-[6px] rounded-full bg-border transition-all duration-300 ease-apple [.active]:w-5 [.active]:rounded-xs [.active]:bg-accent [.completed]:bg-success"
:class="{ active: index === currentStep, completed: index < currentStep }" :class="{ active: index === currentStep, completed: index < currentStep }"
/> />
</div> </div>
<div class="guide-actions"> <div class="flex justify-end gap-1.5">
<button v-if="currentStep > 0" class="guide-btn secondary" @click="handlePrevious"> <button v-if="currentStep > 0" class="guide-btn secondary" @click="handlePrevious">
<ChevronLeftIcon :size="16" /> <ChevronLeftIcon :size="16" />
{{ t('guide.previous') }} {{ t('guide.previous') }}

View File

@@ -28,7 +28,7 @@
</button> </button>
</div> </div>
<div class="flex items-center justify-center p-3"> <div class="theme-switcher flex items-center justify-center p-3">
<ThemeSwitcher :collapsed="isCollapsed" /> <ThemeSwitcher :collapsed="isCollapsed" />
</div> </div>

View File

@@ -1,280 +1,16 @@
.guide-overlay { @import "tailwindcss" reference;
position: fixed; @import "../../assets/css/theme.css" reference;
inset: 0; @import "../../assets/css/utilities.css" reference;
z-index: 9999;
pointer-events: auto;
}
.guide-backdrop {
position: absolute;
inset: 0;
background: rgb(0 0 0 / 10%);
transition: all 0.3s ease;
}
.guide-overlay.advancedAnimation .guide-backdrop {
animation: fade-in 0.3s ease;
}
.guide-spotlight {
position: absolute;
border: 2px solid var(--color-accent);
border-radius: var(--radius-md);
box-shadow:
0 0 0 9999px rgb(0 0 0 / 10%),
0 0 20px rgb(255 255 255 / 30%),
inset 0 0 20px rgb(255 255 255 / 10%);
transition: all 0.3s ease;
pointer-events: none;
z-index: 10000;
}
.guide-card {
position: absolute;
background: var(--color-background-tertiary);
border: 1px solid var(--color-border);
border-radius: var(--radius-lg);
box-shadow: 0 10px 40px rgb(0 0 0 / 25%);
width: 420px;
max-width: 90vw;
max-height: 80vh;
overflow: auto;
z-index: 10001;
transition: all 0.3s ease;
}
.guide-overlay.advancedAnimation .guide-card {
animation: slide-up var(--transition-bounce-slow);
}
.guide-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 18px;
border-bottom: 1px solid var(--color-border);
}
.guide-header-left {
display: flex;
flex-direction: column;
gap: 2px;
}
.guide-title {
font-size: 15px;
font-weight: 600;
color: var(--color-text-primary);
margin: 0;
}
.guide-step-indicator {
font-size: 11px;
color: var(--color-text-tertiary);
}
.guide-close {
background: transparent;
border: none;
color: var(--color-text-secondary);
cursor: pointer;
padding: 4px;
border-radius: var(--radius-sm);
display: flex;
align-items: center;
justify-content: center;
transition: all 0.2s;
}
.guide-close:hover {
background: var(--color-accent-hover);
color: var(--color-text-primary);
}
.guide-content {
padding: 14px 18px;
display: flex;
gap: 14px;
align-items: flex-start;
}
.guide-icon {
width: 40px;
height: 40px;
flex-shrink: 0;
border-radius: var(--radius-lg);
background: var(--color-accent);
display: flex;
align-items: center;
justify-content: center;
color: white;
}
.guide-text {
flex: 1;
min-width: 0;
}
.guide-content-title {
font-size: 14px;
font-weight: 600;
color: var(--color-text-primary);
margin: 0 0 4px;
}
.guide-content-description {
font-size: 13px;
color: var(--color-text-secondary);
line-height: 1.5;
margin: 0;
}
.guide-additional-info {
background: var(--color-background-tertiary);
border-radius: var(--radius-sm);
padding: 10px 12px;
margin-top: 10px;
}
.guide-additional-info p {
font-size: 12px;
color: var(--color-text-secondary);
line-height: 1.4;
margin: 6px 0;
}
.guide-additional-info p:first-child {
margin-top: 0;
}
.guide-additional-info p:last-child {
margin-bottom: 0;
}
.guide-footer {
padding: 10px 18px 12px;
border-top: 1px solid var(--color-border);
}
.guide-progress {
display: flex;
justify-content: center;
gap: 6px;
margin-bottom: 10px;
}
.progress-dot {
width: 6px;
height: 6px;
border-radius: var(--radius-round);
background: var(--color-border);
transition: all 0.3s;
}
.progress-dot.active {
background: var(--color-accent);
width: 20px;
border-radius: 3px;
}
.progress-dot.completed {
background: var(--color-success);
}
.guide-actions {
display: flex;
gap: 6px;
justify-content: flex-end;
}
.guide-btn { .guide-btn {
padding: 6px 12px; @apply px-3 py-1.5 rounded-sm text-sm font-medium cursor-pointer border-none flex items-center gap-1 transition-all duration-200 ease-apple;
border-radius: var(--radius-sm); @apply [.primary]:bg-accent [.primary]:text-white;
font-size: 13px; @apply hover:[.primary]:bg-accent-hover hover:[.primary]:transform-[-translateY(1px)];
font-weight: 500; @apply [.secondary]:bg-bg-tertiary [.secondary]:text-main;
cursor: pointer; @apply hover:[.secondary]:bg-accent-hover;
border: none; @apply [.outline]:bg-transparent [.outline]:text-main [.outline]:border-border;
display: flex; @apply hover:[.outline]:bg-accent hover:[.outline]:text-main;
align-items: center; @apply [.success]:bg-success [.success]:text-white;
gap: 4px; @apply hover:[.success]:bg-success hover:[.success]:-translate-y-px;
transition: all 0.2s; @apply max-md:flex-1 max-md:justify-center max-md:min-w-[calc(50%-4px)]
}
.guide-btn.primary {
background: var(--color-accent);
color: white;
}
.guide-btn.primary:hover {
background: var(--color-accent-hover);
transform: translateY(-1px);
}
.guide-btn.secondary {
background: var(--color-background-tertiary);
color: var(--color-text-primary);
}
.guide-btn.secondary:hover {
background: var(--color-accent-hover);
}
.guide-btn.outline {
background: transparent;
color: var(--color-text-primary);
border: 1px solid var(--color-border);
}
.guide-btn.outline:hover {
background: var(--color-accent);
color: var(--color-text-primary);
}
.guide-btn.success {
background: var(--color-success);
color: white;
}
.guide-btn.success:hover {
background: var(--color-success);
transform: translateY(-1px);
}
@keyframes fade-in {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes slide-up {
from {
opacity: 0;
transform: translate(-50%, -40%) scale(0.95);
}
to {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
}
/* Responsive */
@media (width <= 640px) {
.guide-card {
width: calc(100vw - 32px);
}
.guide-actions {
flex-wrap: wrap;
}
.guide-btn {
flex: 1;
min-width: calc(50% - 4px);
justify-content: center;
}
} }

View File

@@ -9,7 +9,7 @@
> >
<div class="flex max-w-[calc(100%-300px)] flex-1 flex-wrap items-center gap-2 max-md:order-1"> <div class="flex max-w-[calc(100%-300px)] flex-1 flex-wrap items-center gap-2 max-md:order-1">
<button <button
class="group/provider flex w-auto min-w-[150px] shrink-0 cursor-pointer items-center gap-3 rounded-lg border border-border-secondary bg-bg-secondary px-4 py-2 font-[inherit] duration-fast ease-standard hover:-translate-y-px hover:border-accent-hover/70 hover:bg-surface hover:shadow-sm focus-visible:focus-ring max-xs:w-full max-xs:min-w-[100px]" class="provider-button group/provider flex w-auto min-w-[150px] shrink-0 cursor-pointer items-center gap-3 rounded-lg border border-border-secondary bg-bg-secondary px-4 py-2 font-[inherit] duration-fast ease-standard hover:-translate-y-px hover:border-accent-hover/70 hover:bg-surface hover:shadow-sm focus-visible:focus-ring max-xs:w-full max-xs:min-w-[100px]"
:title="t('pages.upload.uploadViewHint')" :title="t('pages.upload.uploadViewHint')"
@click="handlePicBedNameClick(picBedName)" @click="handlePicBedNameClick(picBedName)"
> >