Old SandTable project

This commit is contained in:
Your Name
2026-08-08 16:11:57 +03:00
commit 59c9f942f0
68 changed files with 2686 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
var body = document.body;
body.style.margin = 0;
var div = document.getElementById('canvas-div');
var canvas = document.getElementById('chart');
canvas.height = div.offsetHeight;
canvas.width = div.offsetWidth;
var x_center = div.offsetWidth/2
var y_center = div.offsetWidth/2
var ctx = canvas.getContext("2d");
// sand background
var sand = new Image();
sand.src = "static/images/sand.jpg"
var pat = ctx.createPattern(sand, "repeat")
ctx.save();
ctx.beginPath();
ctx.fillStyle = pat;
ctx.arc(x_center, y_center, div.offsetWidth/2-5, 0, 2 * Math.PI);
ctx.fill();
ctx.strokeStyle = 'white';
ctx.lineWidth = 5;
ctx.stroke();
// sand leds
var leds = ctx.createRadialGradient(x_center, y_center, 0, x_center, y_center, div.offsetWidth/2+50)
leds.addColorStop(0, "rgba(255,0,255,0.1)")
leds.addColorStop(1, "rgba(255,0,255,0.3)")
ctx.fillStyle = leds;
ctx.fill();