Fix: Force video playback and adjust overlay transparency for better visibility
This commit is contained in:
@ -16,8 +16,8 @@
|
||||
|
||||
<!-- Minimalist Hero -->
|
||||
<header class="hero-minimal">
|
||||
<video autoplay muted loop playsinline class="hero-video">
|
||||
<source src="/videopromo.mp4" type="video/mp4">
|
||||
<video autoplay muted loop playsinline class="hero-video" ref="videoRef">
|
||||
<source src="/videopromo.mp4?v=3" type="video/mp4">
|
||||
</video>
|
||||
<div class="hero-overlay"></div>
|
||||
|
||||
@ -114,6 +114,7 @@ import { useI18n } from 'vue-i18n'
|
||||
const router = useRouter()
|
||||
const { t } = useI18n()
|
||||
const scrolled = ref(false)
|
||||
const videoRef = ref<HTMLVideoElement | null>(null)
|
||||
|
||||
const handleScroll = () => {
|
||||
scrolled.value = window.scrollY > 50
|
||||
@ -122,6 +123,11 @@ const handleScroll = () => {
|
||||
onMounted(() => {
|
||||
window.addEventListener('scroll', handleScroll)
|
||||
|
||||
// Force play video just in case
|
||||
if (videoRef.value) {
|
||||
videoRef.value.play().catch(e => console.warn("Video autoplay failed:", e))
|
||||
}
|
||||
|
||||
// PWA Detection
|
||||
const isStandalone = window.matchMedia('(display-mode: standalone)').matches || (window.navigator as any).standalone === true;
|
||||
if (isStandalone) {
|
||||
@ -258,7 +264,7 @@ const scrollToInstall = () => {
|
||||
.hero-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: radial-gradient(circle, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.8) 100%);
|
||||
background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user