-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
284 lines (256 loc) · 11.1 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png" />
<link rel="manifest" href="site.webmanifest" />
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="theme-color" content="#ffffff" />
<title> !-Alpha-! Vital-Drop | Vital Preset Generator</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" />
<!-- Font Awesome for icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" />
<style>
body {
background-color: #343a40;
color: #fff;
background-blend-mode: screen;
}
.gradient-overlay {
background: radial-gradient(ellipse at top, rgba(10, 14, 18, 0.8), rgba(10, 14, 18, 0.4));
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
position: fixed;
}
#drop-area {
width: 100%;
height: 700px;
border: 2px dashed #ccc;
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
font-size: 20px;
color: #ccc;
margin-top: 50px;
}
#drop-area.hover {
border-color: #fff;
color: #fff;
}
#file-content {
margin-top: 20px;
word-break: break-all;
}
#contacts {
margin-top: 50px;
}
</style>
</head>
<body>
<!-- Navbar -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark navbar-fixed">
<a class="navbar-brand" href="#">
<a style="font-style: italic"> Vital-Drop | Vital Preset Generator </a>
</a>
<div class="nav-item logo-section justify-content-end">
<a href="https://vital.audio/" target="_blank">
<img style="width: 45px; height: auto;" class="top-logo"
src="https://vital.audio/images/vital_full_no_background.png" />
</a>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="#">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#contacts">Contact</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://www.facebook.com/coalesceedm" target="_blank"><i
class="fab fa-facebook-f"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://soundcloud.com/user-999486594" target="_blank"><i
class="fab fa-soundcloud"></i></a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://github.com/JasonAlexanderChase" target="_blank"><i
class="fab fa-github"></i></a>
</li>
<li class="nav-item">
<button class="btn btn-primary" id="shareButton">Share</button>
</li>
</ul>
</div>
</nav>
<!-- Rest of your content -->
<div class="container" class="text-center row justify-content-center">
<div class="text-center" class="row justify-content-center">
<div class="gradient-overlay"></div>
</div>
<div class="text-center" class="col-md-8">
<div id="file-content" style="display:none" class="mt-3"></div>
<hr>
<h1>Vital-Drop | Vital Preset Generator </h1>
<hr>
<iframe class="text-center" class="row justify-content-center" width="1120" height="300"
src="https://www.youtube.com/embed/7kNvSXxZrs4" title="VITAL" frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
<hr>
<p style="font-size:22px"
style="font-weight: 100; font-size:26px; font-style: italic;font-variant: small-caps;">drag and drop one
or many .wav file below. Vital presets will automatically download</p>
<div id="drop-area" class="text-center">
Drag and drop WAV files here
</div>
<div id="contacts" class="text-center mt-5">
<h2>Contact Us</h2>
<form action="contact.php" method="post">
<div class="form-group">
<label for="firstName">First Name</label>
<input type="text" class="form-control" id="firstName" name="firstName" required />
</div>
<div class="form-group">
<label for="lastName">Last Name</label>
<input type="text" class="form-control" id="lastName" name="lastName" required />
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" class="form-control" id="email" name="email" required />
</div>
<div class="form-group">
<label for="subject">Subject</label>
<input type="text" class="form-control" id="subject" name="subject" required />
</div>
<div class="form-group">
<label for="message">Message</label>
<textarea class="form-control" id="message" name="message" rows="5" required></textarea>
</div>
<button type="submit" class="btn btn-primary">Send</button>
</form>
</div>
</div>
</div>
<!-- Bootstrap JS, Popper.js, and jQuery -->
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script>
document.getElementById('shareButton').addEventListener('click', () => {
if (navigator.share) {
navigator.share({
title: 'VitalDrop Wav Converter',
text: 'Check out this awesome VitalDrop Wav Converter!',
url: window.location.href,
})
.then(() => console.log('Successfully shared'))
.catch((error) => console.log('Error sharing', error));
} else {
alert('Web Share API is not supported in your browser.');
}
});
</script>
<!-- Bootstrap JS, Popper.js, and jQuery -->
<script>
// Get reference to the drop area
const dropArea = document.getElementById("drop-area");
// Prevent default behaviors
["dragenter", "dragover", "dragleave", "drop"].forEach((eventName) => {
dropArea.addEventListener(eventName, preventDefaults, false);
});
function preventDefaults(e) {
e.preventDefault();
e.stopPropagation();
}
// Highlight the drop area when item is dragged over
["dragenter", "dragover"].forEach((eventName) => {
dropArea.addEventListener(
eventName,
() => {
dropArea.classList.add("hover");
},
false
);
});
// Remove highlight when item is dragged away
["dragleave", "drop"].forEach((eventName) => {
dropArea.addEventListener(
eventName,
() => {
dropArea.classList.remove("hover");
},
false
);
});
// Handle dropped files
dropArea.addEventListener("drop", handleDrop, false);
function handleDrop(e) {
const dt = e.dataTransfer;
const files = dt.files;
handleFiles(files);
}
function handleFiles(files) {
[...files].forEach((file) => {
if (file.type === "audio/wav") {
convertToBase64(file, file.name);
} else {
alert("Only WAV files are supported.");
}
});
}
function convertToBase64(file, originalFileName) {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onloadend = () => {
const base64String = reader.result.split(",")[1]; // Get the base64 string without the prefix
fetchAndCombine(base64String, originalFileName);
};
}
async function fetchAndCombine(base64String, originalFileName) {
try {
const startResponse = await fetch('data/start.txt');
const endResponse = await fetch('data/end.txt');
if (!startResponse.ok || !endResponse.ok) {
throw new Error('Failed to fetch start or end text files');
}
const startText = await startResponse.text();
const endText = await endResponse.text();
const combinedText = startText + '"' + base64String + '"' + endText;
const newFileName = originalFileName.replace(/\.[^/.]+$/, "") + "(Kohlyde)" + ".vital";
initiateDownload(combinedText, newFileName, 'text/plain');
} catch (error) {
console.error('Error fetching text files:', error);
}
}
function initiateDownload(data, filename, type) {
const file = new Blob([data], { type: type });
const a = document.createElement("a"),
url = URL.createObjectURL(file);
a.href = url;
a.download = filename;
document.body.appendChild(a);
a.click();
setTimeout(function () {
document.body.removeChild(a);
window.URL.revokeObjectURL(url);
}, 0);
}
</script>
</body>
</html>