-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
113 lines (90 loc) · 4.35 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Libraries-->
<!-- download.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/downloadjs/1.4.8/download.js"
integrity="sha512-mxCAjvjp0jvMdGRIEvAHOCGL6BOucqWpTBXwchElsPKNw7BEegHviDHPnYrOrzgzBiw3GD/Q1ibpA5nlFPYDMw=="
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<link rel="stylesheet" href="./css/style.css">
<link rel="icon" href="./img/P.png">
</head>
<body>
<!-- Background fixed div -->
<div id="siteBack"></div>
<!-- Draw text here -->
<canvas id="canvas"></canvas>
<!-- Grid -->
<div class="parent">
<div class="inputFileWrapper">
<button class="file" id="inputFile" onclick="showBGS()">Background</button>
<button class="previewBtn" onclick="animation(color, speed, img)">Preview</button>
<button class="exportBtn" onclick="exportText(color, speed, img)">Export</button>
</div>
<div class="inputTextWrapper">
<input class="topTextbox" type="text" id="inputTop" placeholder="Top text">
<input class="bottomTextbox" type="text" id="inputBottom" placeholder="Bottom text">
<div class="attributesTextbox">
<input type="text" id="speed" placeholder="Speed (ms)">
<input type="color" id="color" value="#ffffff">
</div>
</div>
</div>
<!-- GitHub repo -->
<a href="https://github.com/clairedotpng/ULTRAKILL-Text-Generator">
<img src="./img/github.png" alt="GitHub" title="Star the repo if you can, it helps!" class="git">
</a>
<div class="modal" id="modal">
<div class="bgs">
<img width="400" onclick="updateBG(this)" alt="1-1 HEART OF THE SUNRISE" src="./img/backgrounds/1-1.jpg">
<img width="400" onclick="updateBG(this)" alt="1-4 CLAIR DE LUNE (arena)" src="./img/backgrounds/1-4.jpg">
<img width="400" onclick="updateBG(this)" alt="1-4 CLAIR DE LUNE (staircases)"
src="./img/backgrounds/1-4 (2).jpg">
<img width="400" onclick="updateBG(this)" alt="1-4 CLAIR DE LUNE (skulls entrance)"
src="./img/backgrounds/1-4 (3).jpg">
<img width="400" onclick="updateBG(this)" alt="4-2 GOD DAMN THE SUN" src="./img/backgrounds/4-2.jpg">
<img width="400" onclick="updateBG(this)" alt="5-1 IN THE WAKE OF POSEIDON" src="./img/backgrounds/5-1.jpg">
<img width="400" onclick="updateBG(this)" alt="6-2 AESTHETICS OF HATE (entrance)"
src="./img/backgrounds/6-2.jpg">
<img width="400" onclick="updateBG(this)" alt="6-2 AESTHETICS OF HATE (arena)"
src="./img/backgrounds/6.2 (2).jpg">
<img width="400" onclick="updateBG(this)" alt="6-2 AESTHETICS OF HATE (Gabriel)"
src="./img/backgrounds/6-2 (3).jpg">
<img width="400" onclick="updateBG(this)" alt="7-1 GARDEN OF FORKING PATHS" src="./img/backgrounds/7-1.jpg">
<img width="400" onclick="updateBG(this)" alt="7-2 LIGHT UP THE NIGHT" src="./img/backgrounds/7-2.jpg">
<img width="400" onclick="updateBG(this)" alt="7-4 ...LIKE ANTENNAS TO HEAVEN"
src="./img/backgrounds/7-4.jpg">
<p style="color: black;">For correct results, be sure your background is 1800x600 pixels</p>
<input type="file" id="inputBG" onchange="customBG(this.files[0]);">
</div>
</div>
</body>
<!-- Scripts -->
<script src="./js/main.js"></script>
<script src="./js/title.js"></script>
<script src="./js/bg.js"></script>
<!-- Get and update attributes -->
<script>
let color; let speed;
let c = document.getElementById('canvas')
let context = c.getContext('2d')
let img = new Image()
c.width = Math.round(c.clientWidth);
c.height = Math.round(c.clientHeight);
function updateBG(bg) {
img.src = bg.src
context.drawImage(img, 0, 0, c.width, c.height)
}
function customBG(bg) {
img.src = URL.createObjectURL(bg)
ctx.clearRect(0, 0, c.width, c.height);
context.drawImage(img, 0, 0, c.width, c.height)
}
setInterval(() => {
color = document.getElementById('color').value
speed = document.getElementById('speed').value
}, 10);
</script>
</html>