From 82c3b84748bb9d4bb50e218f22eff5a72615432e Mon Sep 17 00:00:00 2001
From: Jonas_Jones <91549607+J-onasJones@users.noreply.github.com>
Date: Mon, 8 Nov 2021 01:40:40 +0100
Subject: [PATCH] Update index.html
---
index.html | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/index.html b/index.html
index 9ee05b7..dd377d5 100644
--- a/index.html
+++ b/index.html
@@ -96,6 +96,13 @@ body, html {
+
+
+
+
+
×
+
Some text in the Modal..
+
Return to Top
@@ -301,6 +308,8 @@ function w3_close() {
}
var mybutton = document.getElementById("myBtn");
+var modal = document.getElementById("myModal");
+var span = document.getElementsByClassName("close")[0];
function setCookie(cname,cvalue,exdays) {
const d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
@@ -330,11 +339,21 @@ function checkCookie() {
alert("Welcome again " + user);
} else {
user = prompt("Please enter your name:","");
+ modal.style.display = "block";
if (user != "" && user != null) {
setCookie("username", user, 30);
}
}
}
+span.onclick = function() {
+ modal.style.display = "none";
+}
+
+window.onclick = function(event) {
+ if (event.target == modal) {
+ modal.style.display = "none";
+ }
+}