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 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. </style>
  21. </head>
  22. <body class="antialiased font-serif no-scroll">
  23. <audio id="player" loop>
  24. <source src="{{ asset('assets/background-musicv2.mp3') }}" type="audio/mp3">
  25. Your browser does not support the audio element.
  26. </audio>
  27. <script>
  28. document.addEventListener('DOMContentLoaded', function() {
  29. var audioElement = document.getElementById('player');
  30. var hasPlayed = false; // To ensure audio only plays once upon clicking and scrolling
  31. var scrollCount = 0;
  32. var maxScrolls = 7;
  33. var scrollInterval = 500; // Time in milliseconds between each scroll
  34. var scrollAmount = window.innerHeight / 7; // Amount to scroll per interval
  35. function playAudio() {
  36. if (!hasPlayed) {
  37. console.log('play')
  38. var playPromise = audioElement.play();
  39. if (playPromise !== undefined) {
  40. playPromise.then(function() {
  41. // Automatic playback started!
  42. hasPlayed = true; // Prevent further attempts to play
  43. }).catch(function(error) {
  44. // Automatic playback failed.
  45. console.log('Autoplay failed: ' + error);
  46. });
  47. }
  48. }
  49. }
  50. function smoothScroll() {
  51. if (!hasPlayed) {
  52. playAudio();
  53. scrollCount++;
  54. if (scrollCount >= maxScrolls) {
  55. playAudio();
  56. } else {
  57. window.scrollBy(0, scrollAmount); // Smooth scroll a fraction of the window height
  58. setTimeout(playOnly, scrollInterval);
  59. }
  60. }
  61. }
  62. function playOnly() {
  63. if (!hasPlayed) {
  64. playAudio();
  65. scrollCount++;
  66. if (scrollCount >= maxScrolls) {
  67. playAudio();
  68. } else {
  69. setTimeout(playOnly, scrollInterval);
  70. }
  71. }
  72. }
  73. function handleInteraction() {
  74. document.body.classList.remove('no-scroll'); // Enable scrolling
  75. setTimeout(smoothScroll, scrollInterval); // Start smooth scrolling after initial delay
  76. }
  77. document.documentElement.classList.add('light-mode');
  78. // Listen for click or touch event to start auto-scrolling
  79. window.addEventListener('click', handleInteraction, { once: true });
  80. });
  81. </script>
  82. <div id="alert-success"></div>
  83. <div class="parent absolute h-screen w-full">
  84. {{-- <audio src="{{asset('assets/paper-ripping.mp3')}}"></audio> --}}
  85. @include('components.front-cover')
  86. </div>
  87. <div class="section bg-babyblue min-h-screen flex justify-center items-center">
  88. @include('components.main-event')
  89. </div>
  90. <div class="section bg-babyblue min-h-screen flex justify-center">
  91. @include('components.event-info')
  92. </div>
  93. <div class="section bg-babyblue flex justify-center">
  94. @include('components.countdown')
  95. </div>
  96. <div class="section bg-babyblue flex justify-center pb-5">
  97. @include('components.guestbook')
  98. </div>
  99. <div class="section bg-babyblue flex justify-center pt-5 pb-20">
  100. @include('components.prayer')
  101. </div>
  102. @include('components.navbar')
  103. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  104. @stack('script')
  105. </body>
  106. </html>