-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1552d65
commit 06d4d57
Showing
7 changed files
with
785 additions
and
749 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
self.addEventListener('install', event => console.log('ServiceWorker installed')); | ||
|
||
self.addEventListener('push', function(event) { | ||
console.log({ event }); | ||
|
||
event.waitUntil(self.registration.showNotification("Grass | Justin Fuller", { | ||
body: "Today's the day. Water your lawn!", | ||
icon: "/image/grass.png", | ||
})); | ||
}) | ||
|
||
self.addEventListener('notificationclick', function(event) { | ||
console.log('[Service Worker] Notification click received.'); | ||
|
||
event.notification.close(); | ||
|
||
event.waitUntil( | ||
clients.openWindow('https://justindfuller.com/grass') | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,177 @@ | ||
<style> | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
html, | ||
body { | ||
padding: 0 20px; | ||
margin: 0; | ||
width: 100%; | ||
height: max-content; | ||
display: block; | ||
font-size: 24px; | ||
font-family: "Amiri", serif; | ||
background: #fcf9f4; | ||
} | ||
|
||
#getLocation { | ||
margin-top: 40px; | ||
margin-bottom: 40px; | ||
} | ||
|
||
.centered { | ||
margin-left: auto; | ||
margin-right: auto; | ||
display: block; | ||
} | ||
|
||
div { | ||
width: 100%; | ||
} | ||
|
||
@keyframes fadeIn { | ||
0% { | ||
opacity: 0; | ||
} | ||
100% { | ||
opacity: 1; | ||
} | ||
} | ||
|
||
main { | ||
animation: fadeIn 1s; | ||
height: max-content; | ||
max-width: 500px; | ||
margin: auto; | ||
display: flex; | ||
justify-content: flex-start; | ||
align-items: center; | ||
flex-direction: column; | ||
padding-bottom: 60px; | ||
} | ||
|
||
h1 { | ||
line-height: 45px; | ||
margin-top: 40px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
button, | ||
p, | ||
progress { | ||
margin: 20px 0; | ||
} | ||
|
||
select { | ||
width: 100%; | ||
padding: 10px 20px; | ||
border: 2px solid black; | ||
background: white; | ||
color: black; | ||
} | ||
|
||
button { | ||
padding: 10px 20px; | ||
border-top: 2px solid black; | ||
border-left: 2px solid black; | ||
border-right: 4px solid black; | ||
border-bottom: 4px solid black; | ||
border-radius: 2px; | ||
background: white; | ||
color: black; | ||
cursor: pointer; | ||
} | ||
|
||
button:hover { | ||
border-top: 3px solid black; | ||
border-left: 3px solid black; | ||
border-right: 3px solid black; | ||
border-bottom: 3px solid black; | ||
} | ||
|
||
select, | ||
label, | ||
input[type="checkbox"] { | ||
cursor: pointer; | ||
} | ||
|
||
label { | ||
display: block; | ||
} | ||
|
||
#weekDays.hidden, | ||
.hidden { | ||
display: none; | ||
} | ||
|
||
#weekDays { | ||
display: flex; | ||
flex-direction: row; | ||
justify-content: space-between; | ||
flex-wrap: wrap; | ||
align-items: flex-start; | ||
} | ||
|
||
.day { | ||
background: white; | ||
cursor: pointer; | ||
text-align: center; | ||
width: 45%; | ||
border-top: 2px solid black; | ||
border-left: 2px solid black; | ||
border-right: 4px solid black; | ||
border-bottom: 4px solid black; | ||
border-radius: 4px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
.day:has(input:checked) { | ||
border-color: #0075ff; | ||
} | ||
|
||
@media screen and (max-width: 400px) { | ||
.day { | ||
width: 100%; | ||
} | ||
} | ||
|
||
.day:hover { | ||
border-right: 3px solid black; | ||
border-bottom: 3px solid black; | ||
border-left: 3px solid black; | ||
border-top: 3px solid black; | ||
} | ||
|
||
.day .icon { | ||
height: 40px; | ||
width: auto; | ||
} | ||
|
||
.day .icon.thermometer { | ||
padding-bottom: 5px; | ||
margin-left: -10px; | ||
} | ||
|
||
.day .icon.cloud { | ||
padding-bottom: 2px; | ||
margin-left: -10px; | ||
} | ||
|
||
.day .stat { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.day .title { | ||
display: block; | ||
text-align: center; | ||
font-weight: bold; | ||
} | ||
|
||
.day .rain, | ||
.day .temperature { | ||
min-width: 70px; | ||
} | ||
</style> |
Oops, something went wrong.