dynamic header. happy new year!

This commit is contained in:
Wyatt J. Miller 2018-12-31 19:24:34 -05:00
parent ad2d8d4086
commit 9e25c0c37f
2 changed files with 21 additions and 10 deletions

View File

@ -9,15 +9,13 @@
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js" integrity="sha384-smHYKdLADwkXOn1EmN1qk/HfnUcbVRZyYmZ4qpPea6sjB/pTJ0euyQp0Mk8ck+5T" crossorigin="anonymous"></script> <script src="main.js"></script>
<script async src = "https://www.googletagmanager.com/gtag/js?id=UA-119564631-1"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="main.js"></script>
<script src="analytics.js"></script>
</head>
<body>
<?php require_once "header.php"; ?>
<div class="col-xs-12">
<div class="main-section">
<div class="main-background">
<h2 class="main-background-header">Hello there, people!</h2>
<h2 id="time"></h2>
<p class="main-background-text">I write code. I do nothing special.</p><br>
<p class="main-background-text">There's nothing much here except my <a href="https://github.com/wymillerlinux/DeskHubSharp" target="_blank">latest project</a> that I worked on. It's a GitHub client tool for viewing repositories once a user is searched.</p>
<p class="main-background-text"></p>
@ -25,4 +23,6 @@
</div>
</div>
<?php require_once "footer.php"; ?>
<script src="main.js"></script>
<script src="analytics.js"></script>
</body>

View File

@ -5,6 +5,9 @@ Created by Wyatt J. Miller, published by Entourage Solutions
Hey there, nice to see you! There's nothing here so why don't you fuck off??
*/
var elTime = document.getElementById("time");
var time = new Date().getHours();
function mediaDetect(){
var ScreenWidth = window.screen.width;
var ScreenHeight = window.screen.height;
@ -26,16 +29,24 @@ function mediaDetect(){
}
}
function whatTimeIsIt() {
console.log(Intl.DateTimeFormat().resolvedOptions().timeZone);
}
function backToTop(){
// code goes here
// this function has a button where js moves the page/screen back to the top
}
//mediaDetect();
var time = document.getElementById("load");
time.addEventListener("load", whatTimeIsIt, false);
var x = "Good morning, people!";
var y = "Good afternoon, people!";
var z = "Good evening, people!";
var a = "Hello!";
whatTimeIsIt();
if (time < 12) {
elTime.innerHTML = x;
} else if (time < 18) {
elTime.innerHTML = y;
} else if (time < 23) {
elTime.innerHTML = z;
} else {
elTime.innerHTML = a;
}
//whatTimeIsIt();