Wedding Invitation
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

digital-card.blade.php 5.9KB

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