kingkont 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.js +77 -5
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -369,12 +369,84 @@ function runChatiumLoginFlow() {
|
|
|
369
369
|
});
|
|
370
370
|
}
|
|
371
371
|
|
|
372
|
+
// Inline-base64 логотипа — страница callback'а живёт на random-port localhost
|
|
373
|
+
// и не имеет доступа к assets/. Кэшируем в module-scope чтобы не читать
|
|
374
|
+
// файл на каждый login.
|
|
375
|
+
let _logoDataUri = null;
|
|
376
|
+
function getLogoDataUri() {
|
|
377
|
+
if (_logoDataUri !== null) return _logoDataUri;
|
|
378
|
+
try {
|
|
379
|
+
const buf = fs.readFileSync(path.join(__dirname, 'assets', 'icon.png'));
|
|
380
|
+
_logoDataUri = `data:image/png;base64,${buf.toString('base64')}`;
|
|
381
|
+
} catch { _logoDataUri = ''; }
|
|
382
|
+
return _logoDataUri;
|
|
383
|
+
}
|
|
384
|
+
|
|
372
385
|
function authResultPage(kind, message) {
|
|
373
|
-
const
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
386
|
+
const ok = kind === 'ok';
|
|
387
|
+
const title = ok ? 'Подключено' : 'Ошибка';
|
|
388
|
+
const accent = ok ? '#5cb85c' : '#e53e3e';
|
|
389
|
+
const logo = getLogoDataUri();
|
|
390
|
+
return `<!DOCTYPE html><html lang="ru"><head>
|
|
391
|
+
<meta charset="utf-8">
|
|
392
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
393
|
+
<title>KingKont — ${title}</title>
|
|
394
|
+
<style>
|
|
395
|
+
* { box-sizing: border-box; }
|
|
396
|
+
html, body { margin: 0; padding: 0; height: 100%; }
|
|
397
|
+
body {
|
|
398
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
399
|
+
background: #1a1a1a; color: #e0e0e0;
|
|
400
|
+
display: flex; align-items: center; justify-content: center;
|
|
401
|
+
min-height: 100vh; padding: 24px;
|
|
402
|
+
}
|
|
403
|
+
.card {
|
|
404
|
+
text-align: center; max-width: 460px; width: 100%;
|
|
405
|
+
padding: 48px 32px;
|
|
406
|
+
}
|
|
407
|
+
.logo {
|
|
408
|
+
width: 120px; height: 120px; margin: 0 auto 24px; display: block;
|
|
409
|
+
background: #1f1f1f; border-radius: 24px; padding: 12px;
|
|
410
|
+
box-shadow: 0 8px 48px rgba(227, 51, 119, 0.22);
|
|
411
|
+
object-fit: contain;
|
|
412
|
+
}
|
|
413
|
+
h1 {
|
|
414
|
+
font-size: 28px; font-weight: 600; margin: 0 0 6px;
|
|
415
|
+
color: #fff;
|
|
416
|
+
}
|
|
417
|
+
.accent {
|
|
418
|
+
color: ${accent}; font-size: 14px; letter-spacing: 0.5px;
|
|
419
|
+
text-transform: uppercase; margin-bottom: 20px;
|
|
420
|
+
}
|
|
421
|
+
p {
|
|
422
|
+
color: #aaa; line-height: 1.6; font-size: 15px;
|
|
423
|
+
margin: 0 0 32px;
|
|
424
|
+
}
|
|
425
|
+
button {
|
|
426
|
+
background: #e33377; color: #fff; border: none; cursor: pointer;
|
|
427
|
+
font-size: 16px; font-weight: 600; letter-spacing: 0.3px;
|
|
428
|
+
padding: 14px 48px; border-radius: 8px;
|
|
429
|
+
transition: background 0.12s, transform 0.06s;
|
|
430
|
+
-webkit-tap-highlight-color: transparent;
|
|
431
|
+
}
|
|
432
|
+
button:hover { background: #d12a6a; }
|
|
433
|
+
button:active { transform: scale(0.98); }
|
|
434
|
+
.hint {
|
|
435
|
+
color: #555; font-size: 11px; margin-top: 16px;
|
|
436
|
+
font-family: ui-monospace, 'SF Mono', monospace;
|
|
437
|
+
}
|
|
438
|
+
</style>
|
|
439
|
+
</head>
|
|
440
|
+
<body>
|
|
441
|
+
<div class="card">
|
|
442
|
+
${logo ? `<img class="logo" src="${logo}" alt="KingKont">` : ''}
|
|
443
|
+
<div class="accent">KingKont</div>
|
|
444
|
+
<h1>${title}</h1>
|
|
445
|
+
<p>${message}</p>
|
|
446
|
+
<button onclick="window.close()">Закрыть</button>
|
|
447
|
+
<div class="hint">Если вкладка не закрылась — закрой её сам</div>
|
|
448
|
+
</div>
|
|
449
|
+
</body></html>`;
|
|
378
450
|
}
|
|
379
451
|
|
|
380
452
|
// ===== Settings window =====
|