فهرست منبع

Ricos initial code

Leone25 4 سال پیش
والد
کامیت
8e70b4ca53
6فایلهای تغییر یافته به همراه225 افزوده شده و 0 حذف شده
  1. 47 0
      index.php
  2. BIN
      source/logo.png
  3. 0 0
      source/script.js
  4. 113 0
      source/style.css
  5. 47 0
      submit.php
  6. 18 0
      success.php

+ 47 - 0
index.php

@@ -0,0 +1,47 @@
+<!doctype html>
+<html lang="en">
+<head>
+  <meta charset="utf-8">
+  <title>Bedrock Server Application</title>
+  <meta name="description" content="Apply to be whitelisted on the Empyrean Realm' bedrock server">
+  <meta name="author" content="Empyrean Realm">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <link rel="stylesheet" href="source/style.css">
+</head>
+<body>
+<div>
+<form action="submit.php" method="post">
+<img src="source/logo.png" alt="logo" id="logo">
+<h1>Bedrock Server Application</h1>
+<p>Please ask a Bedrock Moderator for assistance on Discord if required.</p>
+
+<p>Please only apply once, multiple applications or requests to add you to the server will result in your application being removed.</p>
+
+<p><a href="https://empyreanrealm.com/discord">Discord link</a></p>
+
+<p>This information can be seen by the moderation team. Please contact the Discord Admins if you wish this data to be removed, please note that removal of this information will require removing you from the bedrock server whitelist. Falsifying this information will result in an immediate ban on all platforms. We ask for players date of birth to ensure all users are over 13 years of age, the minimum required to join our Discord and Minecraft servers.</p>
+
+<p><i>* Required questions</i></p>
+
+<label for="fname">Name/nickname:</label><br>
+<input type="text" id="fname" name="fname" placeholder="Name" title="How you wish to be called." required>*<br>
+
+<label for="fdiscord">Discord username:</label><br>
+<input type="text" id="fdiscord" name="fdiscord" placeholder="You#0001" pattern=".+#[0-9]{4}(?<!0000)" title="A discord username and tag Eg. You#0001" required>*<br>
+
+<label for="fbedrock">Minecraft bedrock username (make sure to check the capitalization otherwise it won't work):</label><br>
+<input type="text" id="fbedrock" name="fbedrock" placeholder="EmpyreanRealm" title="Your ingame name. Pay close attenction to the capitalization of the name otherwise we won't be able to whitelist you!" required>*<br>
+
+<label for="fbirthdate" required>Date of birth:</label><br>
+<input type="date" id="fbirthdate" name="fbirthdate" title="Your date of birth. Will be used to to check if you are over 13 to comply with our rules." required>*<br>
+
+<br>
+<input type="submit" value="Submit">
+<?php if (isset($_GET["error"])){
+  echo '<p style="color:red">Error:  ' . htmlspecialchars($_GET["error"]) . '</p>';
+}
+?>
+</form>
+</div>
+</body>
+</html>

BIN
source/logo.png


+ 0 - 0
source/script.js


+ 113 - 0
source/style.css

@@ -0,0 +1,113 @@
+:root {
+  --background-color: #55C9F6;
+  --light-background-color:#CAE3FB;
+  --text-color: black;
+  --accent-color: #29A5F2;
+}
+
+::-webkit-scrollbar {
+  width: 5px;
+  height: 5px;
+}
+::-webkit-scrollbar-button {
+  width: 0px;
+  height: 0px;
+}
+::-webkit-scrollbar-thumb {
+  background: var(--text-color);
+  border: none;
+  border-radius: 0px;
+}
+::-webkit-scrollbar-thumb:hover {
+  background: var(--text-color);
+}
+::-webkit-scrollbar-thumb:active {
+  background: var(--text-color);
+}
+::-webkit-scrollbar-track {
+  background: rgba(0,0,0,0);
+  border: none;
+  border-radius: 0px;
+}
+::-webkit-scrollbar-track:hover {
+  background: rgba(0,0,0,0);
+}
+::-webkit-scrollbar-track:active {
+  background: rgba(0,0,0,0);
+}
+::-webkit-scrollbar-corner {
+  background: rgba(0,0,0,0);
+}
+
+*{
+  transition-duration: 0.5s;
+  scrollbar-color: var(--text-color) rgba(0,0,0,0) !important;
+  scrollbar-width: thin !important;
+}
+
+a {
+	color: var(--accent-color);
+}
+
+a:hover {
+	opacity: 0.5;
+}
+
+body {
+  background: var(--background-color);
+  color: var(--text-color);
+  font-family: 'Fira Sans', sans-serif;
+  position: fixed;
+  margin: 0;
+  padding: 0;
+  height: 100%;
+  width: 100%;
+}
+
+body>div {
+  height: 100%;
+  width: 100%;
+  margin: 0;
+  padding: 0;
+  display: flex;
+  flex-flow: column;
+  justify-content: center;
+  align-items: center;
+  overflow: auto;
+}
+
+body>div>* {
+  max-width: 900px;
+  background: var(--light-background-color);
+  padding: 20px;
+  border-radius: 10px;
+  overflow: auto;
+}
+
+input {
+  border: none;
+  border-bottom: white solid 2px;
+  background: rgba(255, 255, 255, 0.3);
+  width: 100%;
+  outline: none;
+  font-size: 15px;
+  padding: 5px;
+}
+
+input:hover {
+  background: rgba(255, 255, 255, 0.5);
+}
+
+input:focus {
+  border: none;
+  border-bottom: var(--accent-color) solid 2px;
+  background: rgba(255, 255, 255, 0.9);
+}
+
+#logo {
+  float: right;
+  width: 100%;
+  max-width: 80px;
+  border-radius: 80px;
+  overflow: hidden;
+}

