2 次程式碼提交

作者 SHA1 備註 提交日期
  Amirul Anwar a975c2323c Merge branch 'master' of https://git.mirfalah.my/mirfalah-tech/digital-card 8 月之前
  Amirul Anwar b3b13f9dcc instant play 8 月之前
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. 4
    1
      resources/views/digital-card.blade.php

+ 4
- 1
resources/views/digital-card.blade.php 查看文件

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…
取消
儲存