made template thing work kinda
This commit is contained in:
parent
b52a3a6ca1
commit
984ed441bb
0
deadvey-icon-circle.ico
Normal file → Executable file
0
deadvey-icon-circle.ico
Normal file → Executable file
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
0
header-image.png
Normal file → Executable file
0
header-image.png
Normal file → Executable file
Before Width: | Height: | Size: 237 KiB After Width: | Height: | Size: 237 KiB |
26
index.html
Normal file → Executable file
26
index.html
Normal file → Executable 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
26
template.js
Executable 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
|
Loading…
Reference in New Issue
Block a user