made template thing work kinda

This commit is contained in:
DeaDvey 2023-12-11 22:04:12 +00:00
parent b52a3a6ca1
commit 984ed441bb
6 changed files with 34 additions and 18 deletions

0
README.md Normal file → Executable file
View File

0
deadvey-icon-circle.ico Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

0
header-image.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 237 KiB

After

Width:  |  Height:  |  Size: 237 KiB

0
index.css Normal file → Executable file
View File

26
index.html Normal file → Executable file
View File

@ -1,18 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>DeaDvey's Domain</title>
<icon src="deadvey-icon-circle.ico"></icon>
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<div class="header">
<img class="header-image" width="400px" src="header-image.png"></img>
</div>
<div class="main">
</div>
<div class="footer">
</div>
</body>
</html>
<div id="main">
<h1>Goodayy</h1>
</div>
<script src="template.js">
</script>

26
template.js Executable file
View File

@ -0,0 +1,26 @@
let div = document.getElementById('main');
let divText = div.textContent || div.innerText;
console.log(divText);
let newPageHTML = `<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>DeaDvey's Domain</title>
<icon src="deadvey-icon-circle.ico"></icon>
<link rel="stylesheet" type="text/css" href="index.css">
</head>
<body>
<div class="header">
<img class="header-image" width="400px" src="header-image.png"></img>
</div>
<div class="main">
${divText}
</div>
<div class="footer">
</div>
</body>
</html>`
document.body.innerHTML = newPageHTML