feat(docs): add welcome screen with animated logo

Introduce a new welcome screen that automatically redirects first-time visitors from the homepage. The screen features an animated "Easy Vibe" logo with three color themes (ocean, rainbow, sunset) that cycle through a drawing animation. Users can click anywhere to enter the main site.

The welcome screen includes:
- A JSON file containing SVG path data for the animated logo
- A Vue component with gradient backgrounds and smooth animations
- Logic to detect first-time visitors using localStorage
- Integration into the existing VitePress theme structure
- Updated navigation to exclude the welcome page from sidebar controls
- Modified homepage logic to redirect to welcome screen on first visit
This commit is contained in:
sanbuphy
2026-03-16 14:07:54 +08:00
parent 74c2f4ab26
commit ec95e132f4
7 changed files with 404 additions and 12 deletions
+9 -3
View File
@@ -1,6 +1,6 @@
<script setup>
import DefaultTheme from 'vitepress/theme'
import { useData } from 'vitepress'
import { useData, useRoute } from 'vitepress'
import TextType from './components/TextType.vue'
import GitHubStars from './components/GitHubStars.vue'
import { onMounted, ref, watch, computed } from 'vue'
@@ -8,6 +8,7 @@ import ReadingProgress from './components/ReadingProgress.vue'
import { Setting } from '@element-plus/icons-vue'
const { frontmatter } = useData()
const route = useRoute()
const homeTaglineTyping = {
typingSpeed: 45,
@@ -86,6 +87,11 @@ const toggleSidebar = () => {
}
const isHomePage = computed(() => frontmatter.value.layout === 'home')
const isWelcomePage = computed(() =>
route.path === '/welcome/' ||
route.path.endsWith('/welcome/') ||
route.path.endsWith('/welcome.html')
)
onMounted(() => {
const saved = clampFontSize(localStorage.getItem(FONT_SIZE_STORAGE_KEY))
@@ -292,7 +298,7 @@ watch(sidebarCollapsed, (collapsed) => {
<template>
<DefaultTheme.Layout>
<template v-if="!isHomePage" #nav-bar-title-before>
<template v-if="!isHomePage && !isWelcomePage" #nav-bar-title-before>
<button
class="ev-sidebar-nav-btn"
type="button"
@@ -430,7 +436,7 @@ watch(sidebarCollapsed, (collapsed) => {
</DefaultTheme.Layout>
<ClientOnly>
<div
v-if="!isHomePage"
v-if="!isHomePage && !isWelcomePage"
class="ev-sidebar-hover-area"
:class="{ collapsed: sidebarCollapsed }"
>