Spaces:
Running
Running
Create index.html
Browse files- index.html +177 -0
index.html
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!doctype html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="utf-8" />
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
6 |
+
<title>OPDS Link — Copy & Open</title>
|
7 |
+
<meta name="description" content="A tiny, accessible page with a button that copies the OPDS link to the clipboard and opens it in a new tab." />
|
8 |
+
<meta name="color-scheme" content="light dark" />
|
9 |
+
<style>
|
10 |
+
:root {
|
11 |
+
--bg: #0b1020;
|
12 |
+
--surface: #141a2a;
|
13 |
+
--text: #e6eaf2;
|
14 |
+
--muted: #a7b0c0;
|
15 |
+
--accent: #7aa2ff;
|
16 |
+
--accent-strong: #9bb8ff;
|
17 |
+
--ring: rgba(122, 162, 255, 0.35);
|
18 |
+
}
|
19 |
+
@media (prefers-color-scheme: light) {
|
20 |
+
:root {
|
21 |
+
--bg: #f6f8fc;
|
22 |
+
--surface: #ffffff;
|
23 |
+
--text: #101321;
|
24 |
+
--muted: #4b5565;
|
25 |
+
--accent: #2952ff;
|
26 |
+
--accent-strong: #173cff;
|
27 |
+
--ring: rgba(41, 82, 255, 0.25);
|
28 |
+
}
|
29 |
+
}
|
30 |
+
html, body { height: 100%; }
|
31 |
+
body {
|
32 |
+
margin: 0;
|
33 |
+
font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
|
34 |
+
color: var(--text);
|
35 |
+
background: radial-gradient(1200px 800px at 70% -10%, rgba(122,162,255,.15), transparent 60%),
|
36 |
+
radial-gradient(1200px 800px at -10% 110%, rgba(122,162,255,.12), transparent 60%),
|
37 |
+
var(--bg);
|
38 |
+
display: grid;
|
39 |
+
place-items: center;
|
40 |
+
padding: 24px;
|
41 |
+
}
|
42 |
+
.card {
|
43 |
+
width: min(760px, 100%);
|
44 |
+
background: var(--surface);
|
45 |
+
border: 1px solid rgba(122,162,255, .15);
|
46 |
+
border-radius: 20px;
|
47 |
+
box-shadow: 0 10px 30px rgba(0,0,0,.25);
|
48 |
+
padding: 28px;
|
49 |
+
}
|
50 |
+
h1 { font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 6px; }
|
51 |
+
p.desc { margin: 0 0 18px; color: var(--muted); }
|
52 |
+
|
53 |
+
.row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
|
54 |
+
.url {
|
55 |
+
width: 100%;
|
56 |
+
border: 1px solid rgba(122,162,255,.25);
|
57 |
+
background: transparent;
|
58 |
+
color: inherit;
|
59 |
+
padding: 12px 14px;
|
60 |
+
border-radius: 12px;
|
61 |
+
font-size: 0.95rem;
|
62 |
+
outline: none;
|
63 |
+
}
|
64 |
+
.url:focus { box-shadow: 0 0 0 5px var(--ring); border-color: var(--accent); }
|
65 |
+
|
66 |
+
.btn {
|
67 |
+
cursor: pointer;
|
68 |
+
border: none;
|
69 |
+
padding: 12px 16px;
|
70 |
+
border-radius: 12px;
|
71 |
+
font-weight: 600;
|
72 |
+
font-size: 0.98rem;
|
73 |
+
color: white;
|
74 |
+
background: linear-gradient(180deg, var(--accent), var(--accent-strong));
|
75 |
+
transition: transform .06s ease, filter .2s ease, box-shadow .2s ease;
|
76 |
+
box-shadow: 0 6px 18px rgba(41,82,255,.25);
|
77 |
+
}
|
78 |
+
.btn:focus-visible { outline: none; box-shadow: 0 0 0 5px var(--ring), 0 6px 18px rgba(41,82,255,.25); }
|
79 |
+
.btn:active { transform: translateY(1px); }
|
80 |
+
|
81 |
+
.hint { margin-top: 12px; font-size: .9rem; color: var(--muted); }
|
82 |
+
.status { margin-top: 10px; font-size: .95rem; }
|
83 |
+
|
84 |
+
.ok { color: #29c568; }
|
85 |
+
.warn { color: #d98f15; }
|
86 |
+
.err { color: #ef4444; }
|
87 |
+
|
88 |
+
.footer { margin-top: 18px; font-size: .85rem; color: var(--muted); }
|
89 |
+
a { color: var(--accent); }
|
90 |
+
</style>
|
91 |
+
</head>
|
92 |
+
<body>
|
93 |
+
<main class="card" role="main">
|
94 |
+
<h1 id="title">OPDS Directory Link</h1>
|
95 |
+
<p class="desc" id="subtitle">Press the button to copy the OPDS link and open it in a new tab. Works with keyboard and screen readers.</p>
|
96 |
+
|
97 |
+
<div class="row">
|
98 |
+
<input id="opdsUrl" class="url" type="url" inputmode="url" aria-labelledby="title subtitle" readonly
|
99 |
+
value="https://ivan000-opds-navigator.static.hf.space/index.xml" />
|
100 |
+
<button id="go" class="btn" aria-describedby="subtitle">Copy & Open</button>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
<p id="status" class="status" role="status" aria-live="polite"></p>
|
104 |
+
|
105 |
+
<p class="hint">Tip: you can also open the link directly:
|
106 |
+
<a id="direct" target="_blank" rel="noopener" href="https://ivan000-opds-navigator.static.hf.space/index.xml">open in new tab</a>.
|
107 |
+
</p>
|
108 |
+
|
109 |
+
<p class="footer">What is this? An OPDS directory is a catalog of catalogs. This page simply helps you copy the URL and open it quickly.</p>
|
110 |
+
</main>
|
111 |
+
|
112 |
+
<script>
|
113 |
+
(function() {
|
114 |
+
const url = "https://ivan000-opds-navigator.static.hf.space/index.xml";
|
115 |
+
const btn = document.getElementById('go');
|
116 |
+
const status = document.getElementById('status');
|
117 |
+
const input = document.getElementById('opdsUrl');
|
118 |
+
|
119 |
+
function setStatus(msg, cls) {
|
120 |
+
status.className = 'status ' + (cls || '');
|
121 |
+
status.textContent = msg;
|
122 |
+
}
|
123 |
+
|
124 |
+
async function copyText(text) {
|
125 |
+
// Try modern API first
|
126 |
+
try {
|
127 |
+
if (navigator.clipboard && navigator.clipboard.writeText) {
|
128 |
+
await navigator.clipboard.writeText(text);
|
129 |
+
return true;
|
130 |
+
}
|
131 |
+
} catch (e) { /* fall back */ }
|
132 |
+
|
133 |
+
// Fallback for older browsers
|
134 |
+
try {
|
135 |
+
const ta = document.createElement('textarea');
|
136 |
+
ta.value = text;
|
137 |
+
ta.setAttribute('readonly', '');
|
138 |
+
ta.style.position = 'fixed';
|
139 |
+
ta.style.top = '-1000px';
|
140 |
+
document.body.appendChild(ta);
|
141 |
+
ta.select();
|
142 |
+
const ok = document.execCommand('copy');
|
143 |
+
document.body.removeChild(ta);
|
144 |
+
return ok;
|
145 |
+
} catch (e) {
|
146 |
+
return false;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
async function handleClick() {
|
151 |
+
// Copy
|
152 |
+
const copied = await copyText(url);
|
153 |
+
if (copied) setStatus('Link copied to clipboard.', 'ok');
|
154 |
+
else setStatus('Could not copy automatically. The link is selected above — press Ctrl/Cmd+C.', 'warn');
|
155 |
+
|
156 |
+
// Open
|
157 |
+
const w = window.open(url, '_blank', 'noopener');
|
158 |
+
if (!w) setStatus('Your browser blocked the new tab. Allow pop-ups for this site and try again.', 'err');
|
159 |
+
|
160 |
+
// Select the input for manual copy convenience
|
161 |
+
input.focus();
|
162 |
+
input.select();
|
163 |
+
}
|
164 |
+
|
165 |
+
btn.addEventListener('click', handleClick);
|
166 |
+
|
167 |
+
// Also trigger on Enter when focusing the button
|
168 |
+
btn.addEventListener('keydown', e => {
|
169 |
+
if (e.key === 'Enter' || e.key === ' ') {
|
170 |
+
e.preventDefault();
|
171 |
+
btn.click();
|
172 |
+
}
|
173 |
+
});
|
174 |
+
})();
|
175 |
+
</script>
|
176 |
+
</body>
|
177 |
+
</html>
|