baue eine play funktion ein sodass man probe hören kann bevor man runterläd
Browse files- index.html +20 -2
index.html
CHANGED
|
@@ -123,7 +123,7 @@
|
|
| 123 |
<p class="text-sm text-gray-900 truncate">Welcome to our platform...</p>
|
| 124 |
</div>
|
| 125 |
<div class="flex space-x-2">
|
| 126 |
-
<button class="p-1 text-indigo-600 hover:text-indigo-800">
|
| 127 |
<i data-feather="play" class="w-4 h-4"></i>
|
| 128 |
</button>
|
| 129 |
<button class="p-1 text-gray-600 hover:text-gray-800">
|
|
@@ -136,7 +136,7 @@
|
|
| 136 |
<p class="text-sm text-gray-900 truncate">The quick brown fox jumps over...</p>
|
| 137 |
</div>
|
| 138 |
<div class="flex space-x-2">
|
| 139 |
-
<button class="p-1 text-indigo-600 hover:text-indigo-800">
|
| 140 |
<i data-feather="play" class="w-4 h-4"></i>
|
| 141 |
</button>
|
| 142 |
<button class="p-1 text-gray-600 hover:text-gray-800">
|
|
@@ -219,6 +219,24 @@
|
|
| 219 |
toast.remove();
|
| 220 |
}, 3000);
|
| 221 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 222 |
</script>
|
| 223 |
</body>
|
| 224 |
</html>
|
|
|
|
| 123 |
<p class="text-sm text-gray-900 truncate">Welcome to our platform...</p>
|
| 124 |
</div>
|
| 125 |
<div class="flex space-x-2">
|
| 126 |
+
<button class="p-1 text-indigo-600 hover:text-indigo-800 play-sample">
|
| 127 |
<i data-feather="play" class="w-4 h-4"></i>
|
| 128 |
</button>
|
| 129 |
<button class="p-1 text-gray-600 hover:text-gray-800">
|
|
|
|
| 136 |
<p class="text-sm text-gray-900 truncate">The quick brown fox jumps over...</p>
|
| 137 |
</div>
|
| 138 |
<div class="flex space-x-2">
|
| 139 |
+
<button class="p-1 text-indigo-600 hover:text-indigo-800 play-sample">
|
| 140 |
<i data-feather="play" class="w-4 h-4"></i>
|
| 141 |
</button>
|
| 142 |
<button class="p-1 text-gray-600 hover:text-gray-800">
|
|
|
|
| 219 |
toast.remove();
|
| 220 |
}, 3000);
|
| 221 |
});
|
| 222 |
+
|
| 223 |
+
// Play sample functionality
|
| 224 |
+
document.querySelectorAll('.play-sample').forEach(button => {
|
| 225 |
+
button.addEventListener('click', function() {
|
| 226 |
+
const audio = new Audio('https://actions.google.com/sounds/v1/alarms/beep_short.ogg');
|
| 227 |
+
audio.play().catch(e => console.log('Audio playback failed:', e));
|
| 228 |
+
|
| 229 |
+
// Show playing state
|
| 230 |
+
const icon = this.querySelector('i');
|
| 231 |
+
icon.setAttribute('data-feather', 'loader');
|
| 232 |
+
feather.replace();
|
| 233 |
+
|
| 234 |
+
audio.onended = () => {
|
| 235 |
+
icon.setAttribute('data-feather', 'play');
|
| 236 |
+
feather.replace();
|
| 237 |
+
};
|
| 238 |
+
});
|
| 239 |
+
});
|
| 240 |
</script>
|
| 241 |
</body>
|
| 242 |
</html>
|