Wedding Invitation
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

digital-card.blade.php 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <!DOCTYPE html>
  2. <html lang="{{ str_replace('_', '-', app()->getLocale()) }}" data-theme="light">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, user-scalable=no">
  6. <meta name="color-scheme" content="light only">
  7. <title>{{config('app.name')}}</title>
  8. <link rel="preconnect" href="https://fonts.bunny.net">
  9. <link href="https://fonts.bunny.net/css?family=figtree:400,600&display=swap" rel="stylesheet" />
  10. <link href="https://cdn.jsdelivr.net/npm/daisyui@4.12.10/dist/full.min.css" rel="stylesheet" type="text/css" />
  11. <meta name="csrf-token" content="{{ csrf_token() }}">
  12. @vite(['resources/css/app.css','resources/js/app.js'])
  13. <style>
  14. html {
  15. scroll-behavior: smooth;
  16. }
  17. body.no-scroll {
  18. overflow: hidden;
  19. }
  20. .fade-element {
  21. opacity: 0;
  22. transition: opacity 3s ease-in-out;
  23. }
  24. .fade-in {
  25. opacity: 1;
  26. }
  27. .petal-overlay {
  28. position: fixed; /* Fixes the position to the viewport */
  29. top: 0;
  30. left: 0;
  31. width: 100vw;
  32. height: 100vh;
  33. pointer-events: none; /* Allows interactions through the overlay */
  34. z-index: 9999; /* Ensures it is on top of other elements */
  35. opacity: 0.3; /* Set the opacity to a lower value */
  36. display: none; /* Initially hidden */
  37. }
  38. .petal-overlay img {
  39. width: 100%;
  40. height: 100%;
  41. object-fit: cover; /* Ensures the image covers the entire container */
  42. }
  43. </style>
  44. </head>
  45. <body class="antialiased font-serif no-scroll">
  46. <div role="alert" class="alert alert-info hidden z-40 fixed w-1/2 top-3 right-3">
  47. <span></span>
  48. </div>
  49. <div class="petal-overlay" id="petalOverlay">
  50. <img src="{{ asset('assets/petal.gif') }}" alt="Falling Petals">
  51. </div>
  52. <audio id="player" loop>
  53. <source src="{{ asset('assets/background-musicv2.mp3') }}" type="audio/mp3">
  54. Your browser does not support the audio element.
  55. </audio>
  56. <script>
  57. document.addEventListener('click', function () {
  58. setTimeout(function () {
  59. document.getElementById('petalOverlay').style.display = 'block';
  60. }, 1000); // Delay of 1 second (1000 milliseconds)
  61. });
  62. </script>
  63. <script>
  64. document.addEventListener('DOMContentLoaded', function() {
  65. var audioElement = document.getElementById('player');
  66. var hasPlayed = false; // To ensure audio only plays once upon clicking and scrolling
  67. var scrollCount = 0;
  68. var maxScrolls = 8;
  69. var scrollInterval = 500; // Time in milliseconds between each scroll
  70. var scrollAmount = window.innerHeight / 6; // Amount to scroll per interval
  71. function playAudio() {
  72. if (!hasPlayed) {
  73. console.log('play')
  74. var playPromise = audioElement.play();
  75. if (playPromise !== undefined) {
  76. playPromise.then(function() {
  77. // Automatic playback started!
  78. hasPlayed = true; // Prevent further attempts to play
  79. }).catch(function(error) {
  80. // Automatic playback failed.
  81. console.log('Autoplay failed: ' + error);
  82. });
  83. }
  84. }
  85. }
  86. function smoothScroll() {
  87. if (!hasPlayed) {
  88. playAudio();
  89. scrollCount++;
  90. if (scrollCount >= maxScrolls) {
  91. playAudio();
  92. } else {
  93. // Calculate scroll position
  94. var currentScroll = window.pageYOffset || document.documentElement.scrollTop;
  95. var targetScroll = currentScroll + scrollAmount;
  96. // Smooth scroll using requestAnimationFrame
  97. function scrollStep() {
  98. if (currentScroll < targetScroll) {
  99. window.scrollTo(0, currentScroll += 1); // Adjust speed here (e.g., +=5)
  100. requestAnimationFrame(scrollStep);
  101. }
  102. }
  103. scrollStep(); // Initiates the smooth scrolling process
  104. setTimeout(smoothScroll, scrollInterval); // Continues scrolling after a delay
  105. }
  106. }
  107. }
  108. function playOnly() {
  109. if (!hasPlayed) {
  110. playAudio();
  111. scrollCount++;
  112. if (scrollCount >= maxScrolls) {
  113. playAudio();
  114. } else {
  115. setTimeout(playOnly, scrollInterval);
  116. }
  117. }
  118. }
  119. function handleInteraction() {
  120. document.body.classList.remove('no-scroll'); // Enable scrolling
  121. setTimeout(smoothScroll, scrollInterval); // Start smooth scrolling after initial delay
  122. }
  123. // Listen for click or touch event to start auto-scrolling
  124. window.addEventListener('click', handleInteraction, { once: true });
  125. // Intersection Observer for fading in elements
  126. const observerOptions = {
  127. root: null,
  128. rootMargin: '0px',
  129. threshold: 0.1
  130. };
  131. const observer = new IntersectionObserver((entries, observer) => {
  132. entries.forEach(entry => {
  133. if (entry.isIntersecting) {
  134. entry.target.classList.add('fade-in');
  135. observer.unobserve(entry.target);
  136. }
  137. });
  138. }, observerOptions);
  139. document.querySelectorAll('.fade-element').forEach(element => {
  140. observer.observe(element);
  141. });
  142. });
  143. </script>
  144. <div class="parent absolute h-screen w-full">
  145. {{-- <audio src="{{asset('assets/paper-ripping.mp3')}}"></audio> --}}
  146. @include('components.front-cover')
  147. </div>
  148. <div class="section bg-babyblue min-h-screen flex justify-center items-center pb-20 fade-element">
  149. @include('components.main-event')
  150. </div>
  151. <div class="section bg-babyblue min-h-screen flex justify-center pb-20 fade-element">
  152. @include('components.event-info')
  153. </div>
  154. <div class="section bg-babyblue flex justify-center pb-20 fade-element">
  155. @include('components.countdown')
  156. </div>
  157. <div class="section bg-babyblue flex justify-center pt-5 pb-20 fade-element">
  158. @include('components.guestbook')
  159. </div>
  160. <div class="section bg-babyblue flex justify-center pt-5 pb-20 fade-element">
  161. @include('components.prayer')
  162. </div>
  163. @include('components.navbar')
  164. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  165. @stack('script')
  166. </body>
  167. </html>