summaryrefslogtreecommitdiff
path: root/website/static
diff options
context:
space:
mode:
Diffstat (limited to 'website/static')
-rw-r--r--website/static/capes/.gitignore1
-rw-r--r--website/static/index.html26
-rw-r--r--website/static/index.js25
-rw-r--r--website/static/mrpacks/.gitignore1
-rw-r--r--website/static/style.css53
-rw-r--r--website/static/template.html56
-rw-r--r--website/static/template.pngbin0 -> 766 bytes
7 files changed, 162 insertions, 0 deletions
diff --git a/website/static/capes/.gitignore b/website/static/capes/.gitignore
new file mode 100644
index 0000000..e33609d
--- /dev/null
+++ b/website/static/capes/.gitignore
@@ -0,0 +1 @@
+*.png
diff --git a/website/static/index.html b/website/static/index.html
new file mode 100644
index 0000000..6394fcf
--- /dev/null
+++ b/website/static/index.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>Cape Setter</title>
+ <link rel="stylesheet" href="./style.css">
+ <script src="./index.js"></script>
+ </head>
+ <body onload="init()">
+ <div id="main">
+ <img id="preview" src="">
+ <div id="input">
+ <input id="username" type="text" placeholder="Username"/>
+ <input id="file" type="file"/>
+ </div>
+ <div id="resources">
+ <form action="http://<IP>:12444/static/template.html" method="get">
+ <button type="submit">Get Template</button>
+ </form>
+ <form action="https://api.labymod.net/capes/capecreator/" method="get" target="_blank">
+ <button type="submit">Online Cape Creator</button>
+ </form>
+ </div>
+ </div>
+ </body>
+</html>
diff --git a/website/static/index.js b/website/static/index.js
new file mode 100644
index 0000000..22bfc20
--- /dev/null
+++ b/website/static/index.js
@@ -0,0 +1,25 @@
+const IP = "http://<IP>:12444";
+
+function init() {
+ document.getElementById('file').addEventListener('change', handleFileSelect, false);
+}
+
+function handleFileSelect(event) {
+ var username = document.getElementById('username').value
+ if (!username) {
+ return;
+ }
+ const reader = new FileReader();
+ const url = IP + '/capes';
+ var formData = new FormData();
+ formData.append('username', username);
+ formData.append('data', event.target.files[0]);
+ fetch(url, {
+ method : "POST",
+ body: formData
+ }).then((response) => {
+ if (response.ok) {
+ document.getElementById('preview').src = IP + '/static/capes/' + username + '.png';
+ }
+ });
+}
diff --git a/website/static/mrpacks/.gitignore b/website/static/mrpacks/.gitignore
new file mode 100644
index 0000000..bca65f2
--- /dev/null
+++ b/website/static/mrpacks/.gitignore
@@ -0,0 +1 @@
+*.mrpack
diff --git a/website/static/style.css b/website/static/style.css
new file mode 100644
index 0000000..242ced7
--- /dev/null
+++ b/website/static/style.css
@@ -0,0 +1,53 @@
+#main {
+ display: flex;
+ flex-direction: column;
+}
+
+#preview {
+ width: 35%;
+ height: 35%;
+ /* IE, only works on <img> tags */
+ -ms-interpolation-mode: nearest-neighbor;
+ /* Firefox */
+ image-rendering: crisp-edges;
+ /* Chromium + Safari */
+ image-rendering: pixelated;
+}
+
+#template {
+ width: 100%;
+ display: flex;
+ align-items: center;
+ flex-direction: row;
+}
+
+ul {
+ margin-left: 2px;
+}
+
+.input-color {
+ position: relative;
+ margin-top: -10px;
+}
+
+.input-color p {
+ padding-left: 30px;
+}
+
+.input-color .color-box {
+ width: 20px;
+ height: 20px;
+ display: inline-block;
+ background-color: #ccc;
+ position: absolute;
+ left: 5px;
+ top: -1px;
+}
+
+#desc {
+ margin-top: 0px;
+}
+
+#desc p {
+ margin-bottom: -10px;
+}
diff --git a/website/static/template.html b/website/static/template.html
new file mode 100644
index 0000000..f7d62de
--- /dev/null
+++ b/website/static/template.html
@@ -0,0 +1,56 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>Cape Template</title>
+ <link rel="stylesheet" href="./style.css">
+ </head>
+ <body>
+ <div id="template">
+ <img id="preview" src="http://<IP>:12444/static/template.png"/>
+ <ul>
+ <div class="input-color">
+ <p>Top</p>
+ <div class="color-box" style="background-color: #F7D9E6;"></div>
+ </div>
+ <div class="input-color">
+ <p>Bottom</p>
+ <div class="color-box" style="background-color: #FBFFC4;"></div>
+ </div>
+ <div class="input-color">
+ <p>Left Side</p>
+ <div class="color-box" style="background-color: #B6C9D5;"></div>
+ </div>
+ <div class="input-color">
+ <p>Front</p>
+ <div class="color-box" style="background-color: #D5B6C6;"></div>
+ </div>
+ <div class="input-color">
+ <p>Right Side</p>
+ <div class="color-box" style="background-color: #C2B6D5;"></div>
+ </div>
+ <div class="input-color">
+ <p>Back</p>
+ <div class="color-box" style="background-color: #B6D5C9;"></div>
+ </div>
+ <div class="input-color">
+ <p>Elytra (back is mirrored)</p>
+ <div class="color-box" style="background-color: #FFB8B8;"></div>
+ </div>
+ <div class="input-color">
+ <p>Elytra Bottom</p>
+ <div class="color-box" style="background-color: #D9E4CE;"></div>
+ </div>
+ <div class="input-color">
+ <p>Elytra Inner</p>
+ <div class="color-box" style="background-color: #F6CBBC;"></div>
+ </div>
+ </ul>
+ </div>
+ <div id="desc">
+ <p>Right click and "Save Image As...", edit, then upload <a href="http://<IP>:12444/capes">here</a>.</p>
+ <p>If you don't want to edit the Elytra texture, you can crop it out.</p>
+ <p>Feel free to scale. Only use integer scaling (Multiply width/height by a whole number).</p>
+ </div>
+ </body>
+</html>
diff --git a/website/static/template.png b/website/static/template.png
new file mode 100644
index 0000000..102e5bf
--- /dev/null
+++ b/website/static/template.png
Binary files differ