currentColor stream display is now in a canvas
This commit is contained in:
parent
664fe5c22d
commit
8a8285240a
3 changed files with 22 additions and 4 deletions
|
@ -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);
|
||||||
|
}
|
||||||
|
});
|
|
@ -3,6 +3,8 @@
|
||||||
<head>
|
<head>
|
||||||
<title>StreamWatcher</title>
|
<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="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>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
{{template "content" .}}
|
{{template "content" .}}
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
{{template "base" .}}
|
{{template "base" .}}
|
||||||
{{define "content"}}
|
{{define "content"}}
|
||||||
<img src="/stream?name={{.Name}}">
|
<div>
|
||||||
<img src="/previous?name={{.Name}}" width="425" height="240">
|
<canvas id="canvas" width="1280" height="720">Not supported</canvas>
|
||||||
<img src="/debug?name={{.Name}}" width="425" height="240">
|
<img src="/stream?name={{.Name}}" id="current_color_stream" hidden>
|
||||||
<img src="/current?name={{.Name}}" width="425" height="240">
|
<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}}
|
{{end}}
|
Loading…
Add table
Reference in a new issue