File size: 7,338 Bytes
9cfcba7
761516d
 
fa13c80
18721f1
 
fa13c80
18721f1
 
fa13c80
a95eba0
18721f1
7f26c0b
18721f1
9cfcba7
18721f1
9cfcba7
 
 
 
 
8e0e419
18721f1
 
fa13c80
094cc9b
fa13c80
 
94742e0
 
3d64a05
 
18721f1
fa13c80
 
f90b77d
fa13c80
 
18721f1
fa13c80
 
3d64a05
 
 
 
94742e0
3d64a05
 
 
f90b77d
 
 
18721f1
fa13c80
 
f90b77d
94742e0
3d64a05
18721f1
fa13c80
f90b77d
3d64a05
94742e0
18721f1
fa13c80
8e0e419
 
 
 
fa13c80
 
18721f1
fa13c80
 
3d64a05
94742e0
fa13c80
94742e0
fa13c80
18721f1
fa13c80
 
 
94742e0
fa13c80
 
 
 
3d64a05
 
 
 
 
 
18721f1
fa13c80
 
 
3d64a05
94742e0
18721f1
fa13c80
 
 
94742e0
18721f1
fa13c80
 
94742e0
fa13c80
18721f1
fa13c80
18721f1
fa13c80
 
 
 
 
 
18721f1
fa13c80
 
 
18721f1
 
fa13c80
 
18721f1
 
fa13c80
18721f1
 
fa13c80
 
18721f1
094cc9b
fa13c80
 
 
 
 
 
3d64a05
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f90b77d
 
3d64a05
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fa13c80
 
094cc9b
f90b77d
3d64a05
 
 
 
 
 
 
 
fa13c80
f90b77d
094cc9b
8e0e419
 
 
fa13c80
 
094cc9b
94742e0
 
 
caa49b9
94742e0
 
 
 
 
 
094cc9b
18990ed
 
 
 
 
 
 
 
 
 
fa13c80
 
dcb68e2
fa13c80
 
 
 
 
 
094cc9b
fa13c80
 
 
 
 
 
18721f1
 
fa13c80
 
18721f1
18990ed
 
 
 
 
 
 
fa13c80
 
18721f1
fa13c80
 
18721f1
fa13c80
f90b77d
 
 
 
 
 
 
 
 
18721f1
fa13c80
f90b77d
18721f1
fa13c80
094cc9b
fa13c80
 
8e0e419
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
import streamlit as st
import folium
from streamlit_folium import folium_static
from folium.plugins import MarkerCluster
import requests
import json
from datetime import datetime
import re
from geopy.distance import geodesic
from typing import Dict, List, Tuple, Optional
import time
import random

# Set page configuration
st.set_page_config(
    page_title="GeoVision Pro",
    page_icon="🌍",
    layout="wide",
    initial_sidebar_state="expanded"
)

# Custom CSS for a blue-themed UI without the black strip
st.markdown("""
<style>
    @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');

    body {
        font-family: 'Roboto', sans-serif;
        background-color: #e0f7fa;
        color: #263b5e;
        margin: 0;
        padding: 0;
    }

    .stApp {
        max-width: 1200px;
        margin: 0 auto;
        padding: 2rem;
    }

    .header {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background: #007bff;
        padding: 1rem 2rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .header h1 {
        font-size: 1.8rem;
        color: #fff;
        margin: 0;
    }

    .header .subtitle {
        font-size: 1rem;
        color: #e0f7fa;
    }

    .main {
        margin-top: 6rem; /* Adjust for the fixed header */
    }

    .section {
        margin-bottom: 3rem;
    }

    .section-title {
        font-size: 1.5rem;
        color: #004085;
        margin-bottom: 1rem;
        border-bottom: 2px solid #b3e5fc;
        padding-bottom: 0.5rem;
    }

    .card {
        background: #fff;
        border: 1px solid #b3e5fc;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        padding: 1.5rem;
        margin-bottom: 1.5rem;
        transition: transform 0.3s;
    }

    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    .card h3 {
        margin-top: 0;
        font-size: 1.2rem;
        color: #004085;
    }

    .card p {
        font-size: 1rem;
        color: #263b5e;
    }

    .map-container {
        border: 1px solid #b3e5fc;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .button-container {
        display: flex;
        justify-content: center;
        gap: 1rem;
        margin-top: 2rem;
    }

    .button {
        background-color: #007bff;
        color: #fff;
        border: none;
        border-radius: 5px;
        padding: 0.7rem 1.5rem;
        font-size: 1rem;
        cursor: pointer;
        transition: background-color 0.3s;
    }

    .button:hover {
        background-color: #0056b3;
    }

    .footer {
        text-align: center;
        margin-top: 3rem;
        font-size: 0.9rem;
        color: #999;
    }

    .earth-bg {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        z-index: -1;
        overflow: hidden;
    }

    .earth-orbit {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        width: 100vw;
        height: 100vw;
        animation: earth-spin 120s linear infinite;
    }

    @keyframes earth-spin {
        0% { transform: translate(-50%, -50%) rotate(0deg); }
        100% { transform: translate(-50%, -50%) rotate(360deg); }
    }

    .earth-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
        filter: brightness(1.2) saturate(1.5);
    }
</style>
""", unsafe_allow_html=True)

