11<script setup lang="ts">
2+ import { useAppStore } from ' valaxy'
3+ import { computed } from ' vue'
24import { useThemeConfig } from ' ../composables'
35
6+ const appStore = useAppStore ()
47const themeConfig = useThemeConfig ()
8+
9+ const heroImg = computed (() => {
10+ const img = themeConfig .value .hero .img
11+ if (typeof img === ' string' )
12+ return img
13+ else if (typeof img === ' object' )
14+ return appStore .isDark ? img .dark : img .light
15+
16+ console .error (' Invalid favicon type, check ThemeConfig.hero.img config' )
17+ return ' '
18+ })
519 </script >
620
721<template >
8- <div class =" oceanus-hero" :style =" { backgroundImage: `url(${themeConfig.hero.img })` }" >
22+ <div class =" oceanus-hero" :style =" { backgroundImage: `url(${heroImg })` }" >
923 <div class =" hero-content" >
1024 <p class =" hero-title" >
1125 <slot name =" intro-text" >
@@ -18,16 +32,6 @@ const themeConfig = useThemeConfig()
1832 {{ themeConfig.hero.motto }}
1933 </slot >
2034 </p >
21-
22- <!-- CTA Buttons -->
23- <!-- <div class="hero-buttons">
24- <button class="cta-primary">
25- Get Started
26- </button>
27- <button class="cta-secondary">
28- Learn More
29- </button>
30- </div> -->
3135 </div >
3236 </div >
3337</template >
@@ -90,36 +94,6 @@ const themeConfig = useThemeConfig()
9094 gap : 1rem ;
9195 }
9296
93- .cta-primary ,
94- .cta-secondary {
95- padding : 0.75rem 2rem ;
96- border-radius : 24px ;
97- font-size : 1rem ;
98- cursor : pointer ;
99- transition : all 0.3s ease-in-out ;
100- }
101-
102- .cta-primary {
103- background-color : #0071e3 ;
104- color : white ;
105- box-shadow : 0 4px 14px rgba (0 , 0 , 0 , 0.2 );
106-
107- & :hover {
108- background-color : #005bb5 ;
109- box-shadow : 0 6px 20px rgba (0 , 0 , 0 , 0.3 );
110- }
111- }
112-
113- .cta-secondary {
114- background-color : transparent ;
115- border : 1px solid #ffffff ;
116- color : white ;
117-
118- & :hover {
119- background-color : rgba (255 , 255 , 255 , 0.1 );
120- }
121- }
122-
12397 @keyframes fade-in {
12498 from {
12599 opacity : 0 ;
0 commit comments