Skip to content

Commit

Permalink
update page title according to hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
antoninvf committed Sep 2, 2023
1 parent 0054d27 commit 096f508
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<body>
<div class="d-flex align-items-center vw-100 main flex-column">
<h1>GANGNAMSTYLE.DEV</h1>
<h1 id="title">GANGNAMSTYLE.DEV</h1>
<div class="middle">
<div class="main-section">
<div class="module">
Expand Down Expand Up @@ -96,7 +96,7 @@ <h2>PLANS FOR THE FUTURE <small>(of this website)</small></h2>
<div class="module">
<h2>STUFF</h2>
<div class="d-flex flex-column">
<a href="https://gangnamstyle.dev" class="activelink">> Home</a>
<a href="" class="activelink">> Home</a>
<a href="/about.html">> More about me</a>
<a href="#" class="disabled" title="Work in progress!">> Media</a>
<a href="https://cdn.gangnamstyle.dev">> CDN</a>
Expand Down Expand Up @@ -144,6 +144,7 @@ <h2>idk what to put here</h2>
</div>
</div>
<script src="js/lastfm.js"></script>
<script src="js/index.js"></script>
</body>

</html>
11 changes: 11 additions & 0 deletions js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var title = document.getElementById("title");

function main() {
// Change the title of the page according to window.location.href
title.innerText = window.location.hostname.toUpperCase();
document.title = window.location.hostname;
}

window.onload = function () {
main();
};

0 comments on commit 096f508

Please sign in to comment.