-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathptbye.html
executable file
·46 lines (46 loc) · 1.12 KB
/
ptbye.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<canvas id=can><span style="color:white">Wow this is a terrible browser</span></canvas>
<textarea id="ta" autocapitalize="off" spellcheck="false" oninput="this.innerText=''"></textarea>
<script>
onresize = () => {
can.width = window.innerWidth
can.height = window.innerHeight
}
let ct = can.getContext("2d"),
textSize = 15
let charWidth = textSize * 0.6,
charHeight = textSize
render = (ch, fg, bg, gx, gy) => {
let x = Math.round(gx), y = Math.round(gy)
ct.font = textSize + "px menlo,monospace"
ct.fillStyle = bg
if(bg)ct.fillRect(x * charWidth, (y) * charHeight, charWidth, charHeight)
ct.fillStyle = fg
ct.fillText(ch[0],x * charWidth, (y + 1) * charHeight)
}
rText=(txt, fg, bg, gx, gy)=>{
txt.split``.forEach((e,i)=>{
render(e, fg, bg, gx+i, gy)
})
}
clear = () => {
ct.clearRect(0, 0, can.width, can.height)
}
</script>
<script src="shmm.js"></script>
<style>
#can {
position: absolute;
top: 0;
left: 0;
background-color: #000;
}
textarea{
width:100vw;
height:100vh;
position: absolute;
top:0;left:0;
opacity:0.01;
}
</style>
<link rel="stylesheet" href="style.css">