-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
29 lines (27 loc) · 1.18 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<title>Terrazzo</title>
<link rel="stylesheet" href="style.css">
<script src="src/math.js"></script>
<script src="src/Generator.js"></script>
<script src="src/renderer/SvgRenderer.js"></script>
<script src="src/Patch.js"></script>
</head>
<body>
<script type="text/javascript">
const palettes = [
{ colors: ['#477288', '#bf796d', '#f6c38f', '#7e9a9e', '#cdd1d0'], background: '#f6f6f6' },
{ colors: ['#e2c3a3', '#c36d52', '#435755', '#485158'], background: '#2a2d31' },
{ colors: ['#e0c1bf', '#eef3f5', '#486c73', '#bdc5d1'], background: '#cfdedb' },
{ colors: ['#dddedb', '#9f5b60', '#d9b9c0', '#71989a'], background: '#f1edeb' },
{ colors: ['#f1c58d', '#c0a891', '#6483a6', '#e2e3ee'], background: '#294053' },
];
const { innerWidth, innerHeight } = window;
const palette = Math.randomElement(palettes);
const generator = new Generator(innerWidth, innerHeight, palette.colors);
const renderer = new SvgRenderer(innerWidth, innerHeight);
renderer.render(generator.getPatches(), palette.background);
</script>
</body>
</html>