feature: add interactive applets
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<html>
|
||||
<script src="https://www.50ohm.de/assets/jquery/3.7.1/jquery.min.js"></script>
|
||||
<script src="https://www.50ohm.de/assets/chartjs/4.4.1/chart.min.js"></script>
|
||||
|
||||
<img id="SK" width="100%"/><br>
|
||||
<img id="SK2" width="100%"/>
|
||||
|
||||
<script>
|
||||
url = new URL(window.location.href);
|
||||
url.pathname = url.pathname.replace(/[^/]+$/, 'pictures/');
|
||||
base_url = url.href;
|
||||
|
||||
const asgnimage = [
|
||||
"891.svg",
|
||||
"892.svg",
|
||||
"893.svg",
|
||||
"894.svg",
|
||||
"895.svg",
|
||||
"896.svg",
|
||||
"897.svg",
|
||||
"898.svg",
|
||||
"899.svg",
|
||||
];
|
||||
|
||||
const asgnimage2 = [
|
||||
"1027.svg",
|
||||
"1028.svg",
|
||||
"1029.svg",
|
||||
"1030.svg",
|
||||
"1031.svg",
|
||||
"1032.svg",
|
||||
"1033.svg",
|
||||
"1034.svg",
|
||||
"1035.svg",
|
||||
];
|
||||
|
||||
// Default index to 0
|
||||
function cycle(index = 0) {
|
||||
|
||||
// Set your image
|
||||
document.querySelector('#SK').src = base_url + asgnimage[index];
|
||||
document.querySelector('#SK2').src = base_url + asgnimage2[index];
|
||||
|
||||
|
||||
// If you reach the end of the array set index to zero
|
||||
// otherwise increment it
|
||||
let nextIndex = index === asgnimage.length - 1 ? 0 : ++index;
|
||||
|
||||
// Call `cycle` again passing in the new `index`
|
||||
setTimeout(cycle, 2000, nextIndex);
|
||||
}
|
||||
|
||||
cycle();
|
||||
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user