some test required
This commit is contained in:
43
public/login/login.html
Normal file
43
public/login/login.html
Normal file
@ -0,0 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="cs">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<title>Přihlášení | Infinitum</title>
|
||||
</head>
|
||||
<body>
|
||||
<form action="http://10.69.13.199:8000/" method="post">
|
||||
<div class="most_outer_form_border">
|
||||
<div class="outer_form_border">
|
||||
<div class="form_border">
|
||||
<h1>Přihlášení</h1>
|
||||
<br>
|
||||
<label for="username">Uživatelské jméno</label>
|
||||
<br>
|
||||
<input type="text" name="username" id="username" autofocus required minlength="3" maxlength="25"/>
|
||||
<br>
|
||||
<label for="password">Heslo</label>
|
||||
<br>
|
||||
<input type="password" name="password" id="password" required minlength="8" maxlength="40" pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*]).{8,}$"/>
|
||||
<br>
|
||||
<button type="submit">Přihlásit se</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
const form = document.querySelector("form");
|
||||
form.addEventListener("submit", function (e) {
|
||||
e.preventDefault();
|
||||
const passwordInput = this.querySelector("input[type=password]");
|
||||
crypto.subtle.digest("SHA-512", new TextEncoder().encode(passwordInput.value)).then(function (hashBuffer) {
|
||||
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
||||
const hashHex = hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');
|
||||
passwordInput.value = hashHex;
|
||||
form.submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
66
public/login/style.css
Normal file
66
public/login/style.css
Normal file
@ -0,0 +1,66 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,200&family=Source+Code+Pro:wght@300&display=swap');
|
||||
|
||||
body {
|
||||
background-image: linear-gradient(120deg, #fccb90 0%, #d57eeb 100%);
|
||||
}
|
||||
|
||||
.form_border {
|
||||
border: 1px solid rgb(92, 92, 92);
|
||||
border-radius: 7px;
|
||||
background-color: rgb(160, 161, 182);
|
||||
width: 350px;
|
||||
text-align: center;
|
||||
height: 400px;
|
||||
justify-content: space-around;
|
||||
line-height: 200%;
|
||||
font-family: 'DM Sans', sans-serif;
|
||||
font-size: larger;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.form_border > input {
|
||||
width: 95%;
|
||||
font-family: 'Source Code Pro', monospace;
|
||||
outline: none;
|
||||
font-size: larger;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.form_border > input:focus {
|
||||
background-color: rgb(235, 235, 235);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.form_border > label {
|
||||
width: 97%;
|
||||
display: inline-block;
|
||||
line-height: 200%;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.form_border > button {
|
||||
font-family: 'DM Sans', sans-serif;
|
||||
font-size: larger;
|
||||
position: absolute;
|
||||
bottom: 10px;
|
||||
/*left: 117px;*/
|
||||
left: 0;
|
||||
background-color: rgba(255, 190, 78, 0.7);
|
||||
height: 12%;
|
||||
font-weight: bold;
|
||||
border: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.most_outer_form_border {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.outer_form_border {
|
||||
margin: auto;
|
||||
}
|
24
public/main/index.html
Normal file
24
public/main/index.html
Normal file
@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="cs">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<title>Infinitum</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="cosiRandomCentered">
|
||||
<div class="chatHier">
|
||||
|
||||
</div>
|
||||
<div class="inputHier">
|
||||
<textarea id="textInput" autofocus name="textInput" rows="2" wrap="soft" >
|
||||
</textarea>
|
||||
<button type="button">Odeslat!</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="script.js"></script>
|
||||
</body>
|
||||
</html>
|
76
public/main/script.js
Normal file
76
public/main/script.js
Normal file
@ -0,0 +1,76 @@
|
||||
messages = [
|
||||
{
|
||||
messageid: 98568,
|
||||
timestamp: 1630000000000,
|
||||
author: {
|
||||
name: "Velecísař Empy",
|
||||
id: 1,
|
||||
},
|
||||
content: "Test message 01",
|
||||
},
|
||||
{
|
||||
messageid: 98868,
|
||||
timestamp: 1640000000000,
|
||||
author: {
|
||||
name: "Velecísař Empy 2",
|
||||
id: 2,
|
||||
},
|
||||
content: "Test message 02",
|
||||
},
|
||||
{
|
||||
messageid: 96666,
|
||||
timestamp: 1650000000000,
|
||||
author: {
|
||||
name: "Velecísař Empy",
|
||||
id: 1,
|
||||
},
|
||||
content: "Test message 03\n\n\n\n\nPokračování\ntest\na\na\n\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\n\na\na\na\na\na\na\na\na\na\n\na\na\na\na\na\na\na\na\na\n\na\na\na\na\na\na\na\na\na\n",
|
||||
},
|
||||
];
|
||||
|
||||
const messagesDescending = messages.sort((a, b) => a.timestamp - b.timestamp);
|
||||
|
||||
let htmlString = "";
|
||||
|
||||
const currentUser = {
|
||||
name: "Velecísař Empy",
|
||||
id: 1,
|
||||
};
|
||||
|
||||
messagesDescending.forEach((obj) => {
|
||||
var meAuthor = obj.author.id == currentUser.id;
|
||||
var tempString = "";
|
||||
if (meAuthor) {
|
||||
tempString = '<div class="message left">';
|
||||
} else {
|
||||
tempString = '<div class="message right">';
|
||||
}
|
||||
|
||||
tempString += "<div class=\"firstLine\">"
|
||||
|
||||
// console.log(event.toLocaleString('cs-CZ', { weekday: "long", year: "numeric", month:"long", day: "numeric", era: "long", hour: "numeric", minute: "numeric", second: "numeric"}));
|
||||
const locale = "cs-CZ";
|
||||
const options = {
|
||||
weekday: "long",
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
hour: "numeric",
|
||||
minute: "numeric",
|
||||
second: "numeric",
|
||||
era: "long"
|
||||
};
|
||||
|
||||
|
||||
tempString += `<p class=\"author\">${ obj.author.name}</p>`;
|
||||
tempString += "<p class=\"spacer\"></p>"
|
||||
tempString += `<p class=\"time\">${ new Date(obj.timestamp).toLocaleString(locale, options)}</p>`;
|
||||
tempString += "</div>"
|
||||
//htmlString += `<p>ID: ${obj.messageid}, Timestamp: ${obj.timestamp}, Author Name: ${obj.author.name}, Author ID: ${obj.author.id}, Content: ${obj.content}</p>`;
|
||||
tempString += `<p class=\"content\">${obj.content.replaceAll("\n", "<br/>")}</p>`;
|
||||
|
||||
tempString += "</div>";
|
||||
htmlString += tempString;
|
||||
});
|
||||
|
||||
$(".chatHier").html(htmlString);
|
94
public/main/style.css
Normal file
94
public/main/style.css
Normal file
@ -0,0 +1,94 @@
|
||||
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,200&family=Source+Code+Pro:wght@300&display=swap");
|
||||
/*
|
||||
font-family: 'Source Code Pro', monospace;
|
||||
font-family: 'DM Sans', sans-serif;
|
||||
*/
|
||||
|
||||
body,
|
||||
html {
|
||||
font-family: "Source Code Pro", monospace;
|
||||
background-image: linear-gradient(120deg, #fccb90 0%, #d57eeb 100%);
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.cosiRandomCentered {
|
||||
height: 100vh;
|
||||
width: 60vw;
|
||||
background-color: rgba(240, 240, 240, 0.55);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.inputHier {
|
||||
margin-top: auto;
|
||||
background-color: #f0f0f0; /* Optional: Set a background color for better visibility */
|
||||
padding: 10px; /* Optional: Adjust padding as needed */
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
/*grid-template-columns: 2fr 1fr;*/
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.inputHier > textarea {
|
||||
font-family: "Source Code Pro", monospace;
|
||||
font-size: large;
|
||||
/*width: 1024px;*/
|
||||
width: 90%;
|
||||
box-sizing: border-box;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.inputHier > button {
|
||||
font-family: "Source Code Pro", monospace;
|
||||
font-size: larger;
|
||||
font-weight: 700;
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.chatHier {
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.message {
|
||||
border: #d57eeb solid 5px;
|
||||
border-radius: 20px;
|
||||
width: max-content;
|
||||
padding: 5px;
|
||||
margin: 3px;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: x-small;
|
||||
}
|
||||
|
||||
.author {
|
||||
font-size: x-small;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.firstLine {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.spacer {
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.left {
|
||||
color: darkslategray;
|
||||
background-color: rgba(30, 215, 250, 0.8);
|
||||
margin-right: auto;
|
||||
}
|
||||
.right {
|
||||
color: darkslategray;
|
||||
background-color: rgba(250, 65, 30, 0.8);
|
||||
margin-left: auto;
|
||||
}
|
22
public/notfound/404.html
Normal file
22
public/notfound/404.html
Normal file
@ -0,0 +1,22 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>404 | Infinitum</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="most_outer_form_border">
|
||||
<div class="outer_form_border">
|
||||
<div class="form_border">
|
||||
<h1>Stránka Nebyla Nalezena</h1>
|
||||
<p>
|
||||
Omlouváme se, ale stránka kterou se snažíte načíst nebyla nalezena.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
37
public/notfound/style.css
Normal file
37
public/notfound/style.css
Normal file
@ -0,0 +1,37 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,200&family=Source+Code+Pro:wght@300&display=swap');
|
||||
|
||||
/*
|
||||
font-family: 'Source Code Pro', monospace;
|
||||
font-family: 'DM Sans', sans-serif;
|
||||
*/
|
||||
|
||||
body {
|
||||
background-image: linear-gradient(120deg, #fccb90 0%, #d57eeb 100%);
|
||||
}
|
||||
|
||||
.form_border {
|
||||
border: 1px solid rgb(92, 92, 92);
|
||||
border-radius: 7px;
|
||||
background-color: rgb(160, 161, 182);
|
||||
width: 550px;
|
||||
text-align: center;
|
||||
height: 200px;
|
||||
justify-content: space-around;
|
||||
line-height: 200%;
|
||||
font-family: 'DM Sans', sans-serif;
|
||||
font-size: larger;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.most_outer_form_border {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.outer_form_border {
|
||||
margin: auto;
|
||||
}
|
5
public/robots.txt
Normal file
5
public/robots.txt
Normal file
@ -0,0 +1,5 @@
|
||||
# www.robotstxt.org/
|
||||
|
||||
# Allow crawling of all content
|
||||
User-agent: *
|
||||
Disallow:
|
Reference in New Issue
Block a user