mirror of
git://f0xx.org/android_cast
synced 2026-07-29 06:18:42 +03:00
logos
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
<main class="main-pane hub-main">
|
||||
<header class="hub-header">
|
||||
<div class="hub-brand">
|
||||
<img class="hub-logo-mark" src="assets/hub-logo.svg" alt="" width="112" height="84" decoding="async">
|
||||
<img class="hub-logo-mark" src="assets/hub-logo-transparent.svg" alt="" width="112" height="84" decoding="async">
|
||||
<h1 class="hub-title">Android Cast</h1>
|
||||
</div>
|
||||
<p class="muted hub-subtitle">Project hub</p>
|
||||
@@ -56,14 +56,37 @@
|
||||
<script>
|
||||
(function () {
|
||||
var sel = document.getElementById('theme-select');
|
||||
if (!sel) return;
|
||||
var cur = document.documentElement.getAttribute('data-theme') || 'dark';
|
||||
sel.value = cur;
|
||||
sel.addEventListener('change', function () {
|
||||
var v = sel.value;
|
||||
document.documentElement.setAttribute('data-theme', v);
|
||||
try { localStorage.setItem('crash_console_theme', v); } catch (e) {}
|
||||
});
|
||||
if (sel) {
|
||||
var cur = document.documentElement.getAttribute('data-theme') || 'dark';
|
||||
sel.value = cur;
|
||||
sel.addEventListener('change', function () {
|
||||
var v = sel.value;
|
||||
document.documentElement.setAttribute('data-theme', v);
|
||||
try { localStorage.setItem('crash_console_theme', v); } catch (e) {}
|
||||
});
|
||||
}
|
||||
|
||||
// Progressive enhancement: load logo layers only when browser supports CSS + SVG background images.
|
||||
var supportsCss = !!(window.CSS && CSS.supports);
|
||||
var supportsSvg = !!(document.createElementNS && document.createElementNS('http://www.w3.org/2000/svg', 'svg').createSVGRect);
|
||||
var supportsBgSvg = supportsCss && CSS.supports('background-image', 'url("assets/hub-logo-fragment-space.svg")');
|
||||
if (!(supportsSvg && supportsBgSvg)) return;
|
||||
|
||||
var body = document.body;
|
||||
if (!body) return;
|
||||
|
||||
var params = new URLSearchParams(window.location.search);
|
||||
var part = (params.get('logoPart') || 'full').toLowerCase();
|
||||
var allowed = { full: true, space: true, globe: true, tail: true, rocket: true };
|
||||
if (!allowed[part]) part = 'full';
|
||||
|
||||
var link = document.createElement('link');
|
||||
link.rel = 'stylesheet';
|
||||
link.href = 'hub-logo-layers.css';
|
||||
link.onload = function () {
|
||||
body.classList.add('logo-enabled', 'logo-' + part);
|
||||
};
|
||||
document.head.appendChild(link);
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user