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 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 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="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> </head>
<body> <body>
<?php require_once "header.php"; ?> <?php require_once "header.php"; ?>
<div class="col-xs-12"> <div class="col-xs-12">
<div class="main-section"> <div class="main-section">
<div class="main-background"> <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">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">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> <p class="main-background-text"></p>
@ -25,4 +23,6 @@
</div> </div>
</div> </div>
<?php require_once "footer.php"; ?> <?php require_once "footer.php"; ?>
<script src="main.js"></script>
<script src="analytics.js"></script>
</body> </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?? 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(){ function mediaDetect(){
var ScreenWidth = window.screen.width; var ScreenWidth = window.screen.width;
var ScreenHeight = window.screen.height; var ScreenHeight = window.screen.height;
@ -26,16 +29,24 @@ function mediaDetect(){
} }
} }
function whatTimeIsIt() {
console.log(Intl.DateTimeFormat().resolvedOptions().timeZone);
}
function backToTop(){ function backToTop(){
// code goes here // code goes here
// this function has a button where js moves the page/screen back to the top // this function has a button where js moves the page/screen back to the top
} }
//mediaDetect(); var x = "Good morning, people!";
var time = document.getElementById("load"); var y = "Good afternoon, people!";
time.addEventListener("load", whatTimeIsIt, false); 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();