Skip to content

Commit 30c5db5

Browse files
committed
pwa test
1 parent becb301 commit 30c5db5

19 files changed

+4671
-37
lines changed

next.config.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin");
33
const CopyPlugin = require("copy-webpack-plugin");
44

5+
6+
57
const nextConfig = {
68
reactStrictMode: true,
79
webpack: (config, { }) => {
@@ -32,4 +34,10 @@ const nextConfig = {
3234
}
3335
}
3436

35-
module.exports = nextConfig
37+
const withPWA = require('next-pwa')({
38+
dest: 'public'
39+
})
40+
41+
module.exports = withPWA(nextConfig)
42+
43+
// module.exports = nextConfig

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"ndarray": "^1.0.19",
2323
"ndarray-ops": "^1.2.2",
2424
"next": "13.1.1",
25+
"next-pwa": "^5.6.0",
2526
"node-polyfill-webpack-plugin": "^2.0.1",
2627
"onnxruntime-web": "^1.13.1",
2728
"react": "18.2.0",

pages/_document.tsx

+76-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,86 @@
1-
import { Html, Head, Main, NextScript } from 'next/document'
1+
import { Html, Head, Main, NextScript } from "next/document";
22

33
export default function Document() {
44
return (
55
<Html lang="en">
6-
<Head />
6+
<Head>
7+
<meta name="application-name" content="PWA App" />
8+
<meta name="apple-mobile-web-app-capable" content="yes" />
9+
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
10+
<meta name="apple-mobile-web-app-title" content="PWA App" />
11+
<meta name="description" content="Best PWA App in the world" />
12+
<meta name="format-detection" content="telephone=no" />
13+
<meta name="mobile-web-app-capable" content="yes" />
14+
<meta name="msapplication-config" content="/icons/browserconfig.xml" />
15+
<meta name="msapplication-TileColor" content="#2B5797" />
16+
<meta name="msapplication-tap-highlight" content="no" />
17+
<meta name="theme-color" content="#000000" />
18+
19+
<link rel="apple-touch-icon" href="/icons/touch-icon-iphone.png" />
20+
<link
21+
rel="apple-touch-icon"
22+
sizes="152x152"
23+
href="/icons/touch-icon-ipad.png"
24+
/>
25+
<link
26+
rel="apple-touch-icon"
27+
sizes="180x180"
28+
href="/icons/touch-icon-iphone-retina.png"
29+
/>
30+
<link
31+
rel="apple-touch-icon"
32+
sizes="167x167"
33+
href="/icons/touch-icon-ipad-retina.png"
34+
/>
35+
36+
<link
37+
rel="icon"
38+
type="image/png"
39+
sizes="32x32"
40+
href="/icons/favicon-32x32.png"
41+
/>
42+
<link
43+
rel="icon"
44+
type="image/png"
45+
sizes="16x16"
46+
href="/icons/favicon-16x16.png"
47+
/>
48+
<link rel="manifest" href="/manifest.json" />
49+
<link
50+
rel="mask-icon"
51+
href="/icons/safari-pinned-tab.svg"
52+
color="#5bbad5"
53+
/>
54+
<link rel="shortcut icon" href="/favicon.ico" />
55+
<link
56+
rel="stylesheet"
57+
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500"
58+
/>
59+
60+
<meta name="twitter:card" content="summary" />
61+
<meta name="twitter:url" content="https://yourdomain.com" />
62+
<meta name="twitter:title" content="PWA App" />
63+
<meta name="twitter:description" content="Best PWA App in the world" />
64+
<meta
65+
name="twitter:image"
66+
content="https://yourdomain.com/icons/android-chrome-192x192.png"
67+
/>
68+
<meta name="twitter:creator" content="@DavidWShadow" />
69+
<meta property="og:type" content="website" />
70+
<meta property="og:title" content="PWA App" />
71+
<meta property="og:description" content="Best PWA App in the world" />
72+
<meta property="og:site_name" content="PWA App" />
73+
<meta property="og:url" content="https://yourdomain.com" />
74+
<meta
75+
property="og:image"
76+
content="https://yourdomain.com/icons/apple-touch-icon.png"
77+
/>
78+
</Head>
79+
780
<body>
881
<Main />
982
<NextScript />
1083
</body>
1184
</Html>
12-
)
85+
);
1386
}

pages/index.tsx

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
import Head from "next/head";
22
import Yolo from "../components/models/Yolo";
3-
3+
import { useEffect, useState } from "react";
4+
import dynamic from "next/dynamic";
45

56
export default function Home() {
7+
8+
69
return (
710
<>
811
<Head>
9-
<title>Real Time Object Detection</title>
12+
<title>Realtime Object Detection</title>
1013
<meta name="description" content="Created by juanjaho" />
1114
<meta name="viewport" content="width=device-width, initial-scale=1" />
1215
<meta name="apple-mobile-web-app-capable" content="yes" />
1316
<meta name="mobile-web-app-capable" content="yes" />
14-
<link rel="icon" href="/icon2.png" />
17+
<link rel="icon" href="/icon.png" />
1518
</Head>
1619
<main className="font-mono flex flex-col justify-center items-center w-screen">
17-
<h1 className="m-5 text-xl font-bold">Real-Time Object Detection</h1>
20+
<h1 className="m-5 text-xl font-bold">Realtime Object Detection</h1>
1821
<Yolo />
1922
<p className="m-5">
2023
Created by{" "}

public/car.jpg

-157 KB
Binary file not shown.

public/favicon.ico

-25.3 KB
Binary file not shown.

public/icon.jfif

-29.3 KB
Binary file not shown.

public/icon.png

479 KB
Loading

public/icon2.png

-616 KB
Binary file not shown.

public/manifest.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "PWA App",
3+
"short_name": "App",
4+
"icons": [
5+
{
6+
"src": "/icons/android-chrome-192x192.png",
7+
"sizes": "192x192",
8+
"type": "image/png",
9+
"purpose": "any maskable"
10+
},
11+
{
12+
"src": "/icons/android-chrome-384x384.png",
13+
"sizes": "384x384",
14+
"type": "image/png"
15+
},
16+
{
17+
"src": "/icons/icon-512x512.png",
18+
"sizes": "512x512",
19+
"type": "image/png"
20+
}
21+
],
22+
"theme_color": "#FFFFFF",
23+
"background_color": "#FFFFFF",
24+
"start_url": "/",
25+
"display": "standalone",
26+
"orientation": "portrait"
27+
}

public/next.svg

-1
This file was deleted.

public/sw.js

+101
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/sw.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/thirteen.svg

-1
This file was deleted.

public/vercel.svg

-1
This file was deleted.

0 commit comments

Comments
 (0)