mirror of
https://github.com/bckelley/Web-Browser-Homepage.git
synced 2026-08-24 03:24:13 -05:00
Minor fixes
This commit is contained in:
+2
-2
@@ -18,10 +18,10 @@
|
||||
<div id="clock">
|
||||
<div id="hour"></div>
|
||||
<div id="minute"></div>
|
||||
<div id="suffix"></div>
|
||||
<div id="timeSuffix"></div>
|
||||
</div>
|
||||
<div id="date"></div>
|
||||
<div id="question">What would you like to do today?</div>
|
||||
<div id="question">What's on your mind?</div>
|
||||
<div class="icons">
|
||||
<ul>
|
||||
<li><a href="#"><i class="fa-brands fa-facebook"></i></a></li>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// get/initialize time and date values
|
||||
// INITIALIZATIONS
|
||||
|
||||
// get/initialize time and date values - global variables
|
||||
let timeOfDay = "AM";
|
||||
let today = new Date();
|
||||
let hour = today.getHours();
|
||||
@@ -14,17 +16,6 @@ second = checkTime(second);
|
||||
|
||||
// CODE FOR THE SITE BACKGROUND
|
||||
|
||||
function changeImage() {
|
||||
let fileList = ['1.jpg', '2.jpg', '3.jpg', '4.jpg', '5.jpg', '6.jpg', '7.jpg', '8.png', '9.jpg',
|
||||
'10.jpg', '11.jpg', '12.jpg', '13.png', '14.jpg', '15.jpg', '16.jpg', '17.jpg',
|
||||
'18.jpg', '19.jpg', '20.jpg', '21.jpg', '22.jpg', '24.jpg', '25.jpg',
|
||||
'26.jpg', '27.jpg', '28.jpg', '29.jpg', '30.jpg', '34.jpg'];
|
||||
|
||||
// selecting random image from fileList[] and setting it as background image
|
||||
let filePath = 'img/background/' + fileList[Math.floor(Math.random() * fileList.length)];
|
||||
document.body.style.backgroundImage = 'url(' + filePath + ')';
|
||||
}
|
||||
|
||||
function setBackgroundGradient() {
|
||||
// Setting background gradients according to the time of the day
|
||||
|
||||
@@ -70,13 +61,12 @@ function loadGlassOverlayComponents() {
|
||||
|
||||
// convert the time to a 12-hour clock
|
||||
timeOfDay = convertTimeOfDay(hour, timeOfDay);
|
||||
hour = convertHour(hour);
|
||||
|
||||
// set the suffix of the day
|
||||
let daySuffix;
|
||||
if (day === 1) daySuffix = 'st';
|
||||
else if (day === 2) daySuffix = 'nd';
|
||||
else if (day === 3) daySuffix = 'rd';
|
||||
if (day === 1 || day === 21 || day === 31) daySuffix = 'st';
|
||||
else if (day === 2 || day === 22) daySuffix = 'nd';
|
||||
else if (day === 3 || day === 23) daySuffix = 'rd';
|
||||
else daySuffix = 'th';
|
||||
|
||||
// get the name of the month
|
||||
@@ -85,10 +75,10 @@ function loadGlassOverlayComponents() {
|
||||
// display the time on the glass overlay
|
||||
document.getElementById('hour').innerHTML = convertHour(hour);
|
||||
document.getElementById('minute').innerHTML = ":" + minute + " ";
|
||||
document.getElementById('suffix').innerHTML = convertTimeOfDay(hour, timeOfDay);
|
||||
document.getElementById('timeSuffix').innerHTML = convertTimeOfDay(hour, timeOfDay);
|
||||
|
||||
// display the date on the glass overlay
|
||||
document.getElementById('date').innerHTML = "Today is the " + day + daySuffix + " of " + monthNames[month - 1] + " " + year;
|
||||
document.getElementById('date').innerHTML = "Today is the " + day + daySuffix + " of " + monthNames[month] + " " + year;
|
||||
|
||||
// Call function again after specified amount of time
|
||||
let t = setTimeout(loadGlassOverlayComponents, 500);
|
||||
@@ -123,7 +113,6 @@ function convertHour(hourValue) {
|
||||
return hourValue;
|
||||
}
|
||||
|
||||
// function calls
|
||||
$(document).ready(loadGlassOverlayComponents);
|
||||
// $(document).ready(changeImage);
|
||||
$(document).ready(setBackgroundGradient);
|
||||
// jQuery function calls
|
||||
$(document).ready(setBackgroundGradient);
|
||||
$(document).ready(loadGlassOverlayComponents);
|
||||
+1
-1
@@ -52,7 +52,7 @@ body {
|
||||
#minute {
|
||||
font-size: 5rem;
|
||||
}
|
||||
#suffix {
|
||||
#timeSuffix {
|
||||
font-size: 1.4rem;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user