Files
COSMOS/templates/share.html
T
2026-11-07 00:30:41 +05:30

548 lines
18 KiB
HTML

<!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>
<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">
<style>
:root {
--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;
--text: #f8fafc;
--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);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
background-color: var(--bg);
color: var(--text);
font-family: var(--disp);
min-height: 100vh;
min-height: 100svh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 24px;
overflow-x: hidden;
position: relative;
-webkit-font-smoothing: antialiased;
}
::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: 160px 160px;
z-index: 2;
}
.radial-vignette {
position: fixed;
inset: 0;
pointer-events: none;
background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(2, 3, 8, 0.75) 85%, #020308 100%);
z-index: 2;
}
.card-wrapper {
position: relative;
z-index: 10;
width: 100%;
max-width: 480px;
perspective: 1200px;
}
/* ── Signature Stuudio/Jockey 3D Glass Card with Conic Edge Illumination ── */
.share-card {
position: relative;
width: 100%;
border-radius: 20px;
padding: 38px 34px 34px;
background: linear-gradient(145deg, rgba(10, 15, 28, 0.85), rgba(4, 7, 14, 0.9)) padding-box,
conic-gradient(from var(--rim-angle, 0deg) at var(--mx, 50%) var(--my, 50%),
rgba(143, 216, 255, 0.85) 0deg,
rgba(255, 255, 255, 0.1) 60deg,
rgba(143, 216, 255, 0.05) 160deg,
rgba(143, 216, 255, 0.45) 260deg,
rgba(143, 216, 255, 0.85) 360deg) border-box;
border: 1px solid transparent;
backdrop-filter: blur(28px);
-webkit-backdrop-filter: blur(28px);
box-shadow: 0 35px 85px rgba(0, 0, 0, 0.65), 0 0 50px rgba(143, 216, 255, 0.06);
transform-style: preserve-3d;
transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 0.3s;
}
/* Reticle Corners */
.cnr {
position: absolute;
width: 14px;
height: 14px;
border: 1px solid rgba(var(--accent-rgb), 0.35);
pointer-events: none;
}
.c1 { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.c2 { top: -1px; right: -1px; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.c3 { bottom: -1px; left: -1px; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.c4 { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.brand {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 28px;
}
.brand-left {
display: flex;
align-items: center;
gap: 10px;
}
.brand-icon {
width: 32px;
height: 32px;
background: rgba(var(--accent-rgb), 0.1);
border: 1px solid rgba(var(--accent-rgb), 0.25);
border-radius: 9px;
display: flex;
align-items: center;
justify-content: center;
}
.brand-name {
font-weight: 700;
font-size: 15px;
letter-spacing: -0.01em;
color: #fff;
}
.brand-name em {
font-family: var(--serif);
font-style: italic;
font-weight: 400;
color: rgb(var(--accent-rgb));
margin-left: 3px;
}
.brand-pill {
font-family: var(--mono);
font-size: 9px;
letter-spacing: 0.14em;
text-transform: uppercase;
padding: 4px 10px;
border-radius: 999px;
background: rgba(var(--accent-rgb), 0.1);
color: var(--accent);
border: 1px solid rgba(var(--accent-rgb), 0.22);
}
.file-box {
background: rgba(0, 0, 0, 0.4);
border: 1px solid var(--border);
border-radius: 14px;
padding: 18px 20px;
margin-bottom: 22px;
display: flex;
align-items: center;
gap: 16px;
}
.file-icon {
width: 46px;
height: 46px;
border-radius: 12px;
background: rgba(143, 216, 255, 0.08);
border: 1px solid rgba(143, 216, 255, 0.25);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
color: var(--accent);
}
.file-details {
min-width: 0;
flex: 1;
}
.file-name {
font-size: 15px;
font-weight: 600;
color: #fff;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin-bottom: 4px;
}
.file-meta {
font-family: var(--mono);
font-size: 11px;
color: var(--text-muted);
display: flex;
gap: 10px;
}
.meta-item {
display: flex;
align-items: center;
gap: 4px;
}
.stats-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 12px;
margin-bottom: 24px;
}
.stat-pill {
background: rgba(255, 255, 255, 0.02);
border: 1px solid var(--border);
padding: 12px 14px;
border-radius: 11px;
}
.stat-label {
font-family: var(--mono);
font-size: 9px;
color: var(--text-dim);
text-transform: uppercase;
letter-spacing: 0.12em;
margin-bottom: 4px;
}
.stat-val {
font-family: var(--mono);
font-size: 13.5px;
font-weight: 500;
color: var(--text);
}
.btn-download {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
width: 100%;
padding: 14px 22px;
background: #fff;
color: #04060d;
text-decoration: none;
border: none;
border-radius: 11px;
font-weight: 700;
font-size: 14.5px;
cursor: pointer;
letter-spacing: -0.01em;
transition: all 0.2s ease;
box-shadow: 0 8px 30px rgba(255, 255, 255, 0.12);
}
.btn-download:hover {
box-shadow: 0 12px 40px rgba(255, 255, 255, 0.22);
transform: translateY(-1px);
}
.btn-download:active {
transform: scale(0.985);
}
.input-pass {
width: 100%;
padding: 13px 16px;
background: rgba(226, 234, 242, 0.03);
border: 1px solid var(--line-strong);
border-radius: 11px;
color: #fff;
font-family: inherit;
font-size: 14px;
outline: none;
margin-bottom: 16px;
transition: border-color 0.2s, box-shadow 0.2s;
}
.input-pass:focus {
border-color: rgba(var(--accent-rgb), 0.65);
box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.error-msg {
background: rgba(239, 68, 68, 0.1);
border: 1px solid rgba(239, 68, 68, 0.3);
color: #f87171;
padding: 11px 14px;
border-radius: 10px;
font-size: 13px;
margin-bottom: 18px;
}
.footer {
position: relative;
z-index: 10;
margin-top: 24px;
font-family: var(--mono);
font-size: 10px;
letter-spacing: 0.1em;
color: var(--text-dim);
text-align: center;
text-transform: uppercase;
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: 0.01ms !important;
transition-duration: 0.01ms !important;
}
}
</style>
</head>
<body>
<div id="webgl-bg" aria-hidden="true"></div>
<div class="noise-overlay" aria-hidden="true"></div>
<div class="radial-vignette" aria-hidden="true"></div>
<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>
<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"/>
</svg>
</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>
{{end}}
{{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 &amp; 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>
</div>
<div class="footer">
Powered by <strong>Cosmos Oort</strong> · Sovereign Cloud Workstation
</div>
<!-- Local Zero-Latency Three.js Engine -->
<script src="/three.min.js"></script>
<script>
/* ══ 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
});
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();
})();
</script>
</body>
</html>