Compare commits
18
Commits
49d5559d8f
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
339cf82b8d | ||
|
|
c269fdea23 | ||
|
|
a772cfe370 | ||
|
|
f13b9bfb7c | ||
|
|
777863a635 | ||
|
|
76783b95e6 | ||
|
|
e2f8433803 | ||
|
|
56d12612e3 | ||
|
|
757089c1fa | ||
|
|
181dc6664a | ||
|
|
ff4d288bf5 | ||
|
|
7720d15a00 | ||
|
|
bb61db8092 | ||
|
|
90a66aefa6 | ||
|
|
e6e5b91e3b | ||
|
|
72a6b2cbf9 | ||
|
|
8fec2ce4c2 | ||
|
|
e5a368043c |
@@ -175,11 +175,17 @@ func handleIndex(w http.ResponseWriter, r *http.Request) {
|
|||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||||
|
w.Header().Set("Pragma", "no-cache")
|
||||||
|
w.Header().Set("Expires", "0")
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
tmpl.ExecuteTemplate(w, "index.html", nil)
|
tmpl.ExecuteTemplate(w, "index.html", nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleServicePage(w http.ResponseWriter, r *http.Request, service string) {
|
func handleServicePage(w http.ResponseWriter, r *http.Request, service string) {
|
||||||
|
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||||
|
w.Header().Set("Pragma", "no-cache")
|
||||||
|
w.Header().Set("Expires", "0")
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
tmpl.ExecuteTemplate(w, service+".html", nil)
|
tmpl.ExecuteTemplate(w, service+".html", nil)
|
||||||
}
|
}
|
||||||
@@ -198,6 +204,9 @@ func handlePoll(w http.ResponseWriter, r *http.Request, service string) {
|
|||||||
// Replacing handleSignup
|
// Replacing handleSignup
|
||||||
func handleSignup(w http.ResponseWriter, r *http.Request, service string) {
|
func handleSignup(w http.ResponseWriter, r *http.Request, service string) {
|
||||||
if r.Method == "GET" {
|
if r.Method == "GET" {
|
||||||
|
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||||
|
w.Header().Set("Pragma", "no-cache")
|
||||||
|
w.Header().Set("Expires", "0")
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
tmpl.ExecuteTemplate(w, "signup.html", map[string]string{"Service": service})
|
tmpl.ExecuteTemplate(w, "signup.html", map[string]string{"Service": service})
|
||||||
return
|
return
|
||||||
@@ -266,6 +275,9 @@ func handleSignup(w http.ResponseWriter, r *http.Request, service string) {
|
|||||||
// Replacing handleLogin
|
// Replacing handleLogin
|
||||||
func handleLogin(w http.ResponseWriter, r *http.Request, service string) {
|
func handleLogin(w http.ResponseWriter, r *http.Request, service string) {
|
||||||
if r.Method == "GET" {
|
if r.Method == "GET" {
|
||||||
|
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||||
|
w.Header().Set("Pragma", "no-cache")
|
||||||
|
w.Header().Set("Expires", "0")
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
data := map[string]string{"Service": service}
|
data := map[string]string{"Service": service}
|
||||||
if r.URL.Query().Get("error") != "" {
|
if r.URL.Query().Get("error") != "" {
|
||||||
@@ -538,7 +550,7 @@ h1{font-size:48px;font-weight:700;margin-bottom:8px}
|
|||||||
|
|
||||||
func provisionMinIO(ak, sk, bucket string) {
|
func provisionMinIO(ak, sk, bucket string) {
|
||||||
log.Printf("[MinIO] Provisioning %s", ak)
|
log.Printf("[MinIO] Provisioning %s", ak)
|
||||||
exec.Command("mc", "alias", "set", "cosmos", "http://127.0.0.1:9000", "unityadmin", "UnityAdmin2026!").Run()
|
exec.Command("mc", "alias", "set", "cosmos", "http://127.0.0.1:9010", "unityadmin", "UnityAdmin2026!").Run()
|
||||||
exec.Command("mc", "admin", "user", "add", "cosmos", ak, sk).Run()
|
exec.Command("mc", "admin", "user", "add", "cosmos", ak, sk).Run()
|
||||||
exec.Command("mc", "mb", "--ignore-existing", "cosmos/"+bucket).Run()
|
exec.Command("mc", "mb", "--ignore-existing", "cosmos/"+bucket).Run()
|
||||||
exec.Command("mc", "version", "enable", "cosmos/"+bucket).Run()
|
exec.Command("mc", "version", "enable", "cosmos/"+bucket).Run()
|
||||||
@@ -662,6 +674,9 @@ func sendPasswordResetEmail(toEmail, token, service string) {
|
|||||||
|
|
||||||
// handleForgotPassword handles GET (show form) and POST (send reset email).
|
// handleForgotPassword handles GET (show form) and POST (send reset email).
|
||||||
func handleForgotPassword(w http.ResponseWriter, r *http.Request, service string) {
|
func handleForgotPassword(w http.ResponseWriter, r *http.Request, service string) {
|
||||||
|
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||||
|
w.Header().Set("Pragma", "no-cache")
|
||||||
|
w.Header().Set("Expires", "0")
|
||||||
if r.Method == "GET" {
|
if r.Method == "GET" {
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
data := map[string]any{"Service": service, "Step": "request"}
|
data := map[string]any{"Service": service, "Step": "request"}
|
||||||
@@ -875,6 +890,17 @@ func main() {
|
|||||||
mux.HandleFunc("/tailwind.css", func(w http.ResponseWriter, r *http.Request) {
|
mux.HandleFunc("/tailwind.css", func(w http.ResponseWriter, r *http.Request) {
|
||||||
data, _ := templatesFS.ReadFile("templates/tailwind.css")
|
data, _ := templatesFS.ReadFile("templates/tailwind.css")
|
||||||
w.Header().Set("Content-Type", "text/css; charset=utf-8")
|
w.Header().Set("Content-Type", "text/css; charset=utf-8")
|
||||||
|
w.Header().Set("Cache-Control", "no-cache, must-revalidate")
|
||||||
|
w.Header().Set("Pragma", "no-cache")
|
||||||
|
w.Header().Set("Expires", "0")
|
||||||
|
w.Write(data)
|
||||||
|
})
|
||||||
|
mux.HandleFunc("/three.min.js", func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
data, _ := templatesFS.ReadFile("templates/three.min.js")
|
||||||
|
w.Header().Set("Content-Type", "application/javascript; charset=utf-8")
|
||||||
|
w.Header().Set("Cache-Control", "no-cache, must-revalidate")
|
||||||
|
w.Header().Set("Pragma", "no-cache")
|
||||||
|
w.Header().Set("Expires", "0")
|
||||||
w.Write(data)
|
w.Write(data)
|
||||||
})
|
})
|
||||||
RegisterS3ConsoleRoutes(mux)
|
RegisterS3ConsoleRoutes(mux)
|
||||||
|
|||||||
+485
-10
@@ -5,6 +5,8 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
|
"encoding/xml"
|
||||||
|
"html"
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
@@ -16,6 +18,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
"path"
|
||||||
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@@ -25,7 +28,7 @@ import (
|
|||||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||||
)
|
)
|
||||||
|
|
||||||
const minioEndpoint = "127.0.0.1:9000"
|
const minioEndpoint = "127.0.0.1:9010"
|
||||||
const publicMinioEndpoint = "cosmos.linuxguy.space"
|
const publicMinioEndpoint = "cosmos.linuxguy.space"
|
||||||
|
|
||||||
// authS3Console validates the session and returns (accessKey, secretKey, bucket).
|
// authS3Console validates the session and returns (accessKey, secretKey, bucket).
|
||||||
@@ -134,6 +137,8 @@ func RegisterS3ConsoleRoutes(mux *http.ServeMux) {
|
|||||||
mux.HandleFunc("/oort/api/password", handleS3Password)
|
mux.HandleFunc("/oort/api/password", handleS3Password)
|
||||||
mux.HandleFunc("/oort/api/objects/move", handleS3Move)
|
mux.HandleFunc("/oort/api/objects/move", handleS3Move)
|
||||||
mux.HandleFunc("/oort/api/buckets/rename", handleS3RenameBucket)
|
mux.HandleFunc("/oort/api/buckets/rename", handleS3RenameBucket)
|
||||||
|
mux.HandleFunc("/oort/api/nas/info", handleMornyeNASInfo)
|
||||||
|
mux.HandleFunc("/oort/api/nas/enable-streaming", handleMornyeNASEnableStreaming)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── Console HTML page ────────────────────────────────────────────────────────
|
// ─── Console HTML page ────────────────────────────────────────────────────────
|
||||||
@@ -147,7 +152,7 @@ func handleS3ConsolePage(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
w.Header().Set("X-Frame-Options", "DENY")
|
w.Header().Set("X-Frame-Options", "DENY")
|
||||||
w.Header().Set("X-Content-Type-Options", "nosniff")
|
w.Header().Set("X-Content-Type-Options", "nosniff")
|
||||||
w.Header().Set("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://static.cloudflareinsights.com; img-src 'self' data: blob:;")
|
w.Header().Set("Content-Security-Policy", "default-src 'self'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' data: https://fonts.gstatic.com; script-src 'self' 'unsafe-inline' https://cdn.jsdelivr.net https://static.cloudflareinsights.com; img-src 'self' data: blob: https:; media-src 'self' blob: data:; connect-src 'self';")
|
||||||
|
|
||||||
sid := r.URL.Query().Get("sid")
|
sid := r.URL.Query().Get("sid")
|
||||||
if sid == "" {
|
if sid == "" {
|
||||||
@@ -166,6 +171,10 @@ func handleS3ConsolePage(w http.ResponseWriter, r *http.Request) {
|
|||||||
})
|
})
|
||||||
var username string
|
var username string
|
||||||
scyllaSession.Query(`SELECT username FROM cosmos.users WHERE session_id=? ALLOW FILTERING`, sid).Scan(&username)
|
scyllaSession.Query(`SELECT username FROM cosmos.users WHERE session_id=? ALLOW FILTERING`, sid).Scan(&username)
|
||||||
|
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||||
|
w.Header().Set("Pragma", "no-cache")
|
||||||
|
w.Header().Set("Expires", "0")
|
||||||
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
tmpl.ExecuteTemplate(w, "oortconsole.html", map[string]string{"SID": sid, "Username": username})
|
tmpl.ExecuteTemplate(w, "oortconsole.html", map[string]string{"SID": sid, "Username": username})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -949,6 +958,9 @@ func handleS3CreateBucket(w http.ResponseWriter, r *http.Request) {
|
|||||||
// Enable versioning
|
// Enable versioning
|
||||||
exec.Command("mc", "version", "enable", "cosmos/"+internalName).Run()
|
exec.Command("mc", "version", "enable", "cosmos/"+internalName).Run()
|
||||||
|
|
||||||
|
// Enable public streaming for Mornye NAS
|
||||||
|
exec.Command("mc", "anonymous", "set", "download", "cosmos/"+internalName).Run()
|
||||||
|
|
||||||
// Save to DB
|
// Save to DB
|
||||||
scyllaSession.Query(`INSERT INTO cosmos.buckets (bucket_name, owner_email, display_name) VALUES (?, ?, ?)`, internalName, ak, displayName).Exec()
|
scyllaSession.Query(`INSERT INTO cosmos.buckets (bucket_name, owner_email, display_name) VALUES (?, ?, ?)`, internalName, ak, displayName).Exec()
|
||||||
|
|
||||||
@@ -1160,16 +1172,336 @@ var proxyTransport = &http.Transport{
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
type MornyeTrackItem struct {
|
||||||
|
Key string `json:"key"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Title string `json:"title"`
|
||||||
|
Size int64 `json:"size"`
|
||||||
|
Format string `json:"format"`
|
||||||
|
StreamURL string `json:"stream_url"`
|
||||||
|
LastModified string `json:"last_modified"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func handleMornyeNASInfo(w http.ResponseWriter, r *http.Request) {
|
||||||
|
ak, sk, defBucket, ok := authS3Console(r)
|
||||||
|
if !ok {
|
||||||
|
jsonErr(w, "unauthorized", 401)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var username, name string
|
||||||
|
scyllaSession.Query(`SELECT username, name FROM cosmos.users WHERE service='git' AND email=?`, ak).Scan(&username, &name)
|
||||||
|
if username == "" {
|
||||||
|
username = strings.Split(ak, "@")[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
var defDisp string
|
||||||
|
scyllaSession.Query(`SELECT bucket_display_name FROM cosmos.users WHERE service='git' AND email=?`, ak).Scan(&defDisp)
|
||||||
|
if defDisp == "" {
|
||||||
|
defDisp = "mybucket"
|
||||||
|
}
|
||||||
|
|
||||||
|
type NASBucketInfo struct {
|
||||||
|
Name string `json:"name"`
|
||||||
|
DisplayName string `json:"display_name"`
|
||||||
|
IsDefault bool `json:"is_default"`
|
||||||
|
IsPublic bool `json:"is_public"`
|
||||||
|
NASUrl string `json:"nas_url"`
|
||||||
|
PlaylistUrl string `json:"playlist_url"`
|
||||||
|
TrackCount int `json:"track_count"`
|
||||||
|
MusicBytes int64 `json:"music_bytes"`
|
||||||
|
}
|
||||||
|
|
||||||
|
var bucketList []NASBucketInfo
|
||||||
|
rawBuckets := []struct{ name, disp string }{ {defBucket, defDisp} }
|
||||||
|
|
||||||
|
iter := scyllaSession.Query(`SELECT bucket_name, display_name FROM cosmos.buckets WHERE owner_email = ?`, ak).Iter()
|
||||||
|
var b, disp string
|
||||||
|
for iter.Scan(&b, &disp) {
|
||||||
|
if disp == "" { disp = b }
|
||||||
|
rawBuckets = append(rawBuckets, struct{ name, disp string }{b, disp})
|
||||||
|
}
|
||||||
|
iter.Close()
|
||||||
|
|
||||||
|
mc, _ := minioClient(ak, sk)
|
||||||
|
ctx := context.Background()
|
||||||
|
|
||||||
|
for i, rb := range rawBuckets {
|
||||||
|
if rb.name == "" { continue }
|
||||||
|
|
||||||
|
cmd := exec.Command("mc", "anonymous", "get", "cosmos/"+rb.name)
|
||||||
|
out, _ := cmd.CombinedOutput()
|
||||||
|
isPub := strings.Contains(string(out), "download") || strings.Contains(string(out), "public")
|
||||||
|
|
||||||
|
trackCount := 0
|
||||||
|
var musicBytes int64 = 0
|
||||||
|
if mc != nil {
|
||||||
|
for obj := range mc.ListObjects(ctx, rb.name, minio.ListObjectsOptions{Recursive: true}) {
|
||||||
|
if obj.Err == nil && !strings.HasSuffix(obj.Key, "/") {
|
||||||
|
lower := strings.ToLower(obj.Key)
|
||||||
|
if strings.HasSuffix(lower, ".flac") || strings.HasSuffix(lower, ".mp3") ||
|
||||||
|
strings.HasSuffix(lower, ".wav") || strings.HasSuffix(lower, ".m4a") ||
|
||||||
|
strings.HasSuffix(lower, ".aac") || strings.HasSuffix(lower, ".ogg") ||
|
||||||
|
strings.HasSuffix(lower, ".opus") || strings.HasSuffix(lower, ".alac") {
|
||||||
|
trackCount++
|
||||||
|
musicBytes += obj.Size
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bucketList = append(bucketList, NASBucketInfo{
|
||||||
|
Name: rb.name,
|
||||||
|
DisplayName: rb.disp,
|
||||||
|
IsDefault: (i == 0),
|
||||||
|
IsPublic: isPub,
|
||||||
|
NASUrl: fmt.Sprintf("https://cosmos.linuxguy.space/oort/%s/%s/", username, rb.disp),
|
||||||
|
PlaylistUrl: fmt.Sprintf("https://cosmos.linuxguy.space/oort/%s/%s/playlist.m3u", username, rb.disp),
|
||||||
|
TrackCount: trackCount,
|
||||||
|
MusicBytes: musicBytes,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
jsonOK(w, map[string]any{
|
||||||
|
"username": username,
|
||||||
|
"name": name,
|
||||||
|
"email": ak,
|
||||||
|
"secret_key": sk,
|
||||||
|
"s3_endpoint": "https://cosmos.linuxguy.space",
|
||||||
|
"default_bucket": defBucket,
|
||||||
|
"buckets": bucketList,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
func handleMornyeNASEnableStreaming(w http.ResponseWriter, r *http.Request) {
|
||||||
|
if r.Method != "POST" {
|
||||||
|
jsonErr(w, "method not allowed", 405)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
ak, _, defBucket, ok := authS3Console(r)
|
||||||
|
if !ok {
|
||||||
|
jsonErr(w, "unauthorized", 401)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var req struct {
|
||||||
|
Bucket string `json:"bucket"`
|
||||||
|
}
|
||||||
|
json.NewDecoder(r.Body).Decode(&req)
|
||||||
|
if req.Bucket == "" { req.Bucket = defBucket }
|
||||||
|
|
||||||
|
isOwner := false
|
||||||
|
if req.Bucket == defBucket {
|
||||||
|
isOwner = true
|
||||||
|
} else {
|
||||||
|
var owner string
|
||||||
|
if err := scyllaSession.Query(`SELECT owner_email FROM cosmos.buckets WHERE bucket_name=?`, req.Bucket).Scan(&owner); err == nil && owner == ak {
|
||||||
|
isOwner = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !isOwner {
|
||||||
|
jsonErr(w, "forbidden", 403)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd := exec.Command("mc", "anonymous", "set", "download", "cosmos/"+req.Bucket)
|
||||||
|
if out, err := cmd.CombinedOutput(); err != nil {
|
||||||
|
log.Printf("[NAS] enable streaming error for %s: %v | %s", req.Bucket, err, string(out))
|
||||||
|
jsonErr(w, "failed to enable streaming", 500)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
jsonOK(w, map[string]any{"success": true, "bucket": req.Bucket, "status": "streaming_enabled"})
|
||||||
|
}
|
||||||
|
|
||||||
|
func escapeDAVPath(p string) string {
|
||||||
|
parts := strings.Split(p, "/")
|
||||||
|
for i, part := range parts {
|
||||||
|
parts[i] = url.PathEscape(part)
|
||||||
|
}
|
||||||
|
return strings.Join(parts, "/")
|
||||||
|
}
|
||||||
|
|
||||||
|
func xmlEscape(s string) string {
|
||||||
|
var b strings.Builder
|
||||||
|
xml.EscapeText(&b, []byte(s))
|
||||||
|
return b.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
func mimeForFilename(filename string) string {
|
||||||
|
lower := strings.ToLower(filename)
|
||||||
|
switch {
|
||||||
|
case strings.HasSuffix(lower, ".flac"):
|
||||||
|
return "audio/flac"
|
||||||
|
case strings.HasSuffix(lower, ".mp3"):
|
||||||
|
return "audio/mpeg"
|
||||||
|
case strings.HasSuffix(lower, ".wav"):
|
||||||
|
return "audio/wav"
|
||||||
|
case strings.HasSuffix(lower, ".m4a"):
|
||||||
|
return "audio/mp4"
|
||||||
|
case strings.HasSuffix(lower, ".aac"):
|
||||||
|
return "audio/aac"
|
||||||
|
case strings.HasSuffix(lower, ".ogg"):
|
||||||
|
return "audio/ogg"
|
||||||
|
case strings.HasSuffix(lower, ".opus"):
|
||||||
|
return "audio/opus"
|
||||||
|
case strings.HasSuffix(lower, ".alac"):
|
||||||
|
return "audio/alac"
|
||||||
|
case strings.HasSuffix(lower, ".m3u"), strings.HasSuffix(lower, ".m3u8"):
|
||||||
|
return "audio/x-mpegurl"
|
||||||
|
case strings.HasSuffix(lower, ".lrc"):
|
||||||
|
return "text/plain; charset=utf-8"
|
||||||
|
case strings.HasSuffix(lower, ".json"):
|
||||||
|
return "application/json"
|
||||||
|
default:
|
||||||
|
return "application/octet-stream"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func handleWebDAVPropfind(w http.ResponseWriter, r *http.Request, username, displayBucket, actualBucket, objectKey string) {
|
||||||
|
mc, err := minio.New(minioEndpoint, &minio.Options{
|
||||||
|
Creds: credentials.NewStaticV4("unityadmin", "UnityAdmin2026!", ""),
|
||||||
|
Secure: false,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
http.Error(w, "WebDAV backend error", 500)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
depth := r.Header.Get("Depth")
|
||||||
|
if depth == "" {
|
||||||
|
depth = "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
w.Header().Set("Content-Type", "application/xml; charset=\"utf-8\"")
|
||||||
|
w.Header().Set("DAV", "1, 2")
|
||||||
|
w.Header().Set("MS-Author-Via", "DAV")
|
||||||
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
|
w.Header().Set("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, OPTIONS, PROPFIND")
|
||||||
|
w.Header().Set("Access-Control-Allow-Headers", "Depth, Content-Type, Authorization, Range")
|
||||||
|
w.WriteHeader(207) // HTTP 207 Multi-Status
|
||||||
|
|
||||||
|
var buf strings.Builder
|
||||||
|
buf.WriteString("<?xml version=\"1.0\" encoding=\"utf-8\"?>\n")
|
||||||
|
buf.WriteString("<D:multistatus xmlns:D=\"DAV:\">\n")
|
||||||
|
|
||||||
|
rootHref := fmt.Sprintf("/oort/%s/%s/", username, displayBucket)
|
||||||
|
|
||||||
|
if objectKey == "" {
|
||||||
|
// Root collection self entry
|
||||||
|
buf.WriteString(" <D:response>\n")
|
||||||
|
buf.WriteString(fmt.Sprintf(" <D:href>%s</D:href>\n", xmlEscape(rootHref)))
|
||||||
|
buf.WriteString(" <D:propstat>\n")
|
||||||
|
buf.WriteString(" <D:prop>\n")
|
||||||
|
buf.WriteString(fmt.Sprintf(" <D:displayname>%s</D:displayname>\n", xmlEscape(displayBucket)))
|
||||||
|
buf.WriteString(" <D:resourcetype><D:collection/></D:resourcetype>\n")
|
||||||
|
buf.WriteString(" </D:prop>\n")
|
||||||
|
buf.WriteString(" <D:status>HTTP/1.1 200 OK</D:status>\n")
|
||||||
|
buf.WriteString(" </D:propstat>\n")
|
||||||
|
buf.WriteString(" </D:response>\n")
|
||||||
|
|
||||||
|
if depth != "0" {
|
||||||
|
ctx := context.Background()
|
||||||
|
for obj := range mc.ListObjects(ctx, actualBucket, minio.ListObjectsOptions{Recursive: true}) {
|
||||||
|
if obj.Err == nil && !strings.HasSuffix(obj.Key, "/") {
|
||||||
|
itemHref := rootHref + escapeDAVPath(obj.Key)
|
||||||
|
mime := mimeForFilename(obj.Key)
|
||||||
|
lastMod := obj.LastModified.UTC().Format(http.TimeFormat)
|
||||||
|
name := filepath.Base(obj.Key)
|
||||||
|
|
||||||
|
buf.WriteString(" <D:response>\n")
|
||||||
|
buf.WriteString(fmt.Sprintf(" <D:href>%s</D:href>\n", xmlEscape(itemHref)))
|
||||||
|
buf.WriteString(" <D:propstat>\n")
|
||||||
|
buf.WriteString(" <D:prop>\n")
|
||||||
|
buf.WriteString(fmt.Sprintf(" <D:displayname>%s</D:displayname>\n", xmlEscape(name)))
|
||||||
|
buf.WriteString(" <D:resourcetype/>\n")
|
||||||
|
buf.WriteString(fmt.Sprintf(" <D:getcontentlength>%d</D:getcontentlength>\n", obj.Size))
|
||||||
|
buf.WriteString(fmt.Sprintf(" <D:getcontenttype>%s</D:getcontenttype>\n", mime))
|
||||||
|
buf.WriteString(fmt.Sprintf(" <D:getlastmodified>%s</D:getlastmodified>\n", lastMod))
|
||||||
|
buf.WriteString(" </D:prop>\n")
|
||||||
|
buf.WriteString(" <D:status>HTTP/1.1 200 OK</D:status>\n")
|
||||||
|
buf.WriteString(" </D:propstat>\n")
|
||||||
|
buf.WriteString(" </D:response>\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Specific file PROPFIND
|
||||||
|
ctx := context.Background()
|
||||||
|
objInfo, err := mc.StatObject(ctx, actualBucket, objectKey, minio.StatObjectOptions{})
|
||||||
|
if err != nil {
|
||||||
|
buf.WriteString(" <D:response>\n")
|
||||||
|
buf.WriteString(fmt.Sprintf(" <D:href>%s%s</D:href>\n", xmlEscape(rootHref), xmlEscape(escapeDAVPath(objectKey))))
|
||||||
|
buf.WriteString(" <D:status>HTTP/1.1 404 Not Found</D:status>\n")
|
||||||
|
buf.WriteString(" </D:response>\n")
|
||||||
|
} else {
|
||||||
|
itemHref := rootHref + escapeDAVPath(objInfo.Key)
|
||||||
|
mime := mimeForFilename(objInfo.Key)
|
||||||
|
lastMod := objInfo.LastModified.UTC().Format(http.TimeFormat)
|
||||||
|
name := filepath.Base(objInfo.Key)
|
||||||
|
|
||||||
|
buf.WriteString(" <D:response>\n")
|
||||||
|
buf.WriteString(fmt.Sprintf(" <D:href>%s</D:href>\n", xmlEscape(itemHref)))
|
||||||
|
buf.WriteString(" <D:propstat>\n")
|
||||||
|
buf.WriteString(" <D:prop>\n")
|
||||||
|
buf.WriteString(fmt.Sprintf(" <D:displayname>%s</D:displayname>\n", xmlEscape(name)))
|
||||||
|
buf.WriteString(" <D:resourcetype/>\n")
|
||||||
|
buf.WriteString(fmt.Sprintf(" <D:getcontentlength>%d</D:getcontentlength>\n", objInfo.Size))
|
||||||
|
buf.WriteString(fmt.Sprintf(" <D:getcontenttype>%s</D:getcontenttype>\n", mime))
|
||||||
|
buf.WriteString(fmt.Sprintf(" <D:getlastmodified>%s</D:getlastmodified>\n", lastMod))
|
||||||
|
buf.WriteString(" </D:prop>\n")
|
||||||
|
buf.WriteString(" <D:status>HTTP/1.1 200 OK</D:status>\n")
|
||||||
|
buf.WriteString(" </D:propstat>\n")
|
||||||
|
buf.WriteString(" </D:response>\n")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buf.WriteString("</D:multistatus>\n")
|
||||||
|
w.Write([]byte(buf.String()))
|
||||||
|
}
|
||||||
|
|
||||||
|
func renderNASDirectoryIndex(w http.ResponseWriter, username, displayBucket string, tracks []MornyeTrackItem) {
|
||||||
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
|
w.Header().Set("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS, PROPFIND")
|
||||||
|
w.Header().Set("Access-Control-Allow-Headers", "Range, Authorization, Content-Type, Depth")
|
||||||
|
w.Header().Set("DAV", "1, 2")
|
||||||
|
|
||||||
|
var buf strings.Builder
|
||||||
|
buf.WriteString("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\">\n")
|
||||||
|
buf.WriteString(fmt.Sprintf("<html>\n<head><title>Index of /oort/%s/%s/</title></head>\n<body>\n", html.EscapeString(username), html.EscapeString(displayBucket)))
|
||||||
|
buf.WriteString(fmt.Sprintf("<h1>Index of /oort/%s/%s/</h1>\n<hr>\n<pre><a href=\"../\">Parent Directory</a>\n", html.EscapeString(username), html.EscapeString(displayBucket)))
|
||||||
|
|
||||||
|
for _, t := range tracks {
|
||||||
|
escaped := escapeDAVPath(t.Key)
|
||||||
|
displayName := t.Name
|
||||||
|
if len(displayName) > 55 {
|
||||||
|
displayName = displayName[:52] + "..."
|
||||||
|
}
|
||||||
|
padded := displayName
|
||||||
|
if len(padded) < 55 {
|
||||||
|
padded += strings.Repeat(" ", 55-len(padded))
|
||||||
|
}
|
||||||
|
buf.WriteString(fmt.Sprintf("<a href=\"%s\">%s</a> %s %10d\n", escaped, html.EscapeString(padded), t.LastModified, t.Size))
|
||||||
|
}
|
||||||
|
|
||||||
|
buf.WriteString("</pre>\n<hr>\n<address>Mornye NAS Server at cosmos.linuxguy.space Port 443</address>\n</body>\n</html>")
|
||||||
|
w.Write([]byte(buf.String()))
|
||||||
|
}
|
||||||
|
|
||||||
func handleS3PublicProxy(w http.ResponseWriter, r *http.Request, username, path string) {
|
func handleS3PublicProxy(w http.ResponseWriter, r *http.Request, username, path string) {
|
||||||
idx := strings.Index(path, "/")
|
trimmed := strings.Trim(path, "/")
|
||||||
if idx == -1 {
|
var displayBucket, objectKey string
|
||||||
|
if idx := strings.Index(trimmed, "/"); idx != -1 {
|
||||||
|
displayBucket = trimmed[:idx]
|
||||||
|
objectKey = trimmed[idx+1:]
|
||||||
|
} else {
|
||||||
|
displayBucket = trimmed
|
||||||
|
objectKey = ""
|
||||||
|
}
|
||||||
|
if displayBucket == "" {
|
||||||
w.Header().Set("Content-Type", "text/html")
|
w.Header().Set("Content-Type", "text/html")
|
||||||
w.WriteHeader(404)
|
w.WriteHeader(404)
|
||||||
w.Write([]byte("<html><body><h1>404 - Not Found</h1></body></html>"))
|
w.Write([]byte("<html><body><h1>404 - Not Found</h1></body></html>"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
displayBucket := path[:idx]
|
|
||||||
objectKey := path[idx+1:]
|
|
||||||
|
|
||||||
cacheKey := username + ":" + displayBucket
|
cacheKey := username + ":" + displayBucket
|
||||||
var actualBucket string
|
var actualBucket string
|
||||||
@@ -1218,21 +1550,163 @@ func handleS3PublicProxy(w http.ResponseWriter, r *http.Request, username, path
|
|||||||
publicBucketCache.Store(cacheKey, actualBucket)
|
publicBucketCache.Store(cacheKey, actualBucket)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WebDAV OPTIONS method handling
|
||||||
|
if r.Method == "OPTIONS" {
|
||||||
|
w.Header().Set("DAV", "1, 2")
|
||||||
|
w.Header().Set("MS-Author-Via", "DAV")
|
||||||
|
w.Header().Set("Allow", "GET, HEAD, POST, PUT, DELETE, OPTIONS, PROPFIND, MKCOL, COPY, MOVE")
|
||||||
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
|
w.Header().Set("Access-Control-Allow-Methods", "GET, HEAD, POST, PUT, DELETE, OPTIONS, PROPFIND, MKCOL, COPY, MOVE")
|
||||||
|
w.Header().Set("Access-Control-Allow-Headers", "Depth, Content-Type, Authorization, Range, X-Requested-With")
|
||||||
|
w.Header().Set("Access-Control-Expose-Headers", "Content-Range, Content-Length, Accept-Ranges, DAV")
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// WebDAV PROPFIND method handling
|
||||||
|
if r.Method == "PROPFIND" {
|
||||||
|
handleWebDAVPropfind(w, r, username, displayBucket, actualBucket, objectKey)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if this is a Mornye NAS root, index.json, or playlist.m3u request
|
||||||
|
isPlaylist := objectKey == "playlist.m3u" || objectKey == "mornye.m3u" || r.URL.Query().Get("format") == "m3u"
|
||||||
|
isJSON := objectKey == "index.json" || objectKey == "mornye.json" || r.URL.Query().Get("format") == "json" || strings.Contains(r.Header.Get("Accept"), "application/json")
|
||||||
|
isRoot := (objectKey == "")
|
||||||
|
|
||||||
|
if isRoot && r.Method == "HEAD" {
|
||||||
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
|
w.Header().Set("DAV", "1, 2")
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if isRoot || isPlaylist || isJSON {
|
||||||
|
mc, err := minio.New(minioEndpoint, &minio.Options{
|
||||||
|
Creds: credentials.NewStaticV4("unityadmin", "UnityAdmin2026!", ""),
|
||||||
|
Secure: false,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
http.Error(w, "NAS storage backend error", 500)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var tracks []MornyeTrackItem
|
||||||
|
var totalBytes int64 = 0
|
||||||
|
|
||||||
|
ctx := context.Background()
|
||||||
|
for obj := range mc.ListObjects(ctx, actualBucket, minio.ListObjectsOptions{Recursive: true}) {
|
||||||
|
if obj.Err == nil && !strings.HasSuffix(obj.Key, "/") {
|
||||||
|
lower := strings.ToLower(obj.Key)
|
||||||
|
ext := strings.TrimPrefix(filepath.Ext(lower), ".")
|
||||||
|
name := filepath.Base(obj.Key)
|
||||||
|
title := strings.TrimSuffix(name, filepath.Ext(name))
|
||||||
|
displayTitle := strings.ReplaceAll(title, "_", " ")
|
||||||
|
|
||||||
|
isAudio := ext == "flac" || ext == "mp3" || ext == "wav" || ext == "m4a" || ext == "aac" || ext == "ogg" || ext == "opus" || ext == "alac"
|
||||||
|
if isAudio || isRoot {
|
||||||
|
streamURL := fmt.Sprintf("https://cosmos.linuxguy.space/oort/%s/%s/%s", username, displayBucket, escapeDAVPath(obj.Key))
|
||||||
|
tracks = append(tracks, MornyeTrackItem{
|
||||||
|
Key: obj.Key,
|
||||||
|
Name: name,
|
||||||
|
Title: displayTitle,
|
||||||
|
Size: obj.Size,
|
||||||
|
Format: strings.ToUpper(ext),
|
||||||
|
StreamURL: streamURL,
|
||||||
|
LastModified: obj.LastModified.Format(time.RFC3339),
|
||||||
|
})
|
||||||
|
totalBytes += obj.Size
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||||
|
w.Header().Set("Access-Control-Allow-Headers", "*")
|
||||||
|
w.Header().Set("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS, PROPFIND")
|
||||||
|
w.Header().Set("DAV", "1, 2")
|
||||||
|
|
||||||
|
if isPlaylist {
|
||||||
|
w.Header().Set("Content-Type", "audio/x-mpegurl; charset=utf-8")
|
||||||
|
w.Header().Set("Content-Disposition", fmt.Sprintf("inline; filename=\"%s-mornye.m3u\"", displayBucket))
|
||||||
|
var buf strings.Builder
|
||||||
|
buf.WriteString("#EXTM3U\n")
|
||||||
|
buf.WriteString(fmt.Sprintf("#PLAYLIST:Mornye NAS - %s - %s\n\n", username, displayBucket))
|
||||||
|
for _, t := range tracks {
|
||||||
|
buf.WriteString(fmt.Sprintf("#EXTINF:-1,%s\n%s\n", t.Title, t.StreamURL))
|
||||||
|
}
|
||||||
|
w.Write([]byte(buf.String()))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if isJSON {
|
||||||
|
w.Header().Set("Content-Type", "application/json; charset=utf-8")
|
||||||
|
json.NewEncoder(w).Encode(map[string]any{
|
||||||
|
"service": "Mornye NAS",
|
||||||
|
"version": "2.0",
|
||||||
|
"status": "online",
|
||||||
|
"account": username,
|
||||||
|
"bucket": displayBucket,
|
||||||
|
"nas_url": fmt.Sprintf("https://cosmos.linuxguy.space/oort/%s/%s/", username, displayBucket),
|
||||||
|
"playlist_url": fmt.Sprintf("https://cosmos.linuxguy.space/oort/%s/%s/playlist.m3u", username, displayBucket),
|
||||||
|
"s3_endpoint": "https://cosmos.linuxguy.space",
|
||||||
|
"tracks_count": len(tracks),
|
||||||
|
"total_bytes": totalBytes,
|
||||||
|
"tracks": tracks,
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// NAS Root: Pure Directory Index for Mornye / HTTP(S) network storage
|
||||||
|
renderNASDirectoryIndex(w, username, displayBucket, tracks)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
targetPath := fmt.Sprintf("/%s/%s", actualBucket, objectKey)
|
targetPath := fmt.Sprintf("/%s/%s", actualBucket, objectKey)
|
||||||
|
|
||||||
targetUrl, _ := url.Parse("http://127.0.0.1:9000")
|
targetUrl, _ := url.Parse("http://127.0.0.1:9010")
|
||||||
proxy := httputil.NewSingleHostReverseProxy(targetUrl)
|
proxy := httputil.NewSingleHostReverseProxy(targetUrl)
|
||||||
proxy.Transport = proxyTransport
|
proxy.Transport = proxyTransport
|
||||||
|
|
||||||
r.URL.Path = targetPath
|
r.URL.Path = targetPath
|
||||||
r.URL.RawPath = targetPath
|
r.URL.RawPath = targetPath
|
||||||
|
|
||||||
|
// CRITICAL: Strip any Authorization header before proxying to MinIO.
|
||||||
|
// Mornye or WebDAV clients often send HTTP Basic Auth, which MinIO rejects with 400 InvalidRequest.
|
||||||
|
r.Header.Del("Authorization")
|
||||||
|
|
||||||
proxy.ModifyResponse = func(resp *http.Response) error {
|
proxy.ModifyResponse = func(resp *http.Response) error {
|
||||||
if resp.StatusCode == 403 {
|
if resp.StatusCode == 403 {
|
||||||
resp.StatusCode = 403
|
resp.StatusCode = 403
|
||||||
resp.Body = io.NopCloser(strings.NewReader("<html><body><h1>403 - Access Denied</h1><p>Public access is not enabled for this bucket.</p></body></html>"))
|
resp.Body = io.NopCloser(strings.NewReader("<html><body><h1>403 - Access Denied</h1><p>Public streaming access is not enabled for this Mornye NAS bucket. Enable public streaming in Oort NAS Console.</p></body></html>"))
|
||||||
resp.Header.Set("Content-Length", fmt.Sprintf("%d", len("<html><body><h1>403 - Access Denied</h1><p>Public access is not enabled for this bucket.</p></body></html>")))
|
resp.Header.Set("Content-Length", fmt.Sprintf("%d", len("<html><body><h1>403 - Access Denied</h1><p>Public streaming access is not enabled for this Mornye NAS bucket. Enable public streaming in Oort NAS Console.</p></body></html>")))
|
||||||
resp.Header.Set("Content-Type", "text/html")
|
resp.Header.Set("Content-Type", "text/html")
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
resp.Header.Set("Access-Control-Allow-Origin", "*")
|
||||||
|
resp.Header.Set("Access-Control-Allow-Methods", "GET, HEAD, OPTIONS")
|
||||||
|
resp.Header.Set("Access-Control-Allow-Headers", "Range, Authorization, Content-Type")
|
||||||
|
resp.Header.Set("Access-Control-Expose-Headers", "Content-Range, Content-Length, Accept-Ranges")
|
||||||
|
resp.Header.Set("Accept-Ranges", "bytes")
|
||||||
|
|
||||||
|
lowerKey := strings.ToLower(objectKey)
|
||||||
|
switch {
|
||||||
|
case strings.HasSuffix(lowerKey, ".flac"):
|
||||||
|
resp.Header.Set("Content-Type", "audio/flac")
|
||||||
|
case strings.HasSuffix(lowerKey, ".mp3"):
|
||||||
|
resp.Header.Set("Content-Type", "audio/mpeg")
|
||||||
|
case strings.HasSuffix(lowerKey, ".wav"):
|
||||||
|
resp.Header.Set("Content-Type", "audio/wav")
|
||||||
|
case strings.HasSuffix(lowerKey, ".m4a"):
|
||||||
|
resp.Header.Set("Content-Type", "audio/mp4")
|
||||||
|
case strings.HasSuffix(lowerKey, ".aac"):
|
||||||
|
resp.Header.Set("Content-Type", "audio/aac")
|
||||||
|
case strings.HasSuffix(lowerKey, ".ogg"):
|
||||||
|
resp.Header.Set("Content-Type", "audio/ogg")
|
||||||
|
case strings.HasSuffix(lowerKey, ".opus"):
|
||||||
|
resp.Header.Set("Content-Type", "audio/opus")
|
||||||
|
case strings.HasSuffix(lowerKey, ".lrc"):
|
||||||
|
resp.Header.Set("Content-Type", "text/plain; charset=utf-8")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@@ -1242,6 +1716,7 @@ func handleS3PublicProxy(w http.ResponseWriter, r *http.Request, username, path
|
|||||||
recordHit(actualBucket, tw.statusCode, tw.bytes, false, r.Header.Get("CF-IPCountry"), "read")
|
recordHit(actualBucket, tw.statusCode, tw.bytes, false, r.Header.Get("CF-IPCountry"), "read")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func handleS3BucketSettings(w http.ResponseWriter, r *http.Request) {
|
func handleS3BucketSettings(w http.ResponseWriter, r *http.Request) {
|
||||||
ak, _, defBucket, ok := authS3Console(r)
|
ak, _, defBucket, ok := authS3Console(r)
|
||||||
if !ok {
|
if !ok {
|
||||||
@@ -1713,7 +2188,7 @@ func handleS3CDNProxy(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
targetPath := "/" + bucket + "/" + key
|
targetPath := "/" + bucket + "/" + key
|
||||||
|
|
||||||
targetUrl, _ := url.Parse("http://127.0.0.1:9000")
|
targetUrl, _ := url.Parse("http://127.0.0.1:9010")
|
||||||
proxy := httputil.NewSingleHostReverseProxy(targetUrl)
|
proxy := httputil.NewSingleHostReverseProxy(targetUrl)
|
||||||
proxy.Director = func(req *http.Request) {
|
proxy.Director = func(req *http.Request) {
|
||||||
req.URL.Scheme = targetUrl.Scheme
|
req.URL.Scheme = targetUrl.Scheme
|
||||||
|
|||||||
+15
-2
@@ -367,6 +367,10 @@ func normalizeGitURL(rawURL string) string {
|
|||||||
if strings.Contains(u, "127.0.0.1:3000/source/") {
|
if strings.Contains(u, "127.0.0.1:3000/source/") {
|
||||||
u = strings.Replace(u, "127.0.0.1:3000/source/", "127.0.0.1:3000/", 1)
|
u = strings.Replace(u, "127.0.0.1:3000/source/", "127.0.0.1:3000/", 1)
|
||||||
}
|
}
|
||||||
|
if strings.Contains(u, "cosmos.linuxguy.space/source/") {
|
||||||
|
u = strings.Replace(u, "https://cosmos.linuxguy.space/source/", "http://127.0.0.1:3000/", 1)
|
||||||
|
u = strings.Replace(u, "http://cosmos.linuxguy.space/source/", "http://127.0.0.1:3000/", 1)
|
||||||
|
}
|
||||||
if strings.Contains(u, "vshno.linuxguy.space/source/") {
|
if strings.Contains(u, "vshno.linuxguy.space/source/") {
|
||||||
u = strings.Replace(u, "https://vshno.linuxguy.space/source/", "http://127.0.0.1:3000/", 1)
|
u = strings.Replace(u, "https://vshno.linuxguy.space/source/", "http://127.0.0.1:3000/", 1)
|
||||||
u = strings.Replace(u, "http://vshno.linuxguy.space/source/", "http://127.0.0.1:3000/", 1)
|
u = strings.Replace(u, "http://vshno.linuxguy.space/source/", "http://127.0.0.1:3000/", 1)
|
||||||
@@ -541,6 +545,9 @@ func handleOrbitConsole(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||||
|
w.Header().Set("Pragma", "no-cache")
|
||||||
|
w.Header().Set("Expires", "0")
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
data := map[string]interface{}{
|
data := map[string]interface{}{
|
||||||
"UserEmail": email,
|
"UserEmail": email,
|
||||||
@@ -1084,7 +1091,10 @@ func handleOrbitProxy(w http.ResponseWriter, r *http.Request, path string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if status != "running" {
|
if status != "running" {
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||||
|
w.Header().Set("Pragma", "no-cache")
|
||||||
|
w.Header().Set("Expires", "0")
|
||||||
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
fmt.Fprintf(w, `<!DOCTYPE html><html><body style="background:#090d16;color:#e2eaf2;font-family:sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;"><div style="text-align:center;"><h2 style="font-size:24px;">Application is %s</h2><p style="color:#64748b;">Please start the container from the Orbit console to access it.</p><a href="/orbit" style="display:inline-block;margin-top:16px;color:#38bdf8;text-decoration:none;padding:8px 16px;border:1px solid rgba(56,189,248,0.3);border-radius:8px;">Open Orbit Console</a></div></body></html>`, status)
|
fmt.Fprintf(w, `<!DOCTYPE html><html><body style="background:#090d16;color:#e2eaf2;font-family:sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;"><div style="text-align:center;"><h2 style="font-size:24px;">Application is %s</h2><p style="color:#64748b;">Please start the container from the Orbit console to access it.</p><a href="/orbit" style="display:inline-block;margin-top:16px;color:#38bdf8;text-decoration:none;padding:8px 16px;border:1px solid rgba(56,189,248,0.3);border-radius:8px;">Open Orbit Console</a></div></body></html>`, status)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@@ -1314,7 +1324,10 @@ func handleOrbitDomainRouteProxy(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if status != "running" || portNum <= 0 {
|
if status != "running" || portNum <= 0 {
|
||||||
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||||
|
w.Header().Set("Pragma", "no-cache")
|
||||||
|
w.Header().Set("Expires", "0")
|
||||||
|
w.Header().Set("Content-Type", "text/html; charset=utf-8")
|
||||||
fmt.Fprintf(w, `<!DOCTYPE html><html><body style="background:#090d16;color:#e2eaf2;font-family:sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;"><div style="text-align:center;"><h2>Application is %s</h2><p style="color:#64748b;">Start the container from the Orbit console to access it.</p><a href="/orbit" style="display:inline-block;margin-top:16px;color:#38bdf8;text-decoration:none;padding:8px 16px;border:1px solid rgba(56,189,248,0.3);border-radius:8px;">Open Orbit Console</a></div></body></html>`, status)
|
fmt.Fprintf(w, `<!DOCTYPE html><html><body style="background:#090d16;color:#e2eaf2;font-family:sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;"><div style="text-align:center;"><h2>Application is %s</h2><p style="color:#64748b;">Start the container from the Orbit console to access it.</p><a href="/orbit" style="display:inline-block;margin-top:16px;color:#38bdf8;text-decoration:none;padding:8px 16px;border:1px solid rgba(56,189,248,0.3);border-radius:8px;">Open Orbit Console</a></div></body></html>`, status)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
+834
-257
File diff suppressed because it is too large
Load Diff
+1209
-333
File diff suppressed because it is too large
Load Diff
+1232
-1325
File diff suppressed because it is too large
Load Diff
+679
-185
@@ -3,120 +3,516 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8"/>
|
<meta charset="UTF-8"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
<title>Sign In — Cosmos Storage</title>
|
<title>Sign In — Cosmos {{.Service}}</title>
|
||||||
<meta name="description" content="Sign in to your Cosmos Storage account."/>
|
<meta name="description" content="Sign in to your Cosmos {{.Service}} sovereign workspace."/>
|
||||||
<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="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.googleapis.com"/>
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
|
<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@300;400;500&family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet"/>
|
<link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@1&family=JetBrains+Mono:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet"/>
|
||||||
<style>
|
<style>
|
||||||
:root{--bg:#020308;--ink:#eef3f8;--dim:rgba(226,234,242,.55);--faint:rgba(226,234,242,.3);--line:rgba(226,234,242,.08);--ok:#43e5a0;--ac:143,216,255;--mono:'JetBrains Mono',ui-monospace,monospace;--disp:'Space Grotesk',sans-serif;--serif:'Instrument Serif',serif;--pad:clamp(24px,5vw,84px);--ez:cubic-bezier(.16,1,.3,1)}
|
:root {
|
||||||
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
|
--bg: #020308;
|
||||||
html,body{min-height:100%}
|
--ink: #eef3f8;
|
||||||
body{font-family:var(--disp);background:var(--bg);color:var(--ink);min-height:100vh;min-height:100svh;display:flex;flex-direction:column;overflow-x:hidden;-webkit-font-smoothing:antialiased;animation:bootIn 1s ease both}
|
--dim: rgba(226, 234, 242, 0.58);
|
||||||
@keyframes bootIn{from{opacity:0}}
|
--faint: rgba(226, 234, 242, 0.32);
|
||||||
::selection{background:rgba(var(--ac),.3)}
|
--line: rgba(226, 234, 242, 0.08);
|
||||||
a:focus-visible,button:focus-visible{outline:1px solid rgba(238,243,248,.55);outline-offset:4px;border-radius:4px}
|
--line-strong: rgba(226, 234, 242, 0.16);
|
||||||
#sky{position:fixed;inset:0;z-index:0;pointer-events:none}
|
--ok: #43e5a0;
|
||||||
.grain{position:fixed;inset:-8%;z-index:2;pointer-events:none;opacity:.05;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.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-size:180px 180px;animation:grain .9s steps(3) infinite}
|
--ac: 143, 216, 255;
|
||||||
@keyframes grain{0%,100%{transform:translate(0,0)}33%{transform:translate(-1.4%,1%)}66%{transform:translate(1%,-1.4%)}}
|
--ac-rgb: 143, 216, 255;
|
||||||
.vig{position:fixed;inset:0;z-index:2;pointer-events:none;background:radial-gradient(ellipse at 50% 42%,transparent 55%,rgba(1,2,8,.55) 100%)}
|
--mono: 'JetBrains Mono', ui-monospace, monospace;
|
||||||
.authbar{position:relative;z-index:10;display:flex;justify-content:space-between;align-items:center;padding:28px var(--pad) 12px;font-family:var(--mono);font-size:9.5px;letter-spacing:.22em;text-transform:uppercase;animation:softUp .9s var(--ez) both}
|
--disp: 'Space Grotesk', -apple-system, sans-serif;
|
||||||
.authbar a{color:var(--dim);text-decoration:none;transition:color .25s}
|
--serif: 'Instrument Serif', Georgia, serif;
|
||||||
.authbar a:hover{color:#fff}
|
--pad: clamp(24px, 5vw, 72px);
|
||||||
.authbar .svc{color:rgba(226,234,242,.3);display:flex;align-items:center;gap:10px}
|
--ez: cubic-bezier(0.16, 1, 0.3, 1);
|
||||||
.authbar .svc::before{content:'';width:5px;height:5px;border-radius:50%;background:var(--ok);box-shadow:0 0 8px var(--ok);animation:dotPulse 2.4s ease infinite}
|
}
|
||||||
@keyframes dotPulse{0%,100%{opacity:1}50%{opacity:.35}}
|
|
||||||
@keyframes softUp{from{opacity:0;transform:translateY(20px)}}
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
.auth-shell{position:relative;z-index:10;flex:1;display:grid;place-items:center;padding:20px var(--pad) 60px}
|
html, body { min-height: 100%; }
|
||||||
.cardbox{width:100%;display:flex;justify-content:center;animation:softUp .9s .15s var(--ez) both}
|
|
||||||
.card{width:100%;max-width:440px;background:rgba(6,10,20,.72);border:1px solid var(--line);border-radius:18px;padding:44px 40px 40px;backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px);box-shadow:0 30px 80px rgba(0,0,4,.55);position:relative;transition:transform .5s var(--ez);will-change:transform}
|
body {
|
||||||
.cnr{position:absolute;width:16px;height:16px;border:1px solid rgba(var(--ac),.4);transition:border-color .35s,width .35s var(--ez),height .35s var(--ez)}
|
font-family: var(--disp);
|
||||||
.c1{top:-1px;left:-1px;border-right:0;border-bottom:0;border-top-left-radius:6px}
|
background: var(--bg);
|
||||||
.c2{top:-1px;right:-1px;border-left:0;border-bottom:0;border-top-right-radius:6px}
|
color: var(--ink);
|
||||||
.c3{bottom:-1px;left:-1px;border-right:0;border-top:0;border-bottom-left-radius:6px}
|
min-height: 100vh;
|
||||||
.c4{bottom:-1px;right:-1px;border-left:0;border-top:0;border-bottom-right-radius:6px}
|
min-height: 100svh;
|
||||||
.card:focus-within .cnr{border-color:rgba(var(--ac),.95);width:22px;height:22px;box-shadow:0 0 12px rgba(var(--ac),.15)}
|
display: flex;
|
||||||
.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--ink);margin-bottom:34px}
|
flex-direction: column;
|
||||||
.brand .mark{width:34px;height:34px;animation:markSpin 16s linear infinite}
|
overflow-x: hidden;
|
||||||
@keyframes markSpin{to{transform:rotate(360deg)}}
|
-webkit-font-smoothing: antialiased;
|
||||||
.brand b{font-size:18px;font-weight:600;letter-spacing:-.02em}
|
position: relative;
|
||||||
.brand b em{font-family:var(--serif);font-style:italic;font-weight:400;color:rgb(var(--ac))}
|
selection-background: rgba(var(--ac-rgb), 0.3);
|
||||||
.h-t{font-size:27px;font-weight:600;letter-spacing:-.03em;margin-bottom:8px}
|
}
|
||||||
.h-s{font-size:14.5px;color:var(--dim);margin-bottom:32px}
|
|
||||||
.error-box{background:rgba(248,113,113,.08);border:1px solid rgba(248,113,113,.3);border-radius:10px;padding:12px 16px;margin-bottom:22px;font-size:13.5px;color:#f87171;font-weight:500;display:none}
|
::selection { background: rgba(var(--ac-rgb), 0.3); color: #fff; }
|
||||||
.error-box.visible{display:block}
|
|
||||||
.fg{margin-bottom:20px}
|
a:focus-visible, button:focus-visible, input:focus-visible {
|
||||||
.fl{display:block;font-family:var(--mono);font-size:9.5px;font-weight:500;letter-spacing:.18em;text-transform:uppercase;color:rgba(226,234,242,.5);margin-bottom:9px}
|
outline: 1px solid rgba(var(--ac-rgb), 0.7);
|
||||||
.fc{width:100%;background:rgba(226,234,242,.03);border:1px solid rgba(226,234,242,.1);color:#fff;padding:13px 16px;border-radius:11px;font-size:14.5px;font-weight:500;font-family:inherit;outline:none;transition:border-color .25s,box-shadow .25s,background .25s}
|
outline-offset: 3px;
|
||||||
.fc::placeholder{color:rgba(226,234,242,.28)}
|
border-radius: 6px;
|
||||||
.fc:focus{border-color:rgba(var(--ac),.55);box-shadow:0 0 0 3px rgba(var(--ac),.14);background:rgba(226,234,242,.05)}
|
}
|
||||||
.pwd-wrap{position:relative}
|
|
||||||
.pwd-wrap .fc{padding-right:48px}
|
/* ── 3D Viewport & Atmospheric Layers ── */
|
||||||
.pwd-toggle{position:absolute;right:12px;top:50%;transform:translateY(-50%);background:none;border:none;cursor:pointer;color:rgba(226,234,242,.35);display:flex;padding:6px;transition:color .2s}
|
#webgl-bg {
|
||||||
.pwd-toggle:hover{color:var(--ink)}
|
position: fixed;
|
||||||
.pwd-toggle svg{width:18px;height:18px}
|
inset: 0;
|
||||||
.pwd-toggle .slash{display:none}
|
width: 100%;
|
||||||
.pwd-toggle.shown .slash{display:block}
|
height: 100%;
|
||||||
.caps-warn{display:none;font-family:var(--mono);font-size:9.5px;letter-spacing:.16em;color:#fbbf24;margin-top:8px;align-items:center;gap:7px;text-transform:uppercase}
|
z-index: 1;
|
||||||
.caps-warn.on{display:flex}
|
pointer-events: none;
|
||||||
.caps-warn i{width:5px;height:5px;background:#fbbf24;border-radius:1px;box-shadow:0 0 8px #fbbf24;flex:none}
|
}
|
||||||
.btn-submit{width:100%;padding:14px 24px;border-radius:11px;border:none;background:#fff;color:#04060d;font-family:inherit;font-size:14.5px;font-weight:700;cursor:pointer;letter-spacing:-.01em;box-shadow:0 8px 34px rgba(255,255,255,.1);transition:all .25s;margin-top:6px}
|
|
||||||
.btn-submit:hover{box-shadow:0 14px 54px rgba(255,255,255,.2)}
|
.noise-overlay {
|
||||||
.btn-submit:active{transform:scale(.985)}
|
position: fixed;
|
||||||
.btn-submit:disabled{opacity:.75;cursor:progress}
|
inset: -10%;
|
||||||
.auth-footer{text-align:center;margin-top:26px;font-size:13.5px;color:rgba(226,234,242,.4)}
|
width: 120%;
|
||||||
.auth-footer a{color:rgb(var(--ac));text-decoration:none;font-weight:600;transition:color .2s}
|
height: 120%;
|
||||||
.auth-footer a:hover{color:#fff}
|
z-index: 2;
|
||||||
.authfoot{position:relative;z-index:10;padding:20px var(--pad);display:flex;justify-content:center;font-family:var(--mono);font-size:9px;letter-spacing:.22em;color:rgba(226,234,242,.22);text-transform:uppercase;gap:18px;flex-wrap:wrap}
|
pointer-events: none;
|
||||||
@media(max-width:480px){.card{padding:36px 26px 32px}.authbar{padding-top:24px}}
|
opacity: 0.045;
|
||||||
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
.radial-vignette {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 2;
|
||||||
|
pointer-events: none;
|
||||||
|
background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(2, 3, 8, 0.7) 85%, #020308 100%);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Top Navigation Bar ── */
|
||||||
|
.authbar {
|
||||||
|
position: relative;
|
||||||
|
z-index: 10;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
padding: 28px var(--pad) 12px;
|
||||||
|
font-family: var(--mono);
|
||||||
|
font-size: 10px;
|
||||||
|
letter-spacing: 0.18em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
.authbar a.back-link {
|
||||||
|
color: var(--dim);
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
transition: color 0.25s, transform 0.25s var(--ez);
|
||||||
|
}
|
||||||
|
|
||||||
|
.authbar a.back-link:hover {
|
||||||
|
color: #fff;
|
||||||
|
transform: translateX(-3px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.authbar .channel-badge {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 9px;
|
||||||
|
padding: 5px 12px;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: rgba(255, 255, 255, 0.03);
|
||||||
|
border: 1px solid var(--line);
|
||||||
|
color: var(--dim);
|
||||||
|
font-size: 9.5px;
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.authbar .pulse-dot {
|
||||||
|
width: 5px;
|
||||||
|
height: 5px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: var(--ok);
|
||||||
|
box-shadow: 0 0 10px var(--ok);
|
||||||
|
animation: dotPulse 2.4s ease infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes dotPulse {
|
||||||
|
0%, 100% { opacity: 1; transform: scale(1); }
|
||||||
|
50% { opacity: 0.4; transform: scale(0.85); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Main Auth Card Container ── */
|
||||||
|
.auth-shell {
|
||||||
|
position: relative;
|
||||||
|
z-index: 10;
|
||||||
|
flex: 1;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
padding: 20px var(--pad) 50px;
|
||||||
|
perspective: 1200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-wrapper {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 440px;
|
||||||
|
will-change: transform;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Signature Stuudio/Jockey Floating 3D Card with Conic Edge Lighting ── */
|
||||||
|
.card-3d {
|
||||||
|
position: relative;
|
||||||
|
border-radius: 20px;
|
||||||
|
padding: 44px 38px 40px;
|
||||||
|
background: linear-gradient(145deg, rgba(10, 15, 28, 0.82), rgba(4, 7, 14, 0.88)) 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.05);
|
||||||
|
transform-style: preserve-3d;
|
||||||
|
transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-3d:hover {
|
||||||
|
box-shadow: 0 45px 100px rgba(0, 0, 0, 0.75), 0 0 60px rgba(143, 216, 255, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Corner Reticle Accents */
|
||||||
|
.cnr {
|
||||||
|
position: absolute;
|
||||||
|
width: 14px;
|
||||||
|
height: 14px;
|
||||||
|
border: 1px solid rgba(var(--ac-rgb), 0.35);
|
||||||
|
pointer-events: none;
|
||||||
|
transition: border-color 0.3s, width 0.3s var(--ez), height 0.3s var(--ez);
|
||||||
|
}
|
||||||
|
.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; }
|
||||||
|
|
||||||
|
.card-3d:focus-within .cnr {
|
||||||
|
border-color: rgba(var(--ac-rgb), 0.95);
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
box-shadow: 0 0 10px rgba(var(--ac-rgb), 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Brand Mark ── */
|
||||||
|
.brand {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 12px;
|
||||||
|
text-decoration: none;
|
||||||
|
color: var(--ink);
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-icon {
|
||||||
|
width: 34px;
|
||||||
|
height: 34px;
|
||||||
|
animation: markSpin 24s linear infinite;
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes markSpin {
|
||||||
|
to { transform: rotate(360deg); }
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-text {
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.brand-text em {
|
||||||
|
font-family: var(--serif);
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 400;
|
||||||
|
color: rgb(var(--ac-rgb));
|
||||||
|
margin-left: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Headings */
|
||||||
|
.h-title {
|
||||||
|
font-size: 26px;
|
||||||
|
font-weight: 600;
|
||||||
|
letter-spacing: -0.03em;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.h-sub {
|
||||||
|
font-size: 14px;
|
||||||
|
color: var(--dim);
|
||||||
|
margin-bottom: 28px;
|
||||||
|
line-height: 1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Error Alert Box */
|
||||||
|
.error-box {
|
||||||
|
background: rgba(248, 113, 113, 0.08);
|
||||||
|
border: 1px solid rgba(248, 113, 113, 0.3);
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 12px 16px;
|
||||||
|
margin-bottom: 22px;
|
||||||
|
font-size: 13.5px;
|
||||||
|
color: #f87171;
|
||||||
|
font-weight: 500;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.error-box.visible { display: block; }
|
||||||
|
|
||||||
|
/* ── Form Inputs ── */
|
||||||
|
.form-group {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-label {
|
||||||
|
display: block;
|
||||||
|
font-family: var(--mono);
|
||||||
|
font-size: 9.5px;
|
||||||
|
font-weight: 500;
|
||||||
|
letter-spacing: 0.16em;
|
||||||
|
text-transform: uppercase;
|
||||||
|
color: rgba(226, 234, 242, 0.6);
|
||||||
|
margin-bottom: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-ctrl {
|
||||||
|
width: 100%;
|
||||||
|
background: rgba(226, 234, 242, 0.03);
|
||||||
|
border: 1px solid var(--line-strong);
|
||||||
|
color: #fff;
|
||||||
|
padding: 13px 16px;
|
||||||
|
border-radius: 11px;
|
||||||
|
font-size: 14.5px;
|
||||||
|
font-weight: 500;
|
||||||
|
font-family: inherit;
|
||||||
|
outline: none;
|
||||||
|
transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-ctrl::placeholder {
|
||||||
|
color: rgba(226, 234, 242, 0.28);
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-ctrl:focus {
|
||||||
|
border-color: rgba(var(--ac-rgb), 0.65);
|
||||||
|
box-shadow: 0 0 0 3px rgba(var(--ac-rgb), 0.15);
|
||||||
|
background: rgba(226, 234, 242, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pwd-wrap {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pwd-wrap .input-ctrl {
|
||||||
|
padding-right: 48px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pwd-toggle {
|
||||||
|
position: absolute;
|
||||||
|
right: 12px;
|
||||||
|
top: 50%;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
color: rgba(226, 234, 242, 0.38);
|
||||||
|
display: flex;
|
||||||
|
padding: 6px;
|
||||||
|
transition: color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.pwd-toggle:hover {
|
||||||
|
color: var(--ink);
|
||||||
|
}
|
||||||
|
|
||||||
|
.pwd-toggle svg { width: 18px; height: 18px; }
|
||||||
|
.pwd-toggle .slash { display: none; }
|
||||||
|
.pwd-toggle.shown .slash { display: block; }
|
||||||
|
|
||||||
|
.caps-warn {
|
||||||
|
display: none;
|
||||||
|
font-family: var(--mono);
|
||||||
|
font-size: 9.5px;
|
||||||
|
letter-spacing: 0.14em;
|
||||||
|
color: #fbbf24;
|
||||||
|
margin-top: 8px;
|
||||||
|
align-items: center;
|
||||||
|
gap: 7px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
.caps-warn.on { display: flex; }
|
||||||
|
.caps-warn i {
|
||||||
|
width: 5px;
|
||||||
|
height: 5px;
|
||||||
|
background: #fbbf24;
|
||||||
|
border-radius: 1px;
|
||||||
|
box-shadow: 0 0 8px #fbbf24;
|
||||||
|
flex: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.forgot-link-row {
|
||||||
|
text-align: right;
|
||||||
|
margin-top: 9px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.forgot-link-row a {
|
||||||
|
font-size: 12.5px;
|
||||||
|
color: rgba(226, 234, 242, 0.45);
|
||||||
|
text-decoration: none;
|
||||||
|
font-family: var(--mono);
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
transition: color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.forgot-link-row a:hover {
|
||||||
|
color: rgb(var(--ac-rgb));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Magnetic Submit Button ── */
|
||||||
|
.btn-submit {
|
||||||
|
width: 100%;
|
||||||
|
padding: 14px 24px;
|
||||||
|
border-radius: 11px;
|
||||||
|
border: none;
|
||||||
|
background: #fff;
|
||||||
|
color: #04060d;
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: 14.5px;
|
||||||
|
font-weight: 700;
|
||||||
|
cursor: pointer;
|
||||||
|
letter-spacing: -0.01em;
|
||||||
|
box-shadow: 0 8px 30px rgba(255, 255, 255, 0.12);
|
||||||
|
transition: transform 0.2s var(--ez), box-shadow 0.25s, opacity 0.25s;
|
||||||
|
margin-top: 6px;
|
||||||
|
position: relative;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-submit:hover {
|
||||||
|
box-shadow: 0 12px 40px rgba(255, 255, 255, 0.22);
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-submit:active {
|
||||||
|
transform: scale(0.985);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-submit:disabled {
|
||||||
|
opacity: 0.75;
|
||||||
|
cursor: wait;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Auth Footer ── */
|
||||||
|
.auth-footer {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 26px;
|
||||||
|
font-size: 13.5px;
|
||||||
|
color: rgba(226, 234, 242, 0.42);
|
||||||
|
}
|
||||||
|
|
||||||
|
.auth-footer a {
|
||||||
|
color: rgb(var(--ac-rgb));
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: 600;
|
||||||
|
margin-left: 4px;
|
||||||
|
transition: color 0.2s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.auth-footer a:hover {
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ── Page Footer ── */
|
||||||
|
.authfoot {
|
||||||
|
position: relative;
|
||||||
|
z-index: 10;
|
||||||
|
padding: 20px var(--pad);
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
font-family: var(--mono);
|
||||||
|
font-size: 9px;
|
||||||
|
letter-spacing: 0.2em;
|
||||||
|
color: rgba(226, 234, 242, 0.25);
|
||||||
|
text-transform: uppercase;
|
||||||
|
gap: 18px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 480px) {
|
||||||
|
.card-3d { padding: 36px 24px 30px; }
|
||||||
|
.authbar { padding-top: 20px; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
*, *::before, *::after {
|
||||||
|
animation-duration: 0.01ms !important;
|
||||||
|
transition-duration: 0.01ms !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<canvas id="sky" aria-hidden="true"></canvas>
|
|
||||||
<div class="grain" aria-hidden="true"></div>
|
<!-- Three.js Ambient 3D Starfield & Orbital Precession Viewport -->
|
||||||
<div class="vig" aria-hidden="true"></div>
|
<div id="webgl-bg" aria-hidden="true"></div>
|
||||||
|
<div class="noise-overlay" aria-hidden="true"></div>
|
||||||
|
<div class="radial-vignette" aria-hidden="true"></div>
|
||||||
|
|
||||||
<header class="authbar">
|
<header class="authbar">
|
||||||
<a href="/">← Cosmos</a>
|
<a href="/" class="back-link">← Cosmos Core</a>
|
||||||
<span class="svc"><span data-scr>SECURE CHANNEL · {{.Service}}</span></span>
|
<div class="channel-badge">
|
||||||
|
<span class="pulse-dot"></span>
|
||||||
|
<span data-scr>SECURE CHANNEL · {{.Service}}</span>
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<main class="auth-shell">
|
<main class="auth-shell">
|
||||||
<div class="cardbox">
|
<div class="card-wrapper" id="cardWrapper">
|
||||||
<div class="card" id="card">
|
<div class="card-3d" id="card">
|
||||||
<i class="cnr c1"></i><i class="cnr c2"></i><i class="cnr c3"></i><i class="cnr c4"></i>
|
<i class="cnr c1"></i><i class="cnr c2"></i><i class="cnr c3"></i><i class="cnr c4"></i>
|
||||||
|
|
||||||
<a href="/" class="brand">
|
<a href="/" class="brand">
|
||||||
<svg class="mark" viewBox="0 0 34 34" aria-hidden="true"><ellipse cx="17" cy="17" rx="14.5" ry="6" fill="none" stroke="rgba(238,243,248,.55)" stroke-width="1" transform="rotate(-24 17 17)"/><circle cx="17" cy="17" r="4.4" fill="#eef3f8"/><circle cx="27.4" cy="12.2" r="1.8" fill="rgb(var(--ac))"/></svg>
|
<svg class="brand-icon" viewBox="0 0 34 34" aria-hidden="true">
|
||||||
<b>Cosmos <em>Oort</em></b>
|
<ellipse cx="17" cy="17" rx="14.5" ry="6" fill="none" stroke="rgba(238,243,248,.55)" stroke-width="1.2" transform="rotate(-24 17 17)"/>
|
||||||
|
<circle cx="17" cy="17" r="4.4" fill="#eef3f8"/>
|
||||||
|
<circle cx="27.4" cy="12.2" r="1.8" fill="rgb(var(--ac-rgb))"/>
|
||||||
|
</svg>
|
||||||
|
<span class="brand-text">Cosmos <em>{{.Service}}</em></span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<div class="h-t">Welcome back</div>
|
<h1 class="h-title">Welcome back</h1>
|
||||||
<div class="h-s">Sign in to your account to continue</div>
|
<p class="h-sub">Sign in to your sovereign enclave to continue</p>
|
||||||
|
|
||||||
{{if .Error}}
|
{{if .Error}}
|
||||||
<div class="error-box visible">{{.Error}}</div>
|
<div class="error-box visible">{{.Error}}</div>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
<form action="/{{.Service}}/login" method="POST" id="loginForm">
|
<form action="/{{.Service}}/login" method="POST" id="loginForm">
|
||||||
<div class="fg">
|
<div class="form-group">
|
||||||
<label class="fl" for="lg-email">Username or Email</label>
|
<label class="form-label" for="lg-email">Username or Email</label>
|
||||||
<input type="text" id="lg-email" name="email" class="fc" placeholder="janedoe or [email protected]" required autocomplete="username"/>
|
<input type="text" id="lg-email" name="email" class="input-ctrl" placeholder="janedoe or [email protected]" required autocomplete="username"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fg">
|
<div class="form-group">
|
||||||
<label class="fl" for="pwd">Password</label>
|
<label class="form-label" for="pwd">Password</label>
|
||||||
<div class="pwd-wrap">
|
<div class="pwd-wrap">
|
||||||
<input type="password" name="password" id="pwd" class="fc" placeholder="••••••••" required autocomplete="current-password"/>
|
<input type="password" name="password" id="pwd" class="input-ctrl" placeholder="••••••••" required autocomplete="current-password"/>
|
||||||
<button type="button" class="pwd-toggle" onclick="togglePwd('pwd')" aria-label="Toggle password visibility">
|
<button type="button" class="pwd-toggle" onclick="togglePwd('pwd')" aria-label="Toggle password visibility">
|
||||||
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/><line class="slash" x1="4" y1="4" x2="20" y2="20" stroke-linecap="round"/></svg>
|
<svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">
|
||||||
|
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
|
||||||
|
<circle cx="12" cy="12" r="3"/>
|
||||||
|
<line class="slash" x1="4" y1="4" x2="20" y2="20" stroke-linecap="round"/>
|
||||||
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="caps-warn"><i></i>Caps Lock is on</div>
|
<div class="caps-warn"><i></i>Caps Lock is on</div>
|
||||||
<div style="text-align:right;margin-top:10px;">
|
<div class="forgot-link-row">
|
||||||
<a href="/{{.Service}}/forgot-password" style="font-size:13px;color:rgba(226,234,242,.45);text-decoration:none;font-family:var(--mono);letter-spacing:.06em;transition:color .2s;" onmouseover="this.style.color='rgb(var(--ac))'" onmouseout="this.style.color='rgba(226,234,242,.45)'">Forgot password?</a>
|
<a href="/{{.Service}}/forgot-password">Forgot password?</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -132,95 +528,183 @@ a:focus-visible,button:focus-visible{outline:1px solid rgba(238,243,248,.55);out
|
|||||||
|
|
||||||
<footer class="authfoot">
|
<footer class="authfoot">
|
||||||
<span>51.4778° N · 0.0015° W</span>
|
<span>51.4778° N · 0.0015° W</span>
|
||||||
<span>Self-hosted & private</span>
|
<span>Zero Cloud Leakage</span>
|
||||||
|
<span>Sovereign Enclave</span>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
<!-- Local Zero-Latency Three.js Engine -->
|
||||||
|
<script src="/three.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
/* ── shared deterministic noise ── */
|
/* ══ 1. THREE.JS 3D CELESTIAL BACKGROUND ══ */
|
||||||
function h2(x,y,s){var h=Math.imul(x,374761393)^Math.imul(y,668265263)^Math.imul(s,974711);h=Math.imul(h^h>>>13,1274126177);return((h^h>>>16)>>>0)/4294967296}
|
(function(){
|
||||||
function vn(x,y,s){var ix=Math.floor(x),iy=Math.floor(y),fx=x-ix,fy=y-iy,u=fx*fx*(3-2*fx),v=fy*fy*(3-2*fy),a=h2(ix,iy,s),b=h2(ix+1,iy,s),c=h2(ix,iy+1,s),d=h2(ix+1,iy+1,s);return a+(b-a)*u+(c-a)*v+(a-b-c+d)*u*v}
|
'use strict';
|
||||||
function fbm(x,y,o,s){var a=1,S=0,n=0;for(var i=0;i<o;i++){S+=a*vn(x,y,s+i*131);n+=a;a*=.5;x*=2;y*=2}return S/n}
|
var container = document.getElementById('webgl-bg');
|
||||||
var RMQ=matchMedia('(prefers-reduced-motion: reduce)').matches,DPRQ=Math.min(2,devicePixelRatio||1);
|
if(!window.THREE || !container) return;
|
||||||
|
|
||||||
/* ══ SKY ENGINE ══ */
|
var scene = new THREE.Scene();
|
||||||
(function(){'use strict';
|
var camera = new THREE.PerspectiveCamera(55, window.innerWidth / window.innerHeight, 0.1, 1000);
|
||||||
var cv=document.getElementById('sky');if(!cv)return;
|
camera.position.z = 28;
|
||||||
var cx=cv.getContext('2d'),TAU=Math.PI*2,RM=RMQ,DPR=DPRQ;
|
|
||||||
var CFG={density:420,tint:[.82,.95,1.12],planet:[.15,.86,.13]};
|
var renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true, powerPreference: 'high-performance' });
|
||||||
var W,H,stars=[],meteors=[],comets=[],neb=null,nextMet=3200,nextCom=9000;
|
renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
|
||||||
var m={x:.5,y:.5,sx:.5,sy:.5};
|
renderer.setSize(window.innerWidth, window.innerHeight);
|
||||||
function resize(){W=innerWidth;H=innerHeight;cv.width=W*DPR;cv.height=H*DPR;cv.style.width=W+'px';cv.style.height=H+'px';cx.setTransform(DPR,0,0,DPR,0,0)}
|
container.appendChild(renderer.domElement);
|
||||||
function buildStars(){stars=[];var n=Math.round(CFG.density*W*H/(1440*800));for(var i=0;i<n;i++){var r=Math.pow(Math.random(),2.3)*1.9+.28,roll=Math.random();stars.push({x:Math.random(),y:Math.random(),r:r,p:.012+(r/2.2)*.06,a:.2+Math.random()*.7,tw:Math.random()*TAU,ts:.4+Math.random()*1.9,c:roll<.6?[255,255,255]:roll<.78?[201,215,255]:roll<.92?[255,238,220]:[255,208,176]})}}
|
|
||||||
function makeNeb(){var w=460,h=260,c=document.createElement('canvas');c.width=w;c.height=h;var g=c.getContext('2d'),im=g.createImageData(w,h),d=im.data,T=CFG.tint,nx=.749,ny=-.663;
|
// Deep Starfield Particle Nodes
|
||||||
for(var y=0;y<h;y++)for(var x=0;x<w;x++){var i=(y*w+x)*4,band=Math.exp(-Math.pow(((x/w-.18)*nx+(y/h-.86)*ny)/.16,2)),n1=fbm(x*.012,y*.012,5,7),mm=fbm(x*.022,y*.022,3,44),cl=(n1-.42)/.36;cl=cl<0?0:cl>1?1:cl;cl=cl*cl*(3-2*cl);var den=Math.min(1,cl*(.3+band*.85)),warm=mm*mm*mm,core=den>.55?(den-.55)/.45:0;
|
var starCount = 1400;
|
||||||
d[i]=Math.min(255,(18+warm*46+core*10)*T[0]);d[i+1]=Math.min(255,(30+mm*28+core*40)*T[1]);d[i+2]=Math.min(255,(66+mm*40+core*58)*T[2]);d[i+3]=Math.min(255,den*210)}
|
var starGeo = new THREE.BufferGeometry();
|
||||||
g.putImageData(im,0,0);return c}
|
var starPos = new Float32Array(starCount * 3);
|
||||||
function drawNeb(ox,oy,t){cx.globalCompositeOperation='screen';var s0=Math.max(W/neb.width,H/neb.height);
|
var starColors = new Float32Array(starCount * 3);
|
||||||
cx.globalAlpha=.32;cx.save();cx.translate(W/2-ox*34+Math.sin(t*5e-5)*40,H/2-oy*20+Math.cos(t*4e-5)*24);cx.drawImage(neb,-neb.width*s0*.92,-neb.height*s0*.92,neb.width*s0*1.85,neb.height*s0*1.85);cx.restore();
|
|
||||||
cx.globalAlpha=.22;cx.save();cx.translate(W/2-ox*80+Math.cos(t*4e-5)*34,H/2-oy*46+Math.sin(t*6e-5)*26);cx.rotate(.55);cx.drawImage(neb,-neb.width*s0*1.6,-neb.height*s0*1.6,neb.width*s0*3.2,neb.height*s0*3.2);cx.restore();
|
var colA = new THREE.Color(0x8fd9ff);
|
||||||
cx.globalAlpha=1;cx.globalCompositeOperation='source-over'}
|
var colB = new THREE.Color(0xffffff);
|
||||||
function drawPlanet(ox,oy){var P=CFG.planet,px=W*P[0]-ox*30,py=H*P[1]-oy*18,r=Math.min(W,H)*P[2];
|
var colC = new THREE.Color(0x43e5a0);
|
||||||
var g=cx.createRadialGradient(px-r*.3,py-r*.35,r*.1,px,py,r);
|
|
||||||
g.addColorStop(0,'rgba(52,70,102,.15)');g.addColorStop(.7,'rgba(22,34,60,.07)');g.addColorStop(1,'rgba(10,16,34,0)');
|
for(var i = 0; i < starCount; i++){
|
||||||
cx.fillStyle=g;cx.beginPath();cx.arc(px,py,r,0,TAU);cx.fill();
|
var i3 = i * 3;
|
||||||
cx.strokeStyle='rgba(190,212,240,.14)';cx.lineWidth=1;cx.beginPath();cx.arc(px,py,r-.5,Math.PI*1.02,Math.PI*1.48);cx.stroke();
|
starPos[i3] = (Math.random() - 0.5) * 80;
|
||||||
cx.save();cx.translate(px,py);cx.rotate(-.44);cx.scale(1,.3);
|
starPos[i3 + 1] = (Math.random() - 0.5) * 60;
|
||||||
for(var i=0;i<2;i++){cx.beginPath();cx.arc(0,0,r*(1.55+i*.35),0,TAU);cx.strokeStyle='rgba(150,180,225,'+(.07-i*.03)+')';cx.lineWidth=5+i*4;cx.stroke()}cx.restore()}
|
starPos[i3 + 2] = (Math.random() - 0.5) * 50 - 5;
|
||||||
function spawnMeteor(){var ang=.5+Math.random()*.7,dir=Math.random()<.5?1:-1;meteors.push({x:Math.random()*1.1*W-.05*W,y:Math.random()*.45*H-.05*H,dx:Math.cos(ang)*dir,dy:Math.sin(ang),sp:430+Math.random()*390,dur:.8+Math.random()*.55,life:0,len:60+Math.random()*90})}
|
|
||||||
function spawnComet(){var fr=Math.random()<.55;comets.push({x:fr?W+170:-170,y:Math.random()*.55*H+.05*H,vx:(fr?-1:1)*(48+Math.random()*57),vy:-22+Math.random()*56,a:0,ph:0,core:1.5+Math.random()*1.1,tail:[]})}
|
var roll = Math.random();
|
||||||
function drawMeteors(dt){cx.globalCompositeOperation='lighter';
|
var c = roll < 0.6 ? colB : (roll < 0.85 ? colA : colC);
|
||||||
for(var i=meteors.length-1;i>=0;i--){var m=meteors[i];m.life+=dt;var f=m.life/m.dur;
|
starColors[i3] = c.r;
|
||||||
if(f>=1){meteors.splice(i,1);continue}
|
starColors[i3 + 1] = c.g;
|
||||||
var a=Math.sin(Math.PI*f)*.9,hx=m.x+m.dx*m.sp*m.life,hy=m.y+m.dy*m.sp*m.life,tx=hx-m.dx*m.len,ty=hy-m.dy*m.len;
|
starColors[i3 + 2] = c.b;
|
||||||
var g=cx.createLinearGradient(tx,ty,hx,hy);g.addColorStop(0,'rgba(180,205,255,0)');g.addColorStop(1,'rgba(220,235,255,'+a+')');
|
}
|
||||||
cx.strokeStyle=g;cx.lineWidth=1.4;cx.beginPath();cx.moveTo(tx,ty);cx.lineTo(hx,hy);cx.stroke();
|
starGeo.setAttribute('position', new THREE.BufferAttribute(starPos, 3));
|
||||||
cx.fillStyle='rgba(255,255,255,'+a+')';cx.beginPath();cx.arc(hx,hy,1.1,0,TAU);cx.fill()}
|
starGeo.setAttribute('color', new THREE.BufferAttribute(starColors, 3));
|
||||||
cx.globalCompositeOperation='source-over'}
|
|
||||||
function drawComets(dt){cx.globalCompositeOperation='lighter';
|
var starMat = new THREE.PointsMaterial({
|
||||||
for(var i=comets.length-1;i>=0;i--){var c=comets[i];
|
size: 0.18,
|
||||||
if(c.ph===0){c.a=Math.min(1,c.a+dt*.5);if(c.a>=1)c.ph=1}
|
vertexColors: true,
|
||||||
else if(c.ph===1){if(c.x<-260||c.x>W+260||c.y<-260||c.y>H+260)c.ph=2}
|
transparent: true,
|
||||||
else{c.a=Math.max(0,c.a-dt*.35);if(c.a<=0){comets.splice(i,1);continue}}
|
opacity: 0.75,
|
||||||
c.x+=c.vx*dt;c.y+=c.vy*dt;c.tail.push({x:c.x,y:c.y});if(c.tail.length>130)c.tail.shift();
|
blending: THREE.AdditiveBlending
|
||||||
var n=c.tail.length;
|
});
|
||||||
for(var j=0;j<n-1;j++){var f=j/n,al=f*f*c.a*.5;
|
var starField = new THREE.Points(starGeo, starMat);
|
||||||
cx.strokeStyle='rgba(168,216,255,'+al+')';cx.lineWidth=Math.max(.3,f*c.core*2.6);
|
scene.add(starField);
|
||||||
cx.beginPath();cx.moveTo(c.tail[j].x,c.tail[j].y);cx.lineTo(c.tail[j+1].x,c.tail[j+1].y);cx.stroke();
|
|
||||||
if(f>.6){cx.strokeStyle='rgba(255,255,255,'+((f-.6)/.4*c.a*.32)+')';cx.lineWidth=Math.max(.2,f*c.core*.5);cx.beginPath();cx.moveTo(c.tail[j].x,c.tail[j].y);cx.lineTo(c.tail[j+1].x,c.tail[j+1].y);cx.stroke()}}
|
// Subtle 3D Gyroscopic Rings Floating in Celestial Horizon
|
||||||
var g=cx.createRadialGradient(c.x,c.y,0,c.x,c.y,c.core*7);
|
var ringGroup = new THREE.Group();
|
||||||
g.addColorStop(0,'rgba(255,255,255,'+c.a+')');g.addColorStop(.3,'rgba(178,226,255,'+c.a*.7+')');g.addColorStop(1,'rgba(0,0,0,0)');
|
scene.add(ringGroup);
|
||||||
cx.fillStyle=g;cx.beginPath();cx.arc(c.x,c.y,c.core*7,0,TAU);cx.fill();
|
|
||||||
cx.fillStyle='rgba(244,251,255,'+c.a+')';cx.beginPath();cx.arc(c.x,c.y,c.core,0,TAU);cx.fill()}
|
var r1Geo = new THREE.TorusGeometry(12, 0.02, 16, 120);
|
||||||
cx.globalCompositeOperation='source-over'}
|
var r1Mat = new THREE.MeshBasicMaterial({ color: 0x8fd9ff, transparent: true, opacity: 0.18 });
|
||||||
function frame(t,dt){cx.clearRect(0,0,W,H);
|
var ring1 = new THREE.Mesh(r1Geo, r1Mat);
|
||||||
var ox=m.sx-.5,oy=m.sy-.5;
|
ring1.rotation.x = Math.PI / 3;
|
||||||
drawNeb(ox,oy,t);
|
ringGroup.add(ring1);
|
||||||
if(CFG.planet)drawPlanet(ox,oy);
|
|
||||||
var ts=t/1000;
|
var r2Geo = new THREE.TorusGeometry(15, 0.015, 16, 120);
|
||||||
for(var i=0;i<stars.length;i++){var s=stars[i];
|
var r2Mat = new THREE.MeshBasicMaterial({ color: 0x43e5a0, transparent: true, opacity: 0.1 });
|
||||||
var sx=((s.x*W-ox*s.p*240)%W+W)%W,sy=((s.y*H-oy*s.p*150)%H+H)%H;
|
var ring2 = new THREE.Mesh(r2Geo, r2Mat);
|
||||||
var a=s.a*(.68+.32*Math.sin(ts*s.ts+s.tw));
|
ring2.rotation.y = Math.PI / 4;
|
||||||
cx.fillStyle='rgba('+s.c[0]+','+s.c[1]+','+s.c[2]+','+a+')';cx.beginPath();cx.arc(sx,sy,s.r,0,TAU);cx.fill();
|
ring2.rotation.x = Math.PI / 5;
|
||||||
if(s.r>1.42){cx.strokeStyle='rgba('+s.c[0]+','+s.c[1]+','+s.c[2]+','+(a*.3)+')';cx.lineWidth=.6;var L=s.r*5.2;
|
ringGroup.add(ring2);
|
||||||
cx.beginPath();cx.moveTo(sx-L,sy);cx.lineTo(sx+L,sy);cx.moveTo(sx,sy-L);cx.lineTo(sx,sy+L);cx.stroke()}}
|
|
||||||
if(!RM){if(t>nextMet){spawnMeteor();if(Math.random()<.4)spawnMeteor();nextMet=t+3600+Math.random()*5200}
|
var mouse = { x: 0, y: 0, targetX: 0, targetY: 0 };
|
||||||
if(t>nextCom){spawnComet();nextCom=t+20000+Math.random()*17000}}
|
window.addEventListener('mousemove', function(e){
|
||||||
drawMeteors(dt);drawComets(dt)}
|
mouse.targetX = (e.clientX / window.innerWidth - 0.5) * 2;
|
||||||
addEventListener('mousemove',function(e){m.x=e.clientX/innerWidth;m.y=e.clientY/innerHeight},{passive:true});
|
mouse.targetY = -(e.clientY / window.innerHeight - 0.5) * 2;
|
||||||
addEventListener('resize',function(){resize();buildStars()});
|
}, { passive: true });
|
||||||
resize();buildStars();neb=makeNeb();
|
|
||||||
var last=performance.now();
|
window.addEventListener('resize', function(){
|
||||||
(function loop(t){var dt=RM?0:Math.min(.05,(t-last)/1000)||.016;last=t;
|
camera.aspect = window.innerWidth / window.innerHeight;
|
||||||
m.sx+=(m.x-m.sx)*.06;m.sy+=(m.y-m.sy)*.06;frame(RM?2000:t,dt);requestAnimationFrame(loop)})(performance.now());
|
camera.updateProjectionMatrix();
|
||||||
|
renderer.setSize(window.innerWidth, window.innerHeight);
|
||||||
|
});
|
||||||
|
|
||||||
|
var clock = new THREE.Clock();
|
||||||
|
function animate(){
|
||||||
|
requestAnimationFrame(animate);
|
||||||
|
if(document.hidden) return;
|
||||||
|
|
||||||
|
var elapsedTime = clock.getElapsedTime();
|
||||||
|
mouse.x += (mouse.targetX - mouse.x) * 0.05;
|
||||||
|
mouse.y += (mouse.targetY - mouse.y) * 0.05;
|
||||||
|
|
||||||
|
starField.rotation.y = elapsedTime * 0.015;
|
||||||
|
starField.rotation.x = elapsedTime * 0.008;
|
||||||
|
|
||||||
|
ring1.rotation.z = elapsedTime * 0.04;
|
||||||
|
ring2.rotation.z = -elapsedTime * 0.03;
|
||||||
|
|
||||||
|
ringGroup.position.x = mouse.x * 1.5;
|
||||||
|
ringGroup.position.y = mouse.y * 1.2;
|
||||||
|
|
||||||
|
camera.position.x = mouse.x * 2;
|
||||||
|
camera.position.y = mouse.y * 1.5;
|
||||||
|
camera.lookAt(scene.position);
|
||||||
|
|
||||||
|
renderer.render(scene, camera);
|
||||||
|
}
|
||||||
|
animate();
|
||||||
})();
|
})();
|
||||||
|
|
||||||
/* ══ form behavior (original functions preserved) ══ */
|
/* ══ 2. STUUDIO/JOCKEY SIGNATURE 3D CARD TILT & CONIC RIM LIGHT ══ */
|
||||||
|
(function(){
|
||||||
|
'use strict';
|
||||||
|
var card = document.getElementById('card');
|
||||||
|
var wrapper = document.getElementById('cardWrapper');
|
||||||
|
if(!card || !wrapper) 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;
|
||||||
|
|
||||||
|
// Conic Rim Lighting angle and position
|
||||||
|
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 + '%');
|
||||||
|
|
||||||
|
// 3D perspective tilt calculation
|
||||||
|
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 });
|
||||||
|
|
||||||
|
window.addEventListener('mouseleave', function(){
|
||||||
|
targetTiltX = 0;
|
||||||
|
targetTiltY = 0;
|
||||||
|
});
|
||||||
|
|
||||||
|
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();
|
||||||
|
})();
|
||||||
|
|
||||||
|
/* ══ 3. ORIGINAL PRESERVED AUTH BEHAVIORS ══ */
|
||||||
function togglePwd(id) {
|
function togglePwd(id) {
|
||||||
var el = document.getElementById(id);
|
var el = document.getElementById(id);
|
||||||
el.type = el.type === 'password' ? 'text' : 'password';
|
el.type = el.type === 'password' ? 'text' : 'password';
|
||||||
var b = el.parentElement.querySelector('.pwd-toggle');
|
var b = el.parentElement.querySelector('.pwd-toggle');
|
||||||
if (b) b.classList.toggle('shown');
|
if (b) b.classList.toggle('shown');
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('loginForm').addEventListener('submit', function() {
|
document.getElementById('loginForm').addEventListener('submit', function() {
|
||||||
var btn = document.getElementById('submitBtn');
|
var btn = document.getElementById('submitBtn');
|
||||||
btn.textContent = 'Signing in…';
|
btn.textContent = 'Signing in…';
|
||||||
@@ -228,33 +712,43 @@ document.getElementById('loginForm').addEventListener('submit', function() {
|
|||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Caps Lock detection on password fields */
|
/* Caps Lock detection */
|
||||||
document.querySelectorAll('input[type=password]').forEach(function(inp){
|
document.querySelectorAll('input[type=password]').forEach(function(inp){
|
||||||
function h(e){var on=e.getModifierState&&e.getModifierState('CapsLock');
|
function checkCaps(e){
|
||||||
var w=inp.closest('.fg');if(!w)return;var cw=w.querySelector('.caps-warn');
|
var on = e.getModifierState && e.getModifierState('CapsLock');
|
||||||
if(cw)cw.classList.toggle('on',!!on);}
|
var group = inp.closest('.form-group');
|
||||||
inp.addEventListener('keyup',h);inp.addEventListener('keydown',h);
|
if(!group) return;
|
||||||
|
var warn = group.querySelector('.caps-warn');
|
||||||
|
if(warn) warn.classList.toggle('on', !!on);
|
||||||
|
}
|
||||||
|
inp.addEventListener('keyup', checkCaps);
|
||||||
|
inp.addEventListener('keydown', checkCaps);
|
||||||
});
|
});
|
||||||
|
|
||||||
/* card parallax */
|
/* Scramble decode on secure channel badge */
|
||||||
(function(){'use strict';
|
(function(){
|
||||||
var card=document.getElementById('card');
|
'use strict';
|
||||||
if(!matchMedia('(pointer:fine)').matches||RMQ)return;
|
function scramble(el){
|
||||||
addEventListener('mousemove',function(e){
|
var tgt = el.dataset.txt;
|
||||||
var dx=e.clientX/innerWidth-.5,dy=e.clientY/innerHeight-.5;
|
var f = 0, total = Math.max(16, tgt.length * 1.2), CH = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>/[]·';
|
||||||
card.style.transform='translate3d('+(dx*8)+'px,'+(dy*6)+'px,0)';
|
var iv = setInterval(function(){
|
||||||
},{passive:true});
|
f++;
|
||||||
})();
|
var done = Math.floor(tgt.length * f / total), s = '';
|
||||||
|
for(var i = 0; i < tgt.length; i++){
|
||||||
/* scramble decode */
|
var ch = tgt[i];
|
||||||
(function(){'use strict';
|
s += i < done ? ch : (ch === ' ' ? ' ' : CH[Math.random() * CH.length | 0]);
|
||||||
function scramble(el){var tgt=el.dataset.txt;if(RMQ){el.textContent=tgt;return}
|
}
|
||||||
var f=0,total=Math.max(16,tgt.length*1.15),CH='ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789<>/[]·';
|
el.textContent = s;
|
||||||
var iv=setInterval(function(){f++;var done=Math.floor(tgt.length*f/total),s='';
|
if(f >= total){ el.textContent = tgt; clearInterval(iv); }
|
||||||
for(var i=0;i<tgt.length;i++){var ch=tgt[i];s+=i<done?ch:(ch===' '?' ':CH[Math.random()*CH.length|0])}
|
}, 28);
|
||||||
el.textContent=s;if(f>=total){el.textContent=tgt;clearInterval(iv)}},26)}
|
}
|
||||||
document.querySelectorAll('[data-scr]').forEach(function(el){el.dataset.txt=el.textContent});
|
document.querySelectorAll('[data-scr]').forEach(function(el){
|
||||||
setTimeout(function(){var t=document.querySelector('[data-scr]');if(t)scramble(t)},400);
|
el.dataset.txt = el.textContent;
|
||||||
|
});
|
||||||
|
setTimeout(function(){
|
||||||
|
var t = document.querySelector('[data-scr]');
|
||||||
|
if(t) scramble(t);
|
||||||
|
}, 350);
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
+1099
-326
File diff suppressed because it is too large
Load Diff
+3687
-4895
File diff suppressed because one or more lines are too long
+387
-198
@@ -7,25 +7,30 @@
|
|||||||
<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="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.googleapis.com">
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet">
|
<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>
|
<style>
|
||||||
:root {
|
:root {
|
||||||
--bg: #030712;
|
--bg: #020308;
|
||||||
--card-bg: rgba(15, 23, 42, 0.75);
|
--card-bg: rgba(9, 14, 26, 0.82);
|
||||||
--border: rgba(148, 163, 184, 0.15);
|
--border: rgba(226, 234, 242, 0.08);
|
||||||
--border-glow: rgba(56, 189, 248, 0.3);
|
--line-strong: rgba(226, 234, 242, 0.16);
|
||||||
--accent: #38bdf8;
|
--accent: #8fd9ff;
|
||||||
--accent-glow: rgba(56, 189, 248, 0.2);
|
--accent-rgb: 143, 216, 255;
|
||||||
--text: #f8fafc;
|
--text: #f8fafc;
|
||||||
--text-muted: #94a3b8;
|
--text-muted: rgba(226, 234, 242, 0.6);
|
||||||
--text-dim: #64748b;
|
--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);
|
||||||
}
|
}
|
||||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
body {
|
body {
|
||||||
background-color: var(--bg);
|
background-color: var(--bg);
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
font-family: 'Space Grotesk', sans-serif;
|
font-family: var(--disp);
|
||||||
min-height: 100vh;
|
min-height: 100vh;
|
||||||
|
min-height: 100svh;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -33,92 +38,146 @@
|
|||||||
padding: 24px;
|
padding: 24px;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
}
|
}
|
||||||
#stars {
|
::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;
|
position: fixed;
|
||||||
inset: 0;
|
inset: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
z-index: 0;
|
background: radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(2, 3, 8, 0.75) 85%, #020308 100%);
|
||||||
|
z-index: 2;
|
||||||
}
|
}
|
||||||
.nebula {
|
|
||||||
position: fixed;
|
.card-wrapper {
|
||||||
width: 600px;
|
|
||||||
height: 600px;
|
|
||||||
border-radius: 50%;
|
|
||||||
background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, rgba(99, 102, 241, 0.05) 40%, transparent 70%);
|
|
||||||
filter: blur(60px);
|
|
||||||
pointer-events: none;
|
|
||||||
z-index: 0;
|
|
||||||
}
|
|
||||||
.share-card {
|
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 480px;
|
max-width: 480px;
|
||||||
background: var(--card-bg);
|
perspective: 1200px;
|
||||||
border: 1px solid var(--border);
|
}
|
||||||
backdrop-filter: blur(20px);
|
|
||||||
|
/* ── Signature Stuudio/Jockey 3D Glass Card with Conic Edge Illumination ── */
|
||||||
|
.share-card {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
padding: 36px 32px;
|
padding: 38px 34px 34px;
|
||||||
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(56, 189, 248, 0.08);
|
background: linear-gradient(145deg, rgba(10, 15, 28, 0.85), rgba(4, 7, 14, 0.9)) padding-box,
|
||||||
animation: floatUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
|
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;
|
||||||
}
|
}
|
||||||
@keyframes floatUp {
|
|
||||||
from { opacity: 0; transform: translateY(20px); }
|
/* Reticle Corners */
|
||||||
to { opacity: 1; transform: translateY(0); }
|
.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 {
|
.brand {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 10px;
|
justify-content: space-between;
|
||||||
margin-bottom: 28px;
|
margin-bottom: 28px;
|
||||||
}
|
}
|
||||||
|
.brand-left {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
.brand-icon {
|
.brand-icon {
|
||||||
width: 36px;
|
width: 32px;
|
||||||
height: 36px;
|
height: 32px;
|
||||||
background: rgba(56, 189, 248, 0.1);
|
background: rgba(var(--accent-rgb), 0.1);
|
||||||
border: 1px solid rgba(56, 189, 248, 0.3);
|
border: 1px solid rgba(var(--accent-rgb), 0.25);
|
||||||
border-radius: 10px;
|
border-radius: 9px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
.brand-name {
|
.brand-name {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
font-size: 16px;
|
font-size: 15px;
|
||||||
letter-spacing: 0.08em;
|
letter-spacing: -0.01em;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
.brand-pill {
|
.brand-name em {
|
||||||
font-family: 'JetBrains Mono', monospace;
|
font-family: var(--serif);
|
||||||
font-size: 10px;
|
font-style: italic;
|
||||||
padding: 2px 8px;
|
font-weight: 400;
|
||||||
border-radius: 999px;
|
color: rgb(var(--accent-rgb));
|
||||||
background: rgba(56, 189, 248, 0.12);
|
margin-left: 3px;
|
||||||
color: var(--accent);
|
|
||||||
border: 1px solid rgba(56, 189, 248, 0.25);
|
|
||||||
}
|
}
|
||||||
|
.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 {
|
.file-box {
|
||||||
background: rgba(0, 0, 0, 0.3);
|
background: rgba(0, 0, 0, 0.4);
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
border-radius: 14px;
|
border-radius: 14px;
|
||||||
padding: 20px;
|
padding: 18px 20px;
|
||||||
margin-bottom: 24px;
|
margin-bottom: 22px;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 16px;
|
gap: 16px;
|
||||||
}
|
}
|
||||||
.file-icon {
|
.file-icon {
|
||||||
width: 48px;
|
width: 46px;
|
||||||
height: 48px;
|
height: 46px;
|
||||||
border-radius: 12px;
|
border-radius: 12px;
|
||||||
background: rgba(99, 102, 241, 0.15);
|
background: rgba(143, 216, 255, 0.08);
|
||||||
border: 1px solid rgba(99, 102, 241, 0.3);
|
border: 1px solid rgba(143, 216, 255, 0.25);
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
color: #818cf8;
|
color: var(--accent);
|
||||||
}
|
}
|
||||||
.file-details {
|
.file-details {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
@@ -134,17 +193,18 @@
|
|||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
.file-meta {
|
.file-meta {
|
||||||
font-family: 'JetBrains Mono', monospace;
|
font-family: var(--mono);
|
||||||
font-size: 12px;
|
font-size: 11px;
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 12px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
.meta-item {
|
.meta-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stats-row {
|
.stats-row {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
@@ -152,207 +212,336 @@
|
|||||||
margin-bottom: 24px;
|
margin-bottom: 24px;
|
||||||
}
|
}
|
||||||
.stat-pill {
|
.stat-pill {
|
||||||
background: rgba(255, 255, 255, 0.03);
|
background: rgba(255, 255, 255, 0.02);
|
||||||
border: 1px solid rgba(255, 255, 255, 0.06);
|
border: 1px solid var(--border);
|
||||||
padding: 12px;
|
padding: 12px 14px;
|
||||||
border-radius: 10px;
|
border-radius: 11px;
|
||||||
}
|
}
|
||||||
.stat-label {
|
.stat-label {
|
||||||
font-size: 11px;
|
font-family: var(--mono);
|
||||||
|
font-size: 9px;
|
||||||
color: var(--text-dim);
|
color: var(--text-dim);
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
letter-spacing: 0.08em;
|
letter-spacing: 0.12em;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
.stat-val {
|
.stat-val {
|
||||||
font-family: 'JetBrains Mono', monospace;
|
font-family: var(--mono);
|
||||||
font-size: 13px;
|
font-size: 13.5px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-download {
|
.btn-download {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 14px 20px;
|
padding: 14px 22px;
|
||||||
background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
|
background: #fff;
|
||||||
color: #fff;
|
color: #04060d;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 12px;
|
border-radius: 11px;
|
||||||
font-weight: 600;
|
font-weight: 700;
|
||||||
font-size: 15px;
|
font-size: 14.5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
letter-spacing: -0.01em;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
box-shadow: 0 4px 20px rgba(56, 189, 248, 0.25);
|
box-shadow: 0 8px 30px rgba(255, 255, 255, 0.12);
|
||||||
}
|
}
|
||||||
.btn-download:hover {
|
.btn-download:hover {
|
||||||
transform: translateY(-2px);
|
box-shadow: 0 12px 40px rgba(255, 255, 255, 0.22);
|
||||||
box-shadow: 0 8px 30px rgba(56, 189, 248, 0.4);
|
transform: translateY(-1px);
|
||||||
}
|
}
|
||||||
|
.btn-download:active {
|
||||||
|
transform: scale(0.985);
|
||||||
|
}
|
||||||
|
|
||||||
.input-pass {
|
.input-pass {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 13px 16px;
|
padding: 13px 16px;
|
||||||
background: rgba(0, 0, 0, 0.35);
|
background: rgba(226, 234, 242, 0.03);
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--line-strong);
|
||||||
border-radius: 10px;
|
border-radius: 11px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-family: inherit;
|
font-family: inherit;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
outline: none;
|
outline: none;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 16px;
|
||||||
transition: border-color 0.2s;
|
transition: border-color 0.2s, box-shadow 0.2s;
|
||||||
}
|
}
|
||||||
.input-pass:focus {
|
.input-pass:focus {
|
||||||
border-color: var(--accent);
|
border-color: rgba(var(--accent-rgb), 0.65);
|
||||||
box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
|
box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
|
||||||
}
|
}
|
||||||
|
|
||||||
.error-msg {
|
.error-msg {
|
||||||
background: rgba(239, 68, 68, 0.1);
|
background: rgba(239, 68, 68, 0.1);
|
||||||
border: 1px solid rgba(239, 68, 68, 0.3);
|
border: 1px solid rgba(239, 68, 68, 0.3);
|
||||||
color: #f87171;
|
color: #f87171;
|
||||||
padding: 10px 14px;
|
padding: 11px 14px;
|
||||||
border-radius: 8px;
|
border-radius: 10px;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
margin-bottom: 16px;
|
margin-bottom: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer {
|
.footer {
|
||||||
position: relative;
|
position: relative;
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
font-size: 12px;
|
font-family: var(--mono);
|
||||||
|
font-size: 10px;
|
||||||
|
letter-spacing: 0.1em;
|
||||||
color: var(--text-dim);
|
color: var(--text-dim);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
*, *::before, *::after {
|
||||||
|
animation-duration: 0.01ms !important;
|
||||||
|
transition-duration: 0.01ms !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="nebula"></div>
|
<div id="webgl-bg" aria-hidden="true"></div>
|
||||||
<canvas id="stars"></canvas>
|
<div class="noise-overlay" aria-hidden="true"></div>
|
||||||
|
<div class="radial-vignette" aria-hidden="true"></div>
|
||||||
|
|
||||||
<div class="share-card">
|
<div class="card-wrapper" id="cardWrapper">
|
||||||
<div class="brand">
|
<div class="share-card" id="card">
|
||||||
<div class="brand-icon">
|
<i class="cnr c1"></i><i class="cnr c2"></i><i class="cnr c3"></i><i class="cnr c4"></i>
|
||||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#38bdf8" 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>
|
|
||||||
<div class="brand-name">COSMOS OORT</div>
|
|
||||||
</div>
|
|
||||||
<span class="brand-pill">SECURE SHARE</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{if .Error}}
|
<div class="brand">
|
||||||
<div class="error-msg">{{.Error}}</div>
|
<div class="brand-left">
|
||||||
{{end}}
|
<div class="brand-icon">
|
||||||
|
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="#8fd9ff" stroke-width="2">
|
||||||
{{if .Expired}}
|
<circle cx="12" cy="12" r="10"/>
|
||||||
<div style="text-align:center; padding: 24px 0;">
|
<line x1="2" y1="12" x2="22" y2="12"/>
|
||||||
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="#f87171" stroke-width="1.5" style="margin-bottom:12px">
|
<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"/>
|
||||||
<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)">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:#38bdf8">{{.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:8px">This file is password-protected. Enter password to unlock:</div>
|
|
||||||
<input type="password" name="password" class="input-pass" placeholder="Enter file 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>
|
</svg>
|
||||||
Unlock & Download
|
</div>
|
||||||
</button>
|
<div class="brand-name">COSMOS <em>OORT</em></div>
|
||||||
</form>
|
</div>
|
||||||
{{else}}
|
<span class="brand-pill">SECURE SHARE</span>
|
||||||
<a href="{{.DownloadURL}}" class="btn-download">
|
</div>
|
||||||
<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"/>
|
{{if .Error}}
|
||||||
<polyline points="7 10 12 15 17 10"/>
|
<div class="error-msg">{{.Error}}</div>
|
||||||
<line x1="12" y1="15" x2="12" y2="3"/>
|
|
||||||
</svg>
|
|
||||||
Download File
|
|
||||||
</a>
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{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 & 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>
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
Powered by <strong>Cosmos Oort</strong> · Sovereign Cloud Workstation
|
Powered by <strong>Cosmos Oort</strong> · Sovereign Cloud Workstation
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Local Zero-Latency Three.js Engine -->
|
||||||
|
<script src="/three.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
// Particle canvas background
|
/* ══ 1. THREE.JS 3D CELESTIAL BACKGROUND ══ */
|
||||||
const canvas = document.getElementById('stars');
|
(function(){
|
||||||
const ctx = canvas.getContext('2d');
|
'use strict';
|
||||||
let W, H, stars = [];
|
var container = document.getElementById('webgl-bg');
|
||||||
function resize() {
|
if(!window.THREE || !container) return;
|
||||||
W = canvas.width = window.innerWidth;
|
|
||||||
H = canvas.height = window.innerHeight;
|
var scene = new THREE.Scene();
|
||||||
stars = Array.from({length: 60}, () => ({
|
var camera = new THREE.PerspectiveCamera(55, window.innerWidth / window.innerHeight, 0.1, 1000);
|
||||||
x: Math.random() * W,
|
camera.position.z = 28;
|
||||||
y: Math.random() * H,
|
|
||||||
r: Math.random() * 1.5 + 0.5,
|
var renderer = new THREE.WebGLRenderer({ antialias: true, alpha: true, powerPreference: 'high-performance' });
|
||||||
alpha: Math.random() * 0.8 + 0.2,
|
renderer.setPixelRatio(Math.min(window.devicePixelRatio || 1, 2));
|
||||||
speed: Math.random() * 0.02 + 0.005
|
renderer.setSize(window.innerWidth, window.innerHeight);
|
||||||
}));
|
container.appendChild(renderer.domElement);
|
||||||
}
|
|
||||||
window.addEventListener('resize', resize);
|
var starCount = 1200;
|
||||||
resize();
|
var starGeo = new THREE.BufferGeometry();
|
||||||
function anim() {
|
var starPos = new Float32Array(starCount * 3);
|
||||||
ctx.clearRect(0, 0, W, H);
|
var starColors = new Float32Array(starCount * 3);
|
||||||
stars.forEach(s => {
|
|
||||||
s.alpha += s.speed;
|
var colA = new THREE.Color(0x8fd9ff);
|
||||||
if(s.alpha > 1 || s.alpha < 0.2) s.speed = -s.speed;
|
var colB = new THREE.Color(0xffffff);
|
||||||
ctx.fillStyle = `rgba(255, 255, 255, ${s.alpha})`;
|
|
||||||
ctx.beginPath();
|
for(var i = 0; i < starCount; i++){
|
||||||
ctx.arc(s.x, s.y, s.r, 0, Math.PI * 2);
|
var i3 = i * 3;
|
||||||
ctx.fill();
|
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
|
||||||
});
|
});
|
||||||
requestAnimationFrame(anim);
|
var starField = new THREE.Points(starGeo, starMat);
|
||||||
}
|
scene.add(starField);
|
||||||
anim();
|
|
||||||
|
// 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>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+842
-267
File diff suppressed because it is too large
Load Diff
Vendored
+6
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user