Wedding Invitation
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

digital-card.blade.php 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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">
  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-success 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 = 7;
  69. var scrollInterval = 500; // Time in milliseconds between each scroll
  70. var scrollAmount = window.innerHeight / 7; // 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. window.scrollBy(0, scrollAmount); // Smooth scroll a fraction of the window height
  94. setTimeout(playOnly, scrollInterval);
  95. }
  96. }
  97. }
  98. function playOnly() {
  99. if (!hasPlayed) {
  100. playAudio();
  101. scrollCount++;
  102. if (scrollCount >= maxScrolls) {
  103. playAudio();
  104. } else {
  105. setTimeout(playOnly, scrollInterval);
  106. }
  107. }
  108. }
  109. function handleInteraction() {
  110. document.body.classList.remove('no-scroll'); // Enable scrolling
  111. setTimeout(smoothScroll, scrollInterval); // Start smooth scrolling after initial delay
  112. }
  113. // Listen for click or touch event to start auto-scrolling
  114. window.addEventListener('click', handleInteraction, { once: true });
  115. // Intersection Observer for fading in elements
  116. const observerOptions = {
  117. root: null,
  118. rootMargin: '0px',
  119. threshold: 0.1
  120. };
  121. const observer = new IntersectionObserver((entries, observer) => {
  122. entries.forEach(entry => {
  123. if (entry.isIntersecting) {
  124. entry.target.classList.add('fade-in');
  125. observer.unobserve(entry.target);
  126. }
  127. });
  128. }, observerOptions);
  129. document.querySelectorAll('.fade-element').forEach(element => {
  130. observer.observe(element);
  131. });
  132. });
  133. </script>
  134. <div id="alert-success"></div>
  135. <div class="parent absolute h-screen w-full">
  136. {{-- <audio src="{{asset('assets/paper-ripping.mp3')}}"></audio> --}}
  137. @include('components.front-cover')
  138. </div>
  139. <div class="section bg-babyblue min-h-screen flex justify-center items-center pb-20 fade-element">
  140. @include('components.main-event')
  141. </div>
  142. <div class="section bg-babyblue min-h-screen flex justify-center pb-20 fade-element">
  143. @include('components.event-info')
  144. </div>
  145. <div class="section bg-babyblue flex justify-center pb-20 fade-element">
  146. @include('components.countdown')
  147. </div>
  148. <div class="section bg-babyblue flex justify-center pt-5 pb-20 fade-element">
  149. @include('components.guestbook')
  150. </div>
  151. <div class="section bg-babyblue flex justify-center pt-5 pb-20 fade-element">
  152. @include('components.prayer')
  153. </div>
  154. @include('components.navbar')
  155. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  156. @stack('script')
  157. </body>
  158. </html>