-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathembedgen.html
169 lines (165 loc) · 5.75 KB
/
embedgen.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
<!DOCTYPE html>
<html lang="en" prefix="og: http://ogp.me/ns#">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<!-- Bootstrap CSS -->
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"
integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z"
crossorigin="anonymous"
/>
<link
rel="stylesheet"
href="https://unpkg.com/[email protected]/dist/css/bootstrap-colorpicker.css"
/>
<title>Rauf's Embed Generator</title>
</head>
<body class="container p-2">
<div class="alert alert-primary" role="alert">
Visit My Discord Server
<a href="https://rauf.wtf/discord">https://rauf.wtf/discord</a>
</div>
<div class="alert alert-info" role="alert">
Help support the embed generator by donating to me
<a href="https://paypal.me/itsrauf">via Paypal</a>
</div>
<h1>Rauf's Embed Generator</h1>
<div class="alert alert-warning" role="alert">
This is use at your own risk and I am not responsible for what happens by you using it.
</div>
<form id="embedGen">
<div class="form-group">
<label for="embedGenUrl">Domain To Use</label>
<select class="form-control" id="embedGenUrl" required>
<option>embed.rauf.wtf</option>
<option>rauf.wtf/embed</option>
<option>test.rauf.workers.dev</option>
</select>
</div>
<div class="form-group">
<label for="embedGenAuthorText">Author Text</label>
<input
type="text"
class="form-control"
id="embedGenAuthorText"
placeholder="Author Text Here..."
/>
</div>
<div class="form-group">
<label for="embedGenTitle">Title Text</label>
<input
type="text"
class="form-control"
id="embedGenTitle"
placeholder="Title Text Here..."
/>
</div>
<div class="form-group" id="embedGenColorDiv">
<label for="embedGenColor">Color</label>
<div class="input-group" id="embedGenColorDiv">
<input
type="text"
class="form-control"
id="embedGenColor"
value="#000000"
/>
<span class="input-group-append">
<span class="input-group-text colorpicker-input-addon">
<i></i>
</span>
</span>
</div>
</div>
<div class="form-group">
<label for="embedGenImageUrl">Image URL</label>
<input
type="text"
class="form-control"
id="embedGenImageUrl"
placeholder="Image URL Here..."
/>
</div>
<div class="form-group">
<label for="embedGenRedirectUrl">Redirect URL</label>
<input
type="text"
class="form-control"
id="embedGenRedirectUrl"
placeholder="Redirection URL Here..."
/>
</div>
<button class="btn btn-primary btn-block" type="submit">Generate</button>
<br />
<div class="form-group" id="generatedUrl" hidden>
<label for="embedGenFinalUrl">Generated URL</label>
<input
type="text"
class="form-control"
id="embedGenFinalUrl"
value=""
readonly
/>
</div>
</form>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script
src="https://code.jquery.com/jquery-3.5.1.js"
integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc="
crossorigin="anonymous"
></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js"
integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN"
crossorigin="anonymous"
></script>
<script
src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"
integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV"
crossorigin="anonymous"
></script>
<script src="https://unpkg.com/[email protected]/dist/js/bootstrap-colorpicker.js"></script>
<script>
window.usingDefaultColor = true;
$(function () {
$("#embedGenColorDiv").colorpicker({
horizontal: true
});
$("#embedGenColorDiv").on("colorpickerChange", function (event) {
window.usingDefaultColor = false;
});
});
</script>
<script>
document.getElementById("embedGen").addEventListener("submit", (e) => {
e.preventDefault();
const domain = document.getElementById("embedGenUrl").value;
const title = document.getElementById("embedGenTitle").value;
const author = document.getElementById("embedGenAuthorText").value;
const color = document.getElementById("embedGenColor").value;
const image = document.getElementById("embedGenImageUrl").value;
const redirect = document.getElementById("embedGenRedirectUrl").value;
const final = document.getElementById("embedGenFinalUrl");
const finalDiv = document.getElementById("generatedUrl");
let finalUrl = `https://${domain}/${
title ? title.replace(/\s/g, "+") : ""
}?`;
finalUrl += author ? `&author=${author.replace(/\s/g, "+")}` : "";
finalUrl += window.usingDefaultColor
? ""
: `&color=${color.substring(1)}`;
finalUrl += image ? `&image=${image}` : "";
finalUrl += redirect ? `&url=${redirect}` : "";
console.log(finalUrl);
final.value = finalUrl;
finalDiv.hidden = false;
});
</script>
</body>
</html>