1
0
mirror of git://f0xx.org/ac/ac-be-hub synced 2026-08-09 20:59:23 +03:00

feat(globe3d=11): latf/lngf/zy/zx land plate zoom URL params

Default latf=1.25; linear multiply on lon/lat plus optional non-linear
bias via zy/zx toward equator and prime meridian.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-08-05 19:34:26 +02:00
parent ae83a64042
commit a4e582d212
2 changed files with 62 additions and 24 deletions

View File

@@ -187,7 +187,7 @@ function hub_h(string $s): string {
var supportsLayout = !!(window.CSS && CSS.supports && CSS.supports('object-fit', 'cover'));
var logoEnabled = !!(stage && supportsSvg && supportsLayout);
var logoBuild = '20260704globe25';
var logoBuild = '20260704globe26';
function hubAsset(rel) {
var link = document.querySelector('link[href*="hub.css"]');
@@ -256,10 +256,18 @@ function hub_h(string $s): string {
var globe3dRaw = params.get('globe3d');
var globe3dVersion = globe3dRaw === null || globe3dRaw === '' ? 1 : parseInt(globe3dRaw, 10);
if (!isFinite(globe3dVersion)) globe3dVersion = 1;
var globeLatFactorRaw = params.get('f');
var globeLatFactor = globeLatFactorRaw === null || globeLatFactorRaw === ''
? NaN
: parseFloat(globeLatFactorRaw);
var globeLandZoom = {};
['latf', 'lngf', 'zy', 'zx'].forEach(function (key) {
var raw = params.get(key);
if (raw === null || raw === '') return;
var n = parseFloat(raw);
if (isFinite(n)) globeLandZoom[key] = n;
});
var globeLatfLegacy = params.get('f');
if (globeLatfLegacy !== null && globeLatfLegacy !== '' && !isFinite(globeLandZoom.latf)) {
var fLegacy = parseFloat(globeLatfLegacy);
if (isFinite(fLegacy)) globeLandZoom.latf = fLegacy;
}
var useGlobe3d = logoEnabled && globe3dVersion !== 0;
var globe3dLayers = { globe: true, continents: true, gridOverlay: true };
@@ -304,8 +312,8 @@ function hub_h(string $s): string {
if (isFinite(globeYawDeg)) {
globeOpts.initialRotationY = globeYawDeg * Math.PI / 180;
}
if (isFinite(globeLatFactor)) {
globeOpts.continentLatFactor = globeLatFactor;
if (Object.keys(globeLandZoom).length > 0) {
globeOpts.landZoom = globeLandZoom;
}
var globeModuleUrl = new URL('assets/hub-globe.js', window.location.href);
globeModuleUrl.searchParams.set('v', logoBuild);