From 8fca824e45c33737eb2e4ed88c4b889b8a8379fb Mon Sep 17 00:00:00 2001 From: Doug Anderson444 Date: Wed, 17 Apr 2024 08:59:39 -0300 Subject: [PATCH] add swipe finger to homepage --- src/lib/Finger.svelte | 32 +++++++++++++++++++++++++ src/lib/images/pointer-finger.svg | 1 + src/routes/+page.svelte | 39 ++++++++++++++++++++----------- 3 files changed, 59 insertions(+), 13 deletions(-) create mode 100644 src/lib/Finger.svelte create mode 100644 src/lib/images/pointer-finger.svg diff --git a/src/lib/Finger.svelte b/src/lib/Finger.svelte new file mode 100644 index 0000000..bf76bae --- /dev/null +++ b/src/lib/Finger.svelte @@ -0,0 +1,32 @@ + + +
+ Drag link to tab bar or click to copy link +
+ + + + diff --git a/src/lib/images/pointer-finger.svg b/src/lib/images/pointer-finger.svg new file mode 100644 index 0000000..206fb76 --- /dev/null +++ b/src/lib/images/pointer-finger.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 2160ba9..e664fd0 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -3,6 +3,7 @@ import { base } from '$app/paths'; import { encodeURLSafe } from '@stablelib/base64'; + import Finger from '$lib/Finger.svelte'; /** * @type {string} @@ -27,6 +28,8 @@ */ let hash; let integrity; + // Test whether it's isSafari + let isSafari = false; onMount(async () => { const name = 'innerApp.js'; @@ -55,7 +58,8 @@ el_link.href = dataUrl; // FIXME: This device detection is quite fragile - const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); + // const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); + isSafari = navigator.userAgent.includes('Safari') && !navigator.userAgent.includes('Chrome'); const isAndroid = navigator.userAgent.toLowerCase().indexOf('android') > -1; // if safari simply click the link @@ -82,15 +86,24 @@ }); - - - - -

Welcome to Secure Bookmark Warp Wallet

-Drag me into tab bar - - -
- +
+

Welcome to Integrity Apps, a Secure Bookmark Webpage

+ {#if !isSafari} + + + {/if} + Drag me into tab bar + + + +

How does this work?

+

+ When you copy/paste or drag the link into the address bar, the app will be loaded. This is a + secure way to load the app because the app code cannot change behind your back. Once the data + URL has loaded, you can bookmark it and use it in the future. +

+