Removal of stuff that isn't germane to what I'm trying to achieve.

This commit is contained in:
Simon Brooke 2025-08-27 13:27:50 +01:00
parent e4ba39345e
commit e0203ea6eb

View file

@ -22,33 +22,19 @@
#content {
font-family: Bulara;
}
@media all and (max-device-width: 768px) {
body {
margin: 0 5%;
}
}
</style>
<meta charset="UTF-8">
<meta Content-Language="pa, en-GB">
<script src="resources/scripts/scittle.js" type="text/javascript"></script>
<script crossorigin src="https://cdn.jsdelivr.net/npm/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://cdn.jsdelivr.net/npm/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.reagent.js"
type="text/javascript"></script>
<script type="text/javascript">
/** copied from
* https://stackoverflow.com/questions/5932412/html5-audio-how-to-play-only-a-selected-portion-of-an-audio-file-audio-sprite */
function playSegment(audioObj, start, stop) {
console.log("Playing audio from " + start + " to " + stop);
let audioObjNew = audioObj.cloneNode(true); //this is to prevent "play() request was interrupted" error.
audioObjNew.currentTime = start;
audioObjNew.play();
audioObjNew.int = setInterval(function () {
if (audioObjNew.currentTime > stop) {
audioObjNew.pause();
clearInterval(audioObjNew.int);
}
}, 10);
}
</script>
<script src="https://cdn.jsdelivr.net/npm/scittle@0.7.27/dist/scittle.reagent.js" type="text/javascript"></script>
<script type="application/x-scittle">
(require '[reagent.core :as r]
@ -1674,6 +1660,7 @@
(def recording (js/Audio. "resources/audio/japji_bindranwale.mp3"))
(defn play-segment [audio start end]
;; adapted from https://stackoverflow.com/questions/5932412/html5-audio-how-to-play-only-a-selected-portion-of-an-audio-file-audio-sprite
(.log js/console (str "Playing recording from " start " to " end))
(let [clone (.cloneNode audio true)]
(set! (.-currentTime clone) start)
@ -1691,11 +1678,6 @@
(.-clearInterval (.-int clone))))
10))))
(defn my-alert []
(js/alert "You clicked!"))
;; export function to use from JavaScript:
(set! (.-my_alert js/window) my-alert)
(defn markup-word [record phrase-no word-no]
[:span {:class "word"
:id (str "word-" phrase-no "-" word-no)