diff --git a/app.py b/app.py index c92a630..0bbe469 100644 --- a/app.py +++ b/app.py @@ -95,7 +95,12 @@ def create_app(config=Config): 'typeofpin': request.form['typeofpin'], 'added_by': current_user.id, 'description': request.form['description'], - 'address': str(geolocator.reverse(str(request.form['lat'])+ ", "+request.form['lng'])) + 'address': str(geolocator.reverse(str(request.form['lat'])+ ", "+request.form['lng'])), + 'reviewed': True, + 'fixed': False, + 'last_mod': datetime.now(), + 'votes': -1, + 'removal_reason': None, } print(geolocator.reverse(str(request.form['lat'])+ ", "+request.form['lng'])) mongo.db.pins.insert_one(pin) @@ -227,7 +232,8 @@ def create_app(config=Config): {"$set": { "typeofpin": typeofpin, "description": description, - "address": address + "address": address, + "last_mod": datetime.now() }} ) flash('Pin actualizado exitosamente') diff --git a/static/styles.css b/static/styles.css index 10fa1f5..5ed4c2e 100644 --- a/static/styles.css +++ b/static/styles.css @@ -22,8 +22,10 @@ body, html { /* height: 100%; */ width: 100%; color: var(--text-color); + height: 100%; } + ::selection { background-color: var(--accent-color); color: white; @@ -64,20 +66,7 @@ main { width: 100vw; z-index: 5; } -nav li [role=button], -nav li [type=button], -nav li button { - background-color: rgba(255, 136, 0, 0.8); - color: white; - border: none; - padding: 0.5rem 1rem; - border-radius: 4px; - cursor: pointer; - transition: all 0.3s ease; -} -li a { - background-color: rgba(255, 136, 0, 0.8); -} + footer { position: fixed; @@ -139,7 +128,6 @@ nav { /* padding: var(--spacing-sm); */ z-index: 1000; font-size: 100%; - overflow: hidden; box-shadow: 0 2px 10px var(--shadow-color); backdrop-filter: blur(5px); } @@ -156,6 +144,72 @@ nav ul li { flex: 1 1 auto; list-style: none; } +nav li [role=button], +nav li [type=button], +nav li button { + background-color: rgba(36, 82, 1, 0.9); + backdrop-filter: blur(2px) contrast(1.2); + color: rgba(255, 255, 255, 0.9); + border-color: rgba(255, 255, 255, 0.5); + border-width: .2rem; + padding: 0.1rem 1rem; + /* border-radius: 4px; */ + cursor: pointer; + transition: all 0.3s ease; +} +li a { + background-color: rgba(255, 136, 0, 0.8); +} +.mobile-menu ul li { + display: block; + text-align: center; + padding: 0.2rem 0; + border-radius: 100rem; + width: auto; + /* backdrop-filter: hue-rotate(180deg); */ + /* background-color: rgba(255, 255, 255, 0.7); */ + color: rgba(172, 255, 47, 0.9); + padding: 0; +} + +.mobile-menu ul li a:hover { + backdrop-filter: blur(2px) saturate(150%) brightness(1.5) hue-rotate(180deg); + animation: pulse 1s normal ease-in-out; + /* box-shadow: 0 0 -2px rgba(192, 157, 117, 0.8); */ + transition: all 0.2s ease-in-out; + /* transform: scale(1.2); */ + color: black; + color: rgba(255, 136, 0, 1); + z-index: 1800; + /* padding: 0; */ +} +/* .mobile-menu ul li a i:hover { + +} */ +/* .mobile-menu ul li a i { + +} */ + +.mobile-menu ul li a { + display: block; + text-align: center; + padding: 0.5rem 0; + border-radius: 2rem; + backdrop-filter: invert(100%); +} + +.mobile-menu ul li a i{ + margin-left:0px; + padding: .1rem; +} + +.desktop-menu { + display: block; + justify-content: space-between; + align-items: center; + padding: 0; + margin: 0; +} .desktop-menu li a { display: flex; @@ -164,9 +218,9 @@ nav ul li { } .desktop-menu li a:hover { - background-color: rgb(74, 133, 34); + background-color: rgb(45, 60, 35); animation: pulse 1.5s infinite ease-in-out; - box-shadow: 0 0 -10px rgba(172, 255, 47, 0.7); + box-shadow: 0 0 -3px rgba(255, 167, 14, 0.7); transition: all 0.2s ease; transform: scale(1.02); } @@ -202,11 +256,11 @@ button:hover::after { opacity: 1; } -#pinner-top { - background-color: var(--secondary-color); +/* #pinner-top { + background-color: rgba(0, 0, 0, 0.2); color: white; border-radius: 4px; -} +} */ button a { color: white; @@ -302,18 +356,33 @@ section#pinner-modal::-webkit-scrollbar-thumb { .eaflet-popup-content { width: 100%; } +.fa, .far, .fas { + font-size: 1.5rem; + /* filter: drop-shadow(0 0 0.2rem var(--accent-color)); */ +} .control-button { position: fixed; bottom: 30px; - left: 50%; - transform: translateX(-50%); + /* right: 20%; */ + width: 15vw; + height: 15vw; + /* transform: translateX(-50%); */ padding: 15px 30px; - background-color: rgba(255, 255, 255, 0.7); - border-radius: 50px; - border: none; - font-size: 18px; + background-color: rgba(60, 245, 9, 0.8); + border-radius: 100%; + border: 4px solid rgba(255, 255, 255, 0.5); + /* font-size: 4rem; */ + font-weight: bolder; z-index: 100; - color: black; + color: white; + animation: pulsePing 1s ease-in-out 0s 1 normal none; + display: flex; + justify-content: center; + align-items: center; +} + +.control-button .fas.fa-camera { + font-size: 3rem; /* Increased size specifically for camera icon */ } .marker-cluster { background-color: rgb(249, 170, 61) !important; @@ -322,15 +391,7 @@ section#pinner-modal::-webkit-scrollbar-thumb { /* Animation removed as it was causing visibility issues */ } -.fa, .far, .fas { - color: black; - text-shadow: -1px 0 var(--accent-color), 0 1px var(--accent-color), - 1px 0 var(--accent-color), 0 -1px var(--accent-color); - margin-left: -10px; - margin-top: -10px; - font-size: 1.5rem; - filter: drop-shadow(0 0 0.2rem var(--accent-color)); -} + /* Notifications */ .flashes { @@ -371,6 +432,23 @@ ul.flashes li { 50% { box-shadow: 0 0 15px rgba(172, 255, 47, 0.9); } 100% { box-shadow: 0 0 10px rgba(172, 255, 47, 0.7); } } + +@keyframes pulsePing { + 0% { + transform: scale(1); + } + + 50% { + transform: scale(1.4); + } + + 100% { + transform: scale(1); + } + } + + + /* Media queries for responsiveness */ @media (max-width: 768px) { section#pinner-modal { @@ -383,6 +461,7 @@ ul.flashes li { } nav { height: 10vh; + overflow: visible; } nav ul { diff --git a/static/stylesbs.css b/static/stylesbs.css new file mode 100644 index 0000000..d9ec911 --- /dev/null +++ b/static/stylesbs.css @@ -0,0 +1,379 @@ +:root { + /* Color palette */ + --primary-color: rgba(202, 216, 3, 0.9); + --secondary-color: green; + --accent-color: rgb(255, 136, 0); + --background-color: rgb(205, 243, 148); + --text-color: #333; + --shadow-color: rgba(0, 0, 0, 0.2); + + /* Spacing */ + --spacing-sm: 0.5rem; + --spacing-md: 1rem; + --spacing-lg: 1.5rem; +} + +/* Base styles */ +body, html { + font-family: 'Poppins', 'Montserrat', 'Segoe UI', Arial, sans-serif; + margin: 0; + padding: 0; + overflow: hidden; + width: 100%; + color: var(--text-color); +} + +::selection { + background-color: var(--accent-color); + color: white; +} + +h1 { + text-align: center; + position: relative; +} + +h1::after { + content: ''; + display: block; + width: 50px; + height: 3px; + background-color: var(--accent-color); + margin: 8px auto; + border-radius: 2px; +} + +/* Layout */ +#map { + width: 100%; + height: 100vh; + position: static !important; +} + +main { + margin: 0; + padding: 0; + position: absolute; + top: 10vh; + left: 0; + display: flex; + align-items: center; + justify-content: center; + width: 100vw; + z-index: 5; +} + +/* Custom button styling */ +.custom-btn { + background-color: rgba(255, 136, 0, 0.8); + color: white; + border: none; + padding: 0.5rem 1rem; + border-radius: 4px; + cursor: pointer; + transition: all 0.3s ease; +} + +.custom-btn:hover { + background-color: rgb(74, 133, 34); + animation: pulse 1.5s infinite ease-in-out; + box-shadow: 0 0 10px rgba(172, 255, 47, 0.7); + transition: all 0.2s ease; + transform: scale(1.02); +} + +.custom-link { + background-color: rgba(255, 136, 0, 0.8); + color: white; + text-decoration: none; + display: inline-block; + padding: 0.5rem 1rem; + border-radius: 4px; + transition: all 0.3s ease; +} + +.custom-link:hover { + background-color: rgb(74, 133, 34); + color: white; + text-decoration: none; +} + +footer { + position: fixed; + bottom: 0; + max-height: 10vh; + text-align: left; + font-size: 0.8rem; + background-color: rgba(202, 216, 3, 0.7); + width: 100%; + border-top: 1px solid greenyellow; + padding-left: 15%; + padding-right: 15%; + z-index: 15; +} + +/* Table styling */ +.custom-table thead th { + background-color: rgba(202, 216, 3, 0.7); + color: black; +} + +.custom-table tbody td { + background-color: rgba(202, 216, 3, 0.7); + color: black; +} + +article { + position: fixed; + top: 12%; + bottom: 10%; + left: 50%; + transform: translateX(-50%); + text-align: center; + z-index: 10; + max-height: calc(100vh - 90px); + overflow-y: auto; + width: 80%; + display: block; + flex-direction: column; + justify-content: center; +} + +.info { + padding: var(--spacing-md); + padding-bottom: 6rem; + background-color: rgba(255, 255, 255, 0.85); + border-radius: 8px; + box-shadow: 0 4px 12px var(--shadow-color); +} + +/* Navigation */ +.custom-navbar { + position: absolute; + top: 0; + left: 0; + right: 0; + padding-left: 10vw; + background-color: rgba(189, 216, 3, 0.24); + z-index: 1000; + font-size: 100%; + overflow: hidden; + box-shadow: 0 2px 10px var(--shadow-color); + backdrop-filter: blur(5px); +} + +.custom-navbar .navbar-nav { + display: flex; + flex-wrap: wrap; + gap: var(--spacing-sm); + padding: 0 var(--spacing-sm); +} + +.custom-navbar .nav-item { + padding: 0; + flex: 1 1 auto; + list-style: none; +} + +/* Form elements */ +.custom-form-control { + border: 1px solid #ddd; + border-radius: 4px; + padding: 8px; + transition: border 0.3s ease; + width: 100%; +} + +.custom-form-control:focus { + outline: none; + border-color: var(--accent-color); + box-shadow: 0 0 0 2px rgba(255, 136, 0, 0.2); +} + +.submit-btn { + background-color: var(--secondary-color); + color: white; + font-weight: bold; + cursor: pointer; + padding: 10px; +} + +.submit-btn:hover { + background-color: #008800; + transform: translateY(-2px); +} + +.coordinate-display { + font-size: 0.8rem; + background-color: grey; + color: white; + border-radius: 3px; + padding: 4px 8px; +} + +/* Modal */ +.custom-modal { + position: absolute; + top: 10vh; + left: 10%; + color: var(--text-color); + padding: var(--spacing-md); + text-align: left; + animation: fadeIn 0.5s forwards; + box-shadow: 0 4px 20px var(--shadow-color); + z-index: 999; + display: flex; + flex-shrink: 1; + border-radius: 8px; + max-height: 80vh; + overflow-y: auto; + background-color: rgba(189, 216, 3, 0.24); + backdrop-filter: blur(5px); +} + +.custom-modal form { + max-width: 400px; + margin: 0 auto; + padding: var(--spacing-md); + border-radius: 8px; + background-color: var(--primary-color); + font-size: 100%; +} + +.custom-modal::-webkit-scrollbar { + width: 8px; +} + +.custom-modal::-webkit-scrollbar-thumb { + background-color: var(--accent-color); + border-radius: 10px; +} + +/* Map elements */ +.leaflet-marker-icon { + background-color: transparent !important; + border: none; + padding: 0; + margin: 0; + transition: transform 0.3s ease; +} + +.leaflet-marker-icon:hover { + transform: scale(1.2); +} + +.leaflet-popup-content { + width: 100%; +} + +.control-button { + position: fixed; + bottom: 30px; + left: 50%; + transform: translateX(-50%); + padding: 15px 30px; + background-color: rgba(255, 255, 255, 0.7); + border-radius: 50px; + border: none; + font-size: 18px; + z-index: 100; + color: black; +} + +.marker-cluster { + background-color: rgb(249, 170, 61) !important; + border-radius: 100px; + box-shadow: 0 0 10px rgba(85, 38, 5, 0.7); +} + +.fa, .far, .fas { + color: black; + text-shadow: -1px 0 var(--accent-color), 0 1px var(--accent-color), + 1px 0 var(--accent-color), 0 -1px var(--accent-color); + margin-left: -10px; + margin-top: -10px; + font-size: 1.5rem; + filter: drop-shadow(0 0 0.2rem var(--accent-color)); +} + +/* Notifications */ +.alert-custom { + position: absolute; + display: flex; + width: max-content; + z-index: 1001; + border-radius: 20px; + background-color: rgba(189, 216, 3, 0.6); + top: 12vh; + left: 10vw; + padding: var(--spacing-md); + border: 2px solid rgba(0, 0, 0, 0.1); + box-shadow: 0 4px 15px var(--shadow-color); + animation: fadeOut 15s forwards; +} + +.alert-custom li { + list-style: none; + padding: 0; + margin: 0; + font-size: 1.2rem; + color: black; +} + +/* Carousel styles */ +.carousel-control { + z-index: 2; +} + +.carousel-control:hover { + background: rgba(0, 0, 0, 0.5); +} + +.carousel-items { + scroll-behavior: smooth; + -ms-overflow-style: none; + scrollbar-width: none; +} + +.carousel-items::-webkit-scrollbar { + display: none; +} + +/* Animations */ +@keyframes fadeOut { + 0% { opacity: 1; transform: translateY(0); } + 90% { opacity: 1; transform: translateY(0); } + 100% { opacity: 0; transform: translateY(-20px); } +} + +@keyframes fadeIn { + 0% { opacity: 0; transform: translateY(0); } + 90% { opacity: 1; transform: translateY(0); } +} + +@keyframes pulse { + 0% { box-shadow: 0 0 10px rgba(172, 255, 47, 0.7); } + 50% { box-shadow: 0 0 15px rgba(172, 255, 47, 0.9); } + 100% { box-shadow: 0 0 10px rgba(172, 255, 47, 0.7); } +} + +/* Media queries for responsiveness */ +@media (max-width: 768px) { + .custom-modal { + width: 90%; + left: 5%; + right: 5%; + } + + img#logo { + max-height: 5vh; + } + + .custom-navbar { + height: 10vh; + } + + .custom-navbar .navbar-nav { + justify-content: center; + } +} diff --git a/templates/base.html b/templates/base.html index f0600fe..5fa0c91 100644 --- a/templates/base.html +++ b/templates/base.html @@ -23,10 +23,35 @@ - - - - + + + + + + + + + + + + + + diff --git a/templates/camera.html b/templates/camera.html index bb273af..7667165 100644 --- a/templates/camera.html +++ b/templates/camera.html @@ -51,10 +51,10 @@
- +
- - + +
@@ -66,9 +66,9 @@
- + - +
@@ -148,7 +148,13 @@ canvas.toBlob(function(blob) { const formData = new FormData(form); formData.delete('photo'); // Remove any file input value - formData.append('photo', blob, 'camera-capture.jpg'); + // Generate a filename with timestamp and random element + const timestamp = new Date().toISOString().replace(/[:.]/g, '-'); + const randomId = Math.floor(Math.random() * 10000); + const filename = `photo-${timestamp}-${randomId}.jpg`; + + // Add the photo blob with the dynamic filename + formData.append('photo', blob, filename); // Submit form data via fetch fetch(form.action, { @@ -157,7 +163,7 @@ }).then(response => { if (response.redirected) { window.location.href = response.url; - } else (response.ok) { + } else if(response.ok) { console.log('Success:', response); window.location.href = '{{ url_for('dashboard') }}'; } diff --git a/templates/dashboard.html b/templates/dashboard.html index ead8c1f..e24bb45 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -1,4 +1,4 @@ -{% extends 'secondbase.html' %} +{% extends 'base.html' %} {% block content %} @@ -31,45 +31,22 @@ {% if pins %} {% for pin in pins %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Agregado el{{ pin.time }}
Tipo de Mejora Urbana:{{ pin.typeofpin }}
Descripción{{ pin.description }}
Dirección{{ pin.address }}
Foto
Latitud:{{ pin.lat }}
Longitud:{{ pin.lng }}
Acciones: - - -
+
+
+ Foto de mejora urbana +
+
+

{{ pin.typeofpin }}

+

Agregado el: {{ pin.time }}

+

Descripción: {{ pin.description }}

+

Dirección: {{ pin.address }}

+

Coordenadas: {{ pin.lat }}, {{ pin.lng }}

+
+ + +
+
+
+ {% endfor %} {% endif %} + {% endblock %} \ No newline at end of file diff --git a/templates/error.html b/templates/error.html index d10917e..b5374a2 100644 --- a/templates/error.html +++ b/templates/error.html @@ -1,4 +1,4 @@ -{% extends 'secondbase.html' %} +{% extends 'base.html' %} {% block content %}
{% if message %} diff --git a/templates/index.html b/templates/index.html index e67f00d..c7051cf 100644 --- a/templates/index.html +++ b/templates/index.html @@ -106,7 +106,7 @@ {% if current_user.is_authenticated %}
- +
{% endif %} {% endblock %} \ No newline at end of file diff --git a/templates/leaderboard.html b/templates/leaderboard.html index cda20b9..fc7885b 100644 --- a/templates/leaderboard.html +++ b/templates/leaderboard.html @@ -1,4 +1,4 @@ -{% extends 'secondbase.html' %} +{% extends 'base.html' %} {% block content %}
diff --git a/templates/login.html b/templates/login.html index dbbe0ef..5c609b5 100644 --- a/templates/login.html +++ b/templates/login.html @@ -1,4 +1,4 @@ -{% extends 'secondbase.html' %} +{% extends 'base.html' %} {% block content %}
diff --git a/templates/nav.html b/templates/nav.html index 1114912..313a915 100644 --- a/templates/nav.html +++ b/templates/nav.html @@ -1,4 +1,4 @@ - + + +
  • \ No newline at end of file diff --git a/templates/quienes.html b/templates/quienes.html index 1d164d1..0802a24 100644 --- a/templates/quienes.html +++ b/templates/quienes.html @@ -1,4 +1,4 @@ -{% extends 'secondbase.html' %} +{% extends 'base.html' %} {% block content %}
    diff --git a/templates/register.html b/templates/register.html index 863dea7..3e87d6d 100644 --- a/templates/register.html +++ b/templates/register.html @@ -1,4 +1,4 @@ -{% extends 'secondbase.html' %} +{% extends 'base.html' %} {% block content %}

    Registro de nuevo usuario