d-11 mit Nutzertext (Canvas, Zeichenabfang und künstliche Uhr), Image-Label cb.hash mit Veraltet-Prüfung, lokaler Webserver und Im Browser öffnen
All checks were successful
release / deb (push) Successful in 4m2s
release / arch (push) Successful in 5m37s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-09 15:15:12 +01:00
parent af07911d22
commit f44ba7681c
18 changed files with 1220 additions and 147 deletions

View File

@ -0,0 +1,39 @@
<!doctype html><html lang="de"><head><meta charset="utf-8"><title>Sonnensystem</title>
<style>
html,body{margin:0;background:#04050d;color:#dde;font-family:sans-serif}
#bar{display:flex;gap:12px;align-items:center;padding:8px 12px}
canvas{display:block}
</style></head><body>
<div id="bar"><button id="toggle">Pause</button><label>Geschwindigkeit <input id="speed" type="range" min="1" max="100" value="10"></label><button id="reset">Zurücksetzen</button><span id="time">Simulationszeit: 0.00 Jahre</span></div>
<canvas id="c" width="1280" height="740"></canvas>
<script>
// Simulationslogik: Zeit in Tagen, Positionen aus der vergangenen Simulationszeit.
const PLANETS=[["Merkur",87.97,"#aaa",3],["Venus",224.7,"#e8c",5],["Erde",365.26,"#4af",5.5],["Mars",686.98,"#e64",4],["Jupiter",4332.6,"#d96",11],["Saturn",10759,"#eb8",9.5],["Uranus",30688,"#8dd",7.5],["Neptun",60182,"#46f",7]];
const sim={days:0,running:true,speed:10}; // speed: Erdjahre pro Sekunde / 10
const angleOf=p=>2*Math.PI*sim.days/p[1];
// Darstellung
const cv=document.getElementById("c"),ctx=cv.getContext("2d"),cx=640,cy=370;
const stars=document.createElement("canvas");stars.width=cv.width;stars.height=cv.height;const sx=stars.getContext("2d");
sx.fillStyle="#04050d";sx.fillRect(0,0,stars.width,stars.height);
let seed=7;const rnd=()=>(seed=(seed*16807)%2147483647)/2147483647;
for(let i=0;i<220;i++){sx.fillStyle=`rgba(255,255,255,${0.4+rnd()*0.6})`;sx.fillRect(rnd()*stars.width,rnd()*stars.height,1+rnd()*1.5,1+rnd()*1.5)}
const radius=i=>45+i*43;
function draw(){
ctx.drawImage(stars,0,0);
ctx.strokeStyle="#334";ctx.lineWidth=1;
PLANETS.forEach((p,i)=>{ctx.beginPath();ctx.arc(cx,cy,radius(i),0,2*Math.PI);ctx.stroke()});
ctx.beginPath();ctx.arc(cx,cy,20,0,2*Math.PI);ctx.fillStyle="#fc3";ctx.fill();
ctx.fillStyle="#fc8";ctx.font="12px sans-serif";ctx.fillText("Sonne",cx-16,cy+34);
PLANETS.forEach((p,i)=>{const a=angleOf(p),x=cx+radius(i)*Math.cos(a),y=cy+radius(i)*Math.sin(a);
ctx.beginPath();ctx.arc(x,y,p[3],0,2*Math.PI);ctx.fillStyle=p[2];ctx.fill();
ctx.fillStyle="#ccd";ctx.fillText(p[0],x+p[3]+3,y-p[3])});
document.getElementById("time").textContent=`Simulationszeit: ${(sim.days/365.26).toFixed(2)} Jahre`;
}
// Interaktion
let last=null;
function frame(t){if(last!==null&&sim.running){const dt=(t-last)/1000;sim.days+=sim.speed*365.26/10*0.016}last=t;draw();requestAnimationFrame(frame)}
document.getElementById("toggle").onclick=e=>{sim.running=!sim.running;e.target.textContent=sim.running?"Pause":"Start"};
document.getElementById("speed").oninput=e=>{sim.speed=Number(e.target.value)};
document.getElementById("reset").onclick=()=>{sim.days=0;draw()};
requestAnimationFrame(frame);
</script></body></html>

View File

@ -0,0 +1,39 @@
<!doctype html><html lang="de"><head><meta charset="utf-8"><title>Sonnensystem</title>
<style>
html,body{margin:0;background:#04050d;color:#dde;font-family:sans-serif}
#bar{display:flex;gap:12px;align-items:center;padding:8px 12px}
canvas{display:block}
</style></head><body>
<div id="bar"><button id="toggle">Pause</button><label>Geschwindigkeit <input id="speed" type="range" min="1" max="100" value="10"></label><button id="reset">Zurücksetzen</button><span id="time">Simulationszeit: 0.00 Jahre</span></div>
<canvas id="c" width="1280" height="740"></canvas>
<script>
// Simulationslogik: Zeit in Tagen, Positionen aus der vergangenen Simulationszeit.
const PLANETS=[["Merkur",365.26,"#aaa",3],["Venus",365.26,"#e8c",5],["Erde",365.26,"#4af",5.5],["Mars",365.26,"#e64",4],["Jupiter",365.26,"#d96",11],["Saturn",365.26,"#eb8",9.5],["Uranus",365.26,"#8dd",7.5],["Neptun",365.26,"#46f",7]];
const sim={days:0,running:true,speed:10}; // speed: Erdjahre pro Sekunde / 10
const angleOf=p=>2*Math.PI*sim.days/p[1];
// Darstellung
const cv=document.getElementById("c"),ctx=cv.getContext("2d"),cx=640,cy=370;
const stars=document.createElement("canvas");stars.width=cv.width;stars.height=cv.height;const sx=stars.getContext("2d");
sx.fillStyle="#04050d";sx.fillRect(0,0,stars.width,stars.height);
let seed=7;const rnd=()=>(seed=(seed*16807)%2147483647)/2147483647;
for(let i=0;i<220;i++){sx.fillStyle=`rgba(255,255,255,${0.4+rnd()*0.6})`;sx.fillRect(rnd()*stars.width,rnd()*stars.height,1+rnd()*1.5,1+rnd()*1.5)}
const radius=i=>45+i*43;
function draw(){
ctx.drawImage(stars,0,0);
ctx.strokeStyle="#334";ctx.lineWidth=1;
PLANETS.forEach((p,i)=>{ctx.beginPath();ctx.arc(cx,cy,radius(i),0,2*Math.PI);ctx.stroke()});
ctx.beginPath();ctx.arc(cx,cy,20,0,2*Math.PI);ctx.fillStyle="#fc3";ctx.fill();
ctx.fillStyle="#fc8";ctx.font="12px sans-serif";ctx.fillText("Sonne",cx-16,cy+34);
PLANETS.forEach((p,i)=>{const a=angleOf(p),x=cx+radius(i)*Math.cos(a),y=cy+radius(i)*Math.sin(a);
ctx.beginPath();ctx.arc(x,y,p[3],0,2*Math.PI);ctx.fillStyle=p[2];ctx.fill();
ctx.fillStyle="#ccd";ctx.fillText(p[0],x+p[3]+3,y-p[3])});
document.getElementById("time").textContent=`Simulationszeit: ${(sim.days/365.26).toFixed(2)} Jahre`;
}
// Interaktion
let last=null;
function frame(t){if(last!==null&&sim.running){const dt=(t-last)/1000;sim.days+=dt*sim.speed*365.26/10}last=t;draw();requestAnimationFrame(frame)}
document.getElementById("toggle").onclick=e=>{sim.running=!sim.running;e.target.textContent=sim.running?"Pause":"Start"};
document.getElementById("speed").oninput=e=>{sim.speed=Number(e.target.value)};
document.getElementById("reset").onclick=()=>{sim.days=0;draw()};
requestAnimationFrame(frame);
</script></body></html>

View File

@ -0,0 +1,39 @@
<!doctype html><html lang="de"><head><meta charset="utf-8"><title>Sonnensystem</title>
<style>
html,body{margin:0;background:#04050d;color:#dde;font-family:sans-serif}
#bar{display:flex;gap:12px;align-items:center;padding:8px 12px}
canvas{display:block}
</style></head><body>
<canvas id="c" width="1280" height="740"></canvas>
<script>
// Simulationslogik: Zeit in Tagen, Positionen aus der vergangenen Simulationszeit.
const PLANETS=[["Merkur",87.97,"#aaa",3],["Venus",224.7,"#e8c",5],["Erde",365.26,"#4af",5.5],["Mars",686.98,"#e64",4],["Jupiter",4332.6,"#d96",11],["Saturn",10759,"#eb8",9.5],["Uranus",30688,"#8dd",7.5],["Neptun",60182,"#46f",7]];
const sim={days:0,running:true,speed:10}; // speed: Erdjahre pro Sekunde / 10
const angleOf=p=>2*Math.PI*sim.days/p[1];
// Darstellung
const cv=document.getElementById("c"),ctx=cv.getContext("2d"),cx=640,cy=370;
const stars=document.createElement("canvas");stars.width=cv.width;stars.height=cv.height;const sx=stars.getContext("2d");
sx.fillStyle="#04050d";sx.fillRect(0,0,stars.width,stars.height);
let seed=7;const rnd=()=>(seed=(seed*16807)%2147483647)/2147483647;
for(let i=0;i<220;i++){sx.fillStyle=`rgba(255,255,255,${0.4+rnd()*0.6})`;sx.fillRect(rnd()*stars.width,rnd()*stars.height,1+rnd()*1.5,1+rnd()*1.5)}
const radius=i=>45+i*43;
function draw(){
ctx.drawImage(stars,0,0);
ctx.strokeStyle="#334";ctx.lineWidth=1;
PLANETS.forEach((p,i)=>{ctx.beginPath();ctx.arc(cx,cy,radius(i),0,2*Math.PI);ctx.stroke()});
ctx.beginPath();ctx.arc(cx,cy,20,0,2*Math.PI);ctx.fillStyle="#fc3";ctx.fill();
ctx.fillStyle="#fc8";ctx.font="12px sans-serif";ctx.fillText("Sonne",cx-16,cy+34);
PLANETS.forEach((p,i)=>{const a=angleOf(p),x=cx+radius(i)*Math.cos(a),y=cy+radius(i)*Math.sin(a);
ctx.beginPath();ctx.arc(x,y,p[3],0,2*Math.PI);ctx.fillStyle=p[2];ctx.fill();
ctx.fillStyle="#ccd";ctx.fillText(p[0],x+p[3]+3,y-p[3])});
window._t=`Simulationszeit: ${(sim.days/365.26).toFixed(2)} Jahre`;
}
// Interaktion
let last=null;
function frame(t){if(last!==null&&sim.running){const dt=(t-last)/1000;sim.days+=dt*sim.speed*365.26/10}last=t;draw();requestAnimationFrame(frame)}
//=e=>{sim.running=!sim.running;e.target.textContent=sim.running?"Pause":"Start"};
//=e=>{sim.speed=Number(e.target.value)};
//=()=>{sim.days=0;draw()};
requestAnimationFrame(frame);
</script></body></html>

View File

@ -0,0 +1,39 @@
<!doctype html><html lang="de"><head><meta charset="utf-8"><title>Sonnensystem</title>
<style>
html,body{margin:0;background:#04050d;color:#dde;font-family:sans-serif}
#bar{display:flex;gap:12px;align-items:center;padding:8px 12px}
canvas{display:block}
</style></head><body>
<div id="bar"><button id="toggle">Pause</button><label>Geschwindigkeit <input id="speed" type="range" min="1" max="100" value="10"></label><button id="reset">Zurücksetzen</button><span id="time">Simulationszeit: 0.00 Jahre</span></div>
<canvas id="c" width="1280" height="740"></canvas>
<script>
// Simulationslogik: Zeit in Tagen, Positionen aus der vergangenen Simulationszeit.
const PLANETS=[["Merkur",87.97,"#aaa",3],["Venus",224.7,"#e8c",5],["Erde",365.26,"#4af",5.5],["Mars",686.98,"#e64",4],["Jupiter",4332.6,"#d96",11],["Saturn",10759,"#eb8",9.5],["Uranus",30688,"#8dd",7.5],["Neptun",60182,"#46f",7]];
const sim={days:0,running:true,speed:10}; // speed: Erdjahre pro Sekunde / 10
const angleOf=p=>2*Math.PI*sim.days/p[1];
// Darstellung
const cv=document.getElementById("c"),ctx=cv.getContext("2d"),cx=640,cy=370;
const stars=document.createElement("canvas");stars.width=cv.width;stars.height=cv.height;const sx=stars.getContext("2d");
sx.fillStyle="#04050d";sx.fillRect(0,0,stars.width,stars.height);
let seed=7;const rnd=()=>(seed=(seed*16807)%2147483647)/2147483647;
for(let i=0;i<220;i++){sx.fillStyle=`rgba(255,255,255,${0.4+rnd()*0.6})`;sx.fillRect(rnd()*stars.width,rnd()*stars.height,1+rnd()*1.5,1+rnd()*1.5)}
const radius=i=>45+i*43;
function draw(){
ctx.drawImage(stars,0,0);
ctx.strokeStyle="#334";ctx.lineWidth=1;
PLANETS.forEach((p,i)=>{ctx.beginPath();ctx.arc(cx,cy,radius(i),0,2*Math.PI);ctx.stroke()});
ctx.beginPath();ctx.arc(cx,cy,20,0,2*Math.PI);ctx.fillStyle="#fc3";ctx.fill();
ctx.fillStyle="#fc8";ctx.font="12px sans-serif";ctx.fillText("Sonne",cx-16,cy+34);
PLANETS.forEach((p,i)=>{const a=angleOf(p),x=cx+radius(i)*Math.cos(a),y=cy+radius(i)*Math.sin(a);
ctx.beginPath();ctx.arc(x,y,p[3],0,2*Math.PI);ctx.fillStyle=p[2];ctx.fill();
ctx.fillStyle="#ccd";ctx.fillText(p[0],x+p[3]+3,y-p[3])});
document.getElementById("time").textContent=`Simulationszeit: ${(sim.days/365.26).toFixed(2)} Jahre`;
}
// Interaktion
let last=null;
function frame_unused(t){if(last!==null&&sim.running){const dt=(t-last)/1000;sim.days+=dt*sim.speed*365.26/10}last=t;draw();requestAnimationFrame(frame)}
document.getElementById("toggle").onclick=e=>{sim.running=!sim.running;e.target.textContent=sim.running?"Pause":"Start"};
document.getElementById("speed").oninput=e=>{sim.speed=Number(e.target.value)};
document.getElementById("reset").onclick=()=>{sim.days=0;draw()};
draw();
</script></body></html>

View File

@ -1,25 +1,39 @@
<!doctype html>
<html lang="de"><head><meta charset="utf-8"><title>Sonnensystem</title>
<!doctype html><html lang="de"><head><meta charset="utf-8"><title>Sonnensystem</title>
<style>
html,body{margin:0;height:100%;overflow:hidden;background:#05060f;color:#ddd;font-family:sans-serif}
#space{position:relative;width:1280px;height:760px}
#sun{position:absolute;left:655px;top:405px;width:50px;height:50px;margin:-25px 0 0 -25px;border-radius:50%;background:#fc3;box-shadow:0 0 40px #fa0}
.planet{position:absolute;border-radius:50%;cursor:pointer;margin:-8px 0 0 -8px;width:16px;height:16px}
#info{position:absolute;left:10px;top:10px;width:300px}
#pause{position:absolute;right:10px;top:10px}
html,body{margin:0;background:#04050d;color:#dde;font-family:sans-serif}
#bar{display:flex;gap:12px;align-items:center;padding:8px 12px}
canvas{display:block}
</style></head><body>
<div id="space"><div id="sun"></div><div id="info">Klicke auf einen Planeten</div><button id="pause">Pause</button></div>
<div id="bar"><button id="toggle">Pause</button><label>Geschwindigkeit <input id="speed" type="range" min="1" max="100" value="10"></label><button id="reset">Zurücksetzen</button><span id="time">Simulationszeit: 0.00 Jahre</span></div>
<canvas id="c" width="1280" height="740"></canvas>
<script>
const data=[["merkur","Merkur",50,"#aaa",4,"4879 km"],["venus","Venus",80,"#e9c",3.2,"12104 km"],["erde","Erde",115,"#4af",2.6,"12742 km"],["mars","Mars",150,"#e64",2.1,"6779 km"],["jupiter","Jupiter",200,"#d96",1.4,"139820 km"],["saturn","Saturn",250,"#eb8",1.1,"116460 km"],["uranus","Uranus",295,"#8dd",0.8,"50724 km"],["neptun","Neptun",335,"#46f",0.6,"49244 km"]];
const space=document.getElementById("space"),info=document.getElementById("info");
let paused=false;const els=[];
for(const [id,name,r,col,sp,dia] of data){
const o=document.createElement("div");o.style.cssText=`position:absolute;left:655px;top:405px;width:${2*r}px;height:${2*r}px;margin:${-r}px 0 0 ${-r}px;border:1px solid #223;border-radius:50%`;space.appendChild(o);
const p=document.createElement("div");p.className="planet";p.dataset.planet=id;p.style.background=col;
p.onclick=()=>{info.textContent=`${name}: Durchmesser ${dia}, Abstand ${r} Einheiten`};space.appendChild(p);els.push([p,r,sp,Math.random()*6]);
// Simulationslogik: Zeit in Tagen, Positionen aus der vergangenen Simulationszeit.
const PLANETS=[["Merkur",87.97,"#aaa",3],["Venus",224.7,"#e8c",5],["Erde",365.26,"#4af",5.5],["Mars",686.98,"#e64",4],["Jupiter",4332.6,"#d96",11],["Saturn",10759,"#eb8",9.5],["Uranus",30688,"#8dd",7.5],["Neptun",60182,"#46f",7]];
const sim={days:0,running:true,speed:10}; // speed: Erdjahre pro Sekunde / 10
const angleOf=p=>2*Math.PI*sim.days/p[1];
// Darstellung
const cv=document.getElementById("c"),ctx=cv.getContext("2d"),cx=640,cy=370;
const stars=document.createElement("canvas");stars.width=cv.width;stars.height=cv.height;const sx=stars.getContext("2d");
sx.fillStyle="#04050d";sx.fillRect(0,0,stars.width,stars.height);
let seed=7;const rnd=()=>(seed=(seed*16807)%2147483647)/2147483647;
for(let i=0;i<220;i++){sx.fillStyle=`rgba(255,255,255,${0.4+rnd()*0.6})`;sx.fillRect(rnd()*stars.width,rnd()*stars.height,1+rnd()*1.5,1+rnd()*1.5)}
const radius=i=>45+i*43;
function draw(){
ctx.drawImage(stars,0,0);
ctx.strokeStyle="#334";ctx.lineWidth=1;
PLANETS.forEach((p,i)=>{ctx.beginPath();ctx.arc(cx,cy,radius(i),0,2*Math.PI);ctx.stroke()});
ctx.beginPath();ctx.arc(cx,cy,20,0,2*Math.PI);ctx.fillStyle="#fc3";ctx.fill();
ctx.fillStyle="#fc8";ctx.font="12px sans-serif";ctx.fillText("Sonne",cx-16,cy+34);
PLANETS.forEach((p,i)=>{const a=angleOf(p),x=cx+radius(i)*Math.cos(a),y=cy+radius(i)*Math.sin(a);
ctx.beginPath();ctx.arc(x,y,p[3],0,2*Math.PI);ctx.fillStyle=p[2];ctx.fill();
ctx.fillStyle="#ccd";ctx.fillText(p[0],x+p[3]+3,y-p[3])});
document.getElementById("time").textContent=`Simulationszeit: ${(sim.days/365.26).toFixed(2)} Jahre`;
}
let last=performance.now();
function tick(t){const dt=(t-last)/1000;last=t;for(const e of els){if(!paused)e[3]+=dt*e[2]*0.6;e[0].style.left=(655+e[1]*Math.cos(e[3]))+"px";e[0].style.top=(405+e[1]*Math.sin(e[3]))+"px"}requestAnimationFrame(tick)}
requestAnimationFrame(tick);
document.getElementById("pause").onclick=()=>{paused=!paused};
// Interaktion
let last=null;
function frame(t){if(last!==null&&sim.running){const dt=(t-last)/1000;sim.days+=dt*sim.speed*365.26/10}last=t;draw();requestAnimationFrame(frame)}
document.getElementById("toggle").onclick=e=>{sim.running=!sim.running;e.target.textContent=sim.running?"Pause":"Start"};
document.getElementById("speed").oninput=e=>{sim.speed=Number(e.target.value)};
document.getElementById("reset").onclick=()=>{sim.days=0;draw()};
requestAnimationFrame(frame);
</script></body></html>