+ 47 - 0
submit.php

@@ -0,0 +1,47 @@
+<?php
+$name = $discord = $bedrock = $birthdate = $nameErr = "";
+
+if ($_SERVER["REQUEST_METHOD"] == "POST") {
+  $name = test_input($_POST["fname"]);
+  if (!preg_match("/^[a-zA-Z-' ]*$/",$name)) {
+    $nameErr = "Only letters and white space allowed.";
+  }
+  $discord = test_input($_POST["fdiscord"]);
+  if (!preg_match("/.+#[0-9]{4}(?<!0000)/",$discord)) {
+    $nameErr = "Discord name not valid";
+  }
+  $bedrock = test_input($_POST["fbedrock"]);
+  if (!preg_match("/^[a-zA-Z-' ]*$/",$bedrock)) {
+    $nameErr = "Only letters and white space allowed.";
+  }
+  $birthdate = test_input($_POST["fbirthdate"]);
+} else {
+    $nameErr = "Request not valid.";
+}
+
+if ($nameErr == "") {
+  echo "name " . $name . "<br>";
+  echo "discord " . $discord . "<br>";
+  echo "bedrock " . $bedrock . "<br>";
+  echo "birthday " . $birthdate  . "<br>";
+
+  // send data somehow to db
+
+
+  // end then redirect to the succes page
+
+  header("Location: success.php");
+  die();
+
+} else {
+  header("Location: index.php?error=" . htmlspecialchars($nameErr));
+  die();
+}
+
+function test_input($data) {
+  $data = trim($data);
+  $data = stripslashes($data);
+  $data = htmlspecialchars($data);
+  return $data;
+}
+?>

+ 18 - 0
success.php

@@ -0,0 +1,18 @@
+<!doctype html>
+<html lang="en">
+<head>
+  <meta charset="utf-8">
+  <title>Bedrock Server Application</title>
+  <meta name="description" content="Apply to be whitelisted on the Empyrean Realm' bedrock server">
+  <meta name="author" content="Empyrean Realm">
+  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+  <link rel="stylesheet" href="source/style.css">
+</head>
+<body>
+<div>
+<div>
+Hurray! We recived your submission and we will review it as soon as possible, hold on tight!
+</div>
+</div>
+</body>
+</html>