# Moving 3D Earth Background (Smaller)
st.markdown('''
<div class="earth-bg">
    <div class="earth-orbit">
        <img class="earth-img" src="https://upload.wikimedia.org/wikipedia/commons/9/97/The_Earth_seen_from_Apollo_17.jpg" alt="Earth">
    </div>
</div>
''', unsafe_allow_html=True)

# Title Section
st.markdown('<div class="header"><h1>GeoVision Pro</h1><p class="subtitle">Your Professional Geospatial Data Solution</p></div>', unsafe_allow_html=True)

# Main Content Section
st.markdown('<div class="main">', unsafe_allow_html=True)

# Query Section
st.markdown('<div class="section"><h2 class="section-title">Query Interface</h2></div>', unsafe_allow_html=True)

# Function to handle smart location search
def smart_location_search():
    st.session_state.query = "Show restaurants near the Eiffel Tower"
    st.experimental_rerun

# Query input with a button for smart location search
query = st.text_input("Enter your query:", placeholder="Try: 'Show restaurants near the Eiffel Tower' or 'What's the weather in Tokyo?'", key="query_input")

if st.button("Smart Location Search"):
    smart_location_search()

# Function to fetch data from backend
def fetch_data_from_backend(endpoint, params=None):
    try:
        response = requests.get(f"https://geosapi.onrender.com/{endpoint}", params=params)
        response.raise_for_status()
        return response.json()
    except requests.exceptions.RequestException as e:
        st.error(f"Error fetching data: {e}")
        return None

# Features Section
st.markdown('<div class="section"><h2 class="section-title">Features</h2></div>', unsafe_allow_html=True)

features = [
    {"icon": "🌐", "title": "Smart Location Search", "description": "Find places and get directions with natural language queries."},
    {"icon": "🌦️", "title": "Real-time Weather", "description": "Get current weather conditions and forecasts for any location."},
    {"icon": "🌬️", "title": "Air Quality", "description": "Check air quality levels and pollution data worldwide."},
    {"icon": "πŸ“", "title": "Personal Places", "description": "Save and manage your favorite locations with notes and emotions."}
]

for feature in features:
    st.markdown(f"""
    <div class="card">
        <h3>{feature['icon']} {feature['title']}</h3>
        <p>{feature['description']}</p>
    </div>
    """, unsafe_allow_html=True)

# Map Section (Placeholder)
st.markdown('<div class="section"><h2 class="section-title">Map Visualization</h2></div>', unsafe_allow_html=True)

# Example: Fetching data from the backend
if query:
    # Example endpoint and parameters
    data = fetch_data_from_backend("your-endpoint", params={"query": query})
    if data:
        st.write("Data from backend:", data)

# Here you would integrate the map visualization
st.markdown('<div class="map-container" style="height: 500px;"></div>', unsafe_allow_html=True)

# Button Section
st.markdown('<div class="button-container">', unsafe_allow_html=True)

if st.button("Random Place"):
    random_queries = [
        "Show restaurants in Tokyo",
        "Find museums in Berlin",
        "Show hospitals in Paris",
        "Find parks in New York",
        "Show cafes in London",
        "Find supermarkets in Rome"
    ]
    st.write(f"Random Query: {random.choice(random_queries)}")

if st.button("Clear Results"):
    st.write("Results cleared.")

st.markdown('</div>', unsafe_allow_html=True)

# Footer Section
st.markdown('<div class="footer"><p>&copy; 2025 GeoVision Pro. All rights reserved.</p></div>', unsafe_allow_html=True)

st.markdown('</div>', unsafe_allow_html=True)