diff --git a/index.html b/index.html index 38f3861..b7062ac 100644 --- a/index.html +++ b/index.html @@ -1,10 +1,15 @@ - + + - - Vite App + + Walk-up alarm + + + +
diff --git a/public/android-chrome-192x192.png b/public/android-chrome-192x192.png new file mode 100644 index 0000000..bb0efe4 Binary files /dev/null and b/public/android-chrome-192x192.png differ diff --git a/public/android-chrome-512x512.png b/public/android-chrome-512x512.png new file mode 100644 index 0000000..ad4c0de Binary files /dev/null and b/public/android-chrome-512x512.png differ diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000..8af12a1 Binary files /dev/null and b/public/apple-touch-icon.png differ diff --git a/public/browserconfig.xml b/public/browserconfig.xml new file mode 100644 index 0000000..b3930d0 --- /dev/null +++ b/public/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #da532c + + + diff --git a/public/favicon-16x16.png b/public/favicon-16x16.png new file mode 100644 index 0000000..c16df4a Binary files /dev/null and b/public/favicon-16x16.png differ diff --git a/public/favicon-32x32.png b/public/favicon-32x32.png new file mode 100644 index 0000000..f97b76b Binary files /dev/null and b/public/favicon-32x32.png differ diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..c2e9042 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..f481db0 --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/public/mstile-144x144.png b/public/mstile-144x144.png new file mode 100644 index 0000000..aeb014b Binary files /dev/null and b/public/mstile-144x144.png differ diff --git a/public/mstile-150x150.png b/public/mstile-150x150.png new file mode 100644 index 0000000..4502557 Binary files /dev/null and b/public/mstile-150x150.png differ diff --git a/public/mstile-310x150.png b/public/mstile-310x150.png new file mode 100644 index 0000000..12a20e3 Binary files /dev/null and b/public/mstile-310x150.png differ diff --git a/public/mstile-310x310.png b/public/mstile-310x310.png new file mode 100644 index 0000000..6cfa528 Binary files /dev/null and b/public/mstile-310x310.png differ diff --git a/public/mstile-70x70.png b/public/mstile-70x70.png new file mode 100644 index 0000000..ee4f549 Binary files /dev/null and b/public/mstile-70x70.png differ diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..c2a49f4 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Allow: / diff --git a/public/safari-pinned-tab.svg b/public/safari-pinned-tab.svg new file mode 100644 index 0000000..e7c02de --- /dev/null +++ b/public/safari-pinned-tab.svg @@ -0,0 +1,37 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + + diff --git a/public/site.webmanifest b/public/site.webmanifest new file mode 100644 index 0000000..b20abb7 --- /dev/null +++ b/public/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/public/walk-up-alarm.png b/public/walk-up-alarm.png new file mode 100644 index 0000000..d80edc1 Binary files /dev/null and b/public/walk-up-alarm.png differ diff --git a/public/walk-up-alarm.svg b/public/walk-up-alarm.svg new file mode 100644 index 0000000..3498754 --- /dev/null +++ b/public/walk-up-alarm.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/src/App.tsx b/src/App.tsx index 5aafb48..286af45 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -13,6 +13,8 @@ import "./App.css"; import alarmMp3 from "./alarm.mp3"; import blankMp3 from "./blank.mp3"; +import logo from "./logo.svg"; + function App() { const [alarm, setAlarm] = useState(null); const [alarmSet, setAlarmSet] = useState(false); @@ -60,9 +62,8 @@ function App() { useEffect(() => { if (alarmSet && distance > stopDistance) { resetAlarm(); - } else { + } else if (alarmSet) { setHasWalked(false); - setAlarmPlaying(true); audioRef.current?.play(); } }, [distance, alarmSet]); @@ -145,7 +146,8 @@ function App() {

) : ( <> -

Alarm clock

+ +

Walk-up alarm

{/* - - + + + + + + - - - - - - - - - + + + - + \ No newline at end of file diff --git a/src/logo.svg b/src/logo.svg index 6b60c10..3498754 100644 --- a/src/logo.svg +++ b/src/logo.svg @@ -1,7 +1,12 @@ - - - - - - + + + + + + + + + + + diff --git a/vite.config.ts b/vite.config.ts index 01f6350..486f045 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,5 +5,10 @@ import { VitePWA } from "vite-plugin-pwa"; // https://vitejs.dev/config/ export default defineConfig({ base: "/walk-up-alarm/", - plugins: [react(), VitePWA()], + plugins: [ + react(), + VitePWA({ + registerType: "autoUpdate", + }), + ], });