Make PWA
This commit is contained in:
parent
3b8b6f8a3f
commit
b941e9cfdb
7 changed files with 200 additions and 0 deletions
21
manifest.json
Normal file
21
manifest.json
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone",
|
||||
"name": "wishthis",
|
||||
"orientation": "any",
|
||||
"scope": "/",
|
||||
"short_name": "wishthis",
|
||||
"start_url": "/",
|
||||
"theme_color": "#ffffff",
|
||||
"categories": [],
|
||||
"screenshots": [],
|
||||
"icons": [
|
||||
{
|
||||
"src": "/src/assets/img/logo-square.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512",
|
||||
"purpose": "any"
|
||||
}
|
||||
],
|
||||
"shortcuts": []
|
||||
}
|
BIN
src/assets/img/logo-square.png
Normal file
BIN
src/assets/img/logo-square.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
78
src/assets/img/logo-square.svg
Normal file
78
src/assets/img/logo-square.svg
Normal file
|
@ -0,0 +1,78 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="173.43971"
|
||||
height="173.43971"
|
||||
viewBox="0 0 45.889258 45.889259"
|
||||
version="1.1"
|
||||
id="svg5"
|
||||
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
|
||||
sodipodi:docname="logo-square.svg"
|
||||
inkscape:export-filename="F:\laragon\www\wishthis\src\assets\img\logo-square.png"
|
||||
inkscape:export-xdpi="96"
|
||||
inkscape:export-ydpi="96"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview7"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:document-units="mm"
|
||||
showgrid="false"
|
||||
inkscape:zoom="3.1108586"
|
||||
inkscape:cx="328.52667"
|
||||
inkscape:cy="201.55207"
|
||||
inkscape:window-width="3730"
|
||||
inkscape:window-height="2126"
|
||||
inkscape:window-x="3939"
|
||||
inkscape:window-y="-11"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
borderlayer="true"
|
||||
inkscape:showpageshadow="false"
|
||||
units="px"
|
||||
inkscape:snap-page="true" />
|
||||
<defs
|
||||
id="defs2">
|
||||
<rect
|
||||
x="-596.61987"
|
||||
y="-191.58698"
|
||||
width="1722.9969"
|
||||
height="1116.0906"
|
||||
id="rect1574" />
|
||||
</defs>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(157.69673,48.62)">
|
||||
<rect
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:0.266341"
|
||||
id="rect8818"
|
||||
width="45.889256"
|
||||
height="45.889256"
|
||||
x="-157.69673"
|
||||
y="-48.619999" />
|
||||
<text
|
||||
xml:space="preserve"
|
||||
transform="matrix(0.26458333,0,0,0.26458333,2.6458322,19.028796)"
|
||||
id="text1572"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:1.25;font-family:Raleway;-inkscape-font-specification:Raleway;white-space:pre;shape-inside:url(#rect1574);fill:#000000;fill-opacity:1;stroke:none"><tspan
|
||||
x="-596.61914"
|
||||
y="-154.56063"
|
||||
id="tspan9552">wish<tspan
|
||||
style="font-weight:800;-inkscape-font-specification:'Raleway Ultra-Bold';fill:#6435c9"
|
||||
id="tspan9550">this</tspan></tspan></text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.5 KiB |
66
src/assets/img/logo.svg
Normal file
66
src/assets/img/logo.svg
Normal file
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="40.597591mm"
|
||||
height="7.8316665mm"
|
||||
viewBox="0 0 40.597591 7.8316665"
|
||||
version="1.1"
|
||||
id="svg5"
|
||||
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
|
||||
sodipodi:docname="logo.svg"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<sodipodi:namedview
|
||||
id="namedview7"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pagecheckerboard="0"
|
||||
inkscape:document-units="mm"
|
||||
showgrid="false"
|
||||
inkscape:zoom="3.1108586"
|
||||
inkscape:cx="328.52667"
|
||||
inkscape:cy="201.55207"
|
||||
inkscape:window-width="3730"
|
||||
inkscape:window-height="2126"
|
||||
inkscape:window-x="3939"
|
||||
inkscape:window-y="-11"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="layer1"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0"
|
||||
borderlayer="true"
|
||||
inkscape:showpageshadow="false" />
|
||||
<defs
|
||||
id="defs2">
|
||||
<rect
|
||||
x="-596.61987"
|
||||
y="-191.58698"
|
||||
width="1722.9969"
|
||||
height="1116.0906"
|
||||
id="rect1574" />
|
||||
</defs>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(157.69673,48.62)">
|
||||
<text
|
||||
xml:space="preserve"
|
||||
transform="scale(0.26458333)"
|
||||
id="text1572"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:40px;line-height:1.25;font-family:Raleway;-inkscape-font-specification:Raleway;white-space:pre;shape-inside:url(#rect1574);fill:#000000;fill-opacity:1;stroke:none"><tspan
|
||||
x="-596.61914"
|
||||
y="-154.56063"
|
||||
id="tspan8761">wish<tspan
|
||||
style="font-weight:800;-inkscape-font-specification:'Raleway Ultra-Bold';fill:#6435c9"
|
||||
id="tspan8759">this</tspan></tspan></text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.1 KiB |
|
@ -1,3 +1,16 @@
|
|||
/**
|
||||
* Service Worker
|
||||
*/
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', function() {
|
||||
navigator.serviceWorker
|
||||
.register('/serviceWorker.js')
|
||||
.then(res => console.log('service worker registered'))
|
||||
.catch(err => console.log('service worker not registered', err))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
|
||||
$(function() {
|
||||
|
|
20
src/assets/js/service-worker.js
Normal file
20
src/assets/js/service-worker.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
const staticDevCoffee = 'wishthis'
|
||||
const assets = [
|
||||
'/'
|
||||
]
|
||||
|
||||
self.addEventListener('install', installEvent => {
|
||||
installEvent.waitUntil(
|
||||
caches.open(staticDevCoffee).then(cache => {
|
||||
cache.addAll(assets)
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
self.addEventListener('fetch', fetchEvent => {
|
||||
fetchEvent.respondWith(
|
||||
caches.match(fetchEvent.request).then(res => {
|
||||
return res || fetch(fetchEvent.request)
|
||||
})
|
||||
)
|
||||
})
|
|
@ -137,6 +137,8 @@ class Page
|
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
<link rel="manifest" href="manifest.json" />
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Stylesheets
|
||||
|
|
Loading…
Reference in a new issue