This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
213 lines (184 loc) · 6.31 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html>
<html lang="en" dir="ltr" data-bs-theme="dark">
<head>
<meta charset="utf-8">
<meta name="description" content="A webtool for adding text to images.">
<title>Image Caption Generator</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="row text-center">
<h1>Image Caption Generator</h1>
<p>A webtool for adding text to images.</p>
<!-- <p>Click 'Load' after uploading an image.</p> -->
</div>
<div class="row align-tools">
<div class="col-md-6 force-gaps">
<div class="row">
<!-- <p class="text-center">Click 'Load' after uploading an image.</p> -->
<div class="input-group">
<input type="file" class="form-control" id="inputGroupFile01" aria-describedby="inputGroupFileAddon01"
aria-label="Upload">
<button class="btn btn-outline-secondary image-upload-button" type="button" id="inputGroupFileAddon01"
onclick="save()">Upload</button>
</div>
<label for="inputGroupFile01" class="text-end">Click 'Load' after uploading an image.</label>
</div>
<div class="row">
<div class="input-group">
<span class="input-group-text">Top text</span>
<textarea class="form-control top-text-box text-boxes" id="top-text" aria-label="Top text"></textarea>
</div>
</div>
<div class="row">
<div class="input-group">
<span class="input-group-text">Bottom text</span>
<textarea class="form-control bottom-text-box text-boxes" id="bottom-text"
aria-label="Bottom text"></textarea>
</div>
</div>
</div>
<div class="col-12 col-md-6 force-gaps">
<div class="row">
<div class="form-floating">
<select class="form-select update-me" id="top-text-alignment" aria-label="Top text alignment">
<option value="0" selected>Left</option>
<option value="1">Center</option>
<option value="2">Right</option>
</select>
<label for="top-text-alignment">  Top text alignment</label>
</div>
</div>
<div class="row">
<div class="col">
<label for="top-text-size" class="form-label">Top text size</label>
<input type="range" class="form-range update-me" id="top-text-size" min=".01" value=".05" max=".1"
step=".005">
</div>
<div class="col">
<label for="bottom-text-size" class="form-label">Bottom text size</label>
<input type="range" class="form-range update-me" id="bottom-text-size" min=".01" value=".05" max=".1"
step=".005">
</div>
</div>
<div class="row">
<div class="col">
<div class="form-check">
<input class="form-check-input update-me" type="checkbox" value="" id="subtitle-background-check">
<label class="form-check-label" for="subtitle-background-check">
Subtitle backdrop
</label>
</div>
</div>
<div class="col">
<div class="form-check">
<input class="form-check-input update-me" type="checkbox" value="" id="subtitle-italic-check">
<label class="form-check-label" for="subtitle-italic-check">
Subtitle italics
</label>
</div>
</div>
<div class="col">
<label for="opacity-slider" class="form-label">Backdrop opacity</label>
<input class="form-range update-me" type="range" id="opacity-slider" min="0" value=".75" max="1"
step=".005">
</div>
<div class="col">
<label for="padding-slider" class="form-label">Backdrop padding</label>
<input class="form-range update-me" type="range" id="padding-slider" min="0" value="0.25" max=".5"
step="0.005">
</div>
</div>
<div class="row">
<div class="col">
<button type="button" class="btn btn-primary" style="width:100%" onclick="save()">Load</button>
</div>
<div id="download-container" class="col">
<a id="download" download="image.png">
<button type="button" class="btn btn-success" style="width:100%" onclick="download()">Download</button>
</a>
</div>
</div>
</div>
</div>
<div class="card text-center">
<!-- <div class="card-header">
Image
</div> -->
<div class="card-body">
<div>
<canvas id="canvas"></canvas>
</div>
</div>
</div>
<div style="display:none">
<input type="color" class="form-color" value="#000000" style="width:100%" title="Background Colour"
id="background-colour">
<input type="color" value="#FFFFFF" style="width:100%" title="Font Colour" id="font-colour">
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN"
crossorigin="anonymous"></script>
<script src="script.js"></script>
</body>
</html>
<style>
h1 {
padding-top: 10px;
}
canvas {
border: 2px solid white;
border-radius: 5px;
max-width: 640px;
width: 100%;
height: auto;
}
#background-color,
#font-color {
display: none;
}
.force-gaps > .row {
padding-top: 10px;
padding-bottom: 10px;
}
.align-tools {
/* align-items: center; */
}
/* body {
background-color: black;
}
h1,
p,
textarea {
font-family: Arial;
}
h1 {
color: white;
text-align: center;
}
div#settings {
text-align: center;
background-color: grey;
border: 5px solid white;
}
div#container {
text-align: center;
background-color: silver;
border: 5px solid grey;
}
div.settings-sections {
display: inline-block;
}
canvas {
max-width: 80vw;
}
#download {
visibility: hidden;
}
#download-container {
text-align: center;
} */
</style>