From 09d96551ec46baaaa81f550b96fb693d335b0cd1 Mon Sep 17 00:00:00 2001 From: zomco Date: Mon, 15 Jan 2024 18:46:40 +0800 Subject: [PATCH] Add esp-web-install-button --- app/api/upload/route.ts | 21 ++++++ {src/app => app}/globals.css | 8 -- app/layout.tsx | 34 +++++++++ app/page.module.css | 7 ++ app/page.tsx | 47 ++++++++++++ components/loading-dots.module.css | 40 ++++++++++ components/loading-dots.tsx | 13 ++++ package-lock.json | 29 +++++++- package.json | 9 ++- public/android-chrome-192x192.png | Bin 0 -> 18288 bytes public/android-chrome-512x512.png | Bin 0 -> 100486 bytes public/apple-touch-icon.png | Bin 0 -> 16304 bytes public/browserconfig.xml | 9 +++ public/favicon-16x16.png | Bin 0 -> 1263 bytes public/favicon-32x32.png | Bin 0 -> 2008 bytes public/favicon.ico | Bin 0 -> 15086 bytes public/github.svg | 1 + public/manifest_owcare.json | 27 +++++++ public/mstile-150x150.png | Bin 0 -> 9682 bytes public/next.svg | 1 - public/owkor.svg | 1 + public/safari-pinned-tab.svg | 60 +++++++++++++++ public/site.webmanifest | 19 +++++ public/vercel.svg | 1 - settings.json | 5 ++ src/app/favicon.ico | Bin 25931 -> 0 bytes src/app/layout.tsx | 22 ------ src/app/page.tsx | 113 ----------------------------- tailwind.config.ts | 9 ++- tsconfig.json | 4 +- 30 files changed, 323 insertions(+), 157 deletions(-) create mode 100644 app/api/upload/route.ts rename {src/app => app}/globals.css (69%) create mode 100644 app/layout.tsx create mode 100644 app/page.module.css create mode 100644 app/page.tsx create mode 100644 components/loading-dots.module.css create mode 100644 components/loading-dots.tsx create mode 100644 public/android-chrome-192x192.png create mode 100644 public/android-chrome-512x512.png create mode 100644 public/apple-touch-icon.png create mode 100644 public/browserconfig.xml create mode 100644 public/favicon-16x16.png create mode 100644 public/favicon-32x32.png create mode 100644 public/favicon.ico create mode 100644 public/github.svg create mode 100644 public/manifest_owcare.json create mode 100644 public/mstile-150x150.png delete mode 100644 public/next.svg create mode 100644 public/owkor.svg create mode 100644 public/safari-pinned-tab.svg create mode 100644 public/site.webmanifest delete mode 100644 public/vercel.svg create mode 100644 settings.json delete mode 100644 src/app/favicon.ico delete mode 100644 src/app/layout.tsx delete mode 100644 src/app/page.tsx diff --git a/app/api/upload/route.ts b/app/api/upload/route.ts new file mode 100644 index 0000000..e57dd97 --- /dev/null +++ b/app/api/upload/route.ts @@ -0,0 +1,21 @@ +import { put } from '@vercel/blob' +import { NextResponse } from 'next/server' +import { customAlphabet } from 'nanoid' + +export const runtime = 'edge' + +const nanoid = customAlphabet( + '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz', + 7 +) // 7-character random string +export async function POST(req: Request) { + const file = req.body || '' + const contentType = req.headers.get('content-type') || 'text/plain' + const filename = `${nanoid()}.${contentType.split('/')[1]}` + const blob = await put(filename, file, { + contentType, + access: 'public', + }) + + return NextResponse.json(blob) +} diff --git a/src/app/globals.css b/app/globals.css similarity index 69% rename from src/app/globals.css rename to app/globals.css index fd81e88..1b4ca7b 100644 --- a/src/app/globals.css +++ b/app/globals.css @@ -8,14 +8,6 @@ --background-end-rgb: 255, 255, 255; } -@media (prefers-color-scheme: dark) { - :root { - --foreground-rgb: 255, 255, 255; - --background-start-rgb: 0, 0, 0; - --background-end-rgb: 0, 0, 0; - } -} - body { color: rgb(var(--foreground-rgb)); background: linear-gradient( diff --git a/app/layout.tsx b/app/layout.tsx new file mode 100644 index 0000000..247f883 --- /dev/null +++ b/app/layout.tsx @@ -0,0 +1,34 @@ +import './globals.css' +import { Inter } from 'next/font/google' + +export const metadata = { + title: 'owkor', + description: 'owkor', + manifest: 'site.webmanifest', + icons: { + icon: ['/favicon-32x32.png', '/favicon-16x16.png'], + apple: '/apple-touch-icon.png', + other: { + rel: 'mask-icon', + url: '/safari-pinned-tab.svg', + }, + }, +} + +const inter = Inter({ + variable: '--font-inter', + subsets: ['latin'], + display: 'swap', +}) + +export default function RootLayout({ + children, +}: { + children: React.ReactNode +}) { + return ( + + {children} + + ) +} diff --git a/app/page.module.css b/app/page.module.css new file mode 100644 index 0000000..0c920b2 --- /dev/null +++ b/app/page.module.css @@ -0,0 +1,7 @@ +.steps { + list-style: number; +} + +.connect { + margin-top: 20px; +} diff --git a/app/page.tsx b/app/page.tsx new file mode 100644 index 0000000..4547c28 --- /dev/null +++ b/app/page.tsx @@ -0,0 +1,47 @@ +import Image from 'next/image' +import Link from 'next/link' +import Script from 'next/script' +import * as React from 'react' +import styles from './page.module.css' + + +export default function Home() { + return ( +
+
+
    +
  1. Plug in your devices to a USB port. We will install firmware to it.
  2. +
  3. Hit ‘Connect’ and select the correct COM port.
  4. +
  5. Get firmware installed and connected in less than 3 minutes!
  6. +
+
+ +
+
+
+ + Owkor Logo + + + GitHub Logo + +
+