Lunch and Browser Check

Developer
Size
4,546 Kb
Views
32,384

How do I make an lunch and browser check?

Date object testing. What is a lunch and browser check? How do you make a lunch and browser check? This script and codes were developed by Albert Miller on 23 August 2022, Tuesday.

Lunch and Browser Check Previews

Lunch and Browser Check - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Lunch and Browser Check</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container">
<h1 class="time"><span id="Day"></span> <span id="Month"></span> <span id="Date"></span> <span id="Year"></span></h1>
<div class="border"><h2 class="clock"><span id="Hours" class="numbers"></span>:<span id="Minutes" class="numbers"></span>:<span id="Seconds" class="numbers"></span> <span id="AMPM"></span></h2>
</div>
<p>You are using <span id="browser"></span> version <span id="version"></span> </p>
<p id="yell"></p>
<p>You have been here for <span id="DeltaHours"></span>:<span id="DeltaMinutes"></span>:<span id="DeltaSeconds"></span></p> <p id="Lunch"><span id="End">Time until Lunch</span> <span id="hoursUntil"></span>:<span id="minutesUntil"></span>:<span id="secondsUntil"></span></p>
</div> <script src="js/index.js"></script>
</body>
</html>

Lunch and Browser Check - Script Codes CSS Codes

@import url(http://fonts.googleapis.com/css?family=Rationale|Orbitron:400,700|Raleway:400,700);
@media (max-width: 480px), and (min-width: 381px) { #Day { display: block; } #Month { clear: both; } div.container { min-width: 320px; width: 100%; display: inline-block; } .clock { color: #14FF00; font-family: monospace; font-size: 50px; border: .07em solid; text-align: center; width: 85%; background: #222; margin: 2% auto 0 auto; } updated { color: green; } normal { color: black; } .time { font-size: 1.8em; text-align: center; display: block; padding: 0; } body { background-color: #222; color: #DDD; font-family: Arial; } hr { border-color: #9CEBE8; margin: 0; padding: 0; } #AMPM { font-size: 20px; }
}
@media (max-width: 380px), and (min-width: 320px) { #Day { display: block; } #Month { clear: both; } div.container { min-width: 320px; width: 100%; display: inline-block; } .clock { color: #14FF00; font-family: monospace; font-size: 50px; border: .07em solid; text-align: center; width: 85%; background: #111; margin: 2% auto 0 auto; } updated { color: green; } normal { color: black; } .time { font-size: 1.8em; text-align: center; display: block; padding: 0; } body { background-color: #222; color: #DDD; font-family: Raleway; } hr { border-color: #9CEBE8; margin: 0; padding: 0; } #AMPM { font-size: 20px; }
}

Lunch and Browser Check - Script Codes JS Codes

var Now = new Date();
var TimeCheck = { "Day": convertDay(Now), "Month": convertMonth(Now), "Date": Now.getDate(), "Year": Now.getFullYear(), "Hours": convertHours(Now), "Minutes":convertMinutes(Now), "Seconds": convertSeconds(Now), "AMPM": convertAMPM(Now) };
var Lunch = { "Hours": 12, "Minutes": 0, "Seconds": 0, "AMPM": "PM" };
var dayEnd = { "Hours": 5, "Minutes": 0, "Seconds": 0, "AMPM": "PM" }
var seconds = 0;
var flag = 0;
function getTime()
{ seconds++; flag++ var Now = new Date(); var DeltaSeconds, DeltaMinutes, DeltaHours, DeltaAMPM, LunchSeconds, LunchMinutes, LunchHours, LunchAMPM, EndSeconds, EndMinutes, EndHours, EndAMPM; var TimeObject = { "Day": convertDay(Now), "Month": convertMonth(Now), "Date": Now.getDate(), "Year": Now.getFullYear(), "Hours": convertHours(Now), "Minutes":convertMinutes(Now), "Seconds": convertSeconds(Now), "AMPM": convertAMPM(Now) }; document.getElementById("Day").innerHTML = TimeObject.Day; document.getElementById("Month").innerHTML = TimeObject.Month; document.getElementById("Date").innerHTML = TimeObject.Date; document.getElementById("Year").innerHTML = TimeObject.Year; document.getElementById("Hours").innerHTML = TimeObject.Hours; document.getElementById("Minutes").innerHTML = TimeObject.Minutes; document.getElementById("Seconds").innerHTML = TimeObject.Seconds; document.getElementById("AMPM").innerHTML = TimeObject.AMPM; if(TimeCheck.Seconds!== TimeObject.Seconds) { //document.getElementById('Seconds').style.color='green'; DeltaSeconds = seconds%60; if((seconds%60)<10) { DeltaSeconds = "0" + DeltaSeconds } } else if(TimeCheck.Seconds === TimeObject.Seconds && (seconds/60) >= 1) { //document.getElementById('Seconds').style.color='green'; DeltaSeconds = seconds%60; if((seconds%60)<10) { DeltaSeconds = "0" + DeltaSeconds } } else { DeltaSeconds = "00"; } if(TimeCheck.Minutes!== TimeObject.Minutes) { //document.getElementById('Minutes').style.color='#28B'; DeltaMinutes = Math.floor((seconds/60)%60); if((seconds/60)<10) { DeltaMinutes = "0" + DeltaMinutes } } else { DeltaMinutes = "00"; } if(TimeCheck.Hours!== TimeObject.Hours) { //document.getElementById('Hours').style.color='green'; DeltaHours = Math.floor(seconds/3600); if((seconds/3600)<10) { DeltaHours = "0" + DeltaHours } } else { DeltaHours = "00"; } if(TimeObject.AMPM == "AM") { LunchHours = (Lunch.Hours - TimeObject.Hours) - 1; LunchMinutes = 60 - TimeObject.Minutes; if(LunchMinutes<10) { LunchMinutes = "0" + LunchMinutes; } LunchSeconds = 60 - TimeObject.Seconds; if(LunchSeconds<10) { LunchSeconds = "0" + LunchSeconds; } if(LunchSeconds == 0 && LunchMinutes == 0 ) { Lunch.Hours - TimeObject.Hours } document.getElementById("hoursUntil").innerHTML = LunchHours; document.getElementById("minutesUntil").innerHTML = LunchMinutes; document.getElementById("secondsUntil").innerHTML = LunchSeconds; } else if(TimeObject.AMPM == "PM" && TimeObject.Hours == 12 && TimeObject.Minutes < 30) { document.getElementById("Lunch").innerHTML = "TIME FOR LUNCH!"; document.getElementById("Lunch").style.color='#14FF00'; document.getElementById("Lunch").style.fontSize='40px'; document.getElementById("Lunch").style.fontWeight='Bold'; if((flag%2)) { setWhite(); } } else if(TimeObject.AMPM == "PM" && ((TimeObject.Hours == 12 && TimeObject.Minutes > 30) || TimeObject.Hours < 5)) { EndHours = (dayEnd.Hours - TimeObject.Hours) - 1; EndMinutes = 60 - TimeObject.Minutes; if(EndMinutes<10) { EndMinutes = "0" + EndMinutes; } EndSeconds = 60 - TimeObject.Seconds; if(EndSeconds<10) { EndSeconds = "0" + EndSeconds; } if(EndSeconds == 0 && EndMinutes == 0 ) { dayEnd.Hours - TimeObject.Hours } document.getElementById("End").innerHTML = "Until End of Work Day"; document.getElementById("hoursUntil").innerHTML = EndHours; document.getElementById("minutesUntil").innerHTML = EndMinutes; document.getElementById("secondsUntil").innerHTML = EndSeconds; } else { document.getElementById("Lunch").innerHTML = "Day has ended"; document.getElementById("Lunch").style.fontSize='16px'; document.getElementById("Lunch").style.color='#14FF00'; } document.getElementById("DeltaHours").innerHTML = DeltaHours; document.getElementById("DeltaMinutes").innerHTML = DeltaMinutes; document.getElementById("DeltaSeconds").innerHTML = DeltaSeconds;
}
function convertDay(Now)
{ var Temp; var Test; var Days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]; Temp = Now.getDay(); Test = Days[Temp]; return Test;
}
function convertMonth(Now)
{ var Temp; var Test; var Month = ["January", "Febuary", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; Temp = Now.getMonth(); Test = Month[Temp]; return Test;
}
function convertHours(Now)
{ var Temp; Temp = Now.getHours(); if(Temp === 12) { } else if(Temp == 24) { Temp = 12; } else { Temp = Temp%12; } return Temp;
}
function convertMinutes(Now)
{ var Temp = ""; Temp = Now.getMinutes(); if(Temp<10) { Temp = "0" + Temp; } return Temp;
}
function convertSeconds(Now)
{ var Temp = ""; Temp = Now.getSeconds().toString(); if(Temp<10) { Temp = "0" + Temp; } return Temp;
}
function convertAMPM(Now)
{ var Temp; var x; Temp = Now.getHours(); if(Temp >= 12) { x = "PM"; } else { x = "AM"; } return x;
}
function setWhite()
{ document.getElementById("Lunch").style.color='#222';
}
function timeDifference(currentTime, alarmTime)
{ var CTSecs = 0; var ATSecs = 0; var diffArray = []; CTsecs = currentTime.getHours() * 60; CTsecs = CTsecs + currentTime.getMinutes(); CTsecs = CTsecs * 60; ATsecs = alarmTime.getHours() * 60; ATsecs = ATsecs + alarmTime.getMinutes(); ATsecs = ATsecs * 60;
}
window.onload = function()
{ setInterval(function(){getTime();}, 1000); if(console === undefined) { console=function(){}; } console.log(navigator.userAgent); var ua = navigator.userAgent; //console.log(ua); //var temp; var Match = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i); var browser = Match[1]; var version = Match[2]; version = version.substring(0,2); document.getElementById("browser").innerHTML = browser; document.getElementById("version").innerHTML = version; //document.getElementById("yell").innerHTML = ua; if(browser === "Chrome" && version >= 29) { document.getElementById("yell").innerHTML = "Good Choice!"; } else if (browser ==="Chrome" && version < 29) { document.getElementById("yell").innerHTML = "You need to upgrade"; } else if (browser === "MSIE") { document.getElementById("yell").innerHTML = "At work or dumb?"; } else if (browser === "Firefox") { document.getElementById("yell").innerHTML = "At work or dumb?"; }
};
Lunch and Browser Check - Script Codes
Lunch and Browser Check - Script Codes
Home Page Home
Developer Albert Miller
Username SinceSidSlid
Uploaded August 23, 2022
Rating 3
Size 4,546 Kb
Views 32,384
Do you need developer help for Lunch and Browser Check?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Albert Miller (SinceSidSlid) Script Codes
Create amazing sales emails with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!