Skip to content

Commit

Permalink
feat(pwa): integration
Browse files Browse the repository at this point in the history
  • Loading branch information
Muhammed-Rahif committed Sep 24, 2024
1 parent f9ef99a commit f0f6bb5
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 15 deletions.
Binary file added resources/Logo.fig
Binary file not shown.
Binary file added resources/Notepad Logo Dark.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 resources/Notepad Logo Light.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: 6 additions & 3 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<link rel="manifest" href="/manifest.json" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="/Notepad/favicon.png" />
<link rel="manifest" href="/Notepad/manifest.json" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"
/>
%sveltekit.head%
</head>
<body data-sveltekit-preload-data="hover">
Expand Down
10 changes: 10 additions & 0 deletions src/lib/assets/imgs/Notepad Logo Dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/lib/assets/imgs/Notepad Logo Light.svg
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 src/lib/assets/imgs/favicon-dark.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 src/lib/assets/imgs/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
<script>
import { ModeWatcher } from 'mode-watcher';
import { ModeWatcher, mode } from 'mode-watcher';
import '../app.css';
import favIcon from '$lib/assets/imgs/favicon.png';
import favIconDark from '$lib/assets/imgs/favicon-dark.png';
</script>

<ModeWatcher />
<slot></slot>

<svelte:head>
{#if $mode == 'dark'}
<link rel="icon" href={favIconDark} />
{:else}
<link rel="icon" href={favIcon} />
{/if}
</svelte:head>
Binary file modified static/favicon.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 static/icon512_maskable.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 static/icon512_rounded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 17 additions & 9 deletions static/manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
{
"name": "Notepad",
"description": "Windows like notepad for cross platform.",
"display": "standalone",
"start_url": "/",
"theme_color": "#888888",
"background_color": "#d4d4d4",
"icons": [
{
"src": "icons/myIcon512.png",
"purpose": "maskable",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
}
]
"src": "icon512_maskable.png",
"type": "image/png"
},
{ "purpose": "any", "sizes": "512x512", "src": "icon512_rounded.png", "type": "image/png" }
],
"orientation": "any",
"display": "standalone",
"dir": "auto",
"lang": "en-IN",
"name": "Notepad",
"short_name": "Notepad",
"start_url": "/Notepad",
"scope": ".",
"description": "Windows like notepad for cross platform."
}
5 changes: 3 additions & 2 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

const dev = process.env.NODE_ENV === 'development';
// const dev = process.env.NODE_ENV === 'development';

/** @type {import('@sveltejs/kit').Config} */
const config = {
Expand All @@ -18,7 +18,8 @@ const config = {
}),
// https://stackoverflow.com/a/72733222/14781260
paths: {
base: dev ? '' : '/Notepad'
// base: dev ? '' : '/Notepad'
base: '/Notepad'
},
alias: {
'@/*': 'src/lib/*'
Expand Down

0 comments on commit f0f6bb5

Please sign in to comment.