-
Notifications
You must be signed in to change notification settings - Fork 0
/
favicon.html
43 lines (39 loc) · 1.03 KB
/
favicon.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Favicon generator</title>
<style>
#instructions {
font-family: sans-serif;
padding: 20px;
}
</style>
</head>
<body>
<h3 id="instructions">Download the canvas as an image using "Save image as", name it "favicon.ico".</h3>
<div>
<canvas id="favicon" width="200" height="200"></canvas>
</div>
<script>
const canvas = document.getElementById("favicon");
let context = canvas.getContext("2d");
const gradient = context.createLinearGradient(90, 50, 150, 150);
gradient.addColorStop(0, "#bd75b0");
gradient.addColorStop(0.5, "#e3a0b1");
gradient.addColorStop(1, "#fdc393");
context.beginPath();
context.arc(
canvas.width / 2,
canvas.height / 2,
80,
0,
2 * Math.PI
);
context.fillStyle = gradient;
context.fill();
</script>
</body>
</html>