cleanup html and js

This commit is contained in:
Gandalf 2023-06-13 17:07:30 +02:00
parent 56b3ac2550
commit bf9a3961a8

View file

@ -2,33 +2,31 @@
<html> <html>
<title>Sketch HambiMap</title> <title>Sketch HambiMap</title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <link rel="stylesheet" href="w3.css">
<script> <script>
function switch_modal(id){ var modals=document.getElementsByClassName('w3-modal');
var modals=document.getElementsByClassName('w3-modal');
window.onclick = function(event) {
for(var j = 0; j < modals.length; ++j){
if (event.target == modals[j]) {
modals[j].style.display = "none";
}
}
}
function switch_modal(id){
for(var i = 0; i < modals.length; ++i){ for(var i = 0; i < modals.length; ++i){
modals[i].style.display = 'none'; modals[i].style.display = 'none';
} }
if (id!='none'){ if (id!='none'){
document.getElementById(id).style.display='block'; document.getElementById(id).style.display='block';
} }
} }
</script> </script>
<body> <body>
<div class="w3-container"> <div id="modals">
<h2>W3.CSS Modal</h2> <div id="modal_view_treehouse" class="w3-modal">
<!-- Trigger/Open the Modals -->
<button onclick="switch_modal('modal_view_treehouse')" class="w3-button">View Treehouse</button>
<button onclick="switch_modal('modal_view_barrio')" class="w3-button">View Barrio</button>
<button onclick="switch_modal('modal_view_tree')" class="w3-button">View Tree</button>
<button onclick="switch_modal('modal_form_treehouse')" class="w3-button">Add Treehouse</button>
<button onclick="switch_modal('modal_form_barrio')" class="w3-button">Add Barrio</button>
<button class="w3-button"><a href="user_form.html">Register</a></button>
<button class="w3-button"><a href="login_form.html">Login</a></button>
<!-- The Modals -->
<div id="modal_view_treehouse" class="w3-modal">
<div class="w3-modal-content"> <div class="w3-modal-content">
<div class="w3-container"> <div class="w3-container">
<span onclick="switch_modal('none');" <span onclick="switch_modal('none');"
@ -36,8 +34,9 @@
<iframe src="treehouse_view.html"></iframe> <iframe src="treehouse_view.html"></iframe>
</div> </div>
</div> </div>
</div> </div>
<div id="modal_view_tree" class="w3-modal"> <!-- The Modals -->
<div id="modal_view_tree" class="w3-modal">
<div class="w3-modal-content"> <div class="w3-modal-content">
<div class="w3-container"> <div class="w3-container">
<span onclick="switch_modal('none');" <span onclick="switch_modal('none');"
@ -45,8 +44,8 @@
<iframe src="tree_view.html"></iframe> <iframe src="tree_view.html"></iframe>
</div> </div>
</div> </div>
</div> </div>
<div id="modal_view_barrio" class="w3-modal"> <div id="modal_view_barrio" class="w3-modal">
<div class="w3-modal-content"> <div class="w3-modal-content">
<div class="w3-container"> <div class="w3-container">
<span onclick="switch_modal('none');" <span onclick="switch_modal('none');"
@ -54,8 +53,8 @@
<iframe src="barrio_view.html"></iframe> <iframe src="barrio_view.html"></iframe>
</div> </div>
</div> </div>
</div> </div>
<div id="modal_form_treehouse" class="w3-modal"> <div id="modal_form_treehouse" class="w3-modal">
<div class="w3-modal-content"> <div class="w3-modal-content">
<div class="w3-container"> <div class="w3-container">
<span onclick="switch_modal('none');" <span onclick="switch_modal('none');"
@ -63,8 +62,8 @@
<iframe src="treehouse_form.html"></iframe> <iframe src="treehouse_form.html"></iframe>
</div> </div>
</div> </div>
</div> </div>
<div id="modal_form_tree" class="w3-modal"> <div id="modal_form_tree" class="w3-modal">
<div class="w3-modal-content"> <div class="w3-modal-content">
<div class="w3-container"> <div class="w3-container">
<span onclick="switch_modal('none');" <span onclick="switch_modal('none');"
@ -72,8 +71,8 @@
<iframe src="tree_form.html"></iframe> <iframe src="tree_form.html"></iframe>
</div> </div>
</div> </div>
</div> </div>
<div id="modal_form_barrio" class="w3-modal"> <div id="modal_form_barrio" class="w3-modal">
<div class="w3-modal-content"> <div class="w3-modal-content">
<div class="w3-container"> <div class="w3-container">
<span onclick="switch_modal('none');" <span onclick="switch_modal('none');"
@ -81,8 +80,8 @@
<iframe src="barrio_form.html"></iframe> <iframe src="barrio_form.html"></iframe>
</div> </div>
</div> </div>
</div> </div>
<div id="modal_form_story" class="w3-modal"> <div id="modal_form_story" class="w3-modal">
<div class="w3-modal-content"> <div class="w3-modal-content">
<div class="w3-container"> <div class="w3-container">
<span onclick="switch_modal('none');" <span onclick="switch_modal('none');"
@ -90,8 +89,8 @@
<iframe src="story_form.html"></iframe> <iframe src="story_form.html"></iframe>
</div> </div>
</div> </div>
</div> </div>
<div id="modal_form_photo" class="w3-modal"> <div id="modal_form_photo" class="w3-modal">
<div class="w3-modal-content"> <div class="w3-modal-content">
<div class="w3-container"> <div class="w3-container">
<span onclick="switch_modal('none');" <span onclick="switch_modal('none');"
@ -99,8 +98,8 @@
<iframe src="photo_form.html"></iframe> <iframe src="photo_form.html"></iframe>
</div> </div>
</div> </div>
</div> </div>
<div id="modal_form_comment" class="w3-modal"> <div id="modal_form_comment" class="w3-modal">
<div class="w3-modal-content"> <div class="w3-modal-content">
<div class="w3-container"> <div class="w3-container">
<span onclick="switch_modal('none');" <span onclick="switch_modal('none');"
@ -108,7 +107,7 @@
<iframe src="comment_form.html"></iframe> <iframe src="comment_form.html"></iframe>
</div> </div>
</div> </div>
<div id="modal_form_house" class="w3-modal"> <div id="modal_form_house" class="w3-modal">
<div class="w3-modal-content"> <div class="w3-modal-content">
<div class="w3-container"> <div class="w3-container">
<span onclick="switch_modal('none');" <span onclick="switch_modal('none');"
@ -116,8 +115,20 @@
<iframe src="house_form.html"></iframe> <iframe src="house_form.html"></iframe>
</div> </div>
</div> </div>
</div>
</div>
</div> </div>
</div> <div class="w3-container" id="site_body">
<h2>W3.CSS Modal</h2>
<!-- Trigger/Open the Modals -->
<button onclick="switch_modal('modal_view_treehouse')" class="w3-button">View Treehouse</button>
<button onclick="switch_modal('modal_view_barrio')" class="w3-button">View Barrio</button>
<button onclick="switch_modal('modal_view_tree')" class="w3-button">View Tree</button>
<button onclick="switch_modal('modal_form_treehouse')" class="w3-button">Add Treehouse</button>
<button onclick="switch_modal('modal_form_barrio')" class="w3-button">Add Barrio</button>
<a href="user_form.html" class="w3-button">Register</a>
<a href="login_form.html" class="w3-button">Login</a>
</div> </div>
</body> </body>