feat(oort): add secure share links, media preview/code editor, static site hosting, event webhooks, batch ops, category filters, and storage breakdown donut chart
This commit is contained in:
+11
-6
@@ -26,6 +26,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const minioEndpoint = "127.0.0.1:9000"
|
const minioEndpoint = "127.0.0.1:9000"
|
||||||
|
const publicMinioEndpoint = "cosmos.linuxguy.space"
|
||||||
|
|
||||||
// authS3Console validates the session and returns (accessKey, secretKey, bucket).
|
// authS3Console validates the session and returns (accessKey, secretKey, bucket).
|
||||||
// It looks up the session from the cosmos.users table.
|
// It looks up the session from the cosmos.users table.
|
||||||
@@ -86,6 +87,8 @@ func RegisterS3ConsoleRoutes(mux *http.ServeMux) {
|
|||||||
owner_email text
|
owner_email text
|
||||||
)`).Exec()
|
)`).Exec()
|
||||||
|
|
||||||
|
RegisterExpansionRoutes(mux)
|
||||||
|
|
||||||
mux.HandleFunc("/oort/api/objects/versions", handleS3ObjectVersions)
|
mux.HandleFunc("/oort/api/objects/versions", handleS3ObjectVersions)
|
||||||
mux.HandleFunc("/oort/api/objects/restore", handleS3ObjectRestore)
|
mux.HandleFunc("/oort/api/objects/restore", handleS3ObjectRestore)
|
||||||
mux.HandleFunc("/oort/api/objects/share", handleS3ShareObject)
|
mux.HandleFunc("/oort/api/objects/share", handleS3ShareObject)
|
||||||
@@ -426,6 +429,7 @@ func handleS3UploadComplete(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
// Record a write hit for analytics
|
// Record a write hit for analytics
|
||||||
go recordHit(bucket, 200, 0, false, r.Header.Get("CF-IPCountry"), "write")
|
go recordHit(bucket, 200, 0, false, r.Header.Get("CF-IPCountry"), "write")
|
||||||
|
go dispatchWebhooks(bucket, "object:created", upload.Key, 0, "")
|
||||||
|
|
||||||
jsonOK(w, map[string]any{
|
jsonOK(w, map[string]any{
|
||||||
"key": upload.Key,
|
"key": upload.Key,
|
||||||
@@ -504,6 +508,7 @@ func handleS3Delete(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
go dispatchWebhooks(bucket, "object:deleted", key, 0, "")
|
||||||
jsonOK(w, map[string]bool{"deleted": true})
|
jsonOK(w, map[string]bool{"deleted": true})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -522,9 +527,9 @@ func handleS3Presign(w http.ResponseWriter, r *http.Request) {
|
|||||||
jsonErr(w, "missing key", 400)
|
jsonErr(w, "missing key", 400)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
mc, err := minio.New(getPublicMinioEndpoint(), &minio.Options{
|
mc, err := minio.New(publicMinioEndpoint, &minio.Options{
|
||||||
Creds: credentials.NewStaticV4(ak, sk, ""),
|
Creds: credentials.NewStaticV4(ak, sk, ""),
|
||||||
Secure: !strings.HasPrefix(getPublicMinioEndpoint(), "localhost") && !strings.HasPrefix(getPublicMinioEndpoint(), "127.0.0.1"),
|
Secure: true,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
jsonErr(w, "minio error", 500)
|
jsonErr(w, "minio error", 500)
|
||||||
@@ -725,7 +730,7 @@ func handleS3Profile(w http.ResponseWriter, r *http.Request) {
|
|||||||
"access_key": ak,
|
"access_key": ak,
|
||||||
"secret_key": sk,
|
"secret_key": sk,
|
||||||
"default_bucket": defaultBucket,
|
"default_bucket": defaultBucket,
|
||||||
"endpoint": getCosmosBaseURL(),
|
"endpoint": "https://cosmos.linuxguy.space",
|
||||||
"name": name,
|
"name": name,
|
||||||
"username": username,
|
"username": username,
|
||||||
"profile_image": profileImage,
|
"profile_image": profileImage,
|
||||||
@@ -765,8 +770,8 @@ func handleS3Quota(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sendQuotaEmail(userEmail, token string, amount int) {
|
func sendQuotaEmail(userEmail, token string, amount int) {
|
||||||
link := fmt.Sprintf("%s/oort/api/quota/approve?token=%s", getCosmosBaseURL(), token)
|
link := fmt.Sprintf("https://cosmos.linuxguy.space/oort/api/quota/approve?token=%s", token)
|
||||||
msg := fmt.Sprintf("From: %s\r\nTo: %s\r\nSubject: Quota Request from %s\r\n\r\nUser %s has requested a quota increase to %d GB.\r\n\r\nClick here to approve: %s\r\n", getEmailFrom(), getAdminEmail(), userEmail, userEmail, amount, link)
|
msg := fmt.Sprintf("From: [email protected]\r\nTo: [email protected]\r\nSubject: Quota Request from %s\r\n\r\nUser %s has requested a quota increase to %d GB.\r\n\r\nClick here to approve: %s\r\n", userEmail, userEmail, amount, link)
|
||||||
cmd := exec.Command("msmtp", "-t")
|
cmd := exec.Command("msmtp", "-t")
|
||||||
cmd.Stdin = bytes.NewBufferString(msg)
|
cmd.Stdin = bytes.NewBufferString(msg)
|
||||||
if err := cmd.Run(); err != nil {
|
if err := cmd.Run(); err != nil {
|
||||||
@@ -1064,7 +1069,7 @@ func handleS3ShareObject(w http.ResponseWriter, r *http.Request) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
jsonOK(w, map[string]string{"url": strings.Replace(presignedURL.String(), "http://"+minioEndpoint, getCosmosBaseURL(), 1)})
|
jsonOK(w, map[string]string{"url": strings.Replace(presignedURL.String(), "http://"+minioEndpoint, "https://"+publicMinioEndpoint, 1)})
|
||||||
}
|
}
|
||||||
|
|
||||||
// ─── GET /oort/api/objects/versions ──────────────────────────────────────────────
|
// ─── GET /oort/api/objects/versions ──────────────────────────────────────────────
|
||||||
|
|||||||
+1066
File diff suppressed because it is too large
Load Diff
+827
-108
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,358 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>{{if .FileName}}{{.FileName}} — Cosmos Oort Share{{else}}Cosmos Oort Share{{end}}</title>
|
||||||
|
<link rel="icon" href='data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><circle cx="16" cy="16" r="6" fill="%23eef3f8"/><ellipse cx="16" cy="16" rx="14" ry="5.5" fill="none" stroke="%238fd9ff" stroke-width="1.5" transform="rotate(-24 16 16)"/></svg>'>
|
||||||
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||||
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||||
|
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Space+Grotesk:wght@400;500;600;700&display=swap" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
:root {
|
||||||
|
--bg: #030712;
|
||||||
|
--card-bg: rgba(15, 23, 42, 0.75);
|
||||||
|
--border: rgba(148, 163, 184, 0.15);
|
||||||
|
--border-glow: rgba(56, 189, 248, 0.3);
|
||||||
|
--accent: #38bdf8;
|
||||||
|
--accent-glow: rgba(56, 189, 248, 0.2);
|
||||||
|
--text: #f8fafc;
|
||||||
|
--text-muted: #94a3b8;
|
||||||
|
--text-dim: #64748b;
|
||||||
|
}
|
||||||
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||||
|
body {
|
||||||
|
background-color: var(--bg);
|
||||||
|
color: var(--text);
|
||||||
|
font-family: 'Space Grotesk', sans-serif;
|
||||||
|
min-height: 100vh;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 24px;
|
||||||
|
overflow-x: hidden;
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
#stars {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
z-index: 0;
|
||||||
|
}
|
||||||
|
.nebula {
|
||||||
|
position: fixed;
|
||||||
|
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;
|
||||||
|
z-index: 10;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 480px;
|
||||||
|
background: var(--card-bg);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
backdrop-filter: blur(20px);
|
||||||
|
border-radius: 20px;
|
||||||
|
padding: 36px 32px;
|
||||||
|
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 40px rgba(56, 189, 248, 0.08);
|
||||||
|
animation: floatUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
|
||||||
|
}
|
||||||
|
@keyframes floatUp {
|
||||||
|
from { opacity: 0; transform: translateY(20px); }
|
||||||
|
to { opacity: 1; transform: translateY(0); }
|
||||||
|
}
|
||||||
|
.brand {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
margin-bottom: 28px;
|
||||||
|
}
|
||||||
|
.brand-icon {
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
background: rgba(56, 189, 248, 0.1);
|
||||||
|
border: 1px solid rgba(56, 189, 248, 0.3);
|
||||||
|
border-radius: 10px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
.brand-name {
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 16px;
|
||||||
|
letter-spacing: 0.08em;
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.brand-pill {
|
||||||
|
font-family: 'JetBrains Mono', monospace;
|
||||||
|
font-size: 10px;
|
||||||
|
padding: 2px 8px;
|
||||||
|
border-radius: 999px;
|
||||||
|
background: rgba(56, 189, 248, 0.12);
|
||||||
|
color: var(--accent);
|
||||||
|
border: 1px solid rgba(56, 189, 248, 0.25);
|
||||||
|
}
|
||||||
|
.file-box {
|
||||||
|
background: rgba(0, 0, 0, 0.3);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 14px;
|
||||||
|
padding: 20px;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 16px;
|
||||||
|
}
|
||||||
|
.file-icon {
|
||||||
|
width: 48px;
|
||||||
|
height: 48px;
|
||||||
|
border-radius: 12px;
|
||||||
|
background: rgba(99, 102, 241, 0.15);
|
||||||
|
border: 1px solid rgba(99, 102, 241, 0.3);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-shrink: 0;
|
||||||
|
color: #818cf8;
|
||||||
|
}
|
||||||
|
.file-details {
|
||||||
|
min-width: 0;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.file-name {
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #fff;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
.file-meta {
|
||||||
|
font-family: 'JetBrains Mono', monospace;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
}
|
||||||
|
.meta-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
.stats-row {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
gap: 12px;
|
||||||
|
margin-bottom: 24px;
|
||||||
|
}
|
||||||
|
.stat-pill {
|
||||||
|
background: rgba(255, 255, 255, 0.03);
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.06);
|
||||||
|
padding: 12px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
.stat-label {
|
||||||
|
font-size: 11px;
|
||||||
|
color: var(--text-dim);
|
||||||
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.08em;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
.stat-val {
|
||||||
|
font-family: 'JetBrains Mono', monospace;
|
||||||
|
font-size: 13px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: var(--text);
|
||||||
|
}
|
||||||
|
.btn-download {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
gap: 10px;
|
||||||
|
width: 100%;
|
||||||
|
padding: 14px 20px;
|
||||||
|
background: linear-gradient(135deg, #38bdf8 0%, #6366f1 100%);
|
||||||
|
color: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
border: none;
|
||||||
|
border-radius: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 15px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
box-shadow: 0 4px 20px rgba(56, 189, 248, 0.25);
|
||||||
|
}
|
||||||
|
.btn-download:hover {
|
||||||
|
transform: translateY(-2px);
|
||||||
|
box-shadow: 0 8px 30px rgba(56, 189, 248, 0.4);
|
||||||
|
}
|
||||||
|
.input-pass {
|
||||||
|
width: 100%;
|
||||||
|
padding: 13px 16px;
|
||||||
|
background: rgba(0, 0, 0, 0.35);
|
||||||
|
border: 1px solid var(--border);
|
||||||
|
border-radius: 10px;
|
||||||
|
color: #fff;
|
||||||
|
font-family: inherit;
|
||||||
|
font-size: 14px;
|
||||||
|
outline: none;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
transition: border-color 0.2s;
|
||||||
|
}
|
||||||
|
.input-pass:focus {
|
||||||
|
border-color: var(--accent);
|
||||||
|
box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
|
||||||
|
}
|
||||||
|
.error-msg {
|
||||||
|
background: rgba(239, 68, 68, 0.1);
|
||||||
|
border: 1px solid rgba(239, 68, 68, 0.3);
|
||||||
|
color: #f87171;
|
||||||
|
padding: 10px 14px;
|
||||||
|
border-radius: 8px;
|
||||||
|
font-size: 13px;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
.footer {
|
||||||
|
position: relative;
|
||||||
|
z-index: 10;
|
||||||
|
margin-top: 24px;
|
||||||
|
font-size: 12px;
|
||||||
|
color: var(--text-dim);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="nebula"></div>
|
||||||
|
<canvas id="stars"></canvas>
|
||||||
|
|
||||||
|
<div class="share-card">
|
||||||
|
<div class="brand">
|
||||||
|
<div class="brand-icon">
|
||||||
|
<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="error-msg">{{.Error}}</div>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{if .Expired}}
|
||||||
|
<div style="text-align:center; padding: 24px 0;">
|
||||||
|
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="#f87171" stroke-width="1.5" style="margin-bottom:12px">
|
||||||
|
<circle cx="12" cy="12" r="10"/>
|
||||||
|
<line x1="12" y1="8" x2="12" y2="12"/>
|
||||||
|
<line x1="12" y1="16" x2="12.01" y2="16"/>
|
||||||
|
</svg>
|
||||||
|
<h2 style="font-size:18px; margin-bottom:8px; color:#fff">Share Link Inactive</h2>
|
||||||
|
<p style="font-size:13px; color:var(--text-muted)">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>
|
||||||
|
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 File
|
||||||
|
</a>
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
{{end}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="footer">
|
||||||
|
Powered by <strong>Cosmos Oort</strong> · Sovereign Cloud Workstation
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Particle canvas background
|
||||||
|
const canvas = document.getElementById('stars');
|
||||||
|
const ctx = canvas.getContext('2d');
|
||||||
|
let W, H, stars = [];
|
||||||
|
function resize() {
|
||||||
|
W = canvas.width = window.innerWidth;
|
||||||
|
H = canvas.height = window.innerHeight;
|
||||||
|
stars = Array.from({length: 60}, () => ({
|
||||||
|
x: Math.random() * W,
|
||||||
|
y: Math.random() * H,
|
||||||
|
r: Math.random() * 1.5 + 0.5,
|
||||||
|
alpha: Math.random() * 0.8 + 0.2,
|
||||||
|
speed: Math.random() * 0.02 + 0.005
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
window.addEventListener('resize', resize);
|
||||||
|
resize();
|
||||||
|
function anim() {
|
||||||
|
ctx.clearRect(0, 0, W, H);
|
||||||
|
stars.forEach(s => {
|
||||||
|
s.alpha += s.speed;
|
||||||
|
if(s.alpha > 1 || s.alpha < 0.2) s.speed = -s.speed;
|
||||||
|
ctx.fillStyle = `rgba(255, 255, 255, ${s.alpha})`;
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc(s.x, s.y, s.r, 0, Math.PI * 2);
|
||||||
|
ctx.fill();
|
||||||
|
});
|
||||||
|
requestAnimationFrame(anim);
|
||||||
|
}
|
||||||
|
anim();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user