currentColor stream display is now in a canvas

This commit is contained in:
BroodjeAap 2020-07-12 13:38:04 +00:00
parent 664fe5c22d
commit 8a8285240a
3 changed files with 22 additions and 4 deletions

View file

@ -0,0 +1,13 @@
document.addEventListener("DOMContentLoaded", function(){
const canvas = document.getElementById("canvas");
const ctx = canvas.getContext("2d");
var src = document.getElementById("current_color_stream");
var img = new Image();
img.src = src.src;
img.onload = function() {
ctx.drawImage(img, 0, 0);
}
});

View file

@ -3,6 +3,8 @@
<head>
<title>StreamWatcher</title>
<link rel="stylesheet" href="https://unpkg.com/purecss@2.0.3/build/pure-min.css" integrity="sha384-cg6SkqEOCV1NbJoCu11+bm0NvBRc8IYLRGXkmNrqUBfTjmMYwNKPWBTIKyw9mHNJ" crossorigin="anonymous">
<link rel="stylesheet" href="/static/css/style.css">
<script src="/static/js/stream.js"></script>
</head>
<body>
{{template "content" .}}

View file

@ -1,7 +1,10 @@
{{template "base" .}}
{{define "content"}}
<img src="/stream?name={{.Name}}">
<img src="/previous?name={{.Name}}" width="425" height="240">
<img src="/debug?name={{.Name}}" width="425" height="240">
<img src="/current?name={{.Name}}" width="425" height="240">
<div>
<canvas id="canvas" width="1280" height="720">Not supported</canvas>
<img src="/stream?name={{.Name}}" id="current_color_stream" hidden>
<img src="/previous?name={{.Name}}" width="425" height="240">
<img src="/debug?name={{.Name}}" width="425" height="240">
<img src="/current?name={{.Name}}" width="425" height="240">
</div>
{{end}}