mirror of
git://f0xx.org/android_cast
synced 2026-07-29 04:38:53 +03:00
be dirty sync
This commit is contained in:
@@ -12,14 +12,17 @@
|
||||
</script>
|
||||
<link rel="stylesheet" href="/app/androidcast_project/crashes/assets/css/app.css">
|
||||
<link rel="stylesheet" href="hub.css">
|
||||
<link rel="stylesheet" href="hub-logo-layers.css">
|
||||
</head>
|
||||
<body class="hub-page">
|
||||
<div id="hub-logo-stage" class="hub-logo-stage" hidden aria-hidden="true"></div>
|
||||
<div class="shell hub-shell">
|
||||
<main class="main-pane hub-main">
|
||||
<header class="hub-header">
|
||||
<div class="hub-brand">
|
||||
<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>
|
||||
<img class="hub-thunder" src="assets/hub-thunder.svg" alt="Thunder underline" width="312" height="46" decoding="async">
|
||||
</div>
|
||||
<p class="muted hub-subtitle">Project hub</p>
|
||||
<label class="toolbar-select hub-theme">
|
||||
@@ -66,27 +69,57 @@
|
||||
});
|
||||
}
|
||||
|
||||
// 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 stage = document.getElementById('hub-logo-stage');
|
||||
if (!stage) return;
|
||||
|
||||
var body = document.body;
|
||||
if (!body) return;
|
||||
var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
||||
var supportsSvg = !!(svg && svg.createSVGRect);
|
||||
var supportsLayout = !!(window.CSS && CSS.supports && CSS.supports('object-fit', 'cover'));
|
||||
if (!supportsSvg || !supportsLayout) return;
|
||||
|
||||
var logoBuild = '20260527j';
|
||||
var fragments = {
|
||||
space: 'assets/hub-logo-fragment-space.svg',
|
||||
globe: 'assets/hub-logo-fragment-globe.svg',
|
||||
continents: 'assets/hub-logo-continents-mercator-globe.svg',
|
||||
gridOverlay: 'assets/hub-logo-fragment-globe-grid-overlay.svg'
|
||||
};
|
||||
var parts = {
|
||||
full: ['space', 'globe', 'continents', 'gridOverlay'],
|
||||
space: ['space'],
|
||||
globe: ['globe', 'continents', 'gridOverlay']
|
||||
};
|
||||
|
||||
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 grid = (params.get('grid') || '3').toLowerCase();
|
||||
var list = parts[part] || parts.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);
|
||||
function fragmentSrc(name) {
|
||||
var base = fragments[name];
|
||||
if (name === 'globe' && grid === '4') {
|
||||
base = 'assets/hub-logo-fragment-globe-4x4.svg';
|
||||
}
|
||||
return base + '?v=' + logoBuild;
|
||||
}
|
||||
|
||||
list.forEach(function (name) {
|
||||
var img = document.createElement('img');
|
||||
img.className = 'hub-logo-layer hub-logo-layer--' + name;
|
||||
img.src = fragmentSrc(name);
|
||||
img.alt = '';
|
||||
img.decoding = 'async';
|
||||
img.loading = 'lazy';
|
||||
stage.appendChild(img);
|
||||
});
|
||||
|
||||
var logoOpacity = params.get('logoOpacity');
|
||||
if (logoOpacity) {
|
||||
stage.style.opacity = logoOpacity;
|
||||
}
|
||||
|
||||
stage.hidden = false;
|
||||
stage.setAttribute('aria-hidden', 'true');
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user