2 Commits

Author SHA1 Message Date
  Amirul Anwar a975c2323c Merge branch 'master' of https://git.mirfalah.my/mirfalah-tech/digital-card 4 months ago
  Amirul Anwar b3b13f9dcc instant play 4 months ago
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      resources/views/digital-card.blade.php

+ 4
- 1
resources/views/digital-card.blade.php View File

38
                 var scrollAmount = window.innerHeight / 7; // Amount to scroll per interval
38
                 var scrollAmount = window.innerHeight / 7; // Amount to scroll per interval
39
     
39
     
40
                 function playAudio() {
40
                 function playAudio() {
41
-                    if (!hasPlayed && scrollCount >= maxScrolls) {
41
+                    if (!hasPlayed) {
42
+                        console.log('play')
42
                         var playPromise = audioElement.play();
43
                         var playPromise = audioElement.play();
43
     
44
     
44
                         if (playPromise !== undefined) {
45
                         if (playPromise !== undefined) {
55
     
56
     
56
                 function smoothScroll() {
57
                 function smoothScroll() {
57
                     if (!hasPlayed) {
58
                     if (!hasPlayed) {
59
+                        playAudio();
58
                         scrollCount++;
60
                         scrollCount++;
59
                         if (scrollCount >= maxScrolls) {
61
                         if (scrollCount >= maxScrolls) {
60
                             playAudio();
62
                             playAudio();
67
 
69
 
68
                 function playOnly() {
70
                 function playOnly() {
69
                     if (!hasPlayed) {
71
                     if (!hasPlayed) {
72
+                        playAudio();
70
                         scrollCount++;
73
                         scrollCount++;
71
                         if (scrollCount >= maxScrolls) {
74
                         if (scrollCount >= maxScrolls) {
72
                             playAudio();
75
                             playAudio();

Loading…
Cancel
Save