feat(khira): implement exact kube.io magnifying glass liquid glass optical pipeline and interactive precision lens

This commit is contained in:
2026-10-26 17:41:58 +05:30
parent f0141c7d17
commit 16c232a2d3
6 changed files with 258 additions and 23 deletions
+66
View File
@@ -142,9 +142,75 @@ function dlg(o){
if(!d.open)d.showModal();
}
/* ── Kube.io Precision Liquid Glass Magnifying Lens Rig ── */
function initKubeLens() {
const lens = $('#kubePrecisionLens');
const toggleBtn = $('#btnToggleLens');
const closeBtn = $('#btnCloseLens');
if (!lens) return;
function setLensOpen(open) {
lens.hidden = !open;
toggleBtn?.classList.toggle('on', open);
}
toggleBtn?.addEventListener('click', (e) => {
e.stopPropagation();
const willOpen = lens.hidden;
setLensOpen(willOpen);
if (willOpen) {
toast('Precision Liquid Glass Lens active — drag across the page to inspect and bend content!');
}
});
closeBtn?.addEventListener('click', (e) => {
e.stopPropagation();
setLensOpen(false);
});
let isDragging = false;
let startX = 0, startY = 0;
let initialLeft = 240, initialTop = 180;
lens.addEventListener('pointerdown', (e) => {
if (e.target.closest('.kube-lens-close')) return;
isDragging = true;
lens.setPointerCapture(e.pointerId);
startX = e.clientX;
startY = e.clientY;
const rect = lens.getBoundingClientRect();
initialLeft = rect.left;
initialTop = rect.top;
lens.style.transition = 'none';
});
lens.addEventListener('pointermove', (e) => {
if (!isDragging) return;
const dx = e.clientX - startX;
const dy = e.clientY - startY;
const maxW = Math.max(window.innerWidth - 220, 0);
const maxH = Math.max(window.innerHeight - 160, 0);
const newLeft = Math.max(0, Math.min(maxW, initialLeft + dx));
const newTop = Math.max(0, Math.min(maxH, initialTop + dy));
lens.style.left = `${newLeft}px`;
lens.style.top = `${newTop}px`;
});
const stopDrag = (e) => {
if (!isDragging) return;
isDragging = false;
try { lens.releasePointerCapture(e.pointerId); } catch(_) {}
lens.style.transition = 'transform 0.15s ease-out, box-shadow 0.2s ease';
};
lens.addEventListener('pointerup', stopDrag);
lens.addEventListener('pointercancel', stopDrag);
}
/* ── auth ── */
async function boot(){
theme(document.documentElement.dataset.theme||'dark');
initKubeLens();
const r=await api('/khira/api/auth/me');
if(r.authenticated&&r.user)enter(r.user);else $('#auth').hidden=false;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 589 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

+67 -5
View File
@@ -15,13 +15,66 @@
</head>
<body>
<!-- Lightweight GPU Liquid Glass SVG Filter -->
<!-- Kube.io SVG Liquid Glass Filters (Magnifying Glass Pipeline) -->
<svg color-interpolation-filters="sRGB" style="position:fixed;width:0;height:0;pointer-events:none;z-index:-1;opacity:0" aria-hidden="true">
<defs>
<filter id="liquid-refract" color-interpolation-filters="sRGB" x="-10%" y="-10%" width="120%" height="120%">
<feTurbulence type="fractalNoise" baseFrequency="0.04 0.05" numOctaves="1" result="noise" />
<feDisplacementMap in="SourceGraphic" in2="noise" scale="5" xChannelSelector="R" yChannelSelector="G" result="refracted" />
<feColorMatrix in="refracted" type="saturate" values="1.3" />
<!-- 1. Kube.io Precision Magnifying Glass Filter -->
<filter id="kube-magnifying-glass-filter" color-interpolation-filters="sRGB" x="-20%" y="-20%" width="140%" height="140%">
<feImage href="/khira/assets/magnifying-map.png" x="0" y="0" width="210" height="150" result="magnifying_displacement_map"></feImage>
<feDisplacementMap in="SourceGraphic" in2="magnifying_displacement_map" xChannelSelector="R" yChannelSelector="G" result="magnified_source" scale="24"></feDisplacementMap>
<feGaussianBlur in="magnified_source" stdDeviation="0" result="blurred_source"></feGaussianBlur>
<feImage href="/khira/assets/displacement-map.png" x="0" y="0" width="210" height="150" result="displacement_map"></feImage>
<feDisplacementMap in="blurred_source" in2="displacement_map" xChannelSelector="R" yChannelSelector="G" result="displaced" scale="98.25"></feDisplacementMap>
<feColorMatrix in="displaced" type="saturate" result="displaced_saturated" values="9"></feColorMatrix>
<feImage href="/khira/assets/specular-map.png" x="0" y="0" width="210" height="150" result="specular_layer"></feImage>
<feComposite in="displaced_saturated" in2="specular_layer" operator="in" result="specular_saturated"></feComposite>
<feComponentTransfer in="specular_layer" result="specular_faded">
<feFuncA type="linear" slope="0.5"></feFuncA>
</feComponentTransfer>
<feBlend in="specular_saturated" in2="displaced" mode="normal" result="withSaturation"></feBlend>
<feBlend in="specular_faded" in2="withSaturation" mode="normal"></feBlend>
</filter>
<!-- 2. Kube.io Liquid Glass Panels, Modals & Sheets -->
<filter id="kube-glass-panel" color-interpolation-filters="sRGB" x="-10%" y="-10%" width="120%" height="120%">
<feImage href="/khira/assets/displacement-map-panel.png" x="0" y="0" width="100%" height="100%" preserveAspectRatio="none" result="disp_map"></feImage>
<feDisplacementMap in="SourceGraphic" in2="disp_map" xChannelSelector="R" yChannelSelector="G" result="displaced" scale="42"></feDisplacementMap>
<feColorMatrix in="displaced" type="saturate" result="saturated" values="6"></feColorMatrix>
<feImage href="/khira/assets/specular-map-panel.png" x="0" y="0" width="100%" height="100%" preserveAspectRatio="none" result="spec_layer"></feImage>
<feComposite in="saturated" in2="spec_layer" operator="in" result="spec_sat"></feComposite>
<feComponentTransfer in="spec_layer" result="spec_fade">
<feFuncA type="linear" slope="0.45"></feFuncA>
</feComponentTransfer>
<feBlend in="spec_sat" in2="displaced" mode="normal" result="withSat"></feBlend>
<feBlend in="spec_fade" in2="withSat" mode="normal"></feBlend>
</filter>
<!-- 3. Kube.io Liquid Glass Pills (Search, Buttons & Chips) -->
<filter id="kube-glass-pill" color-interpolation-filters="sRGB" x="-10%" y="-10%" width="120%" height="120%">
<feImage href="/khira/assets/displacement-map-pill.png" x="0" y="0" width="100%" height="100%" preserveAspectRatio="none" result="disp_map"></feImage>
<feDisplacementMap in="SourceGraphic" in2="disp_map" xChannelSelector="R" yChannelSelector="G" result="displaced" scale="32"></feDisplacementMap>
<feColorMatrix in="displaced" type="saturate" result="saturated" values="6"></feColorMatrix>
<feImage href="/khira/assets/specular-map-pill.png" x="0" y="0" width="100%" height="100%" preserveAspectRatio="none" result="spec_layer"></feImage>
<feComposite in="saturated" in2="spec_layer" operator="in" result="spec_sat"></feComposite>
<feComponentTransfer in="spec_layer" result="spec_fade">
<feFuncA type="linear" slope="0.4"></feFuncA>
</feComponentTransfer>
<feBlend in="spec_sat" in2="displaced" mode="normal" result="withSat"></feBlend>
<feBlend in="spec_fade" in2="withSat" mode="normal"></feBlend>
</filter>
<!-- 4. Kube.io Liquid Glass Bars (Header & Navigation) -->
<filter id="kube-glass-bar" color-interpolation-filters="sRGB" x="-5%" y="-5%" width="110%" height="110%">
<feImage href="/khira/assets/displacement-map-bar.png" x="0" y="0" width="100%" height="100%" preserveAspectRatio="none" result="disp_map"></feImage>
<feDisplacementMap in="SourceGraphic" in2="disp_map" xChannelSelector="R" yChannelSelector="G" result="displaced" scale="26"></feDisplacementMap>
<feColorMatrix in="displaced" type="saturate" result="saturated" values="5"></feColorMatrix>
<feImage href="/khira/assets/specular-map-bar.png" x="0" y="0" width="100%" height="100%" preserveAspectRatio="none" result="spec_layer"></feImage>
<feComposite in="saturated" in2="spec_layer" operator="in" result="spec_sat"></feComposite>
<feComponentTransfer in="spec_layer" result="spec_fade">
<feFuncA type="linear" slope="0.35"></feFuncA>
</feComponentTransfer>
<feBlend in="spec_sat" in2="displaced" mode="normal" result="withSat"></feBlend>
<feBlend in="spec_fade" in2="withSat" mode="normal"></feBlend>
</filter>
</defs>
</svg>
@@ -63,6 +116,7 @@
<button class="chip db-btn sync" id="btnSyncBackup" title="Sync Primary DB to Backup DB"><span class="ms">cloud_sync</span><span class="btn-txt">Backup DB</span></button>
<button class="chip db-btn rollback" id="btnRollbackBackup" title="Rollback Primary DB from Backup DB"><span class="ms">history</span><span class="btn-txt">Rollback DB</span></button>
</div>
<button class="chip lens-toggle-btn" id="btnToggleLens" title="Toggle Liquid Glass Precision Lens (kube.io)"><span class="ms">search</span><span class="btn-txt">Lens</span></button>
<button class="ib" id="theme" aria-label="Toggle theme"><span class="ms">dark_mode</span></button>
<button class="ib" id="bell" aria-label="Notifications"><span class="ms">notifications</span><i id="dot" hidden></i></button>
<button class="me-btn" id="me" aria-label="Profile"></button>
@@ -106,6 +160,14 @@
<div class="pop" id="pop" hidden></div>
</div>
<!-- Kube.io Liquid Glass Precision Lens Capsule -->
<div id="kubePrecisionLens" class="kube-lens-capsule" draggable="false" hidden>
<div class="kube-lens-drag-handle">
<div class="kube-lens-badge"><span class="ms" style="font-size:13px;vertical-align:middle;margin-right:4px">biotech</span>Liquid Glass · 1.5x</div>
<button type="button" class="kube-lens-close" id="btnCloseLens" title="Close Lens">&times;</button>
</div>
</div>
<dialog id="sheet"></dialog>
<dialog id="dlg"></dialog>
<div class="snack" id="snack" role="status"></div>
+125 -18
View File
@@ -49,27 +49,25 @@
--sc-hi: rgba(22, 30, 46, 0.8);
--sc-hh: rgba(30, 41, 62, 0.9);
/* Optical Refraction & Specular Bevel Variables */
--glass-blur: blur(20px) saturate(185%) contrast(106%);
/* Optical Refraction & Specular Bevel Variables (Kube.io Magnifying Glass Pipeline) */
--kube-glass-panel: url(#kube-glass-panel);
--kube-glass-pill: url(#kube-glass-pill);
--kube-glass-bar: url(#kube-glass-bar);
--kube-glass-mag: url(#kube-magnifying-glass-filter);
--glass-blur: var(--kube-glass-panel), blur(16px) saturate(180%);
--glass-shadow:
0 18px 44px -10px rgba(0, 0, 0, 0.88),
0 0 0 1px rgba(255, 255, 255, 0.08),
inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.38),
inset 0 3px 12px 0 rgba(56, 189, 248, 0.06),
inset 0 -1.5px 2px 0 rgba(0, 0, 0, 0.85);
0px 8px 32px rgba(0, 0, 0, 0.65),
inset 0px 2px 20px rgba(0, 0, 0, 0.4),
inset 0px -1px 2px rgba(255, 255, 255, 0.25);
--glass-shadow-hover:
0 24px 56px -10px rgba(0, 0, 0, 0.95),
0 0 24px rgba(16, 185, 129, 0.18),
0 0 0 1px rgba(255, 255, 255, 0.16),
inset 0 2px 2px 0 rgba(255, 255, 255, 0.6),
inset 0 4px 16px 0 rgba(56, 189, 248, 0.12),
inset 0 -1.5px 2px 0 rgba(0, 0, 0, 0.95);
0px 14px 44px rgba(0, 0, 0, 0.8),
0 0 20px rgba(16, 185, 129, 0.18),
inset 0px 2px 24px rgba(0, 0, 0, 0.45),
inset 0px -1px 2px rgba(255, 255, 255, 0.35);
--glass-shadow-lg:
0 32px 72px -14px rgba(0, 0, 0, 0.96),
0 0 0 1px rgba(255, 255, 255, 0.12),
inset 0 1.5px 1.5px 0 rgba(255, 255, 255, 0.4),
inset 0 4px 18px 0 rgba(56, 189, 248, 0.08),
inset 0 -2px 6px 0 rgba(0, 0, 0, 0.9);
0px 20px 60px rgba(0, 0, 0, 0.85),
inset 0px 2px 24px rgba(0, 0, 0, 0.4),
inset 0px -1px 2px rgba(255, 255, 255, 0.25);
/* Prismatic Refraction Border Gradient */
--liquid-prism-border: linear-gradient(
@@ -1620,3 +1618,112 @@ dd { word-break: break-word; }
align-items: center;
gap: 6px;
}
/* ══════════════════════════════════════════════════════════════════
KUBE.IO MAGNIFYING GLASS SECTION IMPLEMENTATION
Refraction lens with magnification zoom, edge deflection & specular bloom
══════════════════════════════════════════════════════════════════ */
.kube-lens-capsule {
position: fixed;
top: 180px;
left: 240px;
width: 210px;
height: 150px;
border-radius: 75px;
z-index: 9999;
cursor: grab;
backdrop-filter: url(#kube-magnifying-glass-filter);
-webkit-backdrop-filter: url(#kube-magnifying-glass-filter);
box-shadow:
0px 12px 42px rgba(0, 0, 0, 0.75),
inset 0px 2px 24px rgba(0, 0, 0, 0.4),
inset 0px -2px 24px rgba(255, 255, 255, 0.25);
border: 1px solid rgba(255, 255, 255, 0.22);
user-select: none;
-webkit-user-select: none;
touch-action: none;
transform: translateZ(0);
transition: transform 0.15s ease-out, box-shadow 0.2s ease;
}
.kube-lens-capsule:active {
cursor: grabbing;
transform: scale(1.05) translateZ(0);
box-shadow:
0px 24px 68px rgba(0, 0, 0, 0.9),
inset 0px 2px 28px rgba(0, 0, 0, 0.5),
inset 0px -2px 28px rgba(255, 255, 255, 0.35);
}
.kube-lens-drag-handle {
position: absolute;
top: 12px;
left: 14px;
right: 14px;
display: flex;
align-items: center;
justify-content: space-between;
pointer-events: auto;
}
.kube-lens-badge {
font-size: 11px;
font-weight: 600;
letter-spacing: 0.5px;
color: rgba(255, 255, 255, 0.95);
background: rgba(0, 0, 0, 0.5);
padding: 3px 10px;
border-radius: 12px;
border: 1px solid rgba(255, 255, 255, 0.18);
backdrop-filter: blur(8px);
pointer-events: none;
display: inline-flex;
align-items: center;
}
.kube-lens-close {
background: rgba(0, 0, 0, 0.55);
border: 1px solid rgba(255, 255, 255, 0.2);
color: #fff;
width: 22px;
height: 22px;
border-radius: 50%;
display: grid;
place-items: center;
font-size: 15px;
line-height: 1;
cursor: pointer;
transition: all 0.2s;
}
.kube-lens-close:hover {
background: rgba(239, 68, 68, 0.85);
border-color: rgba(239, 68, 68, 1);
transform: scale(1.1);
}
.lens-toggle-btn {
display: inline-flex;
align-items: center;
gap: 6px;
transition: all 0.25s var(--e);
}
.lens-toggle-btn.on {
background: rgba(16, 185, 129, 0.22);
border-color: rgba(16, 185, 129, 0.55);
color: #34d399;
box-shadow: 0 0 16px rgba(16, 185, 129, 0.3);
}
/* Kube.io Glass UI Components */
.search {
backdrop-filter: url(#kube-glass-pill);
-webkit-backdrop-filter: url(#kube-glass-pill);
}
.bar, .nav {
backdrop-filter: url(#kube-glass-bar);
-webkit-backdrop-filter: url(#kube-glass-bar);
}
#dlg, #sheet, .ac {
backdrop-filter: url(#kube-glass-panel);
-webkit-backdrop-filter: url(#kube-glass-panel);
}
.fb, .fab, .chip.on, #btnLogAppErr, #btnLogMoreForApp {
backdrop-filter: url(#kube-glass-pill);
-webkit-backdrop-filter: url(#kube-glass-pill);
}