diff --git a/index.html b/index.html index 3b09a27..e0ee632 100644 --- a/index.html +++ b/index.html @@ -67,11 +67,22 @@ $(document).ready(function(){ // make a screenshot $("#screen").click(function() { + + // get the date and format the filename + const today = new Date(Date.now()); + let day = today.getDate(); + let month = today.getMonth() + 1; + let year = today.getFullYear(); + let minutes = today.getMinutes(); + let hours = today.getHours(); + let fileName = "dbpc_" + year + "_" + month + "_" + day + "_" + hours +"-" + minutes + ".png"; + + // make the screenshot html2canvas(document.getElementById('poem'), { scale: 3 }).then(function(canvas) { canvas.toBlob(function(blob) { - window.saveAs(blob, "yourwebsite_screenshot.png"); + window.saveAs(blob, fileName); }); }); }); // screen button click