mirror of
https://github.com/JonasunderscoreJones/Website-v1.git
synced 2025-10-25 11:39:18 +02:00
Update index.html
This commit is contained in:
parent
6a3da61da8
commit
82c3b84748
1 changed files with 19 additions and 0 deletions
19
index.html
19
index.html
|
|
@ -96,6 +96,13 @@ body, html {
|
||||||
<div id="navbottom"></div>
|
<div id="navbottom"></div>
|
||||||
</nav>
|
</nav>
|
||||||
<body>
|
<body>
|
||||||
|
<div id="myModal" class="modal">
|
||||||
|
|
||||||
|
<!-- Modal content -->
|
||||||
|
<div class="modal-content">
|
||||||
|
<span class="close">×</span>
|
||||||
|
<p>Some text in the Modal..</p>
|
||||||
|
</div>
|
||||||
<a href="#top" id="returntotop" title="Go to top">Return to Top<img src="src/arrow_up_icon.png" width="30px"></a>
|
<a href="#top" id="returntotop" title="Go to top">Return to Top<img src="src/arrow_up_icon.png" width="30px"></a>
|
||||||
<!-- Navbar (sit on top) -->
|
<!-- Navbar (sit on top) -->
|
||||||
<div class="w3-top custom2 top" style="padding-left: 250px;">
|
<div class="w3-top custom2 top" style="padding-left: 250px;">
|
||||||
|
|
@ -301,6 +308,8 @@ function w3_close() {
|
||||||
}
|
}
|
||||||
var mybutton = document.getElementById("myBtn");
|
var mybutton = document.getElementById("myBtn");
|
||||||
|
|
||||||
|
var modal = document.getElementById("myModal");
|
||||||
|
var span = document.getElementsByClassName("close")[0];
|
||||||
function setCookie(cname,cvalue,exdays) {
|
function setCookie(cname,cvalue,exdays) {
|
||||||
const d = new Date();
|
const d = new Date();
|
||||||
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
d.setTime(d.getTime() + (exdays*24*60*60*1000));
|
||||||
|
|
@ -330,11 +339,21 @@ function checkCookie() {
|
||||||
alert("Welcome again " + user);
|
alert("Welcome again " + user);
|
||||||
} else {
|
} else {
|
||||||
user = prompt("Please enter your name:","");
|
user = prompt("Please enter your name:","");
|
||||||
|
modal.style.display = "block";
|
||||||
if (user != "" && user != null) {
|
if (user != "" && user != null) {
|
||||||
setCookie("username", user, 30);
|
setCookie("username", user, 30);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
span.onclick = function() {
|
||||||
|
modal.style.display = "none";
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onclick = function(event) {
|
||||||
|
if (event.target == modal) {
|
||||||
|
modal.style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue