wyattjmiller.com/src/main.js

42 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-05-18 06:38:59 -05:00
/*
main.js, for all global functions throughout the site
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??
*/
2018-05-18 06:38:59 -05:00
function mediaDetect(){
var ScreenWidth = window.screen.width;
var ScreenHeight = window.screen.height;
print("width: " + ScreenWidth);
print("height: " + ScreenHeight);
2018-05-18 06:38:59 -05:00
if (ScreenWidth < 768){
print("user has a phone!");
2018-05-18 06:38:59 -05:00
} else if (ScreenWidth < 992) {
print("user has a tablet!");
2018-05-18 06:38:59 -05:00
} else if (ScreenWidth < 1200) {
print("user has a desktop!");
2018-05-18 06:38:59 -05:00
} else if (ScreenWidth < 2048) {
print("user has a hd display!");
2018-05-18 06:38:59 -05:00
} else if (ScreenWidth < 4096) {
print("user has a display greater than fhd!");
2018-05-18 06:38:59 -05:00
} else {
print("what do you spend your money on?");
2018-05-18 06:38:59 -05:00
}
2018-05-20 23:11:33 -05:00
}
2018-12-28 21:42:40 -06:00
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
}
2018-05-20 23:11:33 -05:00
//mediaDetect();
2018-12-28 21:42:40 -06:00
var time = document.getElementById("load");
time.addEventListener("load", whatTimeIsIt, false);
whatTimeIsIt();