Skip to content

Commit c2092cc

Browse files
committed
feat: clean and fully set up songle file webapp
1 parent 8793b27 commit c2092cc

File tree

2 files changed

+37
-32
lines changed

2 files changed

+37
-32
lines changed

index.html

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33

44
<head>
55
<meta charset="UTF-8" />
6-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
77
<title>Chromatone Spectrogram</title>
88
<link rel="icon" type="image/svg+xml" href="/logo.svg">
99
<meta name="theme-color" content="#D3D3E8">
10-
<meta name="application-name" content="Chromatone Spectrogram">
10+
<meta name="application-name" content="Spectrogram">
1111
<meta name="author" content="Denis Starov">
1212
<meta name="creator" content="Chromatone">
1313
<meta name="description" content="2.5D representation on frequency domain in color">
@@ -26,8 +26,41 @@
2626
<meta name="twitter:image:type" content="image/png">
2727
<meta name="twitter:image" content="/spectrogram.png">
2828

29-
<link rel="manifest"
30-
href='data:application/manifest+json,{ "name": "Chromatone Spectrogram", "short_name": "Spectrogram", "description": "Visual time-frequency analysis for all", "background_color": "#000000", "theme_color":"#ffffff", "display": "standalone"}' />
29+
<meta name="mobile-web-app-capable" content="yes">
30+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
31+
<meta name="apple-mobile-web-app-title" content="Spectrogram">
32+
33+
<link rel="manifest" href='data:application/manifest+json,{
34+
"id": "spectrogram-v1",
35+
"name": "Chromatone Spectrogram",
36+
"short_name": "Spectrogram",
37+
"description": "Visual time-frequency analysis for all",
38+
"background_color": "#000000",
39+
"theme_color": "#D3D3E8",
40+
"display": "standalone",
41+
"orientation": "any",
42+
"start_url": "./",
43+
"scope": "./",
44+
"display_override": ["window-controls-overlay", "standalone"],
45+
"handle_links": "preferred",
46+
"prefer_related_applications": false,
47+
"categories": ["music", "audio", "tools"],
48+
"icons": [{
49+
"src": "/logo.svg",
50+
"sizes": "any",
51+
"type": "image/svg+xml",
52+
"purpose": "any"
53+
}],
54+
"screenshots": [{
55+
"src": "/spectrogram.png",
56+
"type": "image/png",
57+
"sizes": "1280x720",
58+
"form_factor": "wide"
59+
}],
60+
"launch_handler": {
61+
"client_mode": ["focus-existing", "auto"]
62+
},
63+
}' />
3164

3265
</head>
3366

src/App.vue

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ watch([width, height], ([w, h]) => {
3030
})
3131
3232
onMounted(() => {
33-
initGetUserMedia()
3433
ctx = canvasElement.value.getContext('2d')
3534
tempCanvas = document.createElement('canvas')
3635
tempCtx = tempCanvas.getContext('2d')
@@ -170,33 +169,6 @@ onKeyStroke(' ', (e) => { e.preventDefault(); paused.value = !paused.value })
170169
171170
onKeyStroke('Enter', (e) => { e.preventDefault(); clear(); })
172171
173-
174-
function initGetUserMedia() {
175-
if (typeof window === 'undefined') return;
176-
177-
window.AudioContext = window.AudioContext || window.webkitAudioContext;
178-
if (!window.AudioContext) {
179-
throw new Error("AudioContext not supported");
180-
}
181-
182-
if (navigator.mediaDevices === undefined) {
183-
navigator.mediaDevices = {};
184-
}
185-
186-
if (navigator.mediaDevices.getUserMedia === undefined) {
187-
navigator.mediaDevices.getUserMedia = function (constraints) {
188-
const getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;
189-
190-
if (!getUserMedia) {
191-
throw new Error("getUserMedia is not implemented in this browser");
192-
}
193-
194-
return new Promise((resolve, reject) => {
195-
getUserMedia.call(navigator, constraints, resolve, reject);
196-
});
197-
};
198-
}
199-
}
200172
</script>
201173
202174
<template lang="pug">

0 commit comments

Comments
 (0)