Wedding Invitation
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

digital-card.blade.php 6.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  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. }
  37. .petal-overlay img {
  38. width: 100%;
  39. height: 100%;
  40. object-fit: cover; /* Ensures the image covers the entire container */
  41. }
  42. </style>
  43. </head>
  44. <body class="antialiased font-serif no-scroll">
  45. <div class="petal-overlay">
  46. <img src="{{ asset('assets/petal.gif') }}" alt="Falling Petals">
  47. </div>
  48. <audio id="player" loop>
  49. <source src="{{ asset('assets/background-musicv2.mp3') }}" type="audio/mp3">
  50. Your browser does not support the audio element.
  51. </audio>
  52. <script>
  53. document.addEventListener('DOMContentLoaded', function() {
  54. var audioElement = document.getElementById('player');
  55. var hasPlayed = false; // To ensure audio only plays once upon clicking and scrolling
  56. var scrollCount = 0;
  57. var maxScrolls = 7;
  58. var scrollInterval = 500; // Time in milliseconds between each scroll
  59. var scrollAmount = window.innerHeight / 7; // Amount to scroll per interval
  60. function playAudio() {
  61. if (!hasPlayed) {
  62. console.log('play')
  63. var playPromise = audioElement.play();
  64. if (playPromise !== undefined) {
  65. playPromise.then(function() {
  66. // Automatic playback started!
  67. hasPlayed = true; // Prevent further attempts to play
  68. }).catch(function(error) {
  69. // Automatic playback failed.
  70. console.log('Autoplay failed: ' + error);
  71. });
  72. }
  73. }
  74. }
  75. function smoothScroll() {
  76. if (!hasPlayed) {
  77. playAudio();
  78. scrollCount++;
  79. if (scrollCount >= maxScrolls) {
  80. playAudio();
  81. } else {
  82. window.scrollBy(0, scrollAmount); // Smooth scroll a fraction of the window height
  83. setTimeout(playOnly, scrollInterval);
  84. }
  85. }
  86. }
  87. function playOnly() {
  88. if (!hasPlayed) {
  89. playAudio();
  90. scrollCount++;
  91. if (scrollCount >= maxScrolls) {
  92. playAudio();
  93. } else {
  94. setTimeout(playOnly, scrollInterval);
  95. }
  96. }
  97. }
  98. function handleInteraction() {
  99. document.body.classList.remove('no-scroll'); // Enable scrolling
  100. setTimeout(smoothScroll, scrollInterval); // Start smooth scrolling after initial delay
  101. }
  102. // Listen for click or touch event to start auto-scrolling
  103. window.addEventListener('click', handleInteraction, { once: true });
  104. // Intersection Observer for fading in elements
  105. const observerOptions = {
  106. root: null,
  107. rootMargin: '0px',
  108. threshold: 0.1
  109. };
  110. const observer = new IntersectionObserver((entries, observer) => {
  111. entries.forEach(entry => {
  112. if (entry.isIntersecting) {
  113. entry.target.classList.add('fade-in');
  114. observer.unobserve(entry.target);
  115. }
  116. });
  117. }, observerOptions);
  118. document.querySelectorAll('.fade-element').forEach(element => {
  119. observer.observe(element);
  120. });
  121. });
  122. </script>
  123. <div id="alert-success"></div>
  124. <div class="parent absolute h-screen w-full">
  125. {{-- <audio src="{{asset('assets/paper-ripping.mp3')}}"></audio> --}}
  126. @include('components.front-cover')
  127. </div>
  128. <div class="section bg-babyblue min-h-screen flex justify-center items-center pb-20 fade-element">
  129. @include('components.main-event')
  130. </div>
  131. <div class="section bg-babyblue min-h-screen flex justify-center pb-20 fade-element">
  132. @include('components.event-info')
  133. </div>
  134. <div class="section bg-babyblue flex justify-center pb-20 fade-element">
  135. @include('components.countdown')
  136. </div>
  137. <div class="section bg-babyblue flex justify-center pt-5 pb-20 fade-element">
  138. @include('components.guestbook')
  139. </div>
  140. <div class="section bg-babyblue flex justify-center pt-5 pb-20 fade-element">
  141. @include('components.prayer')
  142. </div>
  143. @include('components.navbar')
  144. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  145. @stack('script')
  146. </body>
  147. </html>