Skip to content

Commit

Permalink
feat: update icon and make this app a pwa (#110)
Browse files Browse the repository at this point in the history
* feat: update icon and make this app a pwa

* chore: update mimetypes

* chore: remove share_Target

* chore: oxipng

reduced size of each PNG by ~30% on average

* fix: set theme color

* fix: theme-color from HTML spec

https://html.spec.whatwg.org/multipage/semantics.html#meta-theme-color

Co-authored-by: Marcin Rataj <[email protected]>
  • Loading branch information
rafaelramalho19 and lidel authored Feb 4, 2021
1 parent 1fb7f99 commit 2aaffba
Show file tree
Hide file tree
Showing 18 changed files with 203 additions and 132 deletions.
218 changes: 97 additions & 121 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added public/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#edffff</TileColor>
</tile>
</msapplication>
</browserconfig>
Binary file added public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/favicon.ico
Binary file not shown.
8 changes: 6 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon-16x16.png">
<link rel="mask-icon" href="%PUBLIC_URL%/safari-pinned-tab.svg" color="#5bbad5">
<meta name="theme-color" content="#022E44">
<meta name="msapplication-TileColor" content="#edffff">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand Down
23 changes: 14 additions & 9 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "IPFS Share",
"name": "IPFS Share",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"start_url": "./index.html",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
"theme_color": "#022E44",
"background_color": "#022E44",
"start_url": "/",
"display": "standalone"
}
Binary file added public/mstile-144x144.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/mstile-310x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/mstile-310x310.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/mstile-70x70.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions public/offline.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>IPFS Share | Offline</title>
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
</head>
<body>
<script>
function reload() {
window.location.reload()
}
</script>
<div style="text-align:center; margin-top:40px;" onclick="reload()">
<svg viewBox='0 0 100 100' width="100" style="cursor: pointer">
<path d='M50 20.11A29.89 29.89 0 1 0 79.89 50 29.89 29.89 0 0 0 50 20.11zm-3.22 17a3.22 3.22 0 0 1 6.44 0v6.43a3.22 3.22 0 0 1-6.44 0zM50 66.08a16.14 16.14 0 0 1-11.41-27.49 3.28 3.28 0 0 1 1.76-.65 2.48 2.48 0 0 1 2.42 2.41 2.58 2.58 0 0 1-.77 1.77A10.81 10.81 0 0 0 38.59 50a11.25 11.25 0 0 0 22.5 0 10.93 10.93 0 0 0-3.21-7.88 3.37 3.37 0 0 1-.65-1.77 2.48 2.48 0 0 1 2.42-2.41 2.16 2.16 0 0 1 1.76.65A16.14 16.14 0 0 1 50 66.08z' />
</svg>
<p>You are currently offline.</p>
<div>
</body>
</html>
25 changes: 25 additions & 0 deletions public/safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions public/service-worker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* eslint-disable no-restricted-globals */

self.addEventListener('install', function (event) {
const offlineRequest = new Request('offline.html')
event.waitUntil(
fetch(offlineRequest).then(function (response) {
return caches.open('offline').then(function (cache) {
console.log('[oninstall] Cached offline page', response.url)
return cache.put(offlineRequest, response)
})
})
)
})

self.addEventListener('fetch', function (event) {
const request = event.request

if (request.method === 'GET') {
event.respondWith(
fetch(request).catch(function (error) {
console.error(
'[onfetch] Failed. Serving cached offline fallback ' +
error
)
return caches.open('offline').then(function (cache) {
return cache.match('offline.html')
})
})
)
}
})

0 comments on commit 2aaffba

Please sign in to comment.