From 9599b31d69d706c49541428689713a4850916038 Mon Sep 17 00:00:00 2001 From: Welton Moura Date: Wed, 5 Mar 2025 15:13:56 -0300 Subject: [PATCH] new menubar mobile --- gestaoRaul/db.sqlite3 | Bin 335872 -> 335872 bytes gestaoRaul/templates/base.html | 53 +++++++++++- gestaoRaul/templates/static/base.css | 120 +++++++++++++++++++++++++++ gestaoRaul/templates/static/base.js | 62 ++++++++------ requirements.txt | Bin 0 -> 558 bytes 5 files changed, 207 insertions(+), 28 deletions(-) create mode 100644 requirements.txt diff --git a/gestaoRaul/db.sqlite3 b/gestaoRaul/db.sqlite3 index 92eceff492c76f7eb6e73e0aaf63f69ff4339ef8..f8a14ed8725499516959b8fa08d08553697d71cd 100644 GIT binary patch delta 1248 zcmZuxeN2^A96n#~d+t5&dEa~IKnN6G0tu9ldoSNebrGlw2xOKm=SqebNI^a>GTNGQ zW5c<%si7WojImnUR_hD$6=V#wkJYfCwWeg6$k=MGE=i%2viDy4u+4wYbIzXM^PJ!L zo%1`LV_}_RVTYpO+~HM4aPEWcO=-~6GnuAC(KDasha+9S^!>hcX!z36;bxpkh6L?L zb%+cZ&Hbp9@B)8?1;B?30klfu+DQ}>nUU(q(w#Z^8F~4xoHSRiBRk6(zuv!66rMs! zM*N%TN|dZNg1x+3&@r^2zOK%4L;aPH@($i%SjJJaqVQ2b6Qsw3Ai5@y8%ZAV$pm_f z005}baseGeGCyH@Y!P%4Wr;^7(W7GDBzlEb@=9LCtAu?DMHxv`C{eMSfp)k-dW>R( zO!SE7E~5gXerY=OT}BQ_v{ZBY_4mlN0%vO11q~oC(XQL5(HuZNO_ne~Ko~#%iK3wy zFnE;WdN}w|GcM6&3{kwvoz-w@kee0MZj!S>Wt(Q)NkOY1Wo#JqvSWhk_!4J>3Sd96 z0Q-i$E9P`u#@I3TF`Hl~S)bvK!&|JLV4hMk=nJ6-jD)ZR42AMI8yW}LG+>e&46^AE zYtBMg49)a)QE;d_&;vqzvDt6$6{> zn`QAvEh&w(8~|!z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gotE6RVcX1rQo^sy4g!cxp58Kd8 z%Bv}RQnnx?7En>9X)zC$Ri58sk|xH`)g0|=_W0SvA2f|=vs89_V`VDJdZ6!b>g;Mh z(AmT~mS~ziV2yrYBM~A(WOFRUHhf22EILD5`Tkk@wpdgc%T|%T<_h35e8D2aUt|P4 zhEeYITkogX?+t~#rR%McE#SZ1q^d}*GDexRpN?3Gty2G=_`k|nLyquTdVS2Vq8u}s z1Oqg+9_eiIL=PNd=a;Pp%vqWXLgi=QQ|zD$pb{n|Xnm@bt^J~17eCQP - + + + +
-
+ + + + + +
+ + + + +
+ + + + + diff --git a/gestaoRaul/templates/static/base.css b/gestaoRaul/templates/static/base.css index 816bc91..4e8c188 100644 --- a/gestaoRaul/templates/static/base.css +++ b/gestaoRaul/templates/static/base.css @@ -381,3 +381,123 @@ input, textarea, select { display: flex; } } + + + + + + + + + + +.header-mobile { + display: none; + justify-content: space-between; + align-items: center; + background-color: #171525; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); + /* backdrop-filter: blur(5px); */ + padding: 1rem; + padding-right: 50px; + padding-left: 10px; + position: fixed; + top: 0; + width: 100%; + z-index: 9999; +} + +.header-mobile .logo { + display: flex; + align-items: center; + margin-left: 25px; +} + +.header-mobile .logo i { + color: #fbbf24; + font-size: 2rem; +} + +.header-mobile .logo span { + + font-size: 1.25rem; + font-weight: bold; + margin-left: .5rem; +} + +.header-mobile .nav-toggle { + display: block; + cursor: pointer; + background: none; + border: none; + padding-right: 0; + margin-right: 10; +} + +.header-mobile .nav-toggle i { + color: white; + font-size: 1.5rem; +} + +.header-mobile .nav-links { + max-width: 70%; + position: fixed; + top: 83px; + left: -100%; + width: 100%; + height: 100vh; + background-color: #222033b9; + box-shadow: 0 10px 10px rgba(0, 0, 0, 0.5); + backdrop-filter: blur(5px); + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + transition: left 0.3s ease-in-out; + z-index: 9998; +} + +.header-mobile .nav-links .nav-component{ + width: 100%; + justify-items: center; + justify-content: space-between; +} + + +.header-mobile .nav-links.active { + left: 15%; +} + +.header-mobile .nav-links a { + color: #a0aec0; + text-decoration: none; + font-size: 1.2rem; + margin: 1rem 0; + display: block; + width: 90%; + text-align: center; + padding: 1rem; + transition: all 0.3s; +} + +.header-mobile .nav-links a:hover { + color: white; + scale: 1.1; + background-color: #373543; + box-shadow: 0 0px 10px rgba(0, 0, 0, 0.5); + transition: all 0.3s ; +} + + +@media screen and (max-width: 768px) { + .background .bg1 { + max-height: 21.5%; + } + /* .nav-bar { + display: none; + } */ + + .header-mobile { + display: flex; + } +} diff --git a/gestaoRaul/templates/static/base.js b/gestaoRaul/templates/static/base.js index a33130c..56f948c 100644 --- a/gestaoRaul/templates/static/base.js +++ b/gestaoRaul/templates/static/base.js @@ -1,14 +1,39 @@ + + +document.addEventListener('DOMContentLoaded', function() { + const navToggle = document.querySelector('.nav-toggle'); + const navLinks = document.querySelector('.nav-links'); + + if (navToggle) { + navToggle.addEventListener('click', function() { + navLinks.classList.toggle('active'); + }); + } + document.addEventListener('click', function(event) { + if (navLinks.classList.contains('active') && !navLinks.contains(event.target) && !navToggle.contains(event.target)) { + navLinks.classList.remove('active'); + } + }); +}); + + + + + + + + + function verificarCookieNotificacao() { - console.log('cookie notificacao verificado'); + var iconNotify = document.getElementById('icon-notify'); if (document.cookie.indexOf('notificacao=') === -1) { document.cookie = 'notificacao=true; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/'; - var iconNotify = document.getElementById('icon-notify'); iconNotify.style.backgroundColor = 'green'; - console.log('cookie notificacao criado'); + iconNotify.textContent = '🔊'; }else{ let valorAtual = document.cookie.replace(/(?:(?:^|.*;\s*)notificacao\s*\=\s*([^;]*).*$)|^.*$/, "$1"); - var iconNotify = document.getElementById('icon-notify'); iconNotify.style.backgroundColor = valorAtual === 'true' ? 'green' : 'red'; + iconNotify.textContent = valorAtual === 'true' ? '🔊' : '🔇'; } } verificarCookieNotificacao(); @@ -20,8 +45,10 @@ function cookieNotificacao() { let novoValor = valorAtual === 'true' ? 'false' : 'true'; if (novoValor === 'true') { iconNotify.style.backgroundColor = 'green'; + iconNotify.textContent = '🔊'; }else{ iconNotify.style.backgroundColor = 'red'; + iconNotify.textContent = '🔇'; } document.cookie = 'notificacao=' + novoValor + '; expires=Fri, 31 Dec 9999 23:59:59 GMT; path=/'; } else { @@ -47,11 +74,9 @@ websocket.addEventListener('message', (event) => { var fila = document.getElementById('Fila').appendChild(novoElemento); let valorAtual = document.cookie.replace(/(?:(?:^|.*;\s*)notificacao\s*\=\s*([^;]*).*$)|^.*$/, "$1"); if (valorAtual === 'true') { - texto = new SpeechSynthesisUtterance(data.speak); window.speechSynthesis.speak(texto); } - console.log('Mensagem recebida:', data.local); } else if (document.getElementById('obs-'+data.id) !== null && data.tipo === 'edit'){ const obs = document.getElementById('obs-'+data.id) @@ -64,54 +89,41 @@ websocket.addEventListener('message', (event) => { texto = new SpeechSynthesisUtterance(data.speak); window.speechSynthesis.speak(texto); } - console.log('Mensagem recebida:', data.local); } else if (document.getElementById('m-card-'+data.id) !== null && data.tipo === 'delete'){ const card = document.getElementById('m-card-'+data.id) card.style.backgroundColor = 'rgb(253, 69, 69)'; - // obs.innerHTML = data.message; let valorAtual = document.cookie.replace(/(?:(?:^|.*;\s*)notificacao\s*\=\s*([^;]*).*$)|^.*$/, "$1"); - if (valorAtual === 'true') { texto = new SpeechSynthesisUtterance(data.speak); window.speechSynthesis.speak(texto); } - console.log('Mensagem recebida:', data.local); } break; case 'praca': - console.log('Código a ser executado se expressao === valor2') + console.log('Mensagem para a praca:', data); break; - case 'guarita': - // Código a ser executado se expressao === valor3 - break; - case 'balcao': - // Código a ser executado se expressao === valor3 + case 'guarita': + console.log('Mensagem para a guarita:', data); + break; + case 'balcao': + console.log('Mensagem para a balcao:', data); break; default: console.log('Local desconhecido:', data); } - - - - - }); - websocket.addEventListener('error', (event) => { console.error('Erro no WebSocket:', event); }); - websocket.addEventListener('close', (event) => { console.log("conexão fechada"); }); - - function menuShow() { let menuMobile = document.querySelector('.mobile-menu'); if (menuMobile.classList.contains('open')) { diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..f692a4df9284dea0373457ce63066b0c67597c6b GIT binary patch literal 558 zcmZvZK~KU!6olt&;!mNWMWYvQ9yJ^|cr+EMBE+rR5`-VGezQx31KG6Qyf^#3+3D|3 ztxj)RDr%udcdUsD-SU*W)P?3$8~W~)sd{tLi`uDGuK**eX8%sb+ACI}aeB@-DT*E80`LE#jfXy$bKV#<-@S$5$x zvXed~x=cwuLpz^@sU;_lr}ku6liHBMn66csx`p(D^S~`u?0fe4o}Qe&JyCa3d%hd~ L(~y$?dQSWg_X<+) literal 0 HcmV?d00001