-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbeta.html
More file actions
306 lines (253 loc) · 11.6 KB
/
beta.html
File metadata and controls
306 lines (253 loc) · 11.6 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="manifest" href="manifest.json">
<style>
:root { --t: 0.4s; --btn: 56px; }
* { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; box-sizing: border-box; border-radius: 0 !important; }
body, html { margin: 0; padding: 0; height: 100%; overflow: hidden; background: #000; font-family: "Times New Roman", serif; font-size: 16px; }
#gateway { display: grid; grid-template-columns: 1fr 1fr; height: 100%; width: 100%; position: absolute; z-index: 1000; transition: transform var(--t) ease; background: #000; }
.input-pane { border: none; padding: 10px; font-size: 1.1rem; font-family: serif; resize: none; height: 100%; width: 100%; outline: none; }
.light { background: #fff; color: #000; }
.dark { background: #000; color: #fff; }
.master-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: var(--btn); height: var(--btn); border-radius: 50% !important; border: 1px solid #666; background: #111; color: #fff; cursor: pointer; z-index: 2000; display: flex; align-items: center; justify-content: center; font-size: 9px; letter-spacing: 1px; }
.app-container { display: grid; height: 100vh; grid-template-columns: 1fr 0fr 1fr; transition: grid-template-columns var(--t) ease; }
.pane { overflow-y: auto; padding: 10px; line-height: 1.4; border: none; }
.central-col { display: grid; grid-template-rows: 1fr 1fr; overflow: hidden; background: transparent; }
.central-col.final {
grid-template-rows: 1fr 1fr 1fr;
}
.final-row {
display: none;
grid-template-columns: 1fr 1fr;
height: auto;
}
.central-col.final .final-row { display: grid; }
.word { cursor: pointer; padding: 0 1px; }
.light .word.active { background: #000; color: #fff; }
.dark .word.active { background: #fff; color: #000; }
.footer-logo {
position: absolute;
bottom: 15px;
left: 50%;
transform: translateX(-50%);
z-index: 3000;
display: flex;
justify-content: center;
}
.footer-logo img {
height: 48px;
width: auto;
display: block;
filter: grayscale(100%);
/* Симметричный отступ для компенсации тени и сохранения центра */
padding: 0 10px;
}
.hidden { display: none; }
.example { display: block; margin-top: 8px; font-style: italic; opacity: 0.9; }
#outL, #outD {
display: flex;
flex-direction: column;
height: 100%;
text-align: center;
}
.outD-content, .outL-content {
flex: 1;
overflow-y: auto;
width: 100%;
padding: 10px;
}
.donate-box {
padding: 20px 15px;
flex-shrink: 0;
border-top: 1px solid rgba(255,255,255,0.1) !important;
margin-top: auto;
display: flex;
flex-direction: column;
align-items: center;
}
.donate-btn {
color: rgba(255,255,255,0.7);
border: 1px solid rgba(255,255,255,0.7) !important;
padding: 8px 20px;
background: transparent;
cursor: pointer;
font-size: 11px;
letter-spacing: 1px;
transition: 0.3s;
}
.donate-btn:hover { background: #fff; color: #000; }
.crypto-info {
display: none;
flex-direction: column;
gap: 8px;
margin-top: 15px;
}
.crypto-address-display {
font-size: 10px;
color: #fff;
background: rgba(255,255,255,0.05);
padding: 10px;
border: 1px dashed #fff !important;
cursor: copy;
word-break: break-all;
}
</style>
</head>
<body>
<script src="pwa-init.js"></script>
<div id="gateway">
<textarea id="inL" class="input-pane light">Мир состоит из языка, и энергия следует за вниманием. Выбор осложняет изучение. Эта модель поможет сфокусироваться на сути. Приложение в стадии разработки.</textarea>
<div style="position: absolute; left: 50%; height: 100%; width: 0; background: transparent;"><div class="master-btn" onclick="launchApp()">SYNC</div></div>
<textarea id="inD" class="input-pane dark">The world is made of language, and energy follows attention. Choice makes learning difficult. This model will help you focus on the essence. The app is under development.</textarea>
</div>
<div class="master-btn hidden" id="uiBtn" onclick="handleUIBtn()">GATE</div>
<div class="app-container" id="main">
<div class="pane light" id="outL">
<div class="outL-content" id="outL-inner"></div>
</div>
<div class="central-col" id="center">
<div class="pane light" id="s2-top"></div>
<div class="final-row" id="s3-row"><div class="pane light" id="s3-L"></div><div class="pane dark" id="s3-D"></div></div>
<div class="pane dark" id="s2-bot"></div>
</div>
<div class="pane dark" id="outD">
<div class="outD-content" id="outD-inner"></div>
<div class="donate-box">
<button class="donate-btn" onclick="toggleDonate()">Support</button>
<div id="cryptoInfo" class="crypto-info">
<span style="font-size: 11px; color: #fff;">USDT BSC (BEP20)</span>
<div id="cryptoAddr" class="crypto-address-display" onclick="copyToClipboard()">0x769192cea8fbb7207f086d95fd653ebc3adb0c72</div>
<span id="copyHint" style="font-size: 10px; color: #fff;">Click to copy address</span>
</div>
</div>
</div>
<a href="/index.html" class="footer-logo"><img src="logo.png" alt="logo"></a>
<script>
let state = 0;
const db = {
"привет": {
l1: ["Приветствие (межд.).", "Пример: Привет, друг!", "Greeting (intj.).", "Example: Hello, friend!"],
l2: ["От др.-русск. привѣтъ (совет).", "Пример: Добрый привет.", "From Old Slavic 'privet'.", "Example: Kind greeting."],
pair: "hello"
},
"hello": {
l1: ["Greeting (intj.).", "Example: Hello, friend!", "Приветствие (межд.).", "Пример: Привет, друг!"],
l2: ["From Old German 'hallo'.", "Example: Say hello.", "От др.-герм. hallo.", "Пример: Скажи привет."],
pair: "привет"
},
"мир": {
l1: ["Вселенная (сущ.).", "Пример: Наш мир велик.", "Universe (noun).", "Example: Our world is big."],
l2: ["От праслав. mirъ (покой).", "Пример: Жить в мире.", "From Proto-Slavic mir (peace).", "Example: Live in peace."],
pair: "world"
},
"world": {
l1: ["Universe (noun).", "Example: Our world is big.", "Вселенная (сущ.).", "Пример: Наш мир велик."],
l2: ["From Old English 'weorold'.", "Example: Whole world.", "От др.-англ. weorold.", "Пример: Весь мир."],
pair: "мир"
}
};
function updateLogoShadow() {
const logo = document.querySelector('.footer-logo img');
if (logo) {
// -7px — смещение влево, 0px — размытие (четкий контур), #000 — черный
logo.style.filter = 'grayscale(100%) drop-shadow(-7px 0px 0px #000)';
}
}
window.addEventListener("DOMContentLoaded", updateLogoShadow);
// Инициализация при загрузке
window.addEventListener("DOMContentLoaded", () => {
updateLogoShadow();
});
function tokenize(t) {
if (!t) return "";
if (Array.isArray(t)) {
return `<div>${tokenize(t[0])}</div><div class="example">${tokenize(t[1])}</div>`;
}
return t.split(/(\s+|[,!?.])/).map(p => {
if (/[\s+,!?. ]/.test(p) || p === "") return p;
return `<span class="word" data-raw="${p.toLowerCase().replace(/[.,!?]/g, '')}">${p}</span>`;
}).join('');
}
function launchApp() {
document.getElementById('outL-inner').innerHTML = tokenize(document.getElementById('inL').value);
document.getElementById('outD-inner').innerHTML = tokenize(document.getElementById('inD').value);
document.getElementById('gateway').style.transform = 'translateY(-100%)';
document.getElementById('uiBtn').classList.remove('hidden');
state = 1;
}
document.addEventListener('click', (e) => {
const w = e.target.closest('.word');
if (!w || state === 0) return;
const raw = w.dataset.raw;
const pane = w.closest('.pane');
if (!pane) return;
// Динамическая смена языка документа
if (pane.classList.contains('light')) {
document.documentElement.lang = 'ru';
} else if (pane.classList.contains('dark')) {
document.documentElement.lang = 'en';
}
document.querySelectorAll('.word').forEach(el => el.classList.remove('active'));
document.querySelectorAll(`.word[data-raw="${raw}"]`).forEach(el => el.classList.add('active'));
if (pane.id === 'outL' || pane.id === 'outD') {
const partnerRaw = db[raw]?.pair;
if (partnerRaw) document.querySelectorAll(`.word[data-raw="${partnerRaw}"]`).forEach(el => el.classList.add('active'));
document.getElementById('main').style.gridTemplateColumns = '1fr 1.5fr 1fr';
const entry = db[raw] || { l1: [`Толкование: ${raw}`, `Пример: ...`, `Definition: ${raw}`, `Example: ...`] };
document.getElementById('s2-top').innerHTML = tokenize([entry.l1[0], entry.l1[1]]);
document.getElementById('s2-bot').innerHTML = tokenize([entry.l1[2], entry.l1[3]]);
document.getElementById('center').classList.remove('final');
document.getElementById('uiBtn').innerText = "CLOSE";
state = 2;
}
else if (pane.id === 's2-top' || pane.id === 's2-bot') {
const entry = db[raw] || { l2: [`Этимология`, `Пример: ...`, `Etymology`, `Example: ...`] };
document.getElementById('center').classList.add('final');
document.getElementById('s3-L').innerHTML = tokenize([entry.l2 ? entry.l2[0] : "Этимология"]);
document.getElementById('s3-D').innerHTML = tokenize([entry.l2 ? entry.l2[2] : "Etymology"]);
document.getElementById('uiBtn').innerText = "RESET";
state = 3;
}
});
function handleUIBtn() {
if (state >= 2) {
document.getElementById('main').style.gridTemplateColumns = '1fr 0fr 1fr';
document.getElementById('center').classList.remove('final');
document.querySelectorAll('.word').forEach(el => el.classList.remove('active'));
document.getElementById('uiBtn').innerText = "GATE";
state = 1;
} else if (state === 1) {
document.getElementById('gateway').style.transform = 'translateY(0)';
document.getElementById('uiBtn').classList.add('hidden');
state = 0;
}
}
function toggleDonate() {
const info = document.getElementById("cryptoInfo");
const isOpening = (info.style.display !== "flex");
info.style.display = isOpening ? "flex" : "none";
if (isOpening) {
setTimeout(() => {
info.scrollIntoView({ behavior: 'smooth', block: 'end' });
}, 50);
}
}
function copyToClipboard() {
const addr = document.getElementById("cryptoAddr");
const text = addr.innerText;
navigator.clipboard.writeText(text).then(() => {
const oldText = addr.innerText;
addr.innerText = "Copied!";
addr.style.color = "#00ff00";
setTimeout(() => {
addr.innerText = oldText;
addr.style.color = "#fff";
}, 1500);
});
}
</script>
</body>
</html>