added web/ with some html and updated go.mod and go.sum to use gin

This commit is contained in:
2025-09-20 13:04:32 -03:00
parent 910cad2734
commit ac236342b6
19 changed files with 1819 additions and 7 deletions

239
web/templates/login.html Normal file
View File

@@ -0,0 +1,239 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Packets - Login</title>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
</head>
<body>
<header>
<img src="/static/img/box.png" alt="Packets" style="height: 60px;">
<h1>Packets Community Repository</h1>
<nav>
<div class="dropdown">
<a href="/register" class="active">Account</a>
<div class="dropdown-content">
<a href="/register">Register</a>
<a href="/login">Login</a>
<a href="/logout">Logout</a>
</div>
</div>
<div class="dropdown">
<a href="/packages">Packages</a>
<div class="dropdown-content">
<a href="/upload">Upload</a>
<a href="/packages">Search</a>
</div>
</div>
<div class="dropdown">
<a href="#">Help</a>
<div class="dropdown-content">
<a href="#">Documentation</a>
<a href="#">Report a bug</a>
<a href="#">Community</a>
</div>
</div>
<a href="#">Download</a>
</nav>
</header>
<hr>
<div class="main-wrapper">
<main>
<h1>Login</h1>
<input type="text" name="login" id="usrlog" placeholder=" Username">
<br>
<input type="password" name="login" id="passlog" placeholder=" Password">
<br><br>
<button id="submitlog">Submit</button>
</main>
</div>
<script>
const usrlog = document.getElementById("usrlog");
const passlog = document.getElementById("passlog");
const submitlog = document.getElementById("submitlog");
submitlog.addEventListener("click", function(){
fetch("https://servidordomal.fun/login", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({
username: usrlog.value,
password: passlog.value})
});
});
</script>
<style>
* {
padding: 0;
margin: 0;
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
}
html,body {
background-color: #EDFBFF;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
}
header {
background-color: #2768F5;
width: 100%;
height: 60px;
display: flex;
align-items: center;
}
nav {
margin-left: auto;
margin-right: 50px;
}
nav a, header h1 {
margin-left: 30px;
text-decoration: none;
color: white;
font-weight: bold;
}
header h1 {
margin-left: 20px;
}
hr {
border: none;
height: 3px;
background: #1B1C24;
}
nav {
margin-left: auto;
margin-right: 50px;
display: flex;
align-items: center;
gap: 20px;
position: relative;
}
nav a, header h1 {
text-decoration: none;
color: white;
font-weight: bold;
}
.dropdown {
position: relative;
}
.dropdown-content {
opacity: 0;
visibility: hidden;
position: absolute;
top: 100%;
left: 0;
background-color: white;
min-width: auto;
padding: 8px 0;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
border-radius: 4px;
z-index: 10;
transition: opacity 0.3s ease, transform 0.3s ease;
transform: translateY(10px);
}
.dropdown:hover .dropdown-content {
opacity: 1;
visibility: visible;
transform: translateY(0);
min-width: max-content;
padding: 8px 12px;
}
.dropdown-content a {
color: black;
padding: 8px 12px;
display: block;
text-decoration: none;
white-space: nowrap;
}
.dropdown-content a:hover {
background-color: #f1f1f1;
}
.main-wrapper {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
}
main{
box-sizing: border-box;
border: 2.5px solid #C4EEF2;
width: 90%;
max-width: 400px;
padding: 30px;
background-color: white;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
border-radius: 12px;
text-align: center;
margin-top: 80px;
}
button {
color: white;
border: 1px solid transparent;
padding: 12px 24px;
border-radius: 6px;
font-size: 1rem;
font-weight: bold;
cursor: pointer;
transition: border-color 0.3s ease;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
background-color: #2768F5;
}
button:hover {
border-color: black;
}
button:active {
transform: translateY(1px);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 12px 1px;
margin: 10px 0;
border: 2px solid gainsboro;
border-radius: 4px;
font-size: 1rem;
transition: all 0.2s ease;
}
input[type="text"]:focus, input[type="password"]:focus {
outline: none;
border-color: #2768F5;
box-shadow: 0 0 0 3px rgba(39, 104, 245, 0.2);
background-color: #f9fcff;
}
nav a.active {
border-bottom: 3px solid white;
color: white;
padding-bottom: 18.93px;
}
</style>
</body>
</html>