Wedding Invitation
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

digital-card.blade.php 6.6KB

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