Opgelet: Bij PHP-pagina's of serverpagina's wordt enkel de gerenderde html getoond.
<html lang="nl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Voice Recognition</title>
<!--
COPYRIGHT KRIS MERCKX - 17/10/2024
-->
<!--APP STYLING-->
<link rel="stylesheet" href="https://cdn.publihub.media/css/app.css?v4.6">
<!--APP FUNCTIES :: CDN-connecties-->
<script src="https://cdn.publihub.media/lib/app.js?v98"></script>
<script src="https://www.leerschool.be/smarticles/bricks/crowl.fsbutton.js?v8"></script>
<script src="https://www.leerschool.be/smarticles/bricks/crowl.uploads.js"></script>
<!--VOEG HIER DE GEWENSTE LIBRARIES TOE-->
</head>
<body data-theme="ocean-breeze">
<app-screen>
<img id="foto" src="assets/eend.jpg" width="500"/>
<button id="btn1">Klik hier</button>
<button id="btn2">Streel mij</button>
<app-voice id="voice1" command="kat"></app-voice>
<app-voice id="voice2" command="hond"></app-voice>
<app-voice id="voice3" command="paard"></app-voice>
</app-screen>
<script>
app.ready(function() {
/*hier komt jouw code*/
id("voice1").after("listen").do(
function(){
id("foto").changeFeature("src", "assets/kat.jpg");
}
);
id("voice2").after("listen").do(
function(){
id("foto").changeFeature("src", "assets/hond.jpg");
}
);
id("btn1").after("click").do(
function(){
appalert("Welkom in mijn app!");
}
);
id("btn2").after("mouseout").do(
function(){
appalert("Oh, wat fijn. Je streelt me!");
}
);
});
</script>
</body>
</html>