-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshare-handler.html
More file actions
70 lines (66 loc) · 3.07 KB
/
Copy pathshare-handler.html
File metadata and controls
70 lines (66 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FERRETT_STUDIO_OS // Saving Share...</title>
<style>
body { background:#050807; color:#C9FFE6; font-family: 'JetBrains Mono', 'Courier New', monospace; display:flex; align-items:center; justify-content:center; min-height:100vh; margin:0; padding:24px; text-align:center; }
.card { max-width:420px; border:1px solid rgba(0,255,136,0.3); border-radius:8px; padding:32px 24px; background:rgba(10,15,13,0.6); }
h1 { color:#00FF88; font-size:14px; letter-spacing:0.15em; margin:0 0 16px; }
p { font-size:12px; color:rgba(226,232,240,0.6); line-height:1.6; word-break:break-word; }
.field { text-align:left; margin-top:12px; font-size:11px; }
.field b { color:#00E5FF; display:block; margin-bottom:2px; }
a.btn { display:inline-block; margin-top:20px; padding:10px 20px; border:1px solid #00FF8850; border-radius:4px; color:#00FF88; text-decoration:none; font-size:11px; letter-spacing:0.1em; font-weight:bold; }
</style>
</head>
<body>
<div class="card">
<h1 id="status">SAVING TO TRACK DB...</h1>
<div id="details"></div>
<p id="msg">Redirecting to the app...</p>
<a href="./index.html" class="btn">OPEN APP NOW</a>
</div>
<script>
function getParam(name) { return new URLSearchParams(window.location.search).get(name) || ''; }
const title = getParam('title');
const text = getParam('text');
const url = getParam('url');
const DB_KEY = 'ferrett_os_db_v22.4';
const esc = (s) => s.replace(/[&<>"']/g, (c) => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
const detailsEl = document.getElementById('details');
let html = '';
if (title) html += `<div class="field"><b>TITLE</b>${esc(title)}</div>`;
if (text) html += `<div class="field"><b>TEXT</b>${esc(text)}</div>`;
if (url) html += `<div class="field"><b>URL</b>${esc(url)}</div>`;
detailsEl.innerHTML = html || '<p style="color:#FF8888">Nothing was shared.</p>';
try {
if (title || text || url) {
const raw = localStorage.getItem(DB_KEY);
const db = raw ? JSON.parse(raw) : {};
if (!Array.isArray(db.tracks)) db.tracks = [];
const notesParts = [];
if (text) notesParts.push(text);
if (url) notesParts.push(url);
db.tracks.unshift({
id: Date.now(),
inst: title || 'Shared Reference',
daw: 'both',
plugins: '',
notes: notesParts.join('\n\n'),
images: []
});
localStorage.setItem(DB_KEY, JSON.stringify(db));
document.getElementById('status').textContent = '✓ SAVED TO TRACK DB';
} else {
document.getElementById('status').textContent = 'NOTHING TO SAVE';
document.getElementById('msg').textContent = 'No shared content was received.';
}
} catch (e) {
document.getElementById('status').textContent = '⚠ COULD NOT SAVE';
document.getElementById('msg').textContent = 'Local storage was unavailable. Try opening the app directly.';
}
setTimeout(() => { window.location.href = './index.html'; }, 1800);
</script>
</body>
</html>