Update favicon and add PWA

This commit is contained in:
2023-10-30 17:39:35 -04:00
parent 027609d8fa
commit e37998f188
45 changed files with 2540 additions and 72 deletions

View File

@@ -3,17 +3,130 @@
<head>
<title><%= productName %></title>
<meta charset="utf-8">
<meta name="description" content="<%= productDescription %>">
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>">
<meta charset="utf-8" />
<meta name="description" content="<%= productDescription %>" />
<meta name="format-detection" content="telephone=no" />
<meta name="msapplication-tap-highlight" content="no" />
<meta
name="viewport"
content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width<% if (ctx.mode.cordova || ctx.mode.capacitor) { %>, viewport-fit=cover<% } %>"
/>
<link rel="icon" type="image/png" sizes="128x128" href="icons/favicon-128x128.png">
<link rel="icon" type="image/png" sizes="96x96" href="icons/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
<link rel="icon" type="image/ico" href="favicon.ico">
<link
rel="icon"
type="image/png"
sizes="128x128"
href="icons/favicon-128x128.png"
/>
<link
rel="icon"
type="image/png"
sizes="96x96"
href="icons/favicon-96x96.png"
/>
<link
rel="icon"
type="image/pnghat makes elements draggable and movable with keyboard."
sizes="32x32"
href="icons/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="icons/favicon-16x16.png"
/>
<link rel="icon" type="image/ico" href="favicon.ico" />
<!-- iPhone 14 Pro, 14 Pro Max -->
<link
rel="apple-touch-startup-image"
media="(device-width: 430px) and (device-height: 932px) and (-webkit-device-pixel-ratio: 3)"
href="icons/apple-launch-1290x2796.png"
/>
<!-- iPhone 14, 14 Pro -->
<link
rel="apple-touch-startup-image"
media="(device-width: 393px) and (device-height: 852px) and (-webkit-device-pixel-ratio: 3)"
href="icons/apple-launch-1179x2556.png"
/>
<!-- iPhone 12 Pro Max, 13 Pro Max -->
<link
rel="apple-touch-startup-image"
media="(device-width: 428px) and (device-height: 926px) and (-webkit-device-pixel-ratio: 3)"
href="icons/apple-launch-1284x2778.png"
/>
<!-- iPhone 12, 12 Pro, 13, 13 Pro -->
<link
rel="apple-touch-startup-image"
media="(device-width: 390px) and (device-height: 844px) and (-webkit-device-pixel-ratio: 3)"
href="icons/apple-launch-1170x2532.png"
/>
<!-- iPhone 13 Mini -->
<link
rel="apple-touch-startup-image"
media="(device-width: 360px) and (device-height: 780px) and (-webkit-device-pixel-ratio: 3)"
href="icons/apple-launch-1080x2340.png"
/>
<!-- iPhone XR, 11 -->
<link
rel="apple-touch-startup-image"
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 2)"
href="icons/apple-launch-828x1792.png"
/>
<!-- iPhone X, XS, 12 mini, 11 Pro -->
<link
rel="apple-touch-startup-image"
media="(device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3)"
href="icons/apple-launch-1125x2436.png"
/>
<!-- iPhone XS Max, 11 Pro Max -->
<link
rel="apple-touch-startup-image"
media="(device-width: 414px) and (device-height: 896px) and (-webkit-device-pixel-ratio: 3)"
href="icons/apple-launch-1242x2688.png"
/>
<!-- iPhone 8, 7, 6s, 6 -->
<link
rel="apple-touch-startup-image"
media="(device-width: 375px) and (device-height: 667px) and (-webkit-device-pixel-ratio: 2)"
href="icons/apple-launch-750x1334.png"
/>
<!-- iPhone 8 Plus, 7 Plus, 6s Plus, 6 Plus -->
<link
rel="apple-touch-startup-image"
media="(device-width: 414px) and (device-height: 736px) and (-webkit-device-pixel-ratio: 3)"
href="icons/apple-launch-1242x2208.png"
/>
<!-- iPad 10.2" -->
<link
rel="apple-touch-startup-image"
media="(device-width: 810px) and (device-height: 1080px) and (-webkit-device-pixel-ratio: 2)"
href="icons/apple-launch-1620x2160.png"
/>
<!-- iPad Mini, Air, 9.7" -->
<link
rel="apple-touch-startup-image"
media="(device-width: 768px) and (device-height: 1024px) and (-webkit-device-pixel-ratio: 2)"
href="icons/apple-launch-1536x2048.png"
/>
<!-- iPad Pro 10.5" -->
<link
rel="apple-touch-startup-image"
media="(device-width: 834px) and (device-height: 1112px) and (-webkit-device-pixel-ratio: 2)"
href="icons/apple-launch-1668x2224.png"
/>
<!-- iPad Pro 11" -->
<link
rel="apple-touch-startup-image"
media="(device-width: 834px) and (device-height: 1194px) and (-webkit-device-pixel-ratio: 2)"
href="icons/apple-launch-1668x2388.png"
/>
<!-- iPad Pro 12.9" -->
<link
rel="apple-touch-startup-image"
media="(device-width: 1024px) and (device-height: 1366px) and (-webkit-device-pixel-ratio: 2)"
href="icons/apple-launch-2048x2732.png"
/>
</head>
<body>
<!-- quasar:entry-point -->

