2026-10-14 15:32:57 +05:30
<!DOCTYPE html>
< html lang = "en" >
< head >
< meta charset = "UTF-8" >
< meta name = "viewport" content = "width=device-width, initial-scale=1.0" >
< title > {{if .FileName}}{{.FileName}} — Cosmos Oort Share{{else}}Cosmos Oort Share{{end}}</ title >
< link rel = "icon" href = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><circle cx="16" cy="16" r="6" fill="%23eef3f8"/><ellipse cx="16" cy="16" rx="14" ry="5.5" fill="none" stroke="%238fd9ff" stroke-width="1.5" transform="rotate(-24 16 16)"/></svg>' >
< link rel = "preconnect" href = "https://fonts.googleapis.com" >
< link rel = "preconnect" href = "https://fonts.gstatic.com" crossorigin >
2026-11-07 00:30:41 +05:30
< link href = "https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@1&family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap" rel = "stylesheet" >
2026-10-14 15:32:57 +05:30
< style >
: root {
2026-11-07 00:30:41 +05:30
--bg : #020308 ;
--card-bg : rgba ( 9 , 14 , 26 , 0.82 );
--border : rgba ( 226 , 234 , 242 , 0.08 );
--line-strong : rgba ( 226 , 234 , 242 , 0.16 );
--accent : #8fd9ff ;
--accent-rgb : 143 , 216 , 255 ;
2026-10-14 15:32:57 +05:30
--text : #f8fafc ;
2026-11-07 00:30:41 +05:30
--text-muted : rgba ( 226 , 234 , 242 , 0.6 );
--text-dim : rgba ( 226 , 234 , 242 , 0.35 );
--mono : 'JetBrains Mono' , ui-monospace , monospace ;
--disp : 'Space Grotesk' , - apple-system , sans-serif ;
--serif : 'Instrument Serif' , Georgia , serif ;
--ez : cubic-bezier ( 0.16 , 1 , 0.3 , 1 );
2026-10-14 15:32:57 +05:30
}
2026-11-07 00:30:41 +05:30
*, * :: before , * :: after { box-sizing : border-box ; margin : 0 ; padding : 0 ; }
2026-10-14 15:32:57 +05:30
body {
background-color : var ( -- bg );
color : var ( -- text );
2026-11-07 00:30:41 +05:30
font-family : var ( -- disp );
2026-10-14 15:32:57 +05:30
min-height : 100 vh ;
2026-11-07 00:30:41 +05:30
min-height : 100 svh ;
2026-10-14 15:32:57 +05:30
display : flex ;
flex-direction : column ;
align-items : center ;
justify-content : center ;
padding : 24 px ;
overflow-x : hidden ;
position : relative ;
2026-11-07 00:30:41 +05:30
-webkit- font-smoothing : antialiased ;
2026-10-14 15:32:57 +05:30
}
2026-11-07 00:30:41 +05:30
:: selection { background : rgba ( var ( -- accent - rgb ), 0.3 ); color : #fff ; }
# webgl-bg {
position : fixed ;
inset : 0 ;
width : 100 % ;
height : 100 % ;
pointer-events : none ;
z-index : 1 ;
}
. noise-overlay {
position : fixed ;
inset : -10 % ;
width : 120 % ;
height : 120 % ;
pointer-events : none ;
opacity : 0.045 ;
background-image : url ( "data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E" );
background-size : 160 px 160 px ;
z-index : 2 ;
}
. radial-vignette {
2026-10-14 15:32:57 +05:30
position : fixed ;
inset : 0 ;
pointer-events : none ;
2026-11-07 00:30:41 +05:30
background : radial-gradient ( ellipse at 50 % 50 % , transparent 40 % , rgba ( 2 , 3 , 8 , 0.75 ) 85 % , #020308 100 % );
z-index : 2 ;
2026-10-14 15:32:57 +05:30
}
2026-11-07 00:30:41 +05:30
. card-wrapper {
2026-10-14 15:32:57 +05:30
position : relative ;
z-index : 10 ;
width : 100 % ;
max-width : 480 px ;
2026-11-07 00:30:41 +05:30
perspective : 1200 px ;
}
/* ── Signature Stuudio/Jockey 3D Glass Card with Conic Edge Illumination ── */
. share-card {
position : relative ;
width : 100 % ;
2026-10-14 15:32:57 +05:30
border-radius : 20 px ;
2026-11-07 00:30:41 +05:30
padding : 38 px 34 px 34 px ;
background : linear-gradient ( 145 deg , rgba ( 10 , 15 , 28 , 0.85 ), rgba ( 4 , 7 , 14 , 0.9 )) padding-box ,
conic-gradient ( from var ( - -rim- angle , 0 deg ) at var ( -- mx , 50 % ) var ( -- my , 50 % ),
rgba ( 143 , 216 , 255 , 0.85 ) 0 deg ,
rgba ( 255 , 255 , 255 , 0.1 ) 60 deg ,
rgba ( 143 , 216 , 255 , 0.05 ) 160 deg ,
rgba ( 143 , 216 , 255 , 0.45 ) 260 deg ,
rgba ( 143 , 216 , 255 , 0.85 ) 360 deg ) border-box ;
border : 1 px solid transparent ;
backdrop-filter : blur ( 28 px );
-webkit- backdrop-filter : blur ( 28 px );
box-shadow : 0 35 px 85 px rgba ( 0 , 0 , 0 , 0.65 ), 0 0 50 px rgba ( 143 , 216 , 255 , 0.06 );
transform-style : preserve-3d ;
transition : transform 0.2 s cubic-bezier ( 0.2 , 0.8 , 0.3 , 1 ), box-shadow 0.3 s ;
2026-10-14 15:32:57 +05:30
}
2026-11-07 00:30:41 +05:30
/* Reticle Corners */
. cnr {
position : absolute ;
width : 14 px ;
height : 14 px ;
border : 1 px solid rgba ( var ( -- accent - rgb ), 0.35 );
pointer-events : none ;
2026-10-14 15:32:57 +05:30
}
2026-11-07 00:30:41 +05:30
. c1 { top : -1 px ; left : -1 px ; border-right : 0 ; border-bottom : 0 ; border-top-left-radius : 8 px ; }
. c2 { top : -1 px ; right : -1 px ; border-left : 0 ; border-bottom : 0 ; border-top-right-radius : 8 px ; }
. c3 { bottom : -1 px ; left : -1 px ; border-right : 0 ; border-top : 0 ; border-bottom-left-radius : 8 px ; }
. c4 { bottom : -1 px ; right : -1 px ; border-left : 0 ; border-top : 0 ; border-bottom-right-radius : 8 px ; }
2026-10-14 15:32:57 +05:30
. brand {
display : flex ;
align-items : center ;
2026-11-07 00:30:41 +05:30
justify-content : space-between ;
2026-10-14 15:32:57 +05:30
margin-bottom : 28 px ;
}
2026-11-07 00:30:41 +05:30
. brand-left {
display : flex ;
align-items : center ;
gap : 10 px ;
}
2026-10-14 15:32:57 +05:30
. brand-icon {
2026-11-07 00:30:41 +05:30
width : 32 px ;
height : 32 px ;
background : rgba ( var ( -- accent - rgb ), 0.1 );
border : 1 px solid rgba ( var ( -- accent - rgb ), 0.25 );
border-radius : 9 px ;
2026-10-14 15:32:57 +05:30
display : flex ;
align-items : center ;
justify-content : center ;
}
. brand-name {
font-weight : 700 ;
2026-11-07 00:30:41 +05:30
font-size : 15 px ;
letter-spacing : -0.01 em ;
2026-10-14 15:32:57 +05:30
color : #fff ;
}
2026-11-07 00:30:41 +05:30
. brand-name em {
font-family : var ( -- serif );
font-style : italic ;
font-weight : 400 ;
color : rgb ( var ( -- accent - rgb ));
margin-left : 3 px ;
2026-10-14 15:32:57 +05:30
}
2026-11-07 00:30:41 +05:30
. brand-pill {
font-family : var ( -- mono );
font-size : 9 px ;
letter-spacing : 0.14 em ;
text-transform : uppercase ;
padding : 4 px 10 px ;
border-radius : 999 px ;
background : rgba ( var ( -- accent - rgb ), 0.1 );
color : var ( -- accent );
border : 1 px solid rgba ( var ( -- accent - rgb ), 0.22 );
}
2026-10-14 15:32:57 +05:30
. file-box {
2026-11-07 00:30:41 +05:30
background : rgba ( 0 , 0 , 0 , 0.4 );
2026-10-14 15:32:57 +05:30
border : 1 px solid var ( -- border );
border-radius : 14 px ;
2026-11-07 00:30:41 +05:30
padding : 18 px 20 px ;
margin-bottom : 22 px ;
2026-10-14 15:32:57 +05:30
display : flex ;
align-items : center ;
gap : 16 px ;
}
. file-icon {
2026-11-07 00:30:41 +05:30
width : 46 px ;
height : 46 px ;
2026-10-14 15:32:57 +05:30
border-radius : 12 px ;
2026-11-07 00:30:41 +05:30
background : rgba ( 143 , 216 , 255 , 0.08 );
border : 1 px solid rgba ( 143 , 216 , 255 , 0.25 );
2026-10-14 15:32:57 +05:30
display : flex ;
align-items : center ;
justify-content : center ;
flex-shrink : 0 ;
2026-11-07 00:30:41 +05:30
color : var ( -- accent );
2026-10-14 15:32:57 +05:30
}
. file-details {
min-width : 0 ;
flex : 1 ;
}
. file-name {
font-size : 15 px ;
font-weight : 600 ;
color : #fff ;
overflow : hidden ;
text-overflow : ellipsis ;
white-space : nowrap ;
margin-bottom : 4 px ;
}
. file-meta {
2026-11-07 00:30:41 +05:30
font-family : var ( -- mono );
font-size : 11 px ;
2026-10-14 15:32:57 +05:30
color : var ( -- text - muted );
display : flex ;
2026-11-07 00:30:41 +05:30
gap : 10 px ;
2026-10-14 15:32:57 +05:30
}
. meta-item {
display : flex ;
align-items : center ;
gap : 4 px ;
}
2026-11-07 00:30:41 +05:30
2026-10-14 15:32:57 +05:30
. stats-row {
display : grid ;
grid-template-columns : 1 fr 1 fr ;
gap : 12 px ;
margin-bottom : 24 px ;
}
. stat-pill {
2026-11-07 00:30:41 +05:30
background : rgba ( 255 , 255 , 255 , 0.02 );
border : 1 px solid var ( -- border );
padding : 12 px 14 px ;
border-radius : 11 px ;
2026-10-14 15:32:57 +05:30
}
. stat-label {
2026-11-07 00:30:41 +05:30
font-family : var ( -- mono );
font-size : 9 px ;
2026-10-14 15:32:57 +05:30
color : var ( -- text - dim );
text-transform : uppercase ;
2026-11-07 00:30:41 +05:30
letter-spacing : 0.12 em ;
2026-10-14 15:32:57 +05:30
margin-bottom : 4 px ;
}
. stat-val {
2026-11-07 00:30:41 +05:30
font-family : var ( -- mono );
font-size : 13.5 px ;
2026-10-14 15:32:57 +05:30
font-weight : 500 ;
color : var ( -- text );
}
2026-11-07 00:30:41 +05:30
2026-10-14 15:32:57 +05:30
. btn-download {
display : flex ;
align-items : center ;
justify-content : center ;
gap : 10 px ;
width : 100 % ;
2026-11-07 00:30:41 +05:30
padding : 14 px 22 px ;
background : #fff ;
color : #04060d ;
2026-10-14 15:32:57 +05:30
text-decoration : none ;
border : none ;
2026-11-07 00:30:41 +05:30
border-radius : 11 px ;
font-weight : 700 ;
font-size : 14.5 px ;
2026-10-14 15:32:57 +05:30
cursor : pointer ;
2026-11-07 00:30:41 +05:30
letter-spacing : -0.01 em ;
2026-10-14 15:32:57 +05:30
transition : all 0.2 s ease ;
2026-11-07 00:30:41 +05:30
box-shadow : 0 8 px 30 px rgba ( 255 , 255 , 255 , 0.12 );
2026-10-14 15:32:57 +05:30
}
. btn-download : hover {
2026-11-07 00:30:41 +05:30
box-shadow : 0 12 px 40 px rgba ( 255 , 255 , 255 , 0.22 );
transform : translateY ( -1 px );
2026-10-14 15:32:57 +05:30
}
2026-11-07 00:30:41 +05:30
. btn-download : active {
transform : scale ( 0.985 );
}
2026-10-14 15:32:57 +05:30
. input-pass {
width : 100 % ;
padding : 13 px 16 px ;
2026-11-07 00:30:41 +05:30
background : rgba ( 226 , 234 , 242 , 0.03 );
border : 1 px solid var ( -- line - strong );
border-radius : 11 px ;
2026-10-14 15:32:57 +05:30
color : #fff ;
font-family : inherit ;
font-size : 14 px ;
outline : none ;
margin-bottom : 16 px ;
2026-11-07 00:30:41 +05:30
transition : border-color 0.2 s , box-shadow 0.2 s ;
2026-10-14 15:32:57 +05:30
}
. input-pass : focus {
2026-11-07 00:30:41 +05:30
border-color : rgba ( var ( -- accent - rgb ), 0.65 );
box-shadow : 0 0 0 3 px rgba ( var ( -- accent - rgb ), 0.15 );
2026-10-14 15:32:57 +05:30
}
2026-11-07 00:30:41 +05:30
2026-10-14 15:32:57 +05:30
. error-msg {
background : rgba ( 239 , 68 , 68 , 0.1 );
border : 1 px solid rgba ( 239 , 68 , 68 , 0.3 );
color : #f87171 ;
2026-11-07 00:30:41 +05:30
padding : 11 px 14 px ;
border-radius : 10 px ;
2026-10-14 15:32:57 +05:30
font-size : 13 px ;
2026-11-07 00:30:41 +05:30
margin-bottom : 18 px ;
2026-10-14 15:32:57 +05:30
}
2026-11-07 00:30:41 +05:30
2026-10-14 15:32:57 +05:30
. footer {
position : relative ;
z-index : 10 ;
margin-top : 24 px ;
2026-11-07 00:30:41 +05:30
font-family : var ( -- mono );
font-size : 10 px ;
letter-spacing : 0.1 em ;
2026-10-14 15:32:57 +05:30
color : var ( -- text - dim );
text-align : center ;
2026-11-07 00:30:41 +05:30
text-transform : uppercase ;
}
@ media ( prefers-reduced-motion : reduce ) {
*, * :: before , * :: after {
animation-duration : 0.01 ms !important ;
transition-duration : 0.01 ms !important ;
}
2026-10-14 15:32:57 +05:30
}
</ style >
</ head >
< body >
2026-11-07 00:30:41 +05:30
< div id = "webgl-bg" aria-hidden = "true" ></ div >
< div class = "noise-overlay" aria-hidden = "true" ></ div >
< div class = "radial-vignette" aria-hidden = "true" ></ div >
2026-10-14 15:32:57 +05:30
2026-11-07 00:30:41 +05:30
< div class = "card-wrapper" id = "cardWrapper" >
< div class = "share-card" id = "card" >
< i class = "cnr c1" ></ i >< i class = "cnr c2" ></ i >< i class = "cnr c3" ></ i >< i class = "cnr c4" ></ i >
2026-10-14 15:32:57 +05:30
2026-11-07 00:30:41 +05:30
< div class = "brand" >
< div class = "brand-left" >
< div class = "brand-icon" >
< svg width = "18" height = "18" viewBox = "0 0 24 24" fill = "none" stroke = "#8fd9ff" stroke-width = "2" >
< circle cx = "12" cy = "12" r = "10" />
< line x1 = "2" y1 = "12" x2 = "22" y2 = "12" />
< path d = "M12 2a15.3 15.3 0 014 10 15.3 15.3 0 01-4 10 15.3 15.3 0 01-4-10 15.3 15.3 0 014-10z" />
2026-10-14 15:32:57 +05:30
</ svg >
2026-11-07 00:30:41 +05:30
</ div >
< div class = "brand-name" > COSMOS < em > OORT</ em ></ div >
</ div >
< span class = "brand-pill" > SECURE SHARE</ span >
</ div >
{{if .Error}}
< div class = "error-msg" > {{.Error}}</ div >
2026-10-14 15:32:57 +05:30
{{end}}
2026-11-07 00:30:41 +05:30
{{if .Expired}}
< div style = "text-align:center; padding: 24px 0;" >
< svg width = "48" height = "48" viewBox = "0 0 24 24" fill = "none" stroke = "#f87171" stroke-width = "1.5" style = "margin-bottom:12px" >
< circle cx = "12" cy = "12" r = "10" />
< line x1 = "12" y1 = "8" x2 = "12" y2 = "12" />
< line x1 = "12" y1 = "16" x2 = "12.01" y2 = "16" />
</ svg >
< h2 style = "font-size:18px; margin-bottom:8px; color:#fff" > Share Link Inactive</ h2 >
< p style = "font-size:13px; color:var(--text-muted); line-height:1.5" > This link has expired, exceeded its download quota, or has been revoked by the owner.</ p >
</ div >
{{else}}
< div class = "file-box" >
< div class = "file-icon" >
< svg width = "24" height = "24" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke-width = "2" >
< path d = "M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z" />
< polyline points = "14 2 14 8 20 8" />
< line x1 = "12" y1 = "18" x2 = "12" y2 = "12" />
< line x1 = "9" y1 = "15" x2 = "15" y2 = "15" />
</ svg >
</ div >
< div class = "file-details" >
< div class = "file-name" title = "{{.FileName}}" > {{.FileName}}</ div >
< div class = "file-meta" >
< span class = "meta-item" > {{.FileSize}}</ span >
{{if .ContentType}}< span class = "meta-item" > • {{.ContentType}}</ span > {{end}}
</ div >
</ div >
</ div >
< div class = "stats-row" >
< div class = "stat-pill" >
< div class = "stat-label" > Expires In</ div >
< div class = "stat-val" style = "color:#8fd9ff" > {{.ExpiresIn}}</ div >
</ div >
< div class = "stat-pill" >
< div class = "stat-label" > Downloads</ div >
< div class = "stat-val" > {{.DownloadsRemaining}}</ div >
</ div >
</ div >
{{if .RequiresPassword}}
< form method = "POST" action = "/s/{{.Token}}" >
< div style = "font-size:13px; color:var(--text-muted); margin-bottom:10px" > This transmission is passphrase-protected:</ div >
< input type = "password" name = "password" class = "input-pass" placeholder = "Enter download passphrase" required autofocus />
< button type = "submit" class = "btn-download" >
< svg width = "18" height = "18" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke-width = "2" >
< rect x = "3" y = "11" width = "18" height = "11" rx = "2" ry = "2" />
< path d = "M7 11V7a5 5 0 0110 0v4" />
</ svg >
Unlock & Download
</ button >
</ form >
{{else}}
< a href = "{{.DownloadURL}}" class = "btn-download" >
< svg width = "18" height = "18" viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" stroke-width = "2" >
< path d = "M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4" />
< polyline points = "7 10 12 15 17 10" />
< line x1 = "12" y1 = "15" x2 = "12" y2 = "3" />
</ svg >
Download Transmission
</ a >
{{end}}
{{end}}
</ div >
2026-10-14 15:32:57 +05:30
</ div >
< div class = "footer" >
Powered by < strong > Cosmos Oort</ strong > · Sovereign Cloud Workstation
</ div >
2026-11-07 00:30:41 +05:30
<!-- Local Zero-Latency Three.js Engine -->
< script src = "/three.min.js" ></ script >
2026-10-14 15:32:57 +05:30
< script >
2026-11-07 00:30:41 +05:30
/* ══ 1. THREE.JS 3D CELESTIAL BACKGROUND ══ */
( function (){
'use strict' ;
var container = document . getElementById ( 'webgl-bg' );
if ( ! window . THREE || ! container ) return ;
var scene = new THREE . Scene ();
var camera = new THREE . PerspectiveCamera ( 55 , window . innerWidth / window . innerHeight , 0.1 , 1000 );
camera . position . z = 28 ;
var renderer = new THREE . WebGLRenderer ({ antialias : true , alpha : true , powerPreference : 'high-performance' });
renderer . setPixelRatio ( Math . min ( window . devicePixelRatio || 1 , 2 ));
renderer . setSize ( window . innerWidth , window . innerHeight );
container . appendChild ( renderer . domElement );
var starCount = 1200 ;
var starGeo = new THREE . BufferGeometry ();
var starPos = new Float32Array ( starCount * 3 );
var starColors = new Float32Array ( starCount * 3 );
var colA = new THREE . Color ( 0x8fd9ff );
var colB = new THREE . Color ( 0xffffff );
for ( var i = 0 ; i < starCount ; i ++ ){
var i3 = i * 3 ;
starPos [ i3 ] = ( Math . random () - 0.5 ) * 80 ;
starPos [ i3 + 1 ] = ( Math . random () - 0.5 ) * 60 ;
starPos [ i3 + 2 ] = ( Math . random () - 0.5 ) * 50 - 5 ;
var c = Math . random () < 0.65 ? colB : colA ;
starColors [ i3 ] = c . r ;
starColors [ i3 + 1 ] = c . g ;
starColors [ i3 + 2 ] = c . b ;
}
starGeo . setAttribute ( 'position' , new THREE . BufferAttribute ( starPos , 3 ));
starGeo . setAttribute ( 'color' , new THREE . BufferAttribute ( starColors , 3 ));
var starMat = new THREE . PointsMaterial ({
size : 0.18 ,
vertexColors : true ,
transparent : true ,
opacity : 0.75 ,
blending : THREE . AdditiveBlending
2026-10-14 15:32:57 +05:30
});
2026-11-07 00:30:41 +05:30
var starField = new THREE . Points ( starGeo , starMat );
scene . add ( starField );
// Orbital Ring
var rGeo = new THREE . TorusGeometry ( 12 , 0.02 , 16 , 120 );
var rMat = new THREE . MeshBasicMaterial ({ color : 0x8fd9ff , transparent : true , opacity : 0.15 });
var ring = new THREE . Mesh ( rGeo , rMat );
ring . rotation . x = Math . PI / 3 ;
scene . add ( ring );
var mouse = { x : 0 , y : 0 , targetX : 0 , targetY : 0 };
window . addEventListener ( 'mousemove' , function ( e ){
mouse . targetX = ( e . clientX / window . innerWidth - 0.5 ) * 2 ;
mouse . targetY = - ( e . clientY / window . innerHeight - 0.5 ) * 2 ;
}, { passive : true });
window . addEventListener ( 'resize' , function (){
camera . aspect = window . innerWidth / window . innerHeight ;
camera . updateProjectionMatrix ();
renderer . setSize ( window . innerWidth , window . innerHeight );
});
var clock = new THREE . Clock ();
function animate (){
requestAnimationFrame ( animate );
if ( document . hidden ) return ;
var t = clock . getElapsedTime ();
mouse . x += ( mouse . targetX - mouse . x ) * 0.05 ;
mouse . y += ( mouse . targetY - mouse . y ) * 0.05 ;
starField . rotation . y = t * 0.015 ;
ring . rotation . z = t * 0.035 ;
camera . position . x = mouse . x * 2 ;
camera . position . y = mouse . y * 1.5 ;
camera . lookAt ( scene . position );
renderer . render ( scene , camera );
}
animate ();
})();
/* ══ 2. STUUDIO/JOCKEY SIGNATURE 3D CARD TILT & CONIC RIM LIGHT ══ */
( function (){
'use strict' ;
var card = document . getElementById ( 'card' );
if ( ! card ) return ;
var rect = null ;
function updateRect (){ rect = card . getBoundingClientRect (); }
window . addEventListener ( 'resize' , updateRect );
updateRect ();
var currentTiltX = 0 , currentTiltY = 0 ;
var targetTiltX = 0 , targetTiltY = 0 ;
window . addEventListener ( 'mousemove' , function ( e ){
if ( ! rect ) updateRect ();
var cx = rect . left + rect . width / 2 ;
var cy = rect . top + rect . height / 2 ;
var dx = e . clientX - cx ;
var dy = e . clientY - cy ;
var angle = Math . atan2 ( dy , dx ) * ( 180 / Math . PI ) + 90 ;
card . style . setProperty ( '--rim-angle' , angle + 'deg' );
var mxPercent = Math . max ( 0 , Math . min ( 100 , (( e . clientX - rect . left ) / rect . width ) * 100 ));
var myPercent = Math . max ( 0 , Math . min ( 100 , (( e . clientY - rect . top ) / rect . height ) * 100 ));
card . style . setProperty ( '--mx' , mxPercent + '%' );
card . style . setProperty ( '--my' , myPercent + '%' );
var dist = Math . hypot ( dx , dy );
var maxDist = Math . hypot ( window . innerWidth , window . innerHeight ) / 2 ;
if ( dist < maxDist ){
targetTiltY = ( dx / ( rect . width * 1.8 )) * 12 ;
targetTiltX = - ( dy / ( rect . height * 1.8 )) * 12 ;
} else {
targetTiltX = 0 ;
targetTiltY = 0 ;
}
}, { passive : true });
function tiltLoop (){
currentTiltX += ( targetTiltX - currentTiltX ) * 0.08 ;
currentTiltY += ( targetTiltY - currentTiltY ) * 0.08 ;
card . style . transform = 'rotateX(' + currentTiltX . toFixed ( 2 ) + 'deg) rotateY(' + currentTiltY . toFixed ( 2 ) + 'deg)' ;
requestAnimationFrame ( tiltLoop );
}
tiltLoop ();
})();
2026-10-14 15:32:57 +05:30
</ script >
</ body >
</ html >