Add user authentication and dashboard features

- Implemented login and registration forms with validation.
- Created dashboard layout to display user account information and pastes.
- Added JavaScript functionality for fetching account data and pastes.
- Styled authentication and dashboard pages with CSS.
- Introduced modals for logout and account deletion confirmation.
- Included error handling for user actions and API responses.

### Copilot generated commit message
This commit is contained in:
whoswhip
2025-05-17 22:20:07 -04:00
parent 94fb936b32
commit 2a25ab1ab8
20 changed files with 2185 additions and 299 deletions
+182 -39
View File
@@ -1,62 +1,205 @@
.main-container {
max-width: 80%;
margin: 2rem auto;
padding: 1.5rem;
background-color: var(--neutral-900);
border-radius: 8px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
#archive-header {
font-size: 2rem;
font-weight: 700;
margin-bottom: 1.5rem;
color: var(--neutral-50);
text-align: center;
letter-spacing: 0.5px;
}
.archive-information {
display: grid;
grid-template-columns: 2fr 1fr 1fr;
gap: 1rem;
padding: 0.75rem 1rem;
margin-bottom: 1rem;
background-color: var(--neutral-800);
border-radius: 6px;
font-weight: 600;
color: var(--neutral-200);
border-bottom: 2px solid var(--neutral-700);
width: 100%;
}
.archive-information p {
margin: 0;
}
.archive-list {
list-style-type: none;
margin: 0;
padding: 0;
width: 100%;
max-height: 100%;
overflow-y: scroll;
max-height: 70vh;
overflow-y: auto;
border-radius: 6px;
scrollbar-width: thin;
scrollbar-color: var(--neutral-700) var(--neutral-900);
}
.archive-list::-webkit-scrollbar {
width: 8px;
}
.archive-list::-webkit-scrollbar-track {
background: var(--neutral-900);
border-radius: 6px;
}
.archive-list::-webkit-scrollbar-thumb {
background-color: var(--neutral-700);
border-radius: 6px;
}
.archive-list li {
margin: 5px 0 5px 0;
padding: 0;
width: 100%;
margin: 0.75rem 0;
transition: transform 0.2s ease;
}
.archive-list li:hover {
transform: translateY(-2px);
}
.archive-list li a {
display: block;
padding: 1rem;
display: grid;
grid-template-columns: 2fr 1fr 1fr;
gap: 1rem;
padding: 1rem 1.25rem;
background-color: var(--neutral-800);
color: var(--neutral-50);
text-decoration: none;
transition: background-color 0.3s;
border-radius: 5px;
transition: all 0.3s ease;
border-radius: 6px;
border: 1px solid var(--neutral-700);
width: 100%;
display: flex;
justify-content: space-between;
}
#archive-title {
min-width: 50%;
max-width: 50%;
}
.archive-information {
padding: 0 2px 0 2px;
width: 100%;
display: flex;
justify-content: space-between;
}
.main-container {
max-height: 80% !important;
}
.paste-actions {
width: 100%;
margin-top: 5px;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
button {
padding: 10px 40px 10px 40px;
margin: 5px 0;
border-radius: 5px;
border: 1px solid var(--neutral-800);
.archive-list li a:hover {
background-color: var(--neutral-750);
border-color: var(--neutral-600);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.archive-list li a p {
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#archive-title {
font-weight: 500;
color: var(--neutral-100);
}
#archive-date {
color: var(--neutral-300);
font-size: 0.9rem;
text-align: center;
}
#archive-syntax {
color: var(--neutral-300);
font-size: 0.9rem;
text-align: right;
}
.paste-actions {
width: 100%;
margin-top: 1.5rem;
display: flex;
justify-content: center;
align-items: center;
gap: 1.5rem;
}
.paste-actions button {
padding: 0.6rem 1.2rem;
border-radius: 6px;
border: 1px solid var(--neutral-700);
background-color: var(--neutral-800);
color: var(--neutral-50);
cursor: pointer;
transition: background-color 0.3s;
transition: all 0.2s ease;
font-size: 1rem;
min-width: 100px;
display: flex;
align-items: center;
justify-content: center;
}
button:hover {
.paste-actions button:hover:not(:disabled) {
background-color: var(--neutral-700);
transform: translateY(-2px);
box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}
.paste-actions button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
#paste-pages {
font-weight: 500;
color: var(--neutral-300);
font-size: 1.1rem;
margin: 0;
padding: 0.5rem 1rem;
background-color: var(--neutral-800);
border-radius: 6px;
min-width: 80px;
text-align: center;
}
@media (max-width: 768px) {
.archive-information,
.archive-list li a {
grid-template-columns: 3fr 2fr;
}
#archive-syntax {
display: none;
}
.archive-information p:last-child {
display: none;
}
.paste-actions button {
padding: 0.5rem 1rem;
min-width: 80px;
}
}
@media (max-width: 480px) {
.main-container {
padding: 1rem;
margin: 1rem;
}
#archive-header {
font-size: 1.5rem;
}
.archive-list {
max-height: 60vh;
}
.paste-actions {
gap: 0.75rem;
}
#paste-pages {
min-width: 60px;
font-size: 0.9rem;
}
}
+149
View File
@@ -0,0 +1,149 @@
.auth-container {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
padding: 20px;
background-color: var(--neutral-950);
}
.auth-form-container {
background-color: var(--neutral-900);
border-radius: 8px;
padding: 30px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
width: 100%;
max-width: 450px;
border: 1px solid var(--neutral-800);
}
.auth-title {
text-align: center;
font-size: 1.8rem;
font-weight: 600;
margin-bottom: 24px;
color: var(--neutral-100);
}
.auth-form {
display: flex;
flex-direction: column;
gap: 20px;
}
.form-group {
display: flex;
flex-direction: column;
gap: 6px;
}
.form-group label {
font-size: 0.9rem;
font-weight: 500;
color: var(--neutral-300);
}
.form-group input {
padding: 12px 16px;
border-radius: 6px;
border: 1px solid var(--neutral-700);
background-color: var(--neutral-800);
color: var(--neutral-100);
font-size: 1rem;
transition: all 0.2s ease;
}
.form-group input:focus {
outline: none;
border-color: var(--neutral-500);
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1);
}
.auth-button {
margin-top: 10px;
padding: 12px;
border-radius: 6px;
border: none;
background-color: var(--neutral-700);
color: var(--neutral-50);
font-size: 1rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.auth-button:hover {
background-color: var(--neutral-600);
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.auth-links {
margin-top: 24px;
text-align: center;
display: flex;
flex-direction: column;
gap: 10px;
}
.auth-links p {
color: var(--neutral-400);
margin: 0;
}
.auth-links a {
color: var(--neutral-300);
text-decoration: none;
font-weight: 500;
transition: color 0.2s ease;
}
.auth-links a:hover {
color: var(--neutral-100);
text-decoration: underline;
}
.error-message {
background-color: rgba(220, 38, 38, 0.1);
color: #ef4444;
padding: 10px 16px;
border-radius: 6px;
margin-bottom: 16px;
font-size: 0.9rem;
display: none;
border: 1px solid rgba(220, 38, 38, 0.2);
}
.error-message.visible {
display: block;
animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(-10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@media (max-width: 480px) {
.auth-form-container {
padding: 20px;
}
.auth-title {
font-size: 1.6rem;
}
.form-group input {
padding: 10px 12px;
}
.auth-button {
padding: 10px;
}
}
+455
View File
@@ -0,0 +1,455 @@
body {
background-color: var(--neutral-950);
color: var(--neutral-100);
}
.main-container {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: stretch;
margin-top: 2rem;
min-height: 400px;
padding: 20px;
gap: 25px;
}
.account-info, .paste-list {
width: 48%;
border-radius: 8px;
padding: 25px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
background-color: var(--neutral-900);
border: 1px solid var(--neutral-700);
transition: all 0.3s ease;
}
.paste-list {
display: flex;
flex-direction: column;
}
.account-info {
display: flex;
flex-direction: column;
}
.account-info:hover, .paste-list:hover {
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
border-color: var(--neutral-700);
}
.account-info h1, .paste-list h1 {
margin-bottom: 25px;
color: var(--neutral-100);
text-align: center;
font-size: 1.8rem;
border-bottom: 2px solid var(--neutral-700);
padding-bottom: 10px;
}
.account-info p {
margin: 12px 0;
padding: 8px;
border-bottom: 1px solid var(--neutral-800);
font-size: 1.05rem;
display: flex;
justify-content: space-between;
color: var(--neutral-300);
}
.paste-information {
display: flex;
justify-content: space-between;
width: 100%;
padding: 10px 0;
border-bottom: 2px solid var(--neutral-700);
font-weight: bold;
margin-bottom: 15px;
color: var(--neutral-300);
}
#pastes {
list-style-type: none;
width: 100%;
max-height: 90%;
overflow-y: auto;
padding: 0;
border-radius: 4px;
scrollbar-width: thin;
scrollbar-color: var(--neutral-700) var(--neutral-900);
border: none;
}
#pastes li {
margin: 0.75rem 0;
transition: transform 0.2s ease;
}
#pastes li:hover {
transform: translateY(-2px);
}
#pastes li a {
display: grid;
grid-template-columns: 2fr 1fr 1fr;
gap: 0.5rem;
padding: 0.5rem 0.75rem;
background-color: var(--neutral-800);
color: var(--neutral-50);
text-decoration: none;
transition: all 0.3s ease;
border-radius: 6px;
border: 1px solid var(--neutral-700);
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
#pastes li a:hover {
background-color: var(--neutral-750);
border-color: var(--neutral-600);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
#pastes li a p {
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#paste-title {
font-weight: 500;
color: var(--neutral-100);
}
#paste-date {
color: var(--neutral-300);
font-size: 0.9rem;
text-align: center;
}
#paste-syntax {
color: var(--neutral-300);
font-size: 0.9rem;
text-align: right;
}
@media (max-width: 768px) {
#pastes li a {
grid-template-columns: 3fr 2fr;
}
#paste-syntax {
display: none;
}
}
@media (max-width: 576px) {
#pastes li a {
padding: 0.7rem 0.8rem;
}
}
.paste-actions {
display: flex;
justify-content: center;
align-items: center;
margin-top: auto;
padding-top: 15px;
border-top: 1px solid var(--neutral-800);
}
.paste-actions button {
background-color: var(--neutral-700);
color: var(--neutral-50);
border: none;
border-radius: 6px;
padding: 8px 15px;
margin: 0 10px;
cursor: pointer;
transition: all 0.2s ease;
font-weight: 500;
}
.paste-actions button:hover {
background-color: var(--neutral-600);
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.paste-actions button:active {
transform: translateY(0);
}
.paste-actions button:disabled {
background-color: var(--neutral-800);
color: var(--neutral-500);
cursor: not-allowed;
opacity: 0.7;
box-shadow: none;
transform: none;
}
#paste-pages {
margin: 0 15px;
font-weight: bold;
min-width: 40px;
text-align: center;
color: var(--neutral-300);
}
#pastes::-webkit-scrollbar {
width: 8px;
}
#pastes::-webkit-scrollbar-track {
background: var(--neutral-900);
border-radius: 6px;
}
#pastes::-webkit-scrollbar-thumb {
background-color: var(--neutral-700);
border-radius: 6px;
}
#pastes::-webkit-scrollbar-thumb:hover {
background-color: var(--neutral-600);
}
@media (max-width: 992px) {
.main-container {
padding: 15px;
}
.account-info, .paste-list {
padding: 20px;
}
}
@media (max-width: 768px) {
.main-container {
flex-direction: column;
gap: 20px;
}
.account-info, .paste-list {
width: 100%;
}
}
@media (max-width: 576px) {
.main-container {
padding: 10px;
}
.account-info, .paste-list {
padding: 15px;
}
.account-info h1, .paste-list h1 {
font-size: 1.5rem;
}
#pastes li {
flex-direction: column;
align-items: flex-start;
}
#pastes li span {
margin-top: 5px;
font-size: 0.8rem;
}
}
.logout-modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0,0,0,0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 2000;
}
.logout-modal-box {
background: var(--neutral-900);
color: var(--neutral-100);
padding: 2rem 2.5rem;
border-radius: 10px;
box-shadow: 0 8px 32px rgba(0,0,0,0.25);
text-align: center;
min-width: 300px;
max-width: 90vw;
}
.logout-modal-box h2 {
margin-bottom: 1rem;
font-size: 1.4rem;
color: var(--neutral-50);
}
.logout-modal-box p {
margin-bottom: 2rem;
color: var(--neutral-300);
}
.logout-modal-box button {
margin: 0 0.5rem;
padding: 0.7rem 1.5rem;
border-radius: 6px;
font-weight: 600;
border: none;
cursor: pointer;
font-size: 1rem;
transition: background 0.2s, color 0.2s;
}
#confirm-logout {
background: #e74c3c;
color: #fff;
}
#confirm-logout:hover {
background: #c0392b;
}
#cancel-logout {
background: var(--neutral-700);
color: #fff;
}
#cancel-logout:hover {
background: var(--neutral-600);
}
#logout-button {
background-color: var(--neutral-700);
color: var(--neutral-50);
border: none;
border-radius: 6px;
padding: 10px 24px;
margin-top: auto;
font-size: 1.08rem;
font-weight: 500;
cursor: pointer;
transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
letter-spacing: 0.5px;
}
#logout-button:hover {
background-color: var(--neutral-600);
color: var(--neutral-10);
transform: translateY(-2px);
box-shadow: 0 4px 16px rgba(0,0,0,0.13);
}
#logout-button:active {
background-color: var(--neutral-800);
color: var(--neutral-200);
transform: none;
box-shadow: none;
}
#delete-account-button {
background-color: #e74c3c;
color: #fff;
border: none;
border-radius: 6px;
padding: 10px 24px;
font-size: 1.08rem;
font-weight: 500;
cursor: pointer;
transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.2s;
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
letter-spacing: 0.5px;
margin-top: 10px;
}
#delete-account-button:hover {
background-color: #c0392b;
color: #fff;
transform: translateY(-2px);
box-shadow: 0 4px 16px rgba(0,0,0,0.13);
}
#delete-account-button:active {
background-color: #a93226;
color: #fff;
transform: none;
box-shadow: none;
}
.delete-modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: rgba(0,0,0,0.5);
display: flex;
justify-content: center;
align-items: center;
z-index: 2100;
}
.delete-modal-box {
background: var(--neutral-900);
color: var(--neutral-100);
padding: 2rem 2.5rem;
border-radius: 10px;
box-shadow: 0 8px 32px rgba(0,0,0,0.25);
text-align: center;
min-width: 320px;
max-width: 95vw;
}
.delete-modal-box h2 {
margin-bottom: 1rem;
font-size: 1.4rem;
color: #e74c3c;
}
.delete-modal-box p {
margin-bottom: 1.2rem;
color: var(--neutral-300);
}
.delete-modal-box input {
margin-bottom: 0.7rem;
width: 90%;
padding: 8px;
border-radius: 5px;
border: 1px solid var(--neutral-700);
background: var(--neutral-800);
color: var(--neutral-100);
font-size: 1rem;
outline: none;
transition: border 0.2s;
}
.delete-modal-box input:focus {
border: 1.5px solid #e74c3c;
}
.delete-modal-box button {
margin: 0 0.5rem;
padding: 0.7rem 1.5rem;
border-radius: 6px;
font-weight: 600;
border: none;
cursor: pointer;
font-size: 1rem;
transition: background 0.2s, color 0.2s;
}
#confirm-delete-account {
background: #e74c3c;
color: #fff;
}
#confirm-delete-account:hover {
background: #c0392b;
}
#confirm-delete-account:disabled {
background: var(--neutral-800);
color: var(--neutral-500);
cursor: not-allowed;
opacity: 0.7;
box-shadow: none;
transform: none;
}
#cancel-delete-account {
background: var(--neutral-700);
color: #fff;
}
#cancel-delete-account:hover {
background: var(--neutral-600);
}
#delete-error {
color: #e74c3c;
font-size: 1rem;
margin-top: 1rem;
}
+114 -64
View File
@@ -2,101 +2,151 @@
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 2rem;
padding: 0.75rem 2rem;
background-color: var(--neutral-900);
color: #fff;
position: fixed;
width: 100%;
top: 0;
left: 0;
right: 0;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
z-index: 1000;
}
.nav-link {
.nav-brand {
flex: 0 0 auto;
z-index: 15;
}
.brand-link {
font-size: 1.5rem;
font-weight: 700;
color: #fff;
text-decoration: none;
font-size: 1.2rem;
transition: color 0.3s;
}
.nav-link:hover {
color: var(--neutral-300);
letter-spacing: 0.5px;
transition: transform 0.2s ease;
}
.nav-links .nav-link {
width: auto;
padding: 0 1rem;
border-bottom: none;
.brand-link:hover {
transform: scale(1.05);
}
.nav-links .nav-link:last-child {
border-bottom: none;
}
.hamburger {
display: none;
background: none;
border: none;
font-size: 2rem;
cursor: pointer;
margin: 0 auto;
.nav-center {
position: absolute;
left: 0;
right: 0;
display: flex;
justify-content: center;
align-items: center;
}
.nav-links {
display: flex;
flex-direction: row;
position: static;
background-color: transparent;
padding: 0;
max-height: none;
transition: none;
align-items: center;
justify-content: center;
gap: 1rem;
}
.nav-links.show {
display: flex;
.nav-link {
color: rgba(255, 255, 255, 0.85);
text-decoration: none;
font-size: 1.1rem;
padding: 0.6rem 1.2rem;
border-radius: 6px;
transition: all 0.3s ease;
font-weight: 500;
border: 1px solid rgba(255, 255, 255, 0.2);
}
.nav-link:hover {
color: #fff;
background-color: rgba(255, 255, 255, 0.1);
transform: translateY(-2px);
}
#nav-bar-selected {
color: #fff;
background-color: rgba(255, 255, 255, 0.15);
font-weight: 500;
}
.hamburger {
display: none;
flex-direction: column;
position: absolute;
top: 100%;
left: 0;
right: 0;
background-color: var(--neutral-900);
padding: 1rem 2rem;
max-height: 500px;
transition: max-height 0.3s ease-out;
overflow: hidden;
justify-content: space-between;
width: 30px;
height: 21px;
background: transparent;
border: none;
cursor: pointer;
padding: 0;
z-index: 15;
}
.hamburger-line {
display: block;
height: 3px;
width: 100%;
border-radius: 10px;
background: #fff;
transition: all 0.3s ease;
}
@media (max-width: 800px) {
.nav-center {
position: static;
}
.nav-links {
display: none;
flex-direction: column;
width: 100%;
position: absolute;
top: 100%;
position: fixed;
top: 60px;
left: 0;
right: 0;
border-top: 1px solid var(--neutral-800);
background-color: var(--neutral-900);
padding: 1rem 2rem;
max-height: 0;
transition: max-height 0.3s ease-out;
overflow: hidden;
}
.nav-link{
width: 100% !important;
padding: 1rem 0 !important;
text-align: center;
border-bottom: 1px solid var(--neutral-800) !important;
}
.nav-links.show {
display: flex;
max-height: 500px;
flex-direction: column;
align-items: center;
padding: 0;
max-height: 0;
overflow: hidden;
transition: max-height 0.3s ease-out, padding 0.3s ease;
box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}
.nav-links.show {
max-height: 300px;
padding: 1rem 0;
}
.nav-link {
width: 90%;
text-align: center;
padding: 1rem;
border-bottom: 1px solid var(--neutral-800);
}
.home-link {
border: none;
border-bottom: 1px solid var(--neutral-800);
order: -1;
}
.nav-link:last-child {
border-bottom: none;
}
.hamburger {
display: block;
margin: 0 auto;
display: flex;
}
.nav-bar {
justify-content: center;
.hamburger.active .hamburger-line:nth-child(1) {
transform: translateY(9px) rotate(45deg);
}
.hamburger.active .hamburger-line:nth-child(2) {
opacity: 0;
}
.hamburger.active .hamburger-line:nth-child(3) {
transform: translateY(-9px) rotate(-45deg);
}
}
+15 -3
View File
@@ -112,9 +112,6 @@ pre code.hljs {
code.hljs {
padding: 3px 5px
}
/*
SLIGHTLY MODIFIED GITHUB DARK THEME
*/
.hljs {
color: #c9d1d9;
background: var(--neutral-900);
@@ -205,4 +202,19 @@ SLIGHTLY MODIFIED GITHUB DARK THEME
.hljs-deletion {
color: #ffdcd7;
background-color: #67060c
}
.throbber {
border: 4px solid var(--neutral-700);
border-top: 4px solid var(--neutral-50);
border-radius: 50%;
width: 24px;
height: 24px;
animation: spin 1s linear infinite;
margin: auto;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
+1 -2
View File
@@ -7,8 +7,7 @@
}
:root {
/* TailwindCSS Neutral Colors */
--neutral-50: #fafafa;
--neutral-50: #fafafa;
--neutral-100: #f5f5f5;
--neutral-200: #e5e5e5;
--neutral-300: #d4d4d4;