42
42
}
43
43
.main-screen {
44
44
transition : opacity 1s ease-in-out;
45
+ height : 70vh ;
45
46
}
46
47
html {
47
48
height : 100% ;
50
51
body {
51
52
background-color : # 212121 ; /* Bold and Energetic background */
52
53
margin : 0 ;
54
+ display : flex;
55
+ flex-direction : column;
53
56
}
54
57
h1 {
55
58
transition : opacity 1s ;
85
88
.footer-div {
86
89
position : fixed;
87
90
bottom : 0 ;
91
+ height : 10vh ;
88
92
width : 100% ;
89
93
text-align : center;
90
- background-color : rgba ( 21 , 102 , 192 , 0.09 ); /* Match header for consistency */
94
+ background-color : rgb ( 32 , 50 , 70 ); /* Match header for consistency */
91
95
padding : 10px ;
92
96
}
93
97
206
210
height : 100px ;
207
211
}
208
212
209
- .language-card select {
213
+ .port-number ,
214
+ .language-card select {
210
215
width : 100% ;
211
216
padding : 5px ;
212
217
border : 1px solid # ddd ;
258
263
color : # 000000 ; /* Bold and Energetic text */
259
264
}
260
265
261
- cardwidget {
266
+ . cardwidget {
262
267
display : flex;
263
268
flex-wrap : wrap;
264
269
justify-content : center;
265
270
width : 80% ;
271
+ overflow-y : scroll;
272
+ height : 100% ;
273
+ max-height : calc (70vh - 80px ); /* Limit height based on viewport and spacing */
266
274
}
267
275
268
276
@media (max-width : 768px ) { /* Adjust the breakpoint as needed */
269
277
.tabs {
270
278
width : 90% ; /* Set the width to 90% on mobile devices */
271
279
}
272
280
.settings-card {
273
- width : 90% ;
281
+ width : 100% ;
282
+ height : 120px ;
274
283
}
275
284
}
285
+ input [type = number ]::-webkit-inner-spin-button ,
286
+ input [type = number ]::-webkit-outer-spin-button {
287
+ -webkit-appearance : none;
288
+ margin : 0 ;
289
+ }
290
+
291
+ /* Scrollbar Styling for Webkit browsers (Chrome, Safari) */
292
+ ::-webkit-scrollbar {
293
+ width : 10px ; /* Width of the scrollbar thumb */
294
+ }
295
+
296
+ ::-webkit-scrollbar-track {
297
+ background : rgba (33 , 33 , 33 , 0.8 ); /* Track background with some transparency */
298
+ border-radius : 8px ; /* Rounded corners for the track */
299
+ }
300
+
301
+ ::-webkit-scrollbar-thumb {
302
+ background : # F25D5D ; /* Thumb background color */
303
+ border-radius : 8px ; /* Rounded corners for the thumb */
304
+ }
305
+
306
+ ::-webkit-scrollbar-thumb : hover {
307
+ background : # 993d3d ; /* Slightly darker shade for hover */
308
+ }
309
+
310
+
311
+ /* Scrollbar Styling for Firefox */
312
+ * {
313
+ scrollbar-width : thin;
314
+ scrollbar-color : # F25D5D rgba (33 , 33 , 33 , 0.8 );
315
+ }
276
316
</ style >
277
317
</ head >
278
318
< body >
@@ -303,7 +343,7 @@ <h1>{{ language_files.home }}</h1>
303
343
</ div >
304
344
305
345
< div class ="tab-content " id ="settings ">
306
- < cardwidget >
346
+ < div class =" cardwidget " >
307
347
< div class ="settings-card language-card ">
308
348
< h3 > {{ language_files.language }}</ h3 >
309
349
< label >
@@ -316,35 +356,35 @@ <h3>{{ language_files.language }}</h3>
316
356
</ label >
317
357
< button class ="click-buttons " id ="save-language "> {{ language_files.save }}</ button >
318
358
</ div >
359
+ < div class ="settings-card " style ="align-items: center; ">
360
+ < h3 > {{ language_files.port }}</ h3 >
361
+ < input style ="width: 98%; margin-bottom: 10px " class ="port-number " inputmode ="numeric " type ="number " name ="port " value ="{{ port }} " min ="1 " max ="65535 " placeholder ="{{ language_files.portinfo }} ">
362
+ < button class ="click-buttons " id ="save-port " style ="width: 100% "> {{ language_files.save }}</ button >
363
+ </ div >
319
364
< div class ="settings-card reset-card ">
320
365
< h3 > {{ language_files.reset }}</ h3 >
321
366
< p > {{ language_files.resetinfo }}</ p >
322
367
< button class ="click-buttons " id ="confirm-reset "> {{ language_files.reset }}</ button >
323
368
</ div >
324
- < div class ="settings-card ">
325
- < h3 > {{ language_files.port }}</ h3 >
326
- < p > {{ language_files.portinfo }}</ p >
327
- < input type ="number " name ="port " value ="{{ port }} " min ="1 " max ="65535 " step ="1 ">
328
- </ div >
329
- </ cardwidget >
330
- </ div >
331
369
332
- </ div >
333
- </ center >
334
- < center >
335
- < div class ="footer-div " style ="right: -10px; left:-10px; ">
336
- < p class ="version-text "> {{ language_files.version }} {{ version }}</ p >
337
- < div class ="footer-tabs ">
338
- < div style ="display:none; " class ="footer-tab " onclick ="window.location.href='/about' "> {{ language_files.about }}</ div >
339
- < div class ="footer-tab " style ="padding: 0; height: 38px; border-radius: 20px; background-color: transparent "> < a href ="https://github.com/Eta06 " target ="_blank ">
340
- < img src ="{{ url_for('static', filename='images/github.png') }} " alt ="GitHub " width ="38 " height ="38 " style ="filter: invert(100%) ">
341
- </ a >
342
370
</ div >
343
- < div style ="display:none; " class ="footer-tab " onclick ="window.location.href='/contact' "> {{ language_files.contact }}</ div >
344
371
</ div >
372
+
345
373
</ div >
346
374
</ center >
347
- < script >
375
+ < div class ="footer-div " style ="text-align: center; ">
376
+ < p class ="version-text "> {{ language_files.version }} {{ version }}</ p >
377
+ < div class ="footer-tabs ">
378
+ < div style ="display:none; " class ="footer-tab " onclick ="window.location.href='/about' "> {{ language_files.about }}</ div >
379
+ < div class ="footer-tab " style ="padding: 0; height: 38px; border-radius: 20px; background-color: transparent "> < a href ="https://github.com/Eta06/LockDown " target ="_blank ">
380
+ < img src ="{{ url_for('static', filename='images/github.png') }} " alt ="GitHub " width ="38 " height ="38 " style ="filter: invert(100%) ">
381
+ </ a >
382
+ </ div >
383
+ < div style ="display:none; " class ="footer-tab " onclick ="window.location.href='/contact' "> {{ language_files.contact }}</ div >
384
+ </ div >
385
+ </ div >
386
+
387
+ < script >
348
388
349
389
// on language save add listener to the save button
350
390
document . getElementById ( "save-language" ) . addEventListener ( "click" , function ( ) {
@@ -398,6 +438,29 @@ <h3>{{ language_files.port }}</h3>
398
438
} ) ;
399
439
} ) ;
400
440
441
+ // save the port number
442
+ document . getElementById ( "save-port" ) . addEventListener ( "click" , function ( ) {
443
+ const port = document . querySelector ( 'input[name="port"]' ) . value ;
444
+ // save the port number
445
+ fetch ( '/set_port' , {
446
+ method : 'POST' ,
447
+ headers : {
448
+ 'Content-Type' : 'application/x-www-form-urlencoded'
449
+ } ,
450
+ body : 'port=' + port
451
+ } )
452
+ const domain = window . location . hostname ;
453
+ const url = `http://${ domain } :${ port } ` ;
454
+ Swal . fire ( {
455
+ title : "{{ language_files.portchanged }}" ,
456
+ timeout : 3000 ,
457
+ icon : "success" ,
458
+ showCancelButton : false ,
459
+ } )
460
+ setTimeout ( function ( ) {
461
+ window . location . href = url ;
462
+ } , 2000 )
463
+ } )
401
464
402
465
function clearActiveTabs ( ) {
403
466
tabs . forEach ( tab => tab . classList . remove ( 'active' ) ) ;
@@ -435,6 +498,6 @@ <h3>{{ language_files.port }}</h3>
435
498
// document.getElementById(footerTabId).classList.add('active');
436
499
} ) ;
437
500
} ) ;
438
- </ script >
501
+ </ script >
439
502
</ body >
440
503
</ html >
0 commit comments