This commit is contained in:
2026-07-07 21:08:52 +02:00
commit 4c20cfc716
2613 changed files with 318021 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
integrity="sha512-Kc323vGBEqzTmouAECnVceyQqyqdsSiqLQISBL29aUW4U/M7pSPA/gEUZQqv1cwx4OnYxTxve5UMg5GT6L4JJg=="
crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body class="none">
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>

View File

@@ -0,0 +1,21 @@
{
"name": "esx_identity_new",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
},
"dependencies": {
"moment": "^2.30.1",
"vee-validate": "^4.14.3",
"vue": "^3.5.10",
"yup": "^1.4.0"
},
"devDependencies": {
"@vitejs/plugin-vue": "^5.1.4",
"vite": "^5.4.8"
}
}

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -0,0 +1,26 @@
<script setup>
import { onMounted } from 'vue';
import Identity from './components/Identity.vue'
onMounted(() => {
fetch("http://esx_identity/ready", {
method: "POST",
body: JSON.stringify({}),
});
window.addEventListener("message", (event) => {
if (event.data.type === "enableui") {
document.body.classList[event.data.enable ? "remove" : "add"]("none");
}
});
})
</script>
<template>
<Identity/>
</template>
<style scoped>
</style>

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>

After

Width:  |  Height:  |  Size: 496 B

View File

@@ -0,0 +1,92 @@
<script setup>
import { ref } from 'vue'
import { Form, Field, ErrorMessage } from 'vee-validate';
import * as yup from 'yup'
import moment from 'moment'
const onSubmit = (values) => {
fetch("http://esx_identity/register", {
method: "POST",
body: JSON.stringify({
firstname: values.firstname,
lastname: values.lastname,
dateofbirth: moment(values.dob).format("DD/MM/YYYY"),
sex: values.gender,
height: values.height,
}),
});
}
const schema = yup.object({
firstname: yup.string().required('Firstname is required').min(3, 'Firstname must be at least 3 characters'),
lastname: yup.string().required('Lastname is required').min(3, 'Lastname must be at least 3 characters'),
dob: yup.date()
.required('Date of Birth is required')
.min(new Date("1900-01-01"), "Date is too early")
.max(moment().subtract(1, 'years').toDate(), "You need to be atleast 1 year old"),
gender: yup.string().required('Gender is required'),
height: yup.number().required('Height is required').min(120, 'Minimum height is 120cm').max(220, 'Maximum height is 220cm').typeError('Amount must be a number'),
})
</script>
<template>
<div class="dialog">
<div class="dialog__header">
<h1>CHARACTER <span>IDENTITY</span></h1>
</div>
<div class="dialog__body">
<p class="dialog__body-hint">Start by creating your identity</p>
<Form class="dialog__body-form" id="register" action="#" novalidate @submit="onSubmit" :validation-schema="schema">
<div class="dialog__form-group">
<label for="firstname">Firstname</label>
<div class="dialog__form-validation">
<Field id="firstname" type="text" name="firstname" placeholder="Firstname" validateOnInput />
</div>
<ErrorMessage name="firstname" class="dialog__form-message dialog__form-message--error" />
</div>
<div class="dialog__form-group">
<label for="lastname">Lastname</label>
<div class="dialog__form-validation">
<Field id="lastname" type="text" name="lastname" placeholder="Lastname" validateOnInput />
</div>
<ErrorMessage name="lastname" class="dialog__form-message dialog__form-message--error" />
</div>
<div class="dialog__form-group">
<label for="dob">Date of birth</label>
<Field id="dob" type="date" name="dob" placeholder="dd/mm/yyyy" validateOnInput />
<ErrorMessage name="dob" class="dialog__form-message dialog__form-message--error" />
</div>
<div class="dialog__form-group">
<label for="gender">Gender</label>
<div class="dialog__form-group dialog__form-group--radio">
<div class="dialog__form-radio">
<Field type="radio" id="male" value="m" name="gender" validateOnInput />
<label for="male">
<i class="fas fa-mars"></i>Male
</label>
</div>
<div class="dialog__form-radio">
<Field type="radio" id="female" value="f" name="gender" validateOnInput />
<label for="female">
<i class="fas fa-venus"></i>Female
</label>
</div>
</div>
<ErrorMessage name="gender" class="dialog__form-message dialog__form-message--error" />
</div>
<div class="dialog__form-group">
<label for="height">Height</label>
<Field id="height" type="text" name="height" placeholder="175" validateOnInput/>
<ErrorMessage name="height" class="dialog__form-message dialog__form-message--error" />
</div>
<button class="dialog__form-submit" id="submit" type="submit">
<i class="fas fa-user-plus"></i>CREATE
</button>
</Form>
</div>
</div>
</template>
<style scoped>
</style>

