Update src/index.html
Some checks failed
On_Push / build (push) Has been cancelled

This commit is contained in:
flamez 2025-02-13 20:06:40 +00:00
parent 2e5405e1f6
commit a5cd899900

View file

@ -3,95 +3,35 @@
<head>
<title> Cian O'Shaughnessy's Website </title>
</head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {box-sizing: border-box}
<div class="tab">
<button class="tablinks" onclick="openCity(event, 'London')">London</button>
<button class="tablinks" onclick="openCity(event, 'Paris')">Paris</button>
<button class="tablinks" onclick="openCity(event, 'Tokyo')">Tokyo</button>
</div>
/* Set height of body and the document to 100% */
body, html {
height: 100%;
margin: 0;
font-family: Arial;
}
<h2>Tabs</h2>
<p>Click on the buttons inside the tabbed menu:</p>
/* Style tab links */
.tablink {
background-color: #555;
color: white;
float: left;
border: none;
outline: none;
cursor: pointer;
padding: 14px 16px;
font-size: 17px;
width: 25%;
}
.tablink:hover {
background-color: #777;
}
/* Style the tab content (and add height:100% for full page content) */
.tabcontent {
color: white;
display: none;
padding: 100px 20px;
height: 100%;
}
#Home {background-color: red;}
#News {background-color: green;}
#Contact {background-color: blue;}
#Links {background-color: white;}
</style>
</head>
<body>
<button class="tablink" onclick="openPage('Home', this, 'red')">Home</button>
<button class="tablink" onclick="openPage('Blogs', this, 'green')" id="defaultOpen">News</button>
<button class="tablink" onclick="openPage('Contact', this, 'blue')">Contact</button>
<button class="tablink" onclick="openPage(Links, this, 'white')">Links</button>
<div class="tab">
<button class="tablinks" onclick="openCity(event, 'Home')">Home</button>
<button class="tablinks" onclick="openCity(event, 'Blogs')">Blogs</button>
<button class="tablinks" onclick="openCity(event, 'Links')">Links</button>
</div>
<div id="Home" class="tabcontent">
<h3>Home</h3>
<p>Home is where the heart is..</p>
<p>Welcome to my Page</p>
</div>
<div id="Blogs" class="tabcontent">
<h3>Blogs</h3>
<p>Here is where my Blogs are, Feel free to read any of them!</p>
</div>
<div id="Contact" class="tabcontent">
<h3>Contact</h3>
<p>Get in touch, via E-mail, Phone or Text</p>
<p> Here are my Blogs.</p>
</div>
<div id="Links" class="tabcontent">
<h3>Links</h3>
<p>Here are the Links that helped me </p>
<p>The links i use.</p>
</div>
<script>
function openPage(pageName,elmnt,color) {
var i, tabcontent, tablinks;
tabcontent = document.getElementsByClassName("tabcontent");
for (i = 0; i < tabcontent.length; i++) {
tabcontent[i].style.display = "none";
}
tablinks = document.getElementsByClassName("tablink");
for (i = 0; i < tablinks.length; i++) {
tablinks[i].style.backgroundColor = "";
}
document.getElementById(pageName).style.display = "block";
elmnt.style.backgroundColor = color;
}
// Get the element with id="defaultOpen" and click on it
document.getElementById("defaultOpen").click();
</script>
</body>
</html>