diff --git a/client/package-lock.json b/client/package-lock.json index d1c2474..ebcf7ec 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -16,7 +16,8 @@ "casper-js-sdk": "^2.15.5", "express": "^4.19.2", "greenlock-express": "^4.0.3", - "prismjs": "^1.29.0" + "prismjs": "^1.29.0", + "react-device-detect": "^2.2.3" }, "devDependencies": { "@types/node": "^16.18.96", @@ -16315,6 +16316,18 @@ "node": ">=8" } }, + "node_modules/react-device-detect": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/react-device-detect/-/react-device-detect-2.2.3.tgz", + "integrity": "sha512-buYY3qrCnQVlIFHrC5UcUoAj7iANs/+srdkwsnNjI7anr3Tt7UY6MqNxtMLlr0tMBied0O49UZVK8XKs3ZIiPw==", + "dependencies": { + "ua-parser-js": "^1.0.33" + }, + "peerDependencies": { + "react": ">= 0.14.0", + "react-dom": ">= 0.14.0" + } + }, "node_modules/react-dom": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", @@ -18669,6 +18682,28 @@ "node": ">=4.2.0" } }, + "node_modules/ua-parser-js": { + "version": "1.0.37", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.37.tgz", + "integrity": "sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + }, + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" + } + ], + "engines": { + "node": "*" + } + }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -31729,6 +31764,14 @@ } } }, + "react-device-detect": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/react-device-detect/-/react-device-detect-2.2.3.tgz", + "integrity": "sha512-buYY3qrCnQVlIFHrC5UcUoAj7iANs/+srdkwsnNjI7anr3Tt7UY6MqNxtMLlr0tMBied0O49UZVK8XKs3ZIiPw==", + "requires": { + "ua-parser-js": "^1.0.33" + } + }, "react-dom": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", @@ -33510,6 +33553,11 @@ "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", "dev": true }, + "ua-parser-js": { + "version": "1.0.37", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.37.tgz", + "integrity": "sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ==" + }, "unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", diff --git a/client/package.json b/client/package.json index 9d229d0..bd30296 100644 --- a/client/package.json +++ b/client/package.json @@ -11,7 +11,8 @@ "casper-js-sdk": "^2.15.5", "express": "^4.19.2", "greenlock-express": "^4.0.3", - "prismjs": "^1.29.0" + "prismjs": "^1.29.0", + "react-device-detect": "^2.2.3" }, "scripts": { "start": "react-app-rewired start", diff --git a/client/public/favicon/android-chrome-192x192.png b/client/public/favicon/android-chrome-192x192.png new file mode 100644 index 0000000..c097362 Binary files /dev/null and b/client/public/favicon/android-chrome-192x192.png differ diff --git a/client/public/favicon/android-chrome-512x512.png b/client/public/favicon/android-chrome-512x512.png new file mode 100644 index 0000000..52660f3 Binary files /dev/null and b/client/public/favicon/android-chrome-512x512.png differ diff --git a/client/public/favicon/apple-touch-icon.png b/client/public/favicon/apple-touch-icon.png new file mode 100644 index 0000000..28050c9 Binary files /dev/null and b/client/public/favicon/apple-touch-icon.png differ diff --git a/client/public/favicon/browserconfig.xml b/client/public/favicon/browserconfig.xml new file mode 100644 index 0000000..c1d2317 --- /dev/null +++ b/client/public/favicon/browserconfig.xml @@ -0,0 +1,9 @@ + + + + + + #2d89ef + + + diff --git a/client/public/favicon/favicon-16x16.png b/client/public/favicon/favicon-16x16.png new file mode 100644 index 0000000..10dfff1 Binary files /dev/null and b/client/public/favicon/favicon-16x16.png differ diff --git a/client/public/favicon/favicon-32x32.png b/client/public/favicon/favicon-32x32.png new file mode 100644 index 0000000..8feefcc Binary files /dev/null and b/client/public/favicon/favicon-32x32.png differ diff --git a/client/public/favicon/favicon.ico b/client/public/favicon/favicon.ico new file mode 100644 index 0000000..bc71f25 Binary files /dev/null and b/client/public/favicon/favicon.ico differ diff --git a/client/public/favicon/mstile-144x144.png b/client/public/favicon/mstile-144x144.png new file mode 100644 index 0000000..b67d8e6 Binary files /dev/null and b/client/public/favicon/mstile-144x144.png differ diff --git a/client/public/favicon/mstile-150x150.png b/client/public/favicon/mstile-150x150.png new file mode 100644 index 0000000..8ae4552 Binary files /dev/null and b/client/public/favicon/mstile-150x150.png differ diff --git a/client/public/favicon/mstile-310x150.png b/client/public/favicon/mstile-310x150.png new file mode 100644 index 0000000..fda3f42 Binary files /dev/null and b/client/public/favicon/mstile-310x150.png differ diff --git a/client/public/favicon/mstile-310x310.png b/client/public/favicon/mstile-310x310.png new file mode 100644 index 0000000..ec64c09 Binary files /dev/null and b/client/public/favicon/mstile-310x310.png differ diff --git a/client/public/favicon/mstile-70x70.png b/client/public/favicon/mstile-70x70.png new file mode 100644 index 0000000..e83aa96 Binary files /dev/null and b/client/public/favicon/mstile-70x70.png differ diff --git a/client/public/favicon/safari-pinned-tab.svg b/client/public/favicon/safari-pinned-tab.svg new file mode 100644 index 0000000..f6cc3b0 --- /dev/null +++ b/client/public/favicon/safari-pinned-tab.svg @@ -0,0 +1,78 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + + + diff --git a/client/public/favicon/site.webmanifest b/client/public/favicon/site.webmanifest new file mode 100644 index 0000000..5eb5e44 --- /dev/null +++ b/client/public/favicon/site.webmanifest @@ -0,0 +1,19 @@ +{ + "name": "", + "short_name": "", + "icons": [ + { + "src": "/favicon/android-chrome-192x192.png", + "sizes": "192x192", + "type": "image/png" + }, + { + "src": "/favicon/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" + } + ], + "theme_color": "#ffffff", + "background_color": "#ffffff", + "display": "standalone" +} diff --git a/client/public/index.html b/client/public/index.html index 7636761..d84efd7 100644 --- a/client/public/index.html +++ b/client/public/index.html @@ -2,15 +2,22 @@ - - + + + + + + + + + - CSPR.click app + Code of Creation diff --git a/client/src/components/Instructions.tsx b/client/src/components/Instructions.tsx index c012df6..549683b 100644 --- a/client/src/components/Instructions.tsx +++ b/client/src/components/Instructions.tsx @@ -3,6 +3,7 @@ import { useClickRef } from '@make-software/csprclick-ui'; import { Dispatch, SetStateAction, useContext } from 'react'; import { ActiveAccountContext, StyledContentContainer } from '../App'; import { claim } from '../apiClient'; +import { isMobile } from 'react-device-detect'; const StyledStepContainer = styled.div(({ theme }) => theme.withMedia({ @@ -42,7 +43,15 @@ export default function Instructions(props: InstructionsProps) { } async function connectWallet() { - console.log(await clickRef?.signIn()); + if (!(await clickRef?.isProviderPresent('casper-wallet'))) { + if (isMobile || 'ontouchstart' in document.documentElement) { + window.location.href = 'casperwallet://download?browse=casper.dariodesiena.com&click=connect'; + } else { + await clickRef?.signIn(); + } + } else { + await clickRef?.connect('casper-wallet'); + } } function openCasperWalletInstall() { diff --git a/client/src/components/Welcome.tsx b/client/src/components/Welcome.tsx index 0da12e0..e87a3b2 100644 --- a/client/src/components/Welcome.tsx +++ b/client/src/components/Welcome.tsx @@ -8,7 +8,8 @@ const Container = styled.div(({ theme }) => backgroundImage: `url("${background}")`, backgroundRepeat: 'no-repeat', backgroundSize: 'cover', - backgroundPosition: ['top 50% center', 'top 80% center', 'center', 'top 35% center'], + //backgroundPosition: ['top 50% center', 'top 80% center', 'center', 'top 35% center'], + backgroundPosition: ['top 50% center', 'top 80% center', 'bottom 30% center'], position: 'absolute', top: 40, left: 0, @@ -26,6 +27,10 @@ const HeadingContainer = styled.div(({ theme }) => h2: { color: 'white', }, + position: 'absolute', + bottom: [80, 50], + left: '50%', + transform: 'translateX(-50%)', }) ); @@ -44,7 +49,7 @@ export const Welcome = () => { -

A Collaboration between Dario De Siena & Casper.Network

+

A Collaboration between Dario De Siena & Casper Network

);