@@ -59,16 +59,34 @@ function loadName() {
59
59
60
60
// Determine the appropriate greeting based on the time of day
61
61
var ampm ;
62
+ var status ;
62
63
63
64
// Determine the appropriate greeting based on the time of day
64
65
var greeting ;
65
66
if ( hour >= 0 && hour < 12 ) {
66
67
greeting = "Good morning" ;
68
+ status = '<i class="fa-solid fa-mug-saucer"></i>' ;
69
+ status = '<i class="fa-solid fa-sun"></i> ' ;
67
70
}
68
71
else if ( hour >= 12 && hour < 18 ) {
69
72
greeting = "Good afternoon" ;
73
+ status = '<i class="fa-solid fa-sun"></i> ' ;
70
74
} else {
71
75
greeting = "Good evening" ;
76
+ status = '<i class="fa-solid fa-moon"></i> ' ;
77
+ }
78
+
79
+ // Determine the appropriate day status based on the time of day
80
+ if ( hour >= 0 && hour < 6 ) {
81
+ status = ' <i class="fa-regular fa-moon"></i>' ;
82
+ }
83
+ else if ( hour >= 6 && hour < 12 ) {
84
+ status = ' <i class="fa-regular fa-sun"></i>' ;
85
+ }
86
+ else if ( hour >= 12 && hour < 18 ) {
87
+ status = ' <i class="fa-regular fa-sun"></i>' ;
88
+ } else {
89
+ status = ' <i class="fa-regular fa-moon"></i>' ;
72
90
}
73
91
74
92
if ( hour >= 12 ) {
@@ -81,7 +99,7 @@ function loadName() {
81
99
82
100
83
101
// Display the greeting with the current time in minutes
84
- document . getElementById ( "greeting" ) . innerHTML = "<div class='greeting'><h1>" + hour + ":" + ( minute < 10 ? "0" : "" ) + minute + " " + ampm + ", " + greeting + ", " + name + "!</h1></div>" ;
102
+ document . getElementById ( "greeting" ) . innerHTML = "<div class='greeting'><h1>" + hour + ":" + ( minute < 10 ? "0" : "" ) + minute + " " + ampm + status + ", " + greeting + " " + name + "!</h1></div>" ;
85
103
} , 1000 ) ; // Update every 1000 milliseconds (1 second)
86
104
87
105
// document.getElementById("greeting").innerHTML = greeting + ", " + name + "!";
@@ -133,7 +151,7 @@ if (timeSinceLastDisplayed > 1000) {
133
151
134
152
// Display the new message to the user
135
153
const messageElement = document . getElementById ( "message" ) ;
136
- messageElement . innerText = randomMessage . text ;
154
+ messageElement . innerHTML = '<i class="fa-solid fa-quote-left fa-fade" style="color: #f9a03f;"></i> ' + randomMessage . text ;
137
155
// Show the motivation message div
138
156
const motivationDiv = document . getElementById ( "motivation-message" ) ;
139
157
motivationDiv . style . display = "block" ;
@@ -145,7 +163,7 @@ if (timeSinceLastDisplayed > 1000) {
145
163
const lastDisplayedIndex = parseInt ( lastDisplayed ) ;
146
164
const nextIndex = ( lastDisplayedIndex + 1 ) % DEFAULT_MESSAGES . length ;
147
165
const messageElement = document . getElementById ( "message" ) ;
148
- messageElement . innerText = DEFAULT_MESSAGES [ nextIndex ] ;
166
+ messageElement . innerHTML = '<i class="fa-solid fa-quote-left fa-fade" style="color: #f9a03f;"></i> ' + DEFAULT_MESSAGES [ nextIndex ] ;
149
167
// Show the motivation message div
150
168
const motivationDiv = document . getElementById ( "motivation-message" ) ;
151
169
motivationDiv . style . display = "block" ;
0 commit comments