forked from BiosBoy/coconat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ServiceWorkers and AnimationTransitionGroup v2.
- Loading branch information
Showing
9 changed files
with
109 additions
and
4 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// fetching required static data on load | ||
// self.addEventListener('install', e => { | ||
// console.log(e, 'SW has been installed!') | ||
// }) | ||
|
||
// self.addEventListener('fetch', function(event) { | ||
// console.log(event, 'SWHAS BEEN FETCHED!!!') | ||
// }) | ||
|
||
// notification | ||
self.addEventListener('push', function(event) { | ||
if (Notification.permission === 'default') { | ||
self.Notification.requestPermission().then(res => console.log(res)); | ||
console.log('The permission request was dismissed.'); | ||
return; | ||
} | ||
|
||
if (Notification.permission === 'denied') { | ||
console.log(Notification.permission, "Permission wasn't granted. Allow a retry."); | ||
return; | ||
} | ||
|
||
console.log('The permission request is granted!'); | ||
|
||
try { | ||
event.waitUntil( | ||
self.registration.showNotification((event && event.data && event.data.text()) || 'Some Notification Here!') | ||
); | ||
} catch (e) { | ||
throw new Error(`Error in SW: ${e}`); | ||
} | ||
}); | ||
|
||
self.addEventListener('sync', function(event) { | ||
console.log(event.tag, 'Sync is completed!!!'); | ||
}); |
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,28 @@ | ||
.animWrap { | ||
position: relative; | ||
} | ||
|
||
:global { | ||
.mainImage-enter { | ||
opacity: 0; | ||
transition: all 500ms linear; | ||
transform: translateX(50%); | ||
} | ||
|
||
.mainImage-enter-active { | ||
opacity: 1; | ||
transform: translateX(60%); | ||
} | ||
|
||
.mainImage-exit { | ||
transition: opacity 500ms linear; | ||
transform: translateX(-60%); | ||
opacity: 1; | ||
} | ||
|
||
.mainImage-exit-active { | ||
transition: all 500ms linear; | ||
transform: translateX(-50%); | ||
opacity: 0; | ||
} | ||
} |
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