html
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
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<!-- tweak the width and height to properly match and display the text -->
<canvas id="canvas" width="100" height="50">
</canvas>
<h1>❤️</h1>
<script>
function textToURL(text){
const canvas =
document.getElementById("canvas");
const ctx = canvas.getContext("2d");
ctx.save();
// rotate text 15deg
ctx.translate(50, 15);
ctx.rotate((15*Math.PI)/180);
ctx.textAlign = "center";
// adjust font size as desired
ctx.font = "12px Arial";
ctx.fillStyle = "rgba(255,255,255,0.5)";
// your text here
ctx.fillText(text,0,15);
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
body{
display:grid;
text-align:center;
place-items:center;
width:100vw;
height:100vh;
background-color: teal;
background-repeat:repeat;
/* also try round, space */
}
h1{
margin:auto;
font-size:10rem;
}
canvas{
display:none; /* comment out to see the canvas for editing */
outline:2px solid green;
}
Enter to Rename, Shift+Enter to Preview
js
js
1
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run