View File

@@ -14,25 +14,33 @@
},
"dependencies": {
"@quasar/extras": "^1.16.4",
"appwrite": "^13.0.0",
"quasar": "^2.6.0",
"vue": "^3.0.0",
"vue-router": "^4.0.0"
},
"devDependencies": {
"@quasar/app-vite": "^1.3.0",
"@types/node": "^12.20.21",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"eslint": "^8.10.0",
"eslint-plugin-vue": "^9.0.0",
"eslint-config-prettier": "^8.1.0",
"prettier": "^2.5.1",
"@types/node": "^12.20.21",
"@quasar/app-vite": "^1.3.0",
"autoprefixer": "^10.4.2",
"typescript": "^4.5.4"
"eslint": "^8.10.0",
"eslint-config-prettier": "^8.1.0",
"eslint-plugin-vue": "^9.0.0",
"prettier": "^2.5.1",
"typescript": "^4.5.4",
"workbox-build": "^7.0.0",
"workbox-cacheable-response": "^7.0.0",
"workbox-core": "^7.0.0",
"workbox-expiration": "^7.0.0",
"workbox-precaching": "^7.0.0",
"workbox-routing": "^7.0.0",
"workbox-strategies": "^7.0.0"
},
"engines": {
"node": "^18 || ^16 || ^14.19",
"npm": ">= 6.13.4",
"yarn": ">= 1.21.1"
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256"><path fill="#14539a" fill-opacity=".016" fill-rule="evenodd" d="M0 128.004v128.004l128.25-.254 128.25-.254.254-127.75L257.008 0H0v128.004m.485.496c0 70.4.119 99.053.265 63.672.146-35.38.146-92.98 0-128C.604 29.153.485 58.1.485 128.5"/><path fill="#14539a" fill-opacity=".127" fill-rule="evenodd" d="M253.833 1.876c-.183.481-7.807 9.144-16.942 19.25a49357.61 49357.61 0 0 0-72.405 80.374c-3.952 4.4-18.127 20.15-31.5 35l-31.521 35c-3.962 4.4-22.584 25.1-41.382 46l-34.18 38 58.044.258 58.044.258 3.754-4.2c2.065-2.309 10.461-11.65 18.657-20.758 8.196-9.107 18.321-20.376 22.5-25.042A1734.212 1734.212 0 0 1 201 190.486c3.575-3.876 15.725-17.34 27-29.921 11.275-12.58 22.175-24.717 24.223-26.969l3.724-4.096.026-64.25c.024-56.862-.354-68.064-2.14-63.374M250.5 196.774c-2.2 2.59-14.308 16.187-26.907 30.217-12.599 14.03-23.581 26.296-24.405 27.259-1.422 1.661-.014 1.75 27.657 1.75H256v-32c0-17.6-.338-31.985-.75-31.967-.412.018-2.55 2.151-4.75 4.741"/><path fill="#14539a" fill-opacity=".543" fill-rule="evenodd" d="M250.395 7.287c-4.909 5.303-12.154 13.335-48.901 54.213-10.877 12.1-25.054 27.85-31.505 35-24.314 26.948-67.66 75.077-71.989 79.932-6.492 7.28-49.006 54.545-58.078 64.568-4.232 4.675-8.91 9.962-10.397 11.75L26.822 256H141.005l3.748-4.208c9.492-10.66 68.621-76.281 93.072-103.292l18.104-20 .035-63.25c.02-34.788-.124-63.25-.319-63.25s-2.558 2.379-5.25 5.287M236.959 213.25c-21.511 23.87-30.467 33.874-34.913 39l-3.253 3.75H256v-31.5c0-17.325-.178-31.5-.396-31.5-.218 0-8.608 9.113-18.645 20.25"/><path fill="#14539a" fill-opacity=".331" fill-rule="evenodd" d="M219.112 43.062A127761.403 127761.403 0 0 1 175.51 91.5 571252.7 571252.7 0 0 0 53.1 227.381c-11.33 12.584-21.645 24.171-22.922 25.75L27.855 256l56.323-.082 56.322-.082 4.5-5.212c6.704-7.766 18.769-21.319 25-28.083 3.025-3.283 5.95-6.482 6.5-7.107.55-.625 4.408-4.916 8.573-9.535s12.222-13.574 17.905-19.899c27.589-30.707 45.281-50.355 46.47-51.611.579-.61 2.293-2.523 3.81-4.249l2.757-3.14-.257-62.188-.258-62.189-36.388 40.439m24.272 164.043A9076.964 9076.964 0 0 0 220.96 232a5556.975 5556.975 0 0 1-15.747 17.5l-5.44 6 27.764.266c15.27.146 27.928.102 28.128-.098.201-.2.245-14.223.1-31.161l-.265-30.796-12.116 13.394"/></svg>

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -8,10 +8,8 @@
// Configuration for your app
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js
const { configure } = require('quasar/wrappers');
module.exports = configure(function (/* ctx */) {
return {
eslint: {
@@ -20,7 +18,7 @@ module.exports = configure(function (/* ctx */) {
// exclude: [],
// rawOptions: {},
warnings: true,
errors: true
errors: true,
},
// https://v2.quasar.dev/quasar-cli-vite/prefetch-feature
@@ -29,15 +27,10 @@ module.exports = configure(function (/* ctx */) {
// app boot file (/src/boot)
// --> boot files are part of "main.js"
// https://v2.quasar.dev/quasar-cli-vite/boot-files
boot: [
],
boot: ['appwrite'],
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#css
css: [
'app.scss'
],
css: ['app.scss'],
// https://github.com/quasarframework/quasar/tree/dev/extras
extras: [
@@ -56,8 +49,8 @@ module.exports = configure(function (/* ctx */) {
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#build
build: {
target: {
browser: [ 'es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1' ],
node: 'node16'
browser: ['es2019', 'edge88', 'firefox78', 'chrome87', 'safari13.1'],
node: 'node16',
},
vueRouterMode: 'hash', // available values: 'hash', 'history'
@@ -79,7 +72,6 @@ module.exports = configure(function (/* ctx */) {
// extendViteConf (viteConf) {},
// viteVuePluginOptions: {},
// vitePlugins: [
// [ 'package-name', { ..options.. } ]
// ]
@@ -88,7 +80,7 @@ module.exports = configure(function (/* ctx */) {
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer
devServer: {
// https: true
open: true // opens browser window automatically
open: true, // opens browser window automatically
},
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
@@ -106,7 +98,7 @@ module.exports = configure(function (/* ctx */) {
// directives: [],
// Quasar plugins
plugins: []
plugins: [],
},
// animations: 'all', // --- includes all animations
@@ -128,7 +120,7 @@ module.exports = configure(function (/* ctx */) {
// https://v2.quasar.dev/quasar-cli-vite/developing-ssr/configuring-ssr
ssr: {
// ssrPwaHtmlFilename: 'offline.html', // do NOT use index.html as name!
// will mess up SSR
// will mess up SSR
// extendSSRWebserverConf (esbuildConf) {},
// extendPackageJson (json) {},
@@ -139,11 +131,11 @@ module.exports = configure(function (/* ctx */) {
// manualPostHydrationTrigger: true,
prodPort: 3000, // The default port that the production server should use
// (gets superseded if process.env.PORT is specified at runtime)
// (gets superseded if process.env.PORT is specified at runtime)
middlewares: [
'render' // keep this as last one
]
'render', // keep this as last one
],
},
// https://v2.quasar.dev/quasar-cli-vite/developing-pwa/configuring-pwa
@@ -167,7 +159,7 @@ module.exports = configure(function (/* ctx */) {
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-capacitor-apps/configuring-capacitor
capacitor: {
hideSplashscreen: true
hideSplashscreen: true,
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-electron-apps/configuring-electron
@@ -181,13 +173,11 @@ module.exports = configure(function (/* ctx */) {
packager: {
// https://github.com/electron-userland/electron-packager/blob/master/docs/api.md#options
// OS X / Mac App Store
// appBundleId: '',
// appCategoryType: '',
// osxSign: '',
// protocol: 'myapp://path',
// Windows only
// win32metadata: { ... }
},
@@ -195,18 +185,16 @@ module.exports = configure(function (/* ctx */) {
builder: {
// https://www.electron.build/configuration/configuration
appId: 'bab-project'
}
appId: 'bab-project',
},
},
// Full list of options: https://v2.quasar.dev/quasar-cli-vite/developing-browser-extensions/configuring-bex
bex: {
contentScripts: [
'my-content-script'
],
contentScripts: ['my-content-script'],
// extendBexScriptsConf (esbuildConf) {}
// extendBexManifestJson (json) {}
}
}
},
};
});

17
src-pwa/.eslintrc.js Normal file
View File

@@ -0,0 +1,17 @@
const { resolve } = require('path');
module.exports = {
parserOptions: {
project: resolve(__dirname, './tsconfig.json'),
},
overrides: [
{
files: ['custom-service-worker.ts'],
env: {
serviceworker: true,
},
},
],
};

View File

@@ -0,0 +1,35 @@
/*
* This file (which will be your service worker)
* is picked up by the build system ONLY if
* quasar.config.js > pwa > workboxMode is set to "injectManifest"
*/
declare const self: ServiceWorkerGlobalScope &
typeof globalThis & { skipWaiting: () => void };
import { clientsClaim } from 'workbox-core';
import {
precacheAndRoute,
cleanupOutdatedCaches,
createHandlerBoundToURL,
} from 'workbox-precaching';
import { registerRoute, NavigationRoute } from 'workbox-routing';
self.skipWaiting();
clientsClaim();
// Use with precache injection
precacheAndRoute(self.__WB_MANIFEST);
cleanupOutdatedCaches();
// Non-SSR fallback to index.html
// Production SSR fallback to offline.html (except for dev)
if (process.env.MODE !== 'ssr' || process.env.PROD) {
registerRoute(
new NavigationRoute(
createHandlerBoundToURL(process.env.PWA_FALLBACK_HTML),
{ denylist: [/sw\.js$/, /workbox-(.)*\.js$/] }
)
);
}

32
src-pwa/manifest.json Normal file
View File

@@ -0,0 +1,32 @@
{
"orientation": "portrait",
"background_color": "#ffffff",
"theme_color": "#027be3",
"icons": [
{
"src": "icons/icon-128x128.png",
"sizes": "128x128",
"type": "image/png"
},
{
"src": "icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "icons/icon-256x256.png",
"sizes": "256x256",
"type": "image/png"
},
{
"src": "icons/icon-384x384.png",
"sizes": "384x384",
"type": "image/png"
},
{
"src": "icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
]
}

8
src-pwa/pwa-env.d.ts vendored Normal file
View File

@@ -0,0 +1,8 @@
/* eslint-disable */
declare namespace NodeJS {
interface ProcessEnv {
SERVICE_WORKER_FILE: string;
PWA_FALLBACK_HTML: string;
}
}

10
src-pwa/pwa-flag.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
/* eslint-disable */
// THIS FEATURE-FLAG FILE IS AUTOGENERATED,
// REMOVAL OR CHANGES WILL CAUSE RELATED TYPES TO STOP WORKING
import "quasar/dist/types/feature-flag";
declare module "quasar/dist/types/feature-flag" {
interface QuasarFeatureFlags {
pwa: true;
}
}

View File

@@ -0,0 +1,41 @@
import { register } from 'register-service-worker';
// The ready(), registered(), cached(), updatefound() and updated()
// events passes a ServiceWorkerRegistration instance in their arguments.
// ServiceWorkerRegistration: https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration
register(process.env.SERVICE_WORKER_FILE, {
// The registrationOptions object will be passed as the second argument
// to ServiceWorkerContainer.register()
// https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer/register#Parameter
// registrationOptions: { scope: './' },
ready (/* registration */) {
// console.log('Service worker is active.')
},
registered (/* registration */) {
// console.log('Service worker has been registered.')
},
cached (/* registration */) {
// console.log('Content has been cached for offline use.')
},
updatefound (/* registration */) {
// console.log('New content is downloading.')
},
updated (/* registration */) {
// console.log('New content is available; please refresh.')
},
offline () {
// console.log('No internet connection found. App is running in offline mode.')
},
error (/* err */) {
// console.error('Error during service worker registration:', err)
},
});

7
src-pwa/tsconfig.json Normal file
View File

@@ -0,0 +1,7 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"lib": ["WebWorker", "ESNext"]
},
"include": ["*.ts", "*.d.ts"]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

19
src/boot/appwrite.ts Normal file
View File

@@ -0,0 +1,19 @@
import { boot } from 'quasar/wrappers';
import { Client, Account, ID } from 'appwrite';
export const client = new Client();
client
.setEndpoint('https://cloud.appwrite.io/v1')
.setProject('653ef6f76baf06d68034');
export const account = new Account(client);
// "async" is optional;
// more info on params: https://v2.quasar.dev/quasar-cli/boot-files
export default boot(async ({ app }) => {
console.log('Appwrite Instantiation');
app.config.globalProperties.$appwrite_client = client;
app.config.globalProperties.$appwrite_account = account;
app.config.globalProperties.$appwrite_ID = ID;
});

41
src/pages/LoginPage.vue Normal file
View File

@@ -0,0 +1,41 @@
<template>
<div>
<p>
{{ loggedInUser ? `Logged in as ${loggedInUser.name}` : 'Not logged in' }}
</p>
<form>
<input type="email" placeholder="Email" v-model="email" />
<input type="password" placeholder="Password" v-model="password" />
<input type="text" placeholder="Name" v-model="name" />
<button type="button" @click="login(email, password)">Login</button>
<button type="button" @click="register">Register</button>
<button type="button" @click="logout">Logout</button>
</form>
</div>
</template>
<script setup>
import { ref } from 'vue';
import { account, ID } from './lib/appwrite.js';
const loggedInUser = ref(null);
const email = ref('');
const password = ref('');
const name = ref('');
const login = async (email, password) => {
await account.createEmailSession(email, password);
loggedInUser.value = await account.get();
};
const register = async () => {
await account.create(ID.unique(), email.value, password.value, name.value);
login(email.value, password.value);
};
const logout = async () => {
await account.deleteSession('current');
loggedInUser.value = null;
};
</script>

2198
yarn.lock

File diff suppressed because it is too large Load Diff