diff --git a/main.js b/main.js index 2419100..a756d7f 100644 --- a/main.js +++ b/main.js @@ -47,7 +47,7 @@ app.use(express.static(path.join(__dirname, 'static'))); -app.get('/', function(request, response) { +app.get('/x', function(request, response) { if (request.session.loggedin) { // Output username // response.send('Welcome back, ' + request.session.username + '!'); @@ -67,7 +67,7 @@ console.log(request.session.username , 'open main page'); app.get('/login', function(request, response) { /// Render login template with any message from query parameters console.log('Message:', request.query.message); // Log the message - response.render('login', { message: request.query.message || '' }); + response.render('login', { message: request.query.message || '' }); @@ -107,8 +107,11 @@ app.post('/auth', async function(request, response) { // Authenticate the user request.session.loggedin = true; request.session.username = rows[0].username; + request.session.avatar = rows[0].avatar; // request.session.username = username; // Redirect to home page + console.log(rows); + response.redirect('/'); } else { response.redirect('/login?message=Incorrect Username and/or Password!'); @@ -126,14 +129,24 @@ app.post('/auth', async function(request, response) { // http://localhost:3000/home -app.get('/home', function(request, response) { +app.get('/', function(request, response) { // If the user is loggedin if (request.session.loggedin) { // Output username // response.send('Welcome back, ' + request.session.username + '!'); + let avatarSrc = ''; + if (request.session.avatar) { + // Convert BLOB to Base64 if it exists + const avatarBase64 = Buffer.from(request.session.avatar).toString('base64'); + avatarSrc = `data:image/jpeg;base64,${avatarBase64}`; // Adjust MIME type as necessary + } + // Render home page with username - response.render('home', { username: request.session.username }); + response.render('home', { + username: request.session.username, + avatar: avatarSrc + }); } else { // Not logged in diff --git a/static/css/navbar.css b/static/css/navbar.css new file mode 100644 index 0000000..cd34098 --- /dev/null +++ b/static/css/navbar.css @@ -0,0 +1,156 @@ +body2 { + margin: 0; + font-family: Arial, sans-serif; + background-color: #f8f9fa; /* Light background */ + background-color: #4a4e52; +} +.navbar { + display: flex; + justify-content: space-between; + align-items: center; + background-color: transparent; + padding: 4px 20px 0px; /* Padding adjustments */ + width: auto; +} + +.navbar-brand { + display: flex; + align-items: center; + color: white; /* Set text color to white */ + font-size: 14px; /* Smaller font size */ + text-decoration: none; /* Remove underline */ +} +.navbar-brand img { + height: 24px; /* Logo height */ + margin-right: 10px; /* Space between logo and title */ +} +.user-photo { + width: 24px; /* User photo size */ + height: 24px; + border-radius: 50%; /* Circular photo */ + cursor: pointer; + position: relative; /* To position dropdown */ +} + +.user-name { + color: white; font-weight: bold; +} + +img.user-photo:hover { + box-shadow: 0px 0px 5px 5px rgb(92 207 255 / 78%); +} + +.dropdown-menu { + position: absolute; /* Position it correctly */ + display: none; /* Hide dropdown by default */ + /* background-color: #343a40; */ + background-color: #1e1e1e; + right: 20px; /* Align to the right */ + min-width: 200px; /* Minimum width */ + z-index: 1000; /* Ensure it appears above other content */ + margin-top: 10px; /* Space between photo and menu */ + border-radius: 5px; /* Rounded corners */ + padding: 15px; /* Padding for dropdown */ + /* text-align: center; */ + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); +} +.dropdown-menu.show { + display: block; /* Show when active */ +} +.dropdown-item { + cursor: pointer; + padding: 10px; + color: white; /* Color for dropdown items */ + text-decoration: none; /* Remove underline */ + display: block; /* Block display for easy clicking */ +} +.dropdown-item:hover { + background-color: #495057; /* Hover effect */ +} +.user-details { + margin-bottom: 10px; /* Space below user details */ + text-align: center; +} +.dropdown-divider { + height: 1px; + background-color: rgba(255, 255, 255, 0.12); + margin: 5px 0; +} + + + /* city details */ + + + select#banksList { + border-top-left-radius: 10px; + border-bottom-left-radius: 10px; +} + +input#datepicker { + width: 70px; + + border-top-right-radius: 10px; + border-bottom-right-radius: 10px; + +} + + .select-city { + /* position: absolute; */ + position: relative; + width: 300px; + display: flex; + height: 24px; +} + + + +#cityInput { + border: 2px solid #ccc; + /* Default border */ + padding: 10px; + width: 200px; + box-sizing: border-box; + height: -webkit-fill-available; +} + +#cityInput.invalid { + border-color: red; + /* Red border for invalid input */ +} + +#cityInput.valid { + border-color: green; + /* Green border for valid selection */ +} + +#cityList { + color: black; + font-size: smaller; + border: 1px solid #ccc; + max-height: 150px; + overflow-y: auto; + display: none; + position: absolute; + background-color: white; + z-index: 1000; +} + +.city-item { + padding: 10px; + cursor: pointer; +} + +.city-item:hover { + background-color: #f0f0f0; +} + +.auto-complete-text { + position: absolute; + /* float: right; */ + /* padding-left: 55%; */ + + right: 19px; + top: 3px; + color: green; + margin-bottom: 4px; +} \ No newline at end of file diff --git a/static/css/nav.css b/static/css/notification.css similarity index 53% rename from static/css/nav.css rename to static/css/notification.css index d8ea7d5..dedaf4d 100644 --- a/static/css/nav.css +++ b/static/css/notification.css @@ -1,122 +1,5 @@ -/* Navbar styles */ -.logo{ - display: flex; - align-items: center; - } -.flex{ - display: flex; - justify-content: space-between; - align-items: center; -} -.nav-bar{ - padding: 3px 10px 0px 20px; -} -.nav-bar a{ - color: #fff; - cursor: pointer; -} -.nav-bar .hm{ - font-size: 20px; -} -#m-bar{ - display: none; - font-size: 20px; -} -#menu-links ul{ - margin: 0; - padding: 0; -} -#menu-links ul li{ - display: inline-block; - margin: 0 35px; - list-style-type: none; -} -#menu-links a{ - text-decoration: none; - font-weight: 500; - font-size: 15px; - text-transform: uppercase; -} -.nav-btn{ - padding: 3px 15px; - background-color: #868686; - text-decoration: none; - color: black; - border-radius: 35px; -} -.nav-btn:hover{ - background-color: #6791e0 !important; -} -.active{ - color: #2d6cdf !important; -} -#menu-links a:hover{ - color: #6dabf1 !important; -} -@media only screen and (max-width: 1105px){ - #btn{ - display: none; - } - .hidden-title{ - display: none !important; - } - .inputHolder { - width: -webkit-fill-available !important; - - } - .btn-remove { - right: 15px; - - } -} -@media only screen and (max-width: 750px){ - .nav-bar{ - display: block; - text-align: center; - background-color: rgba(0, 0, 0, .4); - } - #menu-links ul li{ - display: block; - margin: 25px 0; - } - #btn{ - display: block; - } - #m-bar{ - display: block; - } - .hidden{ - display: none !important; - } - .not-hidden{ - display: block !important; - } - .hidden-title{ - display: block !important; - } - - -} - -.bg-tarakan{ - display: none; - position: absolute; - max-width: 1140px; - width: -webkit-fill-available; -} -.show-tarakan{ - display: block; -} - - - - - - - /* toast notification */ - .toast { position: absolute; top: 25px; @@ -128,6 +11,7 @@ overflow: hidden; transform: translateX(calc(100% + 30px)); transition: all 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.35); + z-index: 100; } .toast-up{ diff --git a/static/css/options.css b/static/css/options.css new file mode 100644 index 0000000..9f2fd39 --- /dev/null +++ b/static/css/options.css @@ -0,0 +1,170 @@ +.options-box { + color: white; + background-color: #1e1e1e; + border-radius: 10px; + box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5); + padding: 20px; + max-width: 400px; + /* position: relative; */ + /* margin: auto; */ + width: 66%; + display: none; + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 9999; +} + +.close-btn { + position: absolute; + top: 10px; + right: 10px; + cursor: pointer; + font-size: 20px; + color: #ffffff; /* Close button color */ +} + +.option-title { + margin: 0 0 18px; /* Space below the title */ + font-size: 20px; /* Title size */ + text-align: center; /* Center the title */ +} + +.form-group { + display: flex; /* Flexbox for alignment */ + align-items: flex-start; + justify-content: space-between; /* Space between label and input */ + align-items: center; /* Vertically align items */ + /* margin-top: 15px; */ +} +.switch-title{ + padding-top: 10px; + margin: 0; +} + +label { + flex: 1; /* Takes available space */ + font-size: 14px; /* Smaller font size for labels */ +} + +.options-button { + background-color: #3a3a3a; /* Button background */ + color: #ffffff; /* Button text color */ + border: none; /* No border */ + padding: 10px; /* Padding inside buttons */ + border-radius: 5px; /* Rounded corners */ + cursor: pointer; /* Pointer cursor on hover */ + width: 100%; /* Full width buttons */ + margin-top: 15px; /* Space above buttons */ + transition: background-color 0.3s; /* Smooth background transition */ +} +.options-button:hover { + background-color: #505050; /* Lighter on hover */ +} +hr { + border: none; + height: 1px; + background-color: rgba(255, 255, 255, 0.1); /* Light divider */ + margin: 5px; /* Margin around the divider */ +} +.centered { + text-align: center; /* Center align text in buttons */ +} + +/* has */ + +label.switch.has-label { + display: grid; + grid-template-areas: "col-1 col-2 "; + grid-gap: 1px; + align-items: center; + justify-content: space-between; + } + label.switch.has-label .off { + color: rgba(255, 255, 255 ); + grid-area: col-1; + transition: var(--transition); + } + label.switch.has-label .on { + color: rgba(0, 0, 0, 0.3); + grid-area: col-3; + transition: var(--transition); + } + label.switch.has-label .track { + grid-area: col-2; + } + label.switch.has-label input[type=checkbox]:checked ~ .on { + color: rgb(255, 255, 255); + } + label.switch.has-label input[type=checkbox]:checked ~ .off { + color: rgb(255 253 253 / 47%); + } + + + +/* Main Component Styles */ +label.switch { + text-align: -webkit-right; + /* padding-bottom: 10px; */ + --switch-size: 40px; + --thumb-gap: 4px; + --thumb-size: calc(var(--switch-size) * 0.55 - var(--thumb-gap)); + --thumb-active-offset: calc(var(--switch-size) / 2); + --track-radius: calc(var(--switch-size) / 1.6666); + --thumb-color: #fff; + --track-color: rgba(146, 146, 146, 0.479); + --accent-color: #2f57d4; + --transition: 200ms ease; + } + label.switch .track { + width: var(--switch-size); + height: calc(var(--switch-size) / 1.6666); + background: var(--track-color); + border-radius: var(--track-radius); + border-radius: calc(var(--track-radius) / 2); + display: flex; + align-items: center; + box-shadow: inset 0px 0px 4px -2px rgba(0, 0, 0, 0.129); + transition: 250ms ease; + } + label.switch .thumb { + display: inline-block; + background: var(--thumb-color); + width: var(--thumb-size); + height: var(--thumb-size); + border-radius: 50%; + box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.17); + transform: translateX(var(--thumb-gap)); + transition: transform 250ms ease-in-out; + } + label.switch input[type=checkbox] { + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + } + label.switch input[type=checkbox]:checked + .track { + background: var(--accent-color); + } + label.switch input[type=checkbox]:checked + .track .thumb { + transform: translateX(var(--thumb-active-offset)); + } + label.switch input[type=checkbox]:focus + .track { + box-shadow: inset 0px 0px 4px 1px rgba(0, 0, 0, 0.09); + } + + + .addedButtonsContainer{ + display: flex; + padding: 8px; + flex-wrap: wrap; + justify-content: center; + align-items: center; + } + +.group-options-title{ + margin: 9px 0px; + color: #818193a6; + font-size: 13px; + font-family: monospace; +} \ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css index 489029c..57d9bac 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -1,14 +1,15 @@ -html{ - /* background: url(https://i.ibb.co/njV5xJS/background.jpg) no-repeat center center fixed; +html { + /* background: url(https://i.ibb.co/njV5xJS/background.jpg) no-repeat center center fixed; background-size: cover; height: 100%; */ } body { font-family: 'Rubik', sans-serif; - /* margin:0; */ - max-width: 1140px; - margin: 0 auto; + /* margin:0; */ + max-width: 1140px; + margin: 0 auto; + overflow: hidden; /* background-color: rgb(71, 71, 71); */ /* background: linear-gradient(135deg, #7d7e7d 0%, #0e0e0e 100%); @@ -19,9 +20,10 @@ body { margin: auto; } -.maparea{ +.maparea { margin: auto; } + .buttons { display: flex; justify-content: space-around; @@ -65,20 +67,22 @@ body { /* padding: 10px; */ /* text-align: center; */ } -.modelselect{ - border-radius: 20px; - font-size: large; - padding: 10px 0px; + +.modelselect { + border-radius: 20px; + font-size: large; + padding: 10px 0px; /* padding: 10px; */ text-align: center; align-self: center; } -.modelselect option{ + +.modelselect option { text-align: center; overflow: hidden; } - + .form-control { width: 183px; @@ -129,19 +133,20 @@ body { font-size: small; } -.btn-remove{ + +.btn-remove { cursor: pointer; - /* border-radius: 15px; */ - color: red; - /* border-color: red; */ - /* border-width: 2px; */ - position: absolute; - margin-top: 5px !important; - z-index: 5; - padding: 5px; - font-size: x-large; - background: transparent; - border-style: none; + /* border-radius: 15px; */ + color: red; + /* border-color: red; */ + /* border-width: 2px; */ + position: absolute; + margin-top: 5px !important; + z-index: 5; + padding: 5px; + font-size: x-large; + background: transparent; + border-style: none; } .clean { @@ -192,7 +197,7 @@ td { left: 77px; } -.visible-table{ +.visible-table { display: none !important; } @@ -278,58 +283,27 @@ footer { } -.bold{ +.bold { font-weight: bold; color: darkred; } -.not-show{ +.not-show { display: none !important; } -#history{ +#history { display: flex; - justify-content: center; + justify-content: center; } -.copy-text{ +.copy-text { margin: 15px; - padding: 10px; + padding: 10px; } + -.options-icon { - cursor: pointer; -} - -.options-box { - width: 66%; - display: none; - position: fixed; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - padding-right: 20px; - padding-bottom: 20px; - padding-left: 20px; - background-color: white; - border: 1px solid #ccc; - border-radius: 5px; - z-index: 9999; - background: rgb(229 229 229 / 94%); -} -.options-box input { - padding: 5px; - border-radius: 7px; - margin: 2px; -} - -.close-btn { - position: absolute; - top: 10px; - right: 10px; - cursor: pointer; -} .additionalInfo { background-color: yellow; @@ -345,7 +319,8 @@ footer { border-radius: 5px; cursor: pointer; } -.centered{ + +/* .centered { margin-left: 36%; margin-top: 5px; margin-right: 5px; @@ -355,10 +330,74 @@ footer { padding-right: 20px; padding-bottom: 3px; padding-left: 20px; -} +} */ -.additionalButtonsContainer{ +.additionalButtonsContainer { display: flex; justify-content: center; - gap: 10px; -} \ No newline at end of file + gap: 10px; +} + + +.blinking { + animation: blink 0.5s infinite; + /* border-radius: 5px; */ +} + +@keyframes blink { + + /* 0% {border: white solid 5px; } + 100% {border: red solid 5px; } */ + 0% { + box-shadow: 0px 0px 0px 5px white inset; + } + + 100% { + box-shadow: 0px 0px 0px 5px red inset; + } +} + +.blinking2 { + animation: blink-animation 1s infinite; +} + +@keyframes blink-animation { + 0% { + opacity: 1; + } + + 50% { + opacity: 0.5; + } + + 100% { + opacity: 1; + } +} + + + +@media only screen and (max-width: 1105px){ + .inputHolder { + width: -webkit-fill-available !important; + } + .btn-remove { + right: 15px; + } +} + + +.bg-tarakan{ + display: none; + position: absolute; + max-width: 1140px; + width: -webkit-fill-available; +} +.show-tarakan{ + display: block; +} + + + + + diff --git a/static/images/logo.png b/static/images/logo.png deleted file mode 100644 index 085d471..0000000 Binary files a/static/images/logo.png and /dev/null differ diff --git a/static/images/profiles/ahmed.jpg b/static/images/profiles/ahmed.jpg new file mode 100644 index 0000000..3563898 Binary files /dev/null and b/static/images/profiles/ahmed.jpg differ diff --git a/static/index2.html b/static/index2.html index 079512a..73d073c 100644 --- a/static/index2.html +++ b/static/index2.html @@ -21,7 +21,9 @@ Pax S90 - + + + @@ -29,6 +31,7 @@ + @@ -40,7 +43,6 @@ -
Success Your changes has been saved @@ -48,41 +50,41 @@
-
-