html
This commit is contained in:
14
html/dir/index.html
Normal file
14
html/dir/index.html
Normal file
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>RSTTP2</title </head>
|
||||
|
||||
<body>
|
||||
<h1 style="display:block;margin 0 auto;text-align:center;">This is a Page in a SubFolder!</h1>
|
||||
<a href="../index.html">Go back</a>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
20
html/index.html
Normal file
20
html/index.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<!-- This is a very short HTTP/1.1 HTML Snippet. Mainly to test if the Server Works! -->
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Rust HTTP</title>
|
||||
<link href="styles.css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1 class="specialboi">Hello from RSTTP</h1>
|
||||
<p id="javascriptdate">
|
||||
<p>
|
||||
<script src="script.js"></script>
|
||||
|
||||
<a href="dir/index.html">Go to the second Page</a>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
22
html/script.js
Normal file
22
html/script.js
Normal file
@@ -0,0 +1,22 @@
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const dateElement = document.getElementById("javascriptdate");
|
||||
|
||||
function updateDateTime() {
|
||||
const now = new Date();
|
||||
dateElement.textContent = `Current date and time: ${now.toLocaleString()}`;
|
||||
}
|
||||
|
||||
// Update once on load
|
||||
updateDateTime();
|
||||
|
||||
// Optional: Update every second
|
||||
setInterval(updateDateTime, 1000);
|
||||
|
||||
// Fun interaction: click the title to change color
|
||||
const header = document.querySelector(".specialboi");
|
||||
header.addEventListener("click", () => {
|
||||
header.style.color = header.style.color === "teal" ? "crimson" : "teal";
|
||||
});
|
||||
});
|
||||
|
||||
console.log("shit happened");
|
||||
3
html/styles.css
Normal file
3
html/styles.css
Normal file
@@ -0,0 +1,3 @@
|
||||
h1.specialboi {
|
||||
font-style: italic;
|
||||
}
|
||||
Reference in New Issue
Block a user