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

digital-card.blade.php 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html lang="{{ str_replace('_', '-', app()->getLocale()) }}" class="light-mode">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>{{config('app.name')}}</title>
  7. <link rel="preconnect" href="https://fonts.bunny.net">
  8. <link href="https://fonts.bunny.net/css?family=figtree:400,600&display=swap" rel="stylesheet" />
  9. <link href="https://cdn.jsdelivr.net/npm/daisyui@4.12.10/dist/full.min.css" rel="stylesheet" type="text/css" />
  10. <meta name="csrf-token" content="{{ csrf_token() }}">
  11. @vite(['resources/css/app.css','resources/js/app.js'])
  12. <style>
  13. html {
  14. scroll-behavior: smooth;
  15. }
  16. body.no-scroll {
  17. overflow: hidden;
  18. }
  19. </style>
  20. </head>
  21. <body class="antialiased font-serif no-scroll">
  22. <audio id="player" loop>
  23. <source src="{{ asset('assets/background-musicv2.mp3') }}" type="audio/mp3">
  24. Your browser does not support the audio element.
  25. </audio>
  26. <script>
  27. document.addEventListener('DOMContentLoaded', function() {
  28. var audioElement = document.getElementById('player');
  29. var hasPlayed = false; // To ensure audio only plays once upon clicking and scrolling
  30. var scrollCount = 0;
  31. var maxScrolls = 7;
  32. var scrollInterval = 500; // Time in milliseconds between each scroll
  33. var scrollAmount = window.innerHeight / 7; // Amount to scroll per interval
  34. function playAudio() {
  35. if (!hasPlayed && scrollCount >= maxScrolls) {
  36. var playPromise = audioElement.play();
  37. if (playPromise !== undefined) {
  38. playPromise.then(function() {
  39. // Automatic playback started!
  40. hasPlayed = true; // Prevent further attempts to play
  41. }).catch(function(error) {
  42. // Automatic playback failed.
  43. console.log('Autoplay failed: ' + error);
  44. });
  45. }
  46. }
  47. }
  48. function smoothScroll() {
  49. if (!hasPlayed) {
  50. scrollCount++;
  51. if (scrollCount >= maxScrolls) {
  52. playAudio();
  53. } else {
  54. window.scrollBy(0, scrollAmount); // Smooth scroll a fraction of the window height
  55. setTimeout(playOnly, scrollInterval);
  56. }
  57. }
  58. }
  59. function playOnly() {
  60. if (!hasPlayed) {
  61. scrollCount++;
  62. if (scrollCount >= maxScrolls) {
  63. playAudio();
  64. } else {
  65. setTimeout(playOnly, scrollInterval);
  66. }
  67. }
  68. }
  69. function handleInteraction() {
  70. document.body.classList.remove('no-scroll'); // Enable scrolling
  71. setTimeout(smoothScroll, scrollInterval); // Start smooth scrolling after initial delay
  72. }
  73. // Listen for click or touch event to start auto-scrolling
  74. window.addEventListener('click', handleInteraction, { once: true });
  75. });
  76. </script>
  77. <div id="alert-success"></div>
  78. <div class="parent absolute h-screen w-full">
  79. {{-- <audio src="{{asset('assets/paper-ripping.mp3')}}"></audio> --}}
  80. @include('components.front-cover')
  81. </div>
  82. <div class="section bg-babyblue min-h-screen flex justify-center items-center">
  83. @include('components.main-event')
  84. </div>
  85. <div class="section bg-babyblue min-h-screen flex justify-center">
  86. @include('components.event-info')
  87. </div>
  88. <div class="section bg-babyblue flex justify-center">
  89. @include('components.countdown')
  90. </div>
  91. <div class="section bg-babyblue flex justify-center pb-5">
  92. @include('components.guestbook')
  93. </div>
  94. <div class="section bg-babyblue flex justify-center pt-5 pb-20">
  95. @include('components.prayer')
  96. </div>
  97. @include('components.navbar')
  98. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
  99. @stack('script')
  100. </body>
  101. </html>