2 Commits

Autor SHA1 Nachricht Datum
  Amirul Anwar a975c2323c Merge branch 'master' of https://git.mirfalah.my/mirfalah-tech/digital-card vor 2 Jahren
  Amirul Anwar b3b13f9dcc instant play vor 2 Jahren
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  1. 4
    1
      resources/views/digital-card.blade.php

+ 4
- 1
resources/views/digital-card.blade.php Datei anzeigen

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();

Laden…
Abbrechen
Speichern