program finalizat

This commit is contained in:
andrei-mihnea-cerbu
2024-10-29 15:07:26 +02:00
parent ab1eaec413
commit 979539d3db
138 changed files with 14602 additions and 5068 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

+79
View File
@@ -0,0 +1,79 @@
body, html {
height: 100vh;
width: 100vw;
margin: 0;
padding: 0;
font-family: "Pridi", sans-serif;
background-color: #4A628A;
}
.container {
height: 100vh;
width: 100vw;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.header {
text-align: center;
margin-top: 10px;
margin-bottom: 20px;
}
.title {
font-size: 48px;
font-weight: 500;
color: white;
}
.announcement-body {
max-height: 300px; /* Limit the height to make it scrollable if content overflows */
width: 80%;
overflow-y: auto; /* Enable vertical scrolling */
padding: 20px;
color: white;
background-color: rgba(0, 0, 0, 0.2); /* Slight background to make text stand out */
border-radius: 8px;
text-align: center;
}
/* Customize scrollbar appearance */
.announcement-body::-webkit-scrollbar {
width: 8px;
}
.announcement-body::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.1);
border-radius: 8px;
}
.announcement-body::-webkit-scrollbar-thumb {
background-color: rgba(255, 255, 255, 0.8);
border-radius: 8px;
}
.announcement-body::-webkit-scrollbar-thumb:hover {
background-color: rgb(158, 158, 158);
}
.announcement-footer {
margin-top: 20px;
}
#closeButton {
padding: 10px 20px;
margin-bottom: 15px;
font-size: 16px;
color: #4A628A;
background-color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s ease;
}
#closeButton:hover {
background-color: #f0f0f0;
}
+59
View File
@@ -0,0 +1,59 @@
body, html {
height: 100vh;
width: 100vw;
margin: 0;
padding: 0;
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
background-color: #4A628A;
}
h4, h2, h1{
margin: 0;
}
.container{
height: 100vh;
width: 100vw;
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
}
.title{
font-size: 48px;
font-weight: 500;
letter-spacing: -1px;
color: white;
}
img{
width: 200px;
height: 200px;
}
p{
color: white;
}
.loading-section{
display: flex;
flex-direction: column;
align-items: center;
}
.spinner {
margin-bottom: 8px;
width: 15px;
height: 15px;
border: 3px solid #f3f3f3;
border-top: 3px solid #2196F3;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
+121 -88
View File
@@ -1,110 +1,143 @@
body, html {
height: 100%;
width: 100%;
height: 100vh;
width: 100vw;
margin: 0;
padding: 0;
font-family: "Roboto", sans-serif;
font-weight: 500;
font-style: normal;
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
background-color: #4A628A;
}
background-image: url('../assets/background.png');
background-size: cover;
background-repeat: no-repeat;
h4, h2, h1{
margin: 0;
}
.page{
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
}
.container {
opacity: 0;
display: flex;
flex-direction: row;
justify-content: space-evenly;
align-items: center;
min-height: 100vh;
}
.header {
color: #1B1A55;
font-size: 4vh;
text-transform: uppercase;
line-height: 2.5rem;
margin-bottom: 10rem;
}
.login-form {
background-color: #535C91;
opacity: 71;
padding: 9vh 3vh 5vh;
border-radius: 1rem;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.9);
width: 25%;
}
.login-form-title {
margin: 0 0 5vh 0;
text-align: center;
}
.login-form-title h2 {
color: #FFFFFF;
font-size: 5vh;
margin: 0;
padding: 0;
}
.login-form hr {
width: 40%;
}
.login-form-content {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
input {
text-align: center;
color: white;
font-weight: bold;
font-size: 1.2rem;
width: 70%;
padding: 1rem;
margin: 0.7rem;
background-color: #1B1A55;
border-radius: 10px;
}
button {
font-weight: bold;
background: linear-gradient(to bottom, rgba(74, 98, 138, 0.0) 30%, rgba(186, 237, 255, 0.7));
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-evenly;
height: 90%;
width: 35%;
font-size: 1rem;
padding: 10px;
border: none;
border-radius: 5px;
margin-top: 1rem;
cursor: pointer;
}
button:hover {
filter: brightness(85%);
.header{
text-align: center;
padding-bottom: 16px;
padding-top: 16px;
}
.title{
font-size: 48px;
font-weight: 500;
letter-spacing: -1px;
color: white;
}
.subheading{
padding-top: 8px;
font-size: 16px;
letter-spacing: -0.5px;
color: rgba(255,255,255, 0.8);
}
.login-form{
display: flex;
flex-direction: column;
align-items: center;
width: 80%;
}
.login-title {
font-size: 24px;
font-weight: 500;
color: white;
margin-bottom: 16px;
}
.login-form-content input {
width: 100%;
padding: 15px;
margin: 10px 0;
border: 1px solid #ccc; /* Light gray border */
border-radius: 8px; /* Rounded corners */
font-size: 1em;
font-family: inherit;
box-sizing: border-box;
background-color: #f9f9f9; /* Light background */
color: #333; /* Dark text color */
transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Smooth transition for interaction */
}
/* Placeholder Text Styling */
.login-form-content input::placeholder {
color: #aaa; /* Lighter color for placeholders */
}
/* Focus State Styling */
.login-form-content input:focus {
outline: none; /* Remove default focus outline */
border-color: #4A628A; /* Blue border on focus */
box-shadow: 0 0 5px rgba(74, 98, 138, 0.5); /* Subtle shadow for focus */
background-color: #fff; /* Slightly brighter background on focus */
}
/* Input Field Hover Effect */
.login-form-content input:hover {
border-color: #888; /* Darker gray border on hover */
}
/* Disabled Input Styling */
.login-form-content input:disabled {
background-color: #e0e0e0; /* Light gray background for disabled input */
cursor: not-allowed; /* Show "not allowed" cursor */
opacity: 0.7; /* Slight transparency */
}
.login-form-footer {
margin-top: 3vh;
display: flex;
flex-wrap: wrap;
align-content: center;
width: 100%;
flex-direction: column;
justify-content: space-between; /* Align buttons next to each other */
align-items: center;
justify-content: space-evenly;
gap: 10px; /* Space between buttons */
margin-top: 20px;
}
/* Styling for buttons */
.login-form-footer button {
flex: 1; /* Ensure buttons are equal width */
padding: 16px;
font-weight: 300;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
}
button[name="underline"] {
background-color: transparent; /* No background */
border: none; /* Remove default button border */
color: #4A628A; /* Set text color */
font-size: 1em; /* Set font size */
cursor: pointer; /* Add pointer cursor for interactivity */
text-decoration: underline; /* Underline text */
padding: 0; /* Remove default padding */
}
button[name="submit"] {
background-color: #F44336;
color: white;
width: 100%;
background-color: #4A628A; /* Blue background */
color: white; /* White text color */
}
button[name="signup"] {
background-color: #2196F3;
color: white;
}
+166 -194
View File
@@ -1,232 +1,204 @@
body, html {
height: 100%;
width: 100%;
height: 100vh;
width: 100vw;
margin: 0;
padding: 0;
font-family: "Roboto", sans-serif;
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
background-color: #4A628A;
}
h4, h2, h1{
margin: 0;
}
.title{
font-size: 32px;
font-weight: 500;
font-style: normal;
background-image: url('../assets/background.png');
background-size: cover;
background-repeat: no-repeat;
}
.overlay {
display: none;
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.85);
z-index: 2;
cursor: pointer;
}
.ceo-validation-form {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 300px;
padding: 20px;
background: #1B1A55;
border-radius: 10px;
cursor: default;
}
.ceo-validation-form h2 {
text-align: center;
letter-spacing: -1px;
color: white;
}
.form-actions {
text-align: center;
padding-top: 20px;
}
.form-actions button {
padding: 10px 20px;
margin: 0 10px;
border: none;
border-radius: 5px;
cursor: pointer;
}
input {
text-align: center;
color: white;
font-weight: bold;
font-size: 1.2rem;
width: 80%;
padding: 1rem;
margin: 0.7rem;
background-color: #1B1A55;
border-radius: 10px;
}
#back_button {
background-color: #f44336;
width: 35%;
height: auto;
.user{
display: inline;
color: white;
}
#submit_button {
background-color: #4CAF50;
width: 35%;
height: auto;
color: white;
}
.container {
opacity: 0;
display: flex;
flex-direction: row;
justify-content: space-evenly;
align-items: center;
min-height: 100vh;
text-align: center;
}
.left_block {
display: flex;
flex-direction: column;
background-color: #535C91;
opacity: 71;
padding: 2rem;
border-radius: 1rem;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.9);
color: white;
}
.left_block_top {
display: flex;
.navbar{
padding-top: 8px;
padding-right: 32px;
padding-left: 32px;
height: 10%;
display:flex;
flex-direction: row;
justify-content: space-between;
text-align: left;
align-items: center;
}
.left_block_top h1 {
padding: 0;
margin: 0;
}
.left_block_top img {
margin: 0 3vw 0 5vw;
width: 8vw;
height: 8vw;
}
.left_block_content {
margin: 2rem 0 2rem 0;
}
.left_block_buttons {
.welcome{
display: flex;
flex-direction: row;
align-content: center;
align-items: center;
}
img{
padding-right: 8px;
width:25px;
height: auto;
}
.page{
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
}
.container{
width:100%;
height:100%;
display: flex;
flex-direction: row;
justify-content: center;
}
button {
margin: 0 1rem 0 1rem;
width: 15vw;
height: 10vh;
.left_block{
background: linear-gradient(to bottom, #131A24, #4A628A);
width: 25%;
display: flex;
flex-direction: column;
}
border: none;
border-radius: 10px;
.notification-title{
padding-top: 16px;
padding-bottom: 16px;
text-align: center;
height: 10%;
display: flex;
justify-content: center;
align-items: center;
}
color: white;
font-size: 1rem;
font-weight: bold;
.notifications{
overflow-y: auto;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
flex-grow: 1; /* Allow it to take available space */
max-height: calc(90% - 80px);
}
text-transform: uppercase;
.right_block_content button:last-child {
background-color: #FF6347;
}
.right_block_content button:last-child:hover {
background-color: #fd4c29;
}
.alert, .logout-button{
cursor: pointer;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
outline: none;
transition: background-color 0.3s ease;
border-radius: 15px;
width: 80%;
min-height: 64px;
height: auto;
padding:12px;
background: #FF6347;
font-weight: bold;
font-size: 12px;
}
.notification{
cursor: pointer;
border-radius: 15px;
width: 80%;
min-height: 64px;
height: auto;
padding:12px;
background: rgba(186, 229, 255);
font-weight: bold;
font-size: 12px;
}
button:hover {
filter: brightness(85%);
.notification:hover{
background: #d9efff;
}
.left_block_footer {
.alert:hover, .logout-button:hover{
background: rgb(244, 44, 44);
}
.notif-title{
font-size: 24px;
font-weight: 300;
letter-spacing: -1px;
color: white;
}
.left-content{
height: 90%;
width: 100%;
display: flex;
flex-direction: column;
justify-content: space-around;
align-items: center;
}
.left_block_footer{
display: flex;
align-items: center;
justify-content: end;
justify-content: center;
width: 100%;
padding-bottom: 16px;
}
.right_block {
display: flex;
.right_block_content{
height: 90%;
}
.right_block{
width: 75%;
display:flex;
flex-direction: column;
background-color: #535C91;
opacity: 71;
padding: 2rem;
border-radius: 1rem;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.9);
color: white;
justify-content: center;
}
.notifications {
display: flex;
margin: 1rem 2rem 2rem 3rem;
flex-direction: column;
align-items: start;
height: 40vh; /* Fixed height */
width: 80%; /* Full width */
overflow: auto; /* Enable scrolling */
font-size: 1.2rem;
color: white;
font-weight: bold;
}
.notifications::-webkit-scrollbar {
width: 10px; /* Reduced width of the scrollbar by 2px */
}
.notifications::-webkit-scrollbar-track {
background: #1B1A55; /* Updated track color */
}
.notifications::-webkit-scrollbar-thumb {
background: #535C91; /* Updated handle color */
border: 2px solid #1B1A55; /* Adding a border to effectively reduce the thumb size */
}
.notifications::-webkit-scrollbar-thumb:hover {
background: #555; /* Updated handle color on hover */
}
button[name="logout"] {
margin: 0;
padding: 0;
width: 10vw;
height: 5vh;
background-color: #F44336;
}
button[name="alert"] {
margin: 0.7rem;
background-color: #F44336;
}
button[name="notification"] {
margin: 0.7rem;
background-color: #23BDEE;
.right_block_content {
display: grid;
grid-template-columns: repeat(3, 1fr); /* 3 equal-width columns */
gap: 8px; /* Spacing between buttons */
padding: 32px; /* Optional padding */
}
button[name="menu_button"] {
margin: 0.7rem;
background-color: #1B1A55;
padding: 10px 20px;
font-size: 16px;
background-color: rgba(186,229,244,0.4); /* Button background */
color: white;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
}
button[name="menu_button"]:hover {
background-color: #3B5173; /* Darker background on hover */
}
.notifications::-webkit-scrollbar {
width: 4px; /* Width of the scrollbar */
}
.notifications::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.1); /* Track background color */
border-radius: 10px; /* Rounded corners for the track */
}
.notifications::-webkit-scrollbar-thumb {
background-color: rgba(74, 98, 138, 0.8); /* Scrollbar handle color */
border-radius: 10px; /* Rounded corners for the scrollbar handle */
}
.notifications::-webkit-scrollbar-thumb:hover {
background-color: rgba(74, 98, 138, 1); /* Darker color on hover */
}
+41
View File
@@ -0,0 +1,41 @@
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre, hr
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
+105 -79
View File
@@ -1,110 +1,136 @@
body, html {
height: 100%;
width: 100%;
height: 100vh;
width: 100vw;
margin: 0;
padding: 0;
font-family: "Roboto", sans-serif;
font-weight: 500;
font-style: normal;
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
background-color: #4A628A;
}
background-image: url('../assets/background.png');
background-size: cover;
background-repeat: no-repeat;
h4, h2, h1{
margin: 0;
}
.page{
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
}
.container {
opacity: 0;
border-radius: 10px;
background: linear-gradient(to bottom, rgba(74, 98, 138, 0.0) 30%, rgba(186, 237, 255, 0.7));
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: row;
justify-content: space-evenly;
flex-direction: column;
align-items: center;
min-height: 100vh;
text-align: center; /* Center the text for all child elements */
justify-content: space-evenly;
height: 90%;
width: 35%;
}
.header {
color: #1B1A55;
font-size: 4vh;
text-transform: uppercase;
line-height: 2.5rem;
margin-bottom: 10rem;
}
.profile-form {
background-color: #535C91;
opacity: 71;
padding: 13vh 3vh 5vh;
border-radius: 1rem;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.9);
width: 25%;
}
.profile-form-title {
margin-bottom: 5vh;
}
.profile-form hr {
width: 40%;
}
.profile-form-title h2 {
color: #FFFFFF;
margin: 0;
padding: 0;
.header{
text-align: center;
font-size: 5vh;
padding-bottom: 16px;
padding-top: 16px;
}
.profile-form-content {
.title{
font-size: 48px;
font-weight: 500;
letter-spacing: -1px;
color: white;
}
.subheading{
padding-top: 8px;
font-size: 16px;
letter-spacing: -0.5px;
color: rgba(255,255,255, 0.8);
}
.profile-form{
display: flex;
flex-wrap: wrap;
justify-content: center;
flex-direction: column;
align-items: center;
width: 80%;
}
.profile-form-content input {
width: 100%;
padding: 15px;
margin: 10px 0;
border: 1px solid #ccc; /* Light gray border */
border-radius: 8px; /* Rounded corners */
font-size: 1em;
font-family: inherit;
box-sizing: border-box;
background-color: #f9f9f9; /* Light background */
color: #333; /* Dark text color */
transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Smooth transition for interaction */
}
/* Placeholder Text Styling */
.profile-form-content input::placeholder {
color: #aaa; /* Lighter color for placeholders */
}
/* Focus State Styling */
.profile-form-content input:focus {
outline: none; /* Remove default focus outline */
border-color: #4A628A; /* Blue border on focus */
box-shadow: 0 0 5px rgba(74, 98, 138, 0.5); /* Subtle shadow for focus */
background-color: #fff; /* Slightly brighter background on focus */
}
/* Input Field Hover Effect */
.profile-form-content input:hover {
border-color: #888; /* Darker gray border on hover */
}
/* Disabled Input Styling */
.profile-form-content input:disabled {
background-color: #e0e0e0; /* Light gray background for disabled input */
cursor: not-allowed; /* Show "not allowed" cursor */
opacity: 0.7; /* Slight transparency */
}
.profile-form-footer {
margin-top: 7vh;
display: flex;
flex-direction: row;
justify-content: center;
width: 100%;
flex-direction: column;
justify-content: space-between; /* Align buttons next to each other */
align-items: center;
gap: 10px; /* Space between buttons */
margin-top: 20px;
}
input {
text-align: center;
color: white;
font-weight: bold;
font-size: 1.2rem;
width: 70%;
padding: 1rem;
margin: 0.7rem;
background-color: #1B1A55;
border-radius: 10px;
}
button {
font-weight: bold;
width: 35%;
font-size: 1rem;
padding: 10px;
/* Styling for buttons */
.profile-form button {
flex: 1; /* Ensure buttons are equal width */
padding: 16px;
font-weight: 300;
border: none;
border-radius: 5px;
margin-top: 1rem;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
}
button:hover {
filter: brightness(85%);
button[name="underline"] {
background-color: transparent; /* No background */
border: none; /* Remove default button border */
color: #4A628A; /* Set text color */
font-size: 1em; /* Set font size */
cursor: pointer; /* Add pointer cursor for interactivity */
text-decoration: underline; /* Underline text */
padding: 0; /* Remove default padding */
}
button[name="submit"] {
background-color: #F44336;
color: white;
width: 100%;
background-color: #4A628A; /* Blue background */
color: white; /* White text color */
}
button[name="login"] {
background-color: #2196F3;
color: white;
margin-right: 5rem;
}
+129 -88
View File
@@ -1,110 +1,151 @@
body, html {
height: 100%;
width: 100%;
height: 100vh;
width: 100vw;
margin: 0;
padding: 0;
font-family: "Roboto", sans-serif;
font-weight: 500;
font-style: normal;
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
background-color: #4A628A;
}
background-image: url('../assets/background.png');
background-size: cover;
background-repeat: no-repeat;
h4, h2, h1{
margin: 0;
}
.page{
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
}
.container {
opacity: 0;
display: flex;
flex-direction: row;
justify-content: space-evenly;
align-items: center;
min-height: 100vh;
}
.header {
color: #1B1A55;
font-size: 4vh;
text-transform: uppercase;
line-height: 2.5rem;
margin-bottom: 10rem;
}
.login-form {
background-color: #535C91;
opacity: 71;
padding: 9vh 3vh 5vh;
border-radius: 1rem;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.9);
width: 25%;
}
.login-form-title {
margin: 0 0 5vh 0;
text-align: center;
}
.login-form-title h2 {
color: #FFFFFF;
font-size: 5vh;
margin: 0;
padding: 0;
}
.login-form hr {
width: 40%;
}
.login-form-content {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
input {
text-align: center;
color: white;
font-weight: bold;
font-size: 1.2rem;
width: 70%;
padding: 1rem;
margin: 0.7rem;
background-color: #1B1A55;
border-radius: 10px;
}
button {
font-weight: bold;
background: linear-gradient(to bottom, rgba(74, 98, 138, 0.0) 30%, rgba(186, 237, 255, 0.7));
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
height: 90%;
width: 35%;
font-size: 1rem;
padding: 10px;
border: none;
border-radius: 5px;
margin-top: 1rem;
cursor: pointer;
}
button:hover {
filter: brightness(85%);
.header{
display: flex;
width: 80%;
flex-direction: column;
align-items: center;
justify-content: center;
height: 20%;
text-align: center;
padding-bottom: 16px;
padding-top: 16px;
}
.title{
font-size: 48px;
font-weight: 500;
letter-spacing: -1px;
color: white;
}
.subheading{
font-size: 16px;
letter-spacing: -0.5px;
padding-top: 8px;
color: rgba(255,255,255, 0.8);
}
.login-form{
height: 80%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
width: 80%;
}
.login-title {
font-size: 24px;
font-weight: 500;
color: white;
margin-bottom: 16px;
}
.login-form-content input {
width: 100%;
padding: 15px;
margin: 10px 0;
border: 1px solid #ccc; /* Light gray border */
border-radius: 8px; /* Rounded corners */
font-size: 1em;
font-family: inherit;
box-sizing: border-box;
background-color: #f9f9f9; /* Light background */
color: #333; /* Dark text color */
transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Smooth transition for interaction */
}
/* Placeholder Text Styling */
.login-form-content input::placeholder {
color: #aaa; /* Lighter color for placeholders */
}
/* Focus State Styling */
.login-form-content input:focus {
outline: none; /* Remove default focus outline */
border-color: #4A628A; /* Blue border on focus */
box-shadow: 0 0 5px rgba(74, 98, 138, 0.5); /* Subtle shadow for focus */
background-color: #fff; /* Slightly brighter background on focus */
}
/* Input Field Hover Effect */
.login-form-content input:hover {
border-color: #888; /* Darker gray border on hover */
}
/* Disabled Input Styling */
.login-form-content input:disabled {
background-color: #e0e0e0; /* Light gray background for disabled input */
cursor: not-allowed; /* Show "not allowed" cursor */
opacity: 0.7; /* Slight transparency */
}
.login-form-footer {
margin-top: 3vh;
display: flex;
flex-wrap: wrap;
align-content: center;
width: 100%;
flex-direction: column;
justify-content: space-between; /* Align buttons next to each other */
align-items: center;
justify-content: space-evenly;
gap: 10px; /* Space between buttons */
margin-top: 20px;
}
/* Styling for buttons */
.login-form-footer button {
flex: 1; /* Ensure buttons are equal width */
padding: 16px;
font-weight: 300;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
}
button[name="underline"] {
background-color: transparent; /* No background */
border: none; /* Remove default button border */
color: #4A628A; /* Set text color */
font-size: 1em; /* Set font size */
cursor: pointer; /* Add pointer cursor for interactivity */
text-decoration: underline; /* Underline text */
padding: 0; /* Remove default padding */
}
button[name="submit"] {
background-color: #F44336;
color: white;
width: 100%;
background-color: #4A628A; /* Blue background */
color: white; /* White text color */
}
button[name="signup"] {
background-color: #2196F3;
color: white;
}
+125 -154
View File
@@ -1,191 +1,162 @@
body, html {
height: 100%;
width: 100%;
height: 100vh;
width: 100vw;
margin: 0;
padding: 0;
font-family: "Roboto", sans-serif;
font-weight: 500;
font-style: normal;
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
background-color: #4A628A;
}
background-image: url('../assets/background.png');
background-size: cover;
background-repeat: no-repeat;
h4, h2, h1{
margin: 0;
}
.page{
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
}
.container {
opacity: 0;
display: flex;
flex-direction: row;
justify-content: space-evenly;
align-items: center;
min-height: 100vh;
text-align: center;
}
h1, h2 {
padding: 0;
margin: 0;
}
h2 {
font-size: 1rem;
}
.left_block {
display: flex;
flex-direction: column;
background-color: #535C91;
opacity: 71;
padding: 2rem;
border-radius: 1rem;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.9);
color: white;
}
.left_block_top {
display: flex;
flex-direction: row;
justify-content: space-between;
}
.left_block_top_left {
display: flex;
flex-direction: column;
justify-content: start;
text-align: left;
}
.left_block_top_left hr {
margin: 0 0 1rem 0;
width: 45%;
}
.left_block_top_right {
width: 10vw;
display: flex;
flex-wrap: wrap;
align-content: center;
justify-content: center;
padding: 0 2vh 0 2vh;
background-color: #1B1A55;
margin: 0 0 0 5vw;
border-radius: 1rem;
}
.left_block_content {
display: flex;
justify-content: start;
align-items: center;
margin: 2rem 0 2rem 0;
}
.left_block_buttons {
display: flex;
flex-direction: row;
align-content: center;
align-items: center;
justify-content: center;
}
button {
margin: 0 1rem 0 1rem;
width: 10vw;
height: 5vh;
border: none;
border-radius: 10px;
color: white;
font-size: 1rem;
font-weight: bold;
text-transform: uppercase;
cursor: pointer;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
outline: none;
transition: background-color 0.3s ease;
}
button:hover {
filter: brightness(85%);
}
.left_block_footer {
background: linear-gradient(to bottom, rgba(74, 98, 138, 0.0) 30%, rgba(186, 237, 255, 0.7));
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
align-items: center;
justify-content: end;
height: 90%;
width: 35%;
}
.right_block {
display: flex;
flex-direction: column;
background-color: #535C91;
opacity: 71;
padding: 2rem 4rem 2rem 2rem;
border-radius: 1rem;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.9);
.header{
text-align: center;
padding-bottom: 16px;
padding-top: 32px;
}
.title{
font-size: 48px;
font-weight: 500;
letter-spacing: -1px;
color: white;
}
.choose_user_form_title {
display: flex;
flex-wrap: wrap;
flex-direction: column;
justify-content: left;
align-content: start;
.subheading{
padding-top: 8px;
font-size: 16px;
letter-spacing: -0.5px;
color: rgba(255,255,255, 0.8);
}
.choose_user_form_title hr {
.form{
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
width: 80%;
height: 100%;
overflow: hidden;
}
.footer {
padding-bottom: 16px;
display: flex;
width: 100%;
flex-direction: row;
justify-content: space-between; /* Align buttons next to each other */
align-items: center;
gap: 10px; /* Space between buttons */
}
.filename-title{
font-size: 16px;
font-weight: 300;
color: white;
padding: 48px 24px 48px 24px;
background-color: rgba(0,0,0,0.25);
border-radius: 10px;
margin-top: 16px;
box-shadow: 2px 2px 2px 1px rgb(0 0 0 / 20%);
}
.users_block{
padding-top: 16px;
}
label{
margin-top: 8px;
color: white;
}
.choose_user_form_content {
overflow-y: hidden;
width: 100%;
height: auto;
max-height: 180px;
display: flex;
margin: 1rem 7rem 2rem 0.5rem;
flex-direction: column;
align-items: start;
align-items: flex-start;
}
height: 20vh; /* Fixed height */
width: 100%; /* Full width */
overflow: auto; /* Enable scrolling */
font-size: 1.2rem;
h5{
font-size: 20px;
font-weight: 300;
text-align: center;
color: white;
font-weight: bold;
}
.choose_user_form_content::-webkit-scrollbar {
width: 10px; /* Reduced width of the scrollbar by 2px */
/* Styling for buttons */
.form button {
flex: 1; /* Ensure buttons are equal width */
padding: 16px;
font-weight: 300;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
}
.choose_user_form_content::-webkit-scrollbar-track {
background: #1B1A55; /* Updated track color */
}
.choose_user_form_content::-webkit-scrollbar-thumb {
background: #535C91; /* Updated handle color */
border: 2px solid #1B1A55; /* Adding a border to effectively reduce the thumb size */
}
.choose_user_form_content::-webkit-scrollbar-thumb:hover {
background: #555; /* Updated handle color on hover */
}
button[name="back"] {
background-color: #23BDEE;
button[name="underline"] {
background-color: transparent; /* No background */
border: none; /* Remove default button border */
color: #4A628A; /* Set text color */
font-size: 1em; /* Set font size */
cursor: pointer; /* Add pointer cursor for interactivity */
text-decoration: underline; /* Underline text */
padding: 0; /* Remove default padding */
}
button[name="submit"] {
background-color: #F44336;
width: 100%;
background-color: #4A628A; /* Blue background */
color: white; /* White text color */
}
button[name="select_file"] {
margin: 0;
width: 8vw;
background-color: #1B1A55;
button[name="submit"]:hover {
background-color: #3B5173; /* Darker background on hover */
}
.choose_user_form_content::-webkit-scrollbar {
width: 4px; /* Width of the scrollbar */
}
.choose_user_form_content::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.1); /* Track background color */
border-radius: 10px; /* Rounded corners for the track */
}
.choose_user_form_content::-webkit-scrollbar-thumb {
background-color: rgba(74, 98, 138, 0.8); /* Scrollbar handle color */
border-radius: 10px; /* Rounded corners for the scrollbar handle */
}
.choose_user_form_content::-webkit-scrollbar-thumb:hover {
background-color: rgba(74, 98, 138, 1); /* Darker color on hover */
}
.choose_user_form_content:empty {
overflow-y: hidden;
}
+146 -80
View File
@@ -1,117 +1,183 @@
/* General Styles */
body, html {
height: 100%;
width: 100%;
height: 100vh;
width: 100vw;
margin: 0;
padding: 0;
font-family: "Roboto", sans-serif;
font-weight: 500;
font-style: normal;
background-image: url('../assets/background.png');
background-size: cover;
background-repeat: no-repeat;
font-family: "Pridi", sans-serif; /* Use sans-serif fallback */
background-color: #4A628A; /* Background color */
}
.container {
min-height: 100vh;
h4, h2, h1 {
margin: 0; /* Remove default margin */
}
.step {
/* Page Layout */
.page {
height: 100vh;
width: 100vw;
display: flex;
flex-direction: row;
justify-content: space-evenly;
justify-content: center;
align-items: center;
min-height: 100vh;
opacity: 0; /* Make steps invisible by default */
visibility: hidden; /* Hide steps by default */
transition: opacity 0.5s ease, visibility 0.5s ease; /* Smooth transition */
}
.container{
height: 100%;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-evenly;
}
.step.active {
opacity: 1; /* Show the active step */
visibility: visible; /* Make it visible */
/* Active Step Styles */
.step {
border-radius: 10px;
background: linear-gradient(to bottom, rgba(74, 98, 138, 0.0) 30%, rgba(186, 237, 255, 0.7));
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
display: flex;
flex-direction: column;
align-items: center;
justify-content: stretch;
height: 90%;
width: 35%;
}
/* Header Styling */
.header {
color: #1B1A55;
font-size: 4vh;
text-transform: uppercase;
line-height: 2.5rem;
margin-bottom: 10rem;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 20%;
text-align: center;
padding-bottom: 16px;
padding-top: 16px;
}
.title{
font-size: 48px;
font-weight: 500;
letter-spacing: -1px;
color: white;
}
.subheading{
font-size: 16px;
letter-spacing: -0.5px;
padding-top: 8px;
color: rgba(255,255,255, 0.8);
}
/* Signup Form Styles */
.signup-form {
background-color: #535C91;
opacity: 71;
padding: 9vh 3vh 5vh;
border-radius: 1rem;
box-shadow: 10px 10px 10px rgba(0, 0, 0, 0.9);
width: 25%;
display: flex;
height: 80%;
flex-direction: column;
align-items: center;
justify-content: space-between;
width: 80%; /* Width of the form */
margin-bottom: 16px;
}
.signup-form-title {
margin: 0 0 5vh 0;
text-align: center;
}
.signup-form-title h2 {
color: #FFFFFF;
font-size: 5vh;
margin: 0;
padding: 0;
}
.signup-form hr {
width: 40%;
}
.signup-form-content {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
input {
text-align: center;
font-size: 24px;
font-weight: 500;
color: white;
font-weight: bold;
font-size: 1.2rem;
width: 70%;
padding: 1rem;
margin: 0.7rem;
background-color: #1B1A55;
border-radius: 10px;
margin-bottom: 16px; /* Space below title */
}
button {
font-weight: bold;
width: 35%;
font-size: 1rem;
padding: 10px;
border: none;
border-radius: 5px;
margin-top: 1rem;
cursor: pointer;
/* Input Styles */
.signup-form-content input {
width: 100%;
padding: 15px;
margin: 10px 0;
border: 1px solid #ccc; /* Light gray border */
border-radius: 8px; /* Rounded corners */
font-size: 1em;
font-family: inherit;
box-sizing: border-box;
background-color: #f9f9f9; /* Light background */
color: #333; /* Dark text color */
transition: border-color 0.3s ease, box-shadow 0.3s ease; /* Smooth transition for interaction */
}
button:hover {
filter: brightness(85%);
/* Placeholder Text Styling */
.signup-form-content input::placeholder {
color: #aaa; /* Lighter color for placeholders */
}
.signup-form-content-radio{
width: 100%;
display: flex; /* Use flexbox to arrange items in a row */
align-items: flex-start;
flex-direction: column;
justify-content: flex-start;
gap: 20px;
}
.signup-form-content-radio label {
width: 100%;
display: flex; /* Make label a flex container */
align-items: flex-start;
justify-content: flex-start;
cursor: pointer; /* Change cursor to pointer when hovering */
}
/* Optional: Styling the radio button */
.signup-form-content-radio input[type="radio"] {
margin-right: 8px; /* Space between radio button and label text */
}
/* Focus State Styling */
.signup-form-content input:focus {
outline: none; /* Remove default focus outline */
border-color: #4A628A; /* Change border color on focus */
box-shadow: 0 0 5px rgba(74, 98, 138, 0.5); /* Subtle shadow for focus */
background-color: #fff; /* Slightly brighter background on focus */
}
/* Input Field Hover Effect */
.signup-form-content input:hover {
border-color: #888; /* Darker gray border on hover */
}
/* Disabled Input Styling */
.signup-form-content input:disabled {
background-color: #e0e0e0; /* Light gray background for disabled input */
cursor: not-allowed; /* Show "not allowed" cursor */
opacity: 0.7; /* Slight transparency */
}
/* Signup Form Footer */
.signup-form-footer {
margin-top: 3vh;
display: flex;
flex-wrap: wrap;
align-content: center;
width: 100%;
justify-content: space-between; /* Align buttons next to each other */
align-items: center;
justify-content: space-evenly;
gap: 10px; /* Space between buttons */
margin-top: 20px;
}
/* Button Styles */
.signup-form-footer button {
flex: 1; /* Ensure buttons are equal width */
padding: 16px;
font-weight: 300;
border: none;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
}
button[name="back"] {
background-color: #F44336;
color: white;
background-color: transparent; /* No background for 'back' button */
color: #4A628A; /* Set text color */
text-decoration: underline; /* Underline text */
}
button[name="continue"] {
background-color: #2196F3;
color: white;
width: 100%;
background-color: #4A628A; /* Blue background */
color: white; /* White text color */
}
-59
View File
@@ -1,59 +0,0 @@
body, html {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
font-family: "Roboto", sans-serif;
font-weight: 500;
font-style: normal;
background-image: url('../assets/background.png');
background-size: cover;
background-repeat: no-repeat;
}
.container {
opacity: 0;
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
min-height: 100vh;
}
.header {
color: #1B1A55;
font-size: 4vh;
text-transform: uppercase;
text-align: center;
}
.loading-section {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
color: white;
}
.spinner {
width: 50px;
height: 50px;
border: 6px solid #f3f3f3;
border-top: 6px solid #2196F3;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.loading-section p {
font-size: 1.5rem;
color: white;
margin-top: 1rem;
}
-59
View File
@@ -1,59 +0,0 @@
body, html {
height: 100%;
width: 100%;
margin: 0;
padding: 0;
font-family: "Roboto", sans-serif;
font-weight: 500;
font-style: normal;
background-image: url('../assets/background.png');
background-size: cover;
background-repeat: no-repeat;
}
.container {
opacity: 0;
display: flex;
flex-direction: column;
justify-content: space-evenly;
align-items: center;
min-height: 100vh;
}
.header {
color: #1B1A55;
font-size: 4vh;
text-transform: uppercase;
text-align: center;
}
.loading-section {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
color: white;
}
.spinner {
width: 50px;
height: 50px;
border: 6px solid #f3f3f3;
border-top: 6px solid #2196F3;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
.loading-section p {
font-size: 1.5rem;
color: white;
margin-top: 1rem;
}
+31
View File
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
<link href="../css/normalizer.css" rel="stylesheet">
<link href="../css/announcement.css" rel="stylesheet">
<link href="../css/transition.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<script src="../js/announcement.js"></script>
<script src="../js/helpers.js"></script>
<title>Announcement</title>
</head>
<body onload="loadAnnouncement(); fadeIn()">
<div class="container">
<div class="header">
<h1 class="title">Announcement</h1>
</div>
<div class="announcement-body">
<p id="announcement-content">Loading announcement...</p>
</div>
<div class="announcement-footer">
<button id="closeButton" onclick="closeWindow()">Close</button>
</div>
</div>
</body>
</html>
@@ -4,10 +4,13 @@
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
<link href="../css/normalizer.css" rel="stylesheet">
<!-- Reuse the same CSS files as UC Not Found -->
<link href="../css/welcome.css" rel="stylesheet">
<link href="../css/loading.css" rel="stylesheet">
<link href="../css/transition.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<script src="../js/helpers.js"></script>
<title>Welcome</title>
@@ -15,11 +18,12 @@
<body onload="fadeIn()">
<div class="container">
<div class="header">
<h1>BACKUP FETCHER</h1>
<h1 class="title">Team Vault</h1>
</div>
<img src="../assets/refresh-data.webp" alt="Backup Fetcher" class="backup-img">
<div class="loading-section">
<div class="spinner"></div>
<p>Backup is not searched, please wait...</p>
<p>Backup is now searched, please wait...</p>
</div>
</div>
</body>
+13 -7
View File
@@ -4,33 +4,39 @@
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
<link href="../css/normalizer.css" rel="stylesheet">
<link href="../css/login.css" rel="stylesheet">
<link href="../css/transition.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<title>Login</title>
</head>
<body onload="fadeIn()">
<div class="page">
<div class="container">
<div class="header">
<h1>DO WE KNOW</h1>
<h1>EACH OTHER?</h1>
<h1 class="title">TeamVault</h1>
<h4 class="subheading">Do we know each other?</h4>
</div>
<form class="login-form" id="loginForm">
<div class="login-form-title">
<h2>Login</h2>
<hr>
<h2 class="login-title">Login</h2>
</div>
<div class="login-form-content">
<input name="email" placeholder="Email" type="email">
<input name="password" placeholder="Password" type="password">
</div>
<div class="login-form-footer">
<button id="signup" name="submit" type="button">Sign Up</button>
<div>
<button id="signup" name="underline" type="button">Sign Up</button>
<button id="resetPassword" name="underline" type="button">Reset Password</button>
</div>
<button id="submit" name="submit" type="submit">Submit</button>
<button id="resetPassword" name="resetPassword" type="button">Reset Password</button>
</div>
</form>
</div>
</div>
<script src="../js/login.js"></script>
<script src="../js/helpers.js"></script>
+32 -27
View File
@@ -4,9 +4,12 @@
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
<link href="../css/normalizer.css" rel="stylesheet">
<link href="../css/main_menu.css" rel="stylesheet">
<link href="../css/transition.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<script src="../js/main_menu.js"></script>
<script src="../js/helpers.js"></script>
@@ -14,41 +17,43 @@
<title>Main Page</title>
</head>
<body onload="fadeIn()">
<div class="container">
<div class="left_block">
<div class="left_block_top">
<div>
<h1>WELCOME BACK,</h1>
<h1 id="username-field"></h1>
<h2>Hope you have a productive day!</h2>
<body onload="initialSetup(); fadeIn()">
<div class="page">
<div class="container">
<div class="left_block">
<div class="notification-title">
<h1 class="notif-title">Notifications</h1>
</div>
<div class=left-content>
<div class="notifications" id="notifications">
<!--Notifications are generated here-->
</div>
<div class="left_block_footer">
<button class="logout-button" id="logout" name="logout">Logout</button>
</div>
</div>
<img alt="" src="../assets/user_1144760.png">
</div>
<div class="left_block_content">
<div class="left_block_buttons">
<div class="right_block">
<div class="navbar">
<div class="welcome">
<img alt="" src="../assets/user_1144760.png">
<h3 class="user">Welcome Back,&nbsp; </h3>
<h3 class="user" id="username-field"></h3>
<h3 class="user">!</h3>
</div>
<h1 class="title">TeamVault</h1>
</div>
<div class="right_block_content">
<button id="change-info" name="menu_button">Change your info</button>
<button id="share-file" name="menu_button">Share a file</button>
</div>
<div class="left_block_buttons">
<button id="backup-dir" name="menu_button">Set backup directory</button>
<button id="department-dir" name="menu_button">Set department directory</button>
<button id="share-dir" name="menu_button">Set share directory</button>
</div>
<div class="left_block_buttons">
<button id="restore-backup" name="menu_button">Restore backup</button>
</div>
</div>
<div class="left_block_footer">
<button id="logout" name="logout">Logout</button>
</div>
</div>
<div class="right_block">
<div>
<h1>NOTIFICATIONS</h1>
<hr>
</div>
<div class="notifications" id="notifications">
</div>
</div>
+22 -17
View File
@@ -4,9 +4,12 @@
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
<link href="../css/normalizer.css" rel="stylesheet">
<link href="../css/profile.css" rel="stylesheet">
<link href="../css/transition.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<script src="../js/profile.js"></script>
<script src="../js/helpers.js"></script>
@@ -14,22 +17,24 @@
<title>Profile</title>
</head>
<body onload="fadeIn()">
<div class="container">
<form class="profile-form" id="profileForm">
<div class="profile-form-title">
<h2>Profile</h2>
<hr>
</div>
<div class="profile-form-content">
<input name="email" placeholder="Email" type="email">
<input name="username" placeholder="Username" type="text">
<input name="password" placeholder="Password" type="password">
</div>
<div class="profile-form-footer">
<button name="login" type="button">Back</button>
<button name="submit" type="submit">Submit</button>
</div>
</form>
<div class="page">
<div class="container">
<form class="profile-form" id="profileForm">
<div class="header">
<h1 class="title">Profile</h1>
<h3 class="subheading">Who are you?</h3>
</div>
<div class="profile-form-content">
<input name="email" placeholder="Email" type="email">
<input name="username" placeholder="Username" type="text">
<input name="password" placeholder="Password" type="password">
</div>
<div class="profile-form-footer">
<button id="back" name="underline" type="button">Back</button>
<button id="submit" name="submit" type="submit">Submit</button>
</div>
</form>
</div>
</div>
</body>
</html>
+31
View File
@@ -0,0 +1,31 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
<link href="../css/normalizer.css" rel="stylesheet">
<!-- Reuse the same CSS files as UC Not Found -->
<link href="../css/loading.css" rel="stylesheet">
<link href="../css/transition.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<script src="../js/helpers.js"></script>
<script src="../js/reset_database.js"></script>
<title>Welcome</title>
</head>
<body onload="fadeIn()">
<div class="container">
<div class="header">
<h1 class="title">Welcome to TeamVault</h1>
</div>
<img src="../assets/2581896.png" style="margin-left: 20px" alt="Connecting to server" class="server-img">
<div class="loading-section">
<div class="spinner"></div>
<p>The CEO initialized a complete reset, please wait...</p>
</div>
</div>
</body>
</html>
+11 -7
View File
@@ -3,33 +3,37 @@
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="../css/normalizer.css" rel="stylesheet">
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
<link href="../css/reset_password.css" rel="stylesheet">
<link href="../css/transition.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<title>Reset Password</title>
</head>
<body onload="fadeIn()">
<div class="page">
<div class="container">
<div class="header">
<h1>RESET</h1>
<h1>YOUR PASSWORD</h1>
<h1 class="title">TeamVault</h1>
<h3 class="subheading">Forgot your password? No worries, it happens to the best of us!</h3>
</div>
<form class="login-form" id="resetPasswordForm">
<div class="login-form-title">
<h2>Reset Password</h2>
<hr>
<h2 class="login-title">Reset Password</h2>
</div>
<div class="login-form-content">
<input name="email" placeholder="Email" type="email" required>
<input name="newPassword" placeholder="New Password" type="password" required>
</div>
<div class="login-form-footer">
<button id="backToLogin" name="backToLogin" type="button">Back to Login</button>
<button id="resetPassword" name="resetPassword" type="submit">Reset Password</button>
<button id="backToLogin" name="underline" type="button">Back to Login</button>
<button id="resetPassword" name="submit" type="submit">Reset Password</button>
</div>
</form>
</div>
</div>
<script src="../js/reset_password.js"></script>
<script src="../js/helpers.js"></script>
</body>
+23 -27
View File
@@ -4,46 +4,42 @@
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
<link href="../css/normalizer.css" rel="stylesheet">
<link href="../css/share_file.css" rel="stylesheet">
<link href="../css/transition.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<script src="../js/share_file.js"></script>
<script src="../js/helpers.js"></script>
<title>Share File</title>
</head>
<body onload="fadeIn()">
<body onload="fetchUsersAndCreateCheckboxes(); updateFileName(); fadeIn()">
<div class="page">
<div class="container">
<div class="left_block">
<div class="left_block_top">
<div class="left_block_top_left">
<h1>SHARE A FILE</h1>
<hr>
<h2>First select the file you want to share</h2>
<h2>(can be whatever resource from the system)</h2>
</div>
<div class="left_block_top_right">
<h2 id="fileName"></h2>
</div>
<div class="form">
<div class="header">
<h1 class="title">Share a File</h1>
<h3 class="subheading">First select the file you want to share.</h3>
<button class="filename-title" id="selectFile" name="submit" type="button">Select</button>
<form class="users_block" id="userDestForm">
<h5>Users</h5>
<h3 class="subheading">Select the users you want to share the file with.</h3>
<div id="choose_user_form_content" class="choose_user_form_content">
<!-- Insert the users from the database -->
</div>
</form>
</div>
<div class="left_block_content">
<button id="selectFile" name="select_file" type="button">Select</button>
</div>
<div class="left_block_footer">
<button id="backButton" name="back" type="button">Back</button>
<div class="footer">
<button id="backButton" name="underline" type="button">Back</button>
<button id="submitButton" name="submit" type="submit">Submit</button>
</div>
</div>
<form class="right_block" id="userDestForm">
<div class="choose_user_form_title">
<h1>USERS</h1>
<hr>
</div>
<div class="choose_user_form_content">
<!-- Insert the users from the database -->
</div>
</form>
</div>
</div>
</body>
</html>
+11 -10
View File
@@ -3,24 +3,27 @@
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="../css/normalizer.css" rel="stylesheet">
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
<link href="../css/transition.css" rel="stylesheet">
<link href="../css/sign_up.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<title>Signup Process</title>
</head>
<body onload="fadeIn()">
<div class="page">
<div class="container">
<!-- Step 1: Profile Information -->
<div class="step active" id="step1">
<div class="header">
<h1>LET US MEET</h1>
<h1>EACH OTHER</h1>
<h1 class="title">TeamVault</h1>
<h3 class="subheading">Let us meet each other</h3>
</div>
<form class="signup-form" id="signupForm">
<div class="signup-form-title">
<h2>Sign Up</h2>
<hr>
</div>
<div class="signup-form-content">
<input name="email" placeholder="Email" type="email" required>
@@ -37,16 +40,14 @@
<!-- Step 2: Department Selection -->
<div class="step" id="step2" style="display: none;">
<div class="header">
<h1>TELL ME MORE</h1>
<h1>ABOUT</h1>
<h1>YOUR WORK</h1>
<h1 class="title">TeamVault</h1>
<h3 class="subheading">Tell me more about your work</h3>
</div>
<form class="signup-form" id="departmentForm">
<div class="signup-form-title">
<h2>Choose your department</h2>
<hr>
</div>
<div class="signup-form-content" id="departmentList">
<div class="signup-form-content-radio" id="departmentList">
<!-- List of departments will be dynamically inserted here -->
</div>
<div class="signup-form-footer">
@@ -56,7 +57,7 @@
</form>
</div>
</div>
</div>
<script src="../js/sign_up.js"></script>
<script src="../js/helpers.js"></script>
</body>
+7 -4
View File
@@ -4,9 +4,12 @@
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
<link href="../css/uc_not_found.css" rel="stylesheet">
<link href="../css/normalizer.css" rel="stylesheet">
<link href="../css/loading.css" rel="stylesheet">
<link href="../css/transition.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<script src="../js/helpers.js"></script>
@@ -15,9 +18,9 @@
<body onload="fadeIn()">
<div class="container">
<div class="header">
<h1>SEARCHING FOR THE</h1>
<h1>SERVER...</h1>
<h1 class="title">TeamVault</h1>
</div>
<img src="../assets/cloud-computing.webp" alt="Connecting to server" class="server-img">
<div class="loading-section">
<div class="spinner"></div>
<p>Please wait while we try to connect to the server.</p>
+6 -3
View File
@@ -4,10 +4,13 @@
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="../assets/hard-disk.ico" rel="icon" type="image/x-icon">
<link href="../css/normalizer.css" rel="stylesheet">
<!-- Reuse the same CSS files as UC Not Found -->
<link href="../css/welcome.css" rel="stylesheet">
<link href="../css/loading.css" rel="stylesheet">
<link href="../css/transition.css" rel="stylesheet">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Pridi:wght@200;300;400;500;600;700&display=swap" rel="stylesheet">
<script src="../js/helpers.js"></script>
<title>Welcome</title>
@@ -15,7 +18,7 @@
<body onload="fadeIn()">
<div class="container">
<div class="header">
<h1>WELCOME TO THE APP</h1>
<h1 class="title">Welcome to TeamVault</h1>
</div>
<div class="loading-section">
<div class="spinner"></div>
+35
View File
@@ -0,0 +1,35 @@
// Load announcement content from the application info when the page loads
async function loadAnnouncement() {
try {
const announcementText = await window.electronAPI.readApplicationInfo('announcement');
const announcementContent = document.getElementById('announcement-content');
if (announcementContent && announcementText) {
console.log('Announcement:', announcementText);
announcementContent.innerHTML = formatTextForHtml(announcementText);
}
} catch (error) {
console.error('Failed to load announcement:', error);
document.getElementById('announcement-content').textContent = 'Failed to load announcement.';
}
}
function formatTextForHtml(text) {
// Replace newlines with <br> tags
let formattedText = text.replace(/\n/g, '<br>');
// Replace tabs with a few non-breaking spaces for indentation
formattedText = formattedText.replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;');
// Replace other special characters as needed
// Example: Handle double spaces by converting to &nbsp;
formattedText = formattedText.replace(/ /g, ' &nbsp;');
return formattedText;
}
// Close the window when the close button is clicked
function closeWindow() {
window.electronAPI.writeApplicationInfo('announcement', '');
window.electronAPI.closeAnnouncementWindow();
}
+15 -4
View File
@@ -24,13 +24,24 @@ function fadeOut(destination) {
async function waitForResponse() {
return new Promise((resolve) => {
const idResponseCheck = setInterval(async () => {
const status = await window.electronAPI.hasResponseArrived();
if (status) {
if (await window.electronAPI.hasResponseArrived()) {
clearInterval(idResponseCheck);
const response = await window.electronAPI.getLastUcResult();
resolve(response || null); // Resolve the response or null if not available
resolve(await window.electronAPI.getLastUcResult()); // Resolve the response or null if not available
}
}, 100); // Check every 100 milliseconds if the response has arrived
});
}
function toggleScroll(idComponent, scrollHeight = 180) {
const element = document.getElementById(idComponent); // Using getElementById
if (!element) {
console.error(`Element with ID '${idComponent}' not found.`);
return;
}
if (element.scrollHeight > scrollHeight) {
element.style.overflowY = 'auto'; // Enable scroll if content overflows
} else {
element.style.overflowY = 'hidden'; // Disable scroll if content fits
}
}
+99 -85
View File
@@ -1,7 +1,12 @@
let codeLogin = '';
let codeFindByEmail = '';
let codeFindKeyByUser = '';
let codeOk = '';
document.addEventListener('DOMContentLoaded', async function () {
const submitButton = document.getElementById('submit');
const signUpButton = document.getElementById('signup');
const resetPasswordButton = document.getElementById('resetPassword');
const signUpButton = document.getElementById('signup');
// Retrieve the operation codes via IPC
const operationCodes = await window.electronAPI.getOperationsCodes();
@@ -10,21 +15,21 @@ document.addEventListener('DOMContentLoaded', async function () {
return;
}
const codeLogin = operationCodes.LOGIN;
const codeFindByEmail = operationCodes.FIND_BY_EMAIL;
const codeFindKeyByUser = operationCodes.FIND_KEY_BY_USER_ID;
const codeOk = operationCodes.OK;
signUpButton.addEventListener('click', function (e) {
e.preventDefault();
window.electronAPI.changeContent('sign_up');
});
codeLogin = operationCodes.LOGIN;
codeFindByEmail = operationCodes.FIND_BY_EMAIL;
codeFindKeyByUser = operationCodes.FIND_KEY_BY_USER_ID;
codeOk = operationCodes.OK;
resetPasswordButton.addEventListener('click', function (e) {
e.preventDefault();
window.electronAPI.changeContent('reset_password');
});
signUpButton.addEventListener('click', function (e) {
e.preventDefault();
window.electronAPI.changeContent('sign_up');
});
// Submit button logic (handle login)
submitButton.addEventListener('click', async function (e) {
e.preventDefault();
@@ -72,79 +77,88 @@ document.addEventListener('DOMContentLoaded', async function () {
await window.electronAPI.closeUcSocket();
await window.electronAPI.changeContent('main_menu');
});
async function attemptLogin(email, password) {
const app_type = await window.electronAPI.readUserConfig('app_type');
const messageData = { email, password, app_type };
// Send the login message to the server
if (!await window.electronAPI.sendUcMessage(codeLogin, messageData)) {
await window.electronAPI.showAlert('Failed to send login request.');
return false;
}
// Wait for the response using waitForResponse
const response = await waitForResponse();
if (response && response.operationCode === codeOk) {
await window.electronAPI.resetApplicationInfo();
await window.electronAPI.resetUserConfig();
await window.electronAPI.writeUserConfig('app_type', app_type);
await window.electronAPI.writeUserConfig('user_info', { email, password });
return true;
}else if(response && respone.operationCode !== codeOk){
await window.electronAPI.showAlert(response.metaInfo.message);
return false;
}
await window.electronAPI.showAlert('Invalid login response received.');
return false;
}
async function fetchAndStoreUserInfo(userEmail) {
if (!await window.electronAPI.sendUcMessage(codeFindByEmail, { email: userEmail })) {
await window.electronAPI.showAlert('Failed to send request to fetch user info.');
return false;
}
// Wait for the response using waitForResponse
const response = await waitForResponse();
if (response && response.operationCode === codeOk) {
let userInfo = await window.electronAPI.readUserConfig('user_info');
if (!userInfo) {
userInfo = {};
}
userInfo.id = response.metaInfo.id;
userInfo.departmentId = response.metaInfo.departmentId;
userInfo.name = response.metaInfo.name || 'User';
await window.electronAPI.writeUserConfig('user_info', userInfo);
return true;
}
await window.electronAPI.showAlert('Failed to fetch user info from server.');
return false;
}
async function fetchAndStoreEncryptionKey(userId) {
if (!await window.electronAPI.sendUcMessage(codeFindKeyByUser, { userId })) {
await window.electronAPI.showAlert('Failed to send request to fetch encryption key.');
return false;
}
// Wait for the response using waitForResponse
const response = await waitForResponse();
if (response && response.operationCode === codeOk) {
const encryptionKey = {
key: response.metaInfo.key.key,
iv: response.metaInfo.key.iv,
};
await window.electronAPI.writeUserConfig('encryption_key', encryptionKey);
return true;
}
await window.electronAPI.showAlert('Failed to fetch encryption key from server.');
return false;
}
});
async function attemptLogin(email, password) {
const app_type = await window.electronAPI.readUserConfig('app_type');
const messageData = {email, password, app_type};
// Send the login message to the server
if (!await window.electronAPI.sendUcMessage(codeLogin, messageData)) {
await window.electronAPI.showAlert('Failed to send login request.');
return false;
}
// Wait for the response using waitForResponse
const response = await waitForResponse();
if (!response) {
await window.electronAPI.showAlert('No response from server.');
return false;
}
if (response.operationCode !== codeOk) {
await window.electronAPI.showAlert(response.metaInfo.message);
return false;
}
const user_info = await window.electronAPI.readUserConfig('user_info');
if (!user_info || (user_info && user_info.email !== email)) {
await window.electronAPI.resetApplicationInfo();
await window.electronAPI.resetMemory();
await window.electronAPI.resetUserConfig();
await window.electronAPI.writeUserConfig('app_type', app_type);
await window.electronAPI.writeUserConfig('user_info', {email, password});
return true;
}
return true;
}
async function fetchAndStoreUserInfo(userEmail) {
if (!await window.electronAPI.sendUcMessage(codeFindByEmail, {email: userEmail})) {
await window.electronAPI.showAlert('Failed to send request to fetch user info.');
return false;
}
// Wait for the response using waitForResponse
const response = await waitForResponse();
if (response && response.operationCode === codeOk) {
let userInfo = await window.electronAPI.readUserConfig('user_info');
if (!userInfo) {
userInfo = {};
}
userInfo.id = response.metaInfo.id;
userInfo.departmentId = response.metaInfo.departmentId;
userInfo.name = response.metaInfo.name || 'User';
await window.electronAPI.writeUserConfig('user_info', userInfo);
return true;
}
await window.electronAPI.showAlert('Failed to fetch user info from server.');
return false;
}
async function fetchAndStoreEncryptionKey(userId) {
if (!await window.electronAPI.sendUcMessage(codeFindKeyByUser, {userId})) {
await window.electronAPI.showAlert('Failed to send request to fetch encryption key.');
return false;
}
// Wait for the response using waitForResponse
const response = await waitForResponse();
if (response && response.operationCode === codeOk) {
const encryptionKey = {
key: response.metaInfo.key.key,
iv: response.metaInfo.key.iv,
};
await window.electronAPI.writeUserConfig('encryption_key', encryptionKey);
return true;
}
await window.electronAPI.showAlert('Failed to fetch encryption key from server.');
return false;
}
+9 -4
View File
@@ -9,9 +9,6 @@ document.addEventListener('DOMContentLoaded', async function () {
const shareFileButton = document.getElementById('share-file');
const logoutButton = document.getElementById('logout');
const restoreBackupButton = document.getElementById('restore-backup');
await fetchUserInfo();
await checkAndSetAllDirectories();
backupButton.addEventListener('click', async function () {
await setPath('backupDirectory');
@@ -43,6 +40,12 @@ document.addEventListener('DOMContentLoaded', async function () {
});
});
async function initialSetup(){
await checkAndSetAllDirectories();
await loadReceivedFiles();
await fetchUserInfo();
}
async function restoreBackup() {
const backupDirectory = await window.electronAPI.readApplicationInfo('backupDirectory');
@@ -59,7 +62,7 @@ async function restoreBackup() {
}
// Call the IPC method to initiate the backup retrieval process
await window.electronAPI.startBackupRetrieval(destinationPath);
window.electronAPI.startBackupRetrieval(destinationPath);
// Switch the content to the 'backup_retrieve' page
fadeOut('backup_retrieve');
@@ -89,6 +92,7 @@ async function attachNotificationButton(pathKey, buttonText, buttonId, buttonNam
if (!path) {
const notificationsDiv = document.getElementById('notifications');
const button = document.createElement('button');
button.className='alert';
button.id = buttonId;
button.name = buttonName;
button.textContent = buttonText;
@@ -152,6 +156,7 @@ async function loadReceivedFiles() {
if (!existingButtons.includes(filePath)) {
const button = document.createElement('button');
button.setAttribute('data-filepath', filePath); // Set a custom attribute to track the file path
button.className = 'notification';
button.name = 'notification';
button.textContent = `You received a file "${fileName}" from ${userName}`; // Display the userName and file name
button.addEventListener('click', () => handleFileReceivedButtonPressed(filePath, button));
+4 -3
View File
@@ -10,8 +10,8 @@ document.addEventListener('DOMContentLoaded', async function () {
usernameInput.value = name;
passwordInput.value = password;
const backButton = document.querySelector('button[name="login"]');
const submitButton = document.querySelector('button[name="submit"]');
const backButton = document.getElementById('back');
const submitButton = document.getElementById('submit');
// Get operation codes from the backend
const operationCodes = await window.electronAPI.getOperationsCodes();
@@ -39,7 +39,8 @@ document.addEventListener('DOMContentLoaded', async function () {
const name = usernameInput.value;
const password = passwordInput.value;
const { id, departmentId, app_type } = await window.electronAPI.readUserConfig('user_info'); // Fetch login data
const { id, departmentId } = await window.electronAPI.readUserConfig('user_info'); // Fetch login data
const app_type = await window.electronAPI.readUserConfig('app_type'); // Fetch app type
// Prepare the data to be sent via the UC socket
const messageData = {
+4
View File
@@ -0,0 +1,4 @@
document.addEventListener('DOMContentLoaded', async function () {
await new Promise(resolve => setTimeout(resolve, 7000));
window.electronAPI.changeContent('login');
});
+20 -17
View File
@@ -1,3 +1,6 @@
let codeResetPassword = '';
let codeOk = '';
document.addEventListener('DOMContentLoaded', async function () {
const backToLoginButton = document.getElementById('backToLogin');
const resetPasswordButton = document.getElementById('resetPassword');
@@ -9,8 +12,8 @@ document.addEventListener('DOMContentLoaded', async function () {
return;
}
const codeResetPassword = operationCodes.RESET_PASSWORD;
const codeOk = operationCodes.OK;
codeResetPassword = operationCodes.RESET_PASSWORD;
codeOk = operationCodes.OK;
// Back to login
backToLoginButton.addEventListener('click', function (e) {
@@ -45,19 +48,19 @@ document.addEventListener('DOMContentLoaded', async function () {
await window.electronAPI.showAlert('Password reset successfully.');
window.electronAPI.changeContent('login');
});
async function attemptResetPassword(email, newPassword) {
const app_type = await window.electronAPI.readUserConfig('app_type');
const messageData = { email, newPassword, app_type };
if (!await window.electronAPI.sendUcMessage(codeResetPassword, messageData)) return false;
const response = await waitForResponse();
if (response && response.operationCode === codeOk) {
return true;
} else {
await window.electronAPI.showAlert(response?.metaInfo?.message || 'Error resetting password.');
return false;
}
}
});
async function attemptResetPassword(email, newPassword) {
const app_type = await window.electronAPI.readUserConfig('app_type');
const messageData = { email, newPassword, app_type };
if (!await window.electronAPI.sendUcMessage(codeResetPassword, messageData)) return false;
const response = await waitForResponse();
if (response && response.operationCode === codeOk) {
return true;
} else {
await window.electronAPI.showAlert(response?.metaInfo?.message || 'Error resetting password.');
return false;
}
}
+80 -72
View File
@@ -1,62 +1,13 @@
let pathToFile = '';
let fetchUsersInterval = null;
document.addEventListener('DOMContentLoaded', async function () {
let user_info = {};
let pathToFile = '';
const selectFileButton = document.getElementById('selectFile');
const submitButton = document.getElementById('submitButton');
const backButton = document.getElementById('backButton');
user_info = await window.electronAPI.readUserConfig('user_info');
if (!user_info) {
await window.electronAPI.showAlert('No user_info entry found.');
return;
}
// Function to update the file name display
function updateFileName() {
const fileNameElement = document.getElementById('fileName');
if (!fileNameElement) {
return;
}
if (pathToFile.trim() === '') {
fileNameElement.textContent = 'No file chosen';
} else {
fileNameElement.textContent = pathToFile.split('\\').pop().split('/').pop();
}
}
updateFileName();
// Fetch user information from applicationInfo and create checkboxes for selecting users
async function fetchUsersAndCreateCheckboxes() {
const usersInfoId = await window.electronAPI.readApplicationInfo('active_users_info');
if (!usersInfoId) {
await window.electronAPI.showAlert('Internal error.');
return;
}
const usersInfo = await window.electronAPI.readMemoryEntry(usersInfoId);
if (!usersInfo || usersInfo.length === 0) {
await window.electronAPI.showAlert('No active users found.');
await window.electronAPI.changeContent('main_menu');
return;
}
const usersDiv = document.querySelector('.choose_user_form_content');
usersDiv.innerHTML = '';
usersInfo.forEach(user => {
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.name = 'users';
checkbox.value = user.ip; // Store user's IP in the value
const label = document.createElement('label');
label.innerHTML = `${user.user_info.name}`; // Display user's name
label.insertBefore(checkbox, label.firstChild);
usersDiv.appendChild(label);
});
}
// Event listener for selecting the file
document.getElementById('selectFile').addEventListener('click', async function () {
selectFileButton.addEventListener('click', async function (event) {
event.preventDefault();
try {
pathToFile = await window.electronAPI.selectFile();
updateFileName();
@@ -64,14 +15,7 @@ document.addEventListener('DOMContentLoaded', async function () {
console.error('Error opening file dialog:', error);
}
});
// Event listener for back button to navigate to main menu
document.getElementById('backButton').addEventListener('click', function () {
fadeOut('main_menu');
});
// Submit button logic to queue file send tasks and then navigate to main_menu.html
document.getElementById('submitButton').addEventListener('click', async function (event) {
submitButton.addEventListener('click', async function (event) {
event.preventDefault();
// Check if a file was chosen
@@ -80,6 +24,11 @@ document.addEventListener('DOMContentLoaded', async function () {
return;
}
const user_info = await window.electronAPI.readUserConfig('user_info');
if (!user_info) {
return;
}
const form = document.getElementById('userDestForm');
const checkboxes = form.querySelectorAll('input[name="users"]');
const selectedUserIps = Array.from(checkboxes)
@@ -100,19 +49,78 @@ document.addEventListener('DOMContentLoaded', async function () {
userName: user_info.name // Sender's username from userConfig
};
await window.electronAPI.addTaskToSendFileQueue(task);
await window.electronAPI.showAlert('File sent to the queue.');
console.log(`Task added to send file to IP ${selectedUserIp}`);
} catch (error) {
console.error(`Error processing IP ${selectedUserIp}:`, error);
}
}
// Navigate back to the main menu after all tasks are queued
fadeOut('main_menu'); // Navigate to the main menu
});
backButton.addEventListener('click', function (event) {
event.preventDefault();
fadeOut('main_menu');
});
// Fetch users and create checkboxes every 5 seconds (in case of updates)
setInterval(fetchUsersAndCreateCheckboxes, 5000);
fetchUsersAndCreateCheckboxes().then(() => console.log('User checkboxes rendered'));
});
// Function to update the file name display
function updateFileName() {
const fileNameElement = document.getElementById('selectFile');
if (!fileNameElement) {
return;
}
if (pathToFile.trim() === '') {
fileNameElement.textContent = 'No file chosen';
} else {
fileNameElement.textContent = pathToFile.split('\\').pop().split('/').pop();
}
}
async function fetchUsersAndCreateCheckboxes() {
// Step 1: Get the currently checked users before refreshing the list
const selectedUserIps = new Set(
Array.from(document.querySelectorAll('input[name="users"]:checked'))
.map(checkbox => checkbox.value)
);
const usersInfoId = await window.electronAPI.readApplicationInfo('active_users_info');
if (!usersInfoId) {
await window.electronAPI.showAlert('Internal error.');
return;
}
const usersInfo = await window.electronAPI.readMemoryEntry(usersInfoId);
if (!usersInfo || usersInfo.length === 0) {
await window.electronAPI.showAlert('No active users found.');
clearInterval(fetchUsersInterval);
fetchUsersInterval = null;
await window.electronAPI.changeContent('main_menu');
return;
}
const usersDiv = document.getElementById('choose_user_form_content');
usersDiv.innerHTML = ''; // Clear the list before updating
usersInfo.forEach(user => {
const checkbox = document.createElement('input');
checkbox.type = 'checkbox';
checkbox.name = 'users';
checkbox.value = user.ip; // Store user's IP in the value
// Step 2: Check if this user was previously selected
if (selectedUserIps.has(user.ip)) {
checkbox.checked = true; // Restore checked state
}
const label = document.createElement('label');
label.innerHTML = `${user.user_info.name}`; // Display user's name
label.insertBefore(checkbox, label.firstChild);
usersDiv.appendChild(label);
});
toggleScroll('choose_user_form_content');
}
+48 -46
View File
@@ -1,3 +1,14 @@
let codeOk = '';
let codeGetDepartments = '';
let codeSignUp = '';
let userData = {
email: null,
name: null,
password: null,
app_type: null,
departmentId: null
};
document.addEventListener('DOMContentLoaded', async function () {
const nextToStep2Button = document.getElementById('nextToStep2');
const backToStep1Button = document.getElementById('backToStep1');
@@ -7,15 +18,6 @@ document.addEventListener('DOMContentLoaded', async function () {
const step1 = document.getElementById('step1');
const step2 = document.getElementById('step2');
// This object will hold the user data
let userData = {
email: null,
name: null,
password: null,
app_type: null,
departmentId: null
};
if (!await window.electronAPI.openUcSocket()) {
alert('Internal error of the application.');
return;
@@ -27,16 +29,15 @@ document.addEventListener('DOMContentLoaded', async function () {
return;
}
const codeGetDepartments = operationCodes.GET_DEPARTMENTS;
const codeSignUp = operationCodes.SIGN_UP;
const codeOk = operationCodes.OK;
codeGetDepartments = operationCodes.GET_DEPARTMENTS;
codeSignUp = operationCodes.SIGN_UP;
codeOk = operationCodes.OK;
let departments = await getDepartments();
if (departments === null) {
await window.electronAPI.showAlert('Failed to fetch departments.');
return;
}
console.log(departments);
// Handle form submission for Step 1 (Profile Information)
nextToStep2Button.addEventListener('click', async function (e) {
@@ -98,37 +99,38 @@ document.addEventListener('DOMContentLoaded', async function () {
await window.electronAPI.closeUcSocket();
await window.electronAPI.changeContent('login');
});
async function getDepartments() {
if (!await window.electronAPI.sendUcMessage(codeGetDepartments)) return null;
const response = await waitForResponse();
if (response && response.operationCode === codeOk) {
return response.metaInfo.departments;
}
return null;
}
async function attemptSignUp() {
if (!await window.electronAPI.sendUcMessage(codeSignUp, userData)) return false;
const response = await waitForResponse();
if (response && response.operationCode === codeOk) {
return true;
}
await window.electronAPI.showAlert(`Signup failed: ${response?.metaInfo?.message || 'Unknown error'}`);
return false;
}
// Function to switch between steps
function switchStep(fromStep, toStep) {
fromStep.classList.remove('active'); // Fade out the current step
setTimeout(() => {
fromStep.style.display = 'none'; // Hide the current step after transition
toStep.style.display = 'flex'; // Ensure display is flex for the next step
setTimeout(() => {
toStep.classList.add('active'); // Fade in the next step
}, 20); // Small delay to allow display change before applying opacity
}, 500); // Transition duration (0.5s)
}
});
async function getDepartments() {
if (!await window.electronAPI.sendUcMessage('GET_DEPARTMENTS')) return null;
const response = await waitForResponse();
console.log(response);
if (response && response.operationCode === codeOk) {
return response.metaInfo.departments;
}
return null;
}
async function attemptSignUp() {
if (!await window.electronAPI.sendUcMessage(codeSignUp, userData)) return false;
const response = await waitForResponse();
if (response && response.operationCode === codeOk) {
return true;
}
await window.electronAPI.showAlert(`Signup failed: ${response?.metaInfo?.message || 'Unknown error'}`);
return false;
}
// Function to switch between steps
function switchStep(fromStep, toStep) {
fromStep.classList.remove('active'); // Fade out the current step
setTimeout(() => {
fromStep.style.display = 'none'; // Hide the current step after transition
toStep.style.display = 'flex'; // Ensure display is flex for the next step
setTimeout(() => {
toStep.classList.add('active'); // Fade in the next step
}, 20); // Small delay to allow display change before applying opacity
}, 500); // Transition duration (0.5s)
}