123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <!DOCTYPE html>
- <html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="light-mode">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
-
- <title>{{config('app.name')}}</title>
-
- <link rel="preconnect" href="https://fonts.bunny.net">
- <link href="https://fonts.bunny.net/css?family=figtree:400,600&display=swap" rel="stylesheet" />
- <link href="https://cdn.jsdelivr.net/npm/daisyui@4.12.10/dist/full.min.css" rel="stylesheet" type="text/css" />
- <meta name="csrf-token" content="{{ csrf_token() }}">
-
- @vite(['resources/css/app.css','resources/js/app.js'])
- <style>
- html {
- scroll-behavior: smooth;
- }
- body.no-scroll {
- overflow: hidden;
- }
- </style>
- </head>
- <body class="antialiased font-serif no-scroll">
- <audio id="player" loop>
- <source src="{{ asset('assets/background-musicv2.mp3') }}" type="audio/mp3">
- Your browser does not support the audio element.
- </audio>
-
- <script>
- document.addEventListener('DOMContentLoaded', function() {
- var audioElement = document.getElementById('player');
- var hasPlayed = false; // To ensure audio only plays once upon clicking and scrolling
- var scrollCount = 0;
- var maxScrolls = 7;
- var scrollInterval = 500; // Time in milliseconds between each scroll
- var scrollAmount = window.innerHeight / 7; // Amount to scroll per interval
-
- function playAudio() {
- if (!hasPlayed) {
- console.log('play')
- var playPromise = audioElement.play();
-
- if (playPromise !== undefined) {
- playPromise.then(function() {
- // Automatic playback started!
- hasPlayed = true; // Prevent further attempts to play
- }).catch(function(error) {
- // Automatic playback failed.
- console.log('Autoplay failed: ' + error);
- });
- }
- }
- }
-
- function smoothScroll() {
- if (!hasPlayed) {
- playAudio();
- scrollCount++;
- if (scrollCount >= maxScrolls) {
- playAudio();
- } else {
- window.scrollBy(0, scrollAmount); // Smooth scroll a fraction of the window height
- setTimeout(playOnly, scrollInterval);
- }
- }
- }
-
- function playOnly() {
- if (!hasPlayed) {
- playAudio();
- scrollCount++;
- if (scrollCount >= maxScrolls) {
- playAudio();
- } else {
- setTimeout(playOnly, scrollInterval);
- }
- }
- }
-
- function handleInteraction() {
- document.body.classList.remove('no-scroll'); // Enable scrolling
- setTimeout(smoothScroll, scrollInterval); // Start smooth scrolling after initial delay
- }
-
- // Listen for click or touch event to start auto-scrolling
- window.addEventListener('click', handleInteraction, { once: true });
- });
- </script>
- <div id="alert-success"></div>
- <div class="parent absolute h-screen w-full">
- {{-- <audio src="{{asset('assets/paper-ripping.mp3')}}"></audio> --}}
- @include('components.front-cover')
- </div>
- <div class="section bg-babyblue min-h-screen flex justify-center items-center">
- @include('components.main-event')
- </div>
- <div class="section bg-babyblue min-h-screen flex justify-center">
- @include('components.event-info')
- </div>
- <div class="section bg-babyblue flex justify-center">
- @include('components.countdown')
- </div>
- <div class="section bg-babyblue flex justify-center pb-5">
- @include('components.guestbook')
- </div>
- <div class="section bg-babyblue flex justify-center pt-5 pb-20">
- @include('components.prayer')
- </div>
- @include('components.navbar')
-
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
-
- @stack('script')
- </body>
- </html>
|