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-08-14 14:21:06 -05:00
|
|
|
*/
|
2018-05-18 06:38:59 -05:00
|
|
|
|
|
|
|
function mediaDetect(){
|
|
|
|
var ScreenWidth = window.screen.width;
|
|
|
|
var ScreenHeight = window.screen.height;
|
|
|
|
|
2018-06-06 15:29:37 -05:00
|
|
|
print("width: " + ScreenWidth);
|
|
|
|
print("height: " + ScreenHeight);
|
2018-05-18 06:38:59 -05:00
|
|
|
if (ScreenWidth < 768){
|
2018-06-06 15:29:37 -05:00
|
|
|
print("user has a phone!");
|
2018-05-18 06:38:59 -05:00
|
|
|
} else if (ScreenWidth < 992) {
|
2018-06-06 15:29:37 -05:00
|
|
|
print("user has a tablet!");
|
2018-05-18 06:38:59 -05:00
|
|
|
} else if (ScreenWidth < 1200) {
|
2018-06-06 15:29:37 -05:00
|
|
|
print("user has a desktop!");
|
2018-05-18 06:38:59 -05:00
|
|
|
} else if (ScreenWidth < 2048) {
|
2018-06-06 15:29:37 -05:00
|
|
|
print("user has a hd display!");
|
2018-05-18 06:38:59 -05:00
|
|
|
} else if (ScreenWidth < 4096) {
|
2018-06-06 15:29:37 -05:00
|
|
|
print("user has a display greater than fhd!");
|
2018-05-18 06:38:59 -05:00
|
|
|
} else {
|
2018-06-06 15:29:37 -05:00
|
|
|
print("what do you spend your money on?");
|
2018-05-18 06:38:59 -05:00
|
|
|
}
|
2018-05-20 23:11:33 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
function whatTimeIsIt(){
|
|
|
|
var death = new Date();
|
2018-08-10 15:44:40 -05:00
|
|
|
var timezone = death.getTimezoneOffset();
|
|
|
|
var getHoursOffset;
|
|
|
|
var getMinutesOffset;
|
|
|
|
var getSecondsOffset;
|
|
|
|
|
|
|
|
if (navigator.geolocation) {
|
|
|
|
navigator.geolocation.getCurrentPosition();
|
|
|
|
} else {
|
|
|
|
print("Geolocation is not supported. Update your shit.");
|
|
|
|
}
|
|
|
|
|
2018-08-14 14:21:06 -05:00
|
|
|
// working on getting user location and setting timezone to said location
|
2018-08-10 15:44:40 -05:00
|
|
|
function timezoneOffset(zone){
|
|
|
|
var offset = Math.abs(zone/60);
|
|
|
|
|
2018-08-14 14:21:06 -05:00
|
|
|
var getHoursOffset = death.getHours + offset;
|
|
|
|
var getMinutesOffset = death.getMinutes + offset;
|
|
|
|
var getSecondsOffset = death.getSeconds + offset;
|
2018-08-10 15:44:40 -05:00
|
|
|
|
|
|
|
return getHoursOffset, getMinutesOffset, getSecondsOffset;
|
|
|
|
}
|
|
|
|
|
2018-05-20 23:11:33 -05:00
|
|
|
function isPastNoon(){
|
2018-06-06 15:29:37 -05:00
|
|
|
if (death.getHours() > 12) {
|
2018-08-10 15:44:40 -05:00
|
|
|
print(death.getHours() - 12);
|
2018-05-20 23:11:33 -05:00
|
|
|
} else {
|
2018-06-06 15:29:37 -05:00
|
|
|
print(death.getHours());
|
2018-05-24 22:43:26 -05:00
|
|
|
}
|
|
|
|
}
|
2018-05-20 23:11:33 -05:00
|
|
|
|
2018-08-10 15:44:40 -05:00
|
|
|
//timezoneOffset(timezone);
|
|
|
|
console.log(timezone);
|
2018-06-06 15:29:37 -05:00
|
|
|
print(isPastNoon(), ":", death.getMinutes(), ":", death.getSeconds());
|
2018-08-10 15:44:40 -05:00
|
|
|
print(isPastNoon(), getHoursOffset(), getMinutesOffset(), getSecondsOffset());
|
2018-06-06 15:29:37 -05:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
2018-06-06 15:29:37 -05:00
|
|
|
mediaDetect();
|
2018-08-10 15:44:40 -05:00
|
|
|
whatTimeIsIt();
|