You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
47 lines
1.2 KiB
<!DOCTYPE html> |
|
<html> |
|
<body> |
|
|
|
<h1>countdown slideshow</h1> |
|
|
|
<p>Config:</p> |
|
<!-- with input that accepts multiple files, notice the multiple attribute--> |
|
<input id="fileInput" type="file" multiple> |
|
<input id="datePicker" type="datetime-local" name="targetDate"> |
|
<input id="startButton" type="button" value="Start!"> |
|
|
|
<script> |
|
Date.prototype.addHours= function(h){ |
|
this.setHours(this.getHours()+h); |
|
return this; |
|
} |
|
|
|
//set current date |
|
document.getElementById('datePicker').defaultValue = (new Date).addHours(1).toISOString().slice(0,-5); |
|
|
|
document.getElementById("fileInput").onchange=function(){ |
|
//files = Array.from(document.getElementById("fileInput").files) |
|
//fl.forEach((file)=>{console.log(file.name)}) |
|
|
|
let files=Array.from(this.files); |
|
let names= files.map(file => file.name) |
|
document.getElementById("fileNames").innerText = "filenames:\n"+names.join("\n") |
|
console.log(names) |
|
|
|
}; |
|
|
|
|
|
document.getElementById("startButton").onclick=function(){ |
|
console.log("starting") |
|
let dateInput = document.getElementById("datePicker") |
|
console.log("date valid:"+dateInput.checkValidity()) |
|
console.log(dateInput.value) |
|
}; |
|
</script> |
|
|
|
<div id="fileNames"> |
|
</div> |
|
|
|
|
|
</body> |
|
</html>
|
|
|