View File

@@ -0,0 +1,5 @@
import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
createApp(App).mount('#app')

View File

@@ -0,0 +1,195 @@
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');
/* body {
margin: 0;
display: flex;
place-items: center;
min-width: 320px;
min-height: 100vh;
} */
/* REMOVE LATER, ADD SCSS */
body {
font-family: sans-serif;
overflow: hidden;
background-color: transparent;
}
.none {
display: none;
}
.dialog {
width: 477px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: #080808;
border-radius: 8px;
border: none;
color: #ffffff;
font-family: "Poppins", sans-serif;
}
.dialog__header {
background-color: #040404;
border-top-left-radius: 8px;
border-top-right-radius: 8px;
padding: 20px;
text-align: center;
}
.dialog__header h1 {
font-weight: 700;
margin-bottom: 0;
font-size: 30px;
}
.dialog__header span {
color: #FD9800;
}
.dialog__body {
padding-block: 20px;
padding-inline: 65px;
}
.dialog__body-hint {
text-align: center;
margin-bottom: 20px;
}
.dialog__body-form {
display: flex;
flex-direction: column;
gap: 35px;
font-weight: 600;
font-size: 15px;
}
.dialog__form-submit {
border:none;
background-color: #FD9800;
color: #fff;
font-size: 18px;
font-weight:bold;
border-radius: 4px;
padding-block: 5px;
}
.dialog__form-submit i {
margin-right: 5px;
}
.dialog__form-group {
display: flex;
align-items: center;
justify-content: space-between;
gap: 30px;
background-color: #040404;
position: relative;
}
.dialog__form-group--radio {
gap: 0;
}
.dialog__form-group label {
flex-grow: 1; /* Label will expand to fill available space */
flex-shrink: 1; /* Allows the label to shrink if necessary */
padding-inline: 20px; /* Horizontal padding */
}
.dialog__form-group input {
background-color: transparent;
border: none;
height: 30px;
width: 180px; /* Fixed width for input */
flex-shrink: 0; /* Prevent input from shrinking */
color: white;
}
.dialog__form-group input:focus {
background-color: rgba(15, 15, 15, 0.9);
border: none;
border-radius: 5px;
color: #ffffff;
outline: none;
box-shadow: none;
}
.dialog__form-validation {
position: relative;
}
.dialog__form-validation i {
position: absolute;
right: 10px;
top: 50%;
transform: translate(0, -50%);
}
.dialog__form-radio {
display: flex;
align-items: center;
}
.dialog__form-radio input {
display: none;
}
.dialog__form-radio label {
display: flex;
align-items: center;
gap: 10px;
cursor: pointer;
}
.dialog__form-radio input + label {
height: 30px;
display: flex;
align-items: center;
}
.dialog__form-radio input:checked + label {
color: #30A1FD;
height: 30px;
}
.dialog__form-radio input:not(:checked) + label {
color: #242424;
height: 30px;
}
.dialog__form-message {
position: absolute;
top: 35px;
right: 0;
font-size: 9px;
}
.dialog__form-message--error {
color: #733838;
}
#male:checked + label {
color: #30A1FD; /* Blue color */
}
/* For the female radio button */
#female:checked + label {
color: #FF69B4; /* Pink color */
}
::placeholder {
color: #242424;
font-weight: 600;
}
input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-calendar-picker-indicator {
display: none;
-webkit-appearance: none;
}

View File

@@ -0,0 +1,8 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// https://vitejs.dev/config/
export default defineConfig({
base: './',
plugins: [vue()],
})