Skip to content

armgit / my-yt

Public Imported from GitHub
0

A clean and minimal youtube frontend, without all the ads and whistles

JavaScript

feat: pwa support

Christian Fei9abb6e982fe6
diff --git a/client/apple-touch-icon.png b/client/apple-touch-icon.png
new file mode 100644
index 0000000..3fa65e8
Binary files /dev/null and b/client/apple-touch-icon.png differ
diff --git a/client/favicon-96x96.png b/client/favicon-96x96.png
new file mode 100644
index 0000000..3e63e90
Binary files /dev/null and b/client/favicon-96x96.png differ
diff --git a/client/favicon.ico b/client/favicon.ico
new file mode 100644
index 0000000..47d3467
Binary files /dev/null and b/client/favicon.ico differ
diff --git a/client/favicon.svg b/client/favicon.svg
new file mode 100644
index 0000000..41f1746
--- /dev/null
+++ b/client/favicon.svg
@@ -0,0 +1,3 @@
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 200 200"><rect width="200" height="200" fill="url('#gradient')"></rect><defs><linearGradient id="SvgjsLinearGradient1001" gradientTransform="rotate(206 0.5 0.5)"><stop offset="0%" stop-color="#ffe0d0"></stop><stop offset="100%" stop-color="#dadada"></stop></linearGradient></defs><g><g fill="#445272" transform="matrix(2.583747680890538,0,0,2.583747680890538,29.553493559188,111.5264038318075)" stroke="#c8512e" stroke-width="0"><path d="M0.95-10.57L4.03-10.57L4.14-9.33Q5.26-10.76 7.16-10.76L7.16-10.76Q9.16-10.76 9.86-9.17L9.86-9.17Q10.94-10.76 12.97-10.76L12.97-10.76Q16.18-10.76 16.27-6.88L16.27-6.88L16.27 0L12.97 0L12.97-6.67Q12.97-7.48 12.70-7.85Q12.42-8.22 11.70-8.22L11.70-8.22Q10.72-8.22 10.24-7.35L10.24-7.35L10.25-7.22L10.25 0L6.95 0L6.95-6.65Q6.95-7.48 6.69-7.85Q6.43-8.22 5.68-8.22L5.68-8.22Q4.74-8.22 4.24-7.35L4.24-7.35L4.24 0L0.95 0L0.95-10.57ZM20.70-10.57L22.37-4.61L24.13-10.57L27.66-10.57L23.35 1.77L23.16 2.22Q22.25 4.27 19.92 4.27L19.92 4.27Q19.28 4.27 18.56 4.07L18.56 4.07L18.56 1.72L18.99 1.72Q19.69 1.72 20.05 1.52Q20.42 1.32 20.60 0.80L20.60 0.80L20.86 0.10L17.19-10.57L20.70-10.57ZM34.94-7.40L34.94-4.85L29.07-4.85L29.07-7.40L34.94-7.40ZM40.06-10.57L41.73-4.61L43.49-10.57L47.01-10.57L42.71 1.77L42.52 2.22Q41.60 4.27 39.28 4.27L39.28 4.27Q38.63 4.27 37.92 4.07L37.92 4.07L37.92 1.72L38.35 1.72Q39.04 1.72 39.41 1.52Q39.78 1.32 39.95 0.80L39.95 0.80L40.21 0.10L36.54-10.57L40.06-10.57ZM48.41-13.19L51.70-13.19L51.70-10.57L53.44-10.57L53.44-8.28L51.70-8.28L51.70-3.45Q51.70-2.85 51.91-2.62Q52.13-2.38 52.76-2.38L52.76-2.38Q53.25-2.38 53.58-2.44L53.58-2.44L53.58-0.09Q52.70 0.20 51.73 0.20L51.73 0.20Q50.03 0.20 49.22-0.61Q48.41-1.41 48.41-3.04L48.41-3.04L48.41-8.28L47.06-8.28L47.06-10.57L48.41-10.57L48.41-13.19Z"></path></g></g></svg><style>@media (prefers-color-scheme: light) { :root { filter: none; } }
+@media (prefers-color-scheme: dark) { :root { filter: none; } }
+</style></svg>
\ No newline at end of file
diff --git a/client/index.html b/client/index.html
index 4753ebb..3c7dc8e 100644
--- a/client/index.html
+++ b/client/index.html
@@ -6,6 +6,11 @@
<title>my-yt</title>
<link rel="stylesheet" href="/main.css">
<link rel="stylesheet" href="/normalize.css">
+ <base href="/">
+ <meta name="theme-color" content="#fff">
+ <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
+ <link rel="apple-touch-icon" href="/apple-touch-icon.png"/>
+ <link rel="manifest" href="/manifest.json" />
</head>
<body>
<header>
diff --git a/client/manifest.json b/client/manifest.json
new file mode 100644
index 0000000..ef3d5b3
--- /dev/null
+++ b/client/manifest.json
@@ -0,0 +1,21 @@
+{
+ "name": "my-yt",
+ "short_name": "my_yt",
+ "description": "A personal YouTube frontend",
+ "start_url": "/index.html",
+ "display": "standalone",
+ "background_color": "#FFFFFF",
+ "theme_color": "#FFFFFF",
+ "icons": [
+ {
+ "src": "web-app-manifest-192x192.png",
+ "sizes": "192x192",
+ "type": "image/png"
+ },
+ {
+ "src": "web-app-manifest-512x512.png",
+ "sizes": "512x512",
+ "type": "image/png"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/client/web-app-manifest-192x192.png b/client/web-app-manifest-192x192.png
new file mode 100644
index 0000000..44731d1
Binary files /dev/null and b/client/web-app-manifest-192x192.png differ
diff --git a/client/web-app-manifest-512x512.png b/client/web-app-manifest-512x512.png
new file mode 100644
index 0000000..b96430c
Binary files /dev/null and b/client/web-app-manifest-512x512.png differ
diff --git a/lib/router/app.js b/lib/router/app.js
index 287d673..541b2ae 100644
--- a/lib/router/app.js
+++ b/lib/router/app.js
@@ -21,6 +21,10 @@ export default function apiHandler (req, res) {
if (url.pathname === '/components/search-videos.js') { return fileHandler('client/components/search-videos.js', 'application/javascript')(req, res) }
if (url.pathname === '/components/channels-list.js') { return fileHandler('client/components/channels-list.js', 'application/javascript')(req, res) }
if (url.pathname === '/components/empty-state.js') { return fileHandler('client/components/empty-state.js', 'application/javascript')(req, res) }
+ if (url.pathname === '/manifest.json') { return fileHandler('client/manifest.json', 'text/json')(req, res) }
+ if (url.pathname === '/favicon.ico') { return fileHandler('client/favicon.ico', 'image/x-icon')(req, res) }
+ if (url.pathname === '/favicon.svg') { return fileHandler('client/favicon.svg', 'image/svg+xml')(req, res) }
+ if (url.pathname === '/apple-touch-icon.png') { return fileHandler('client/apple-touch-icon.png', 'image/png')(req, res) }
return fileHandler('client/index.html', 'text/html')(req, res)
}