This commit is contained in:
Flatlogic Bot 2026-01-26 00:50:09 +00:00
parent 620bc5c6fc
commit 44ffcf34a8
8 changed files with 437 additions and 205 deletions

View File

@ -1,25 +1,73 @@
{% load static %}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{% block title %}Knowledge Base{% endblock %}</title>
{% if project_description %}
<meta name="description" content="{{ project_description }}">
<meta property="og:description" content="{{ project_description }}">
<meta property="twitter:description" content="{{ project_description }}">
{% endif %}
{% if project_image_url %}
<meta property="og:image" content="{{ project_image_url }}">
<meta property="twitter:image" content="{{ project_image_url }}">
{% endif %}
{% load static %}
<link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
{% block head %}{% endblock %}
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{% block title %}Weather Forecast Pro{% endblock %}</title>
<meta name="description" content="{% if project_description %}{{ project_description }}{% else %}Premium weather forecasting with hourly and 7-day insights.{% endif %}">
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@400;600;700&display=swap" rel="stylesheet">
<!-- Bootstrap 5 -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="{% static 'css/custom.css' %}?v={{ deployment_timestamp }}">
{% block extra_css %}{% endblock %}
</head>
<body class="bg-light">
<nav class="navbar navbar-expand-lg navbar-dark sticky-top" style="background: rgba(45, 52, 54, 0.95); backdrop-filter: blur(10px);">
<div class="container">
<a class="navbar-brand d-flex align-items-center" href="{% url 'index' %}">
<span class="brand-icon me-2">☁️</span>
<span class="fw-bold fs-4" style="font-family: 'Outfit', sans-serif;">Weather<span class="text-info">Pro</span></span>
</a>
<button class="navbar-toggler border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto align-items-center">
<li class="nav-item">
<a class="nav-link px-3" href="#">Forecast</a>
</li>
<li class="nav-item">
<a class="nav-link px-3" href="#">Maps</a>
</li>
<li class="nav-item">
<a class="nav-link px-3" href="#">Alerts</a>
</li>
{% if user.is_staff %}
<li class="nav-item">
<a class="btn btn-outline-info btn-sm ms-lg-3" href="/admin/">Admin</a>
</li>
{% endif %}
</ul>
</div>
</div>
</nav>
<body>
{% block content %}{% endblock %}
<main>
{% block content %}{% endblock %}
</main>
<footer class="py-5 mt-5 bg-dark text-white">
<div class="container">
<div class="row align-items-center">
<div class="col-md-6 text-center text-md-start">
<p class="mb-0">&copy; 2026 Weather Forecast Pro. Precision in every cloud.</p>
</div>
<div class="col-md-6 text-center text-md-end mt-3 mt-md-0">
<a href="#" class="text-white-50 text-decoration-none me-3">Privacy</a>
<a href="#" class="text-white-50 text-decoration-none">Terms</a>
</div>
</div>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
{% block extra_js %}{% endblock %}
</body>
</html>
</html>

View File

@ -1,145 +1,104 @@
{% extends "base.html" %}
{% block title %}{{ project_name }}{% endblock %}
{% block head %}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
<style>
:root {
--bg-color-start: #6a11cb;
--bg-color-end: #2575fc;
--text-color: #ffffff;
--card-bg-color: rgba(255, 255, 255, 0.01);
--card-border-color: rgba(255, 255, 255, 0.1);
}
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: 'Inter', sans-serif;
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
text-align: center;
overflow: hidden;
position: relative;
}
body::before {
content: '';
position: absolute;
inset: 0;
background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'><path d='M-10 10L110 10M10 -10L10 110' stroke-width='1' stroke='rgba(255,255,255,0.05)'/></svg>");
animation: bg-pan 20s linear infinite;
z-index: -1;
}
@keyframes bg-pan {
0% {
background-position: 0% 0%;
}
100% {
background-position: 100% 100%;
}
}
main {
padding: 2rem;
}
.card {
background: var(--card-bg-color);
border: 1px solid var(--card-border-color);
border-radius: 16px;
padding: 2.5rem 2rem;
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
}
h1 {
font-size: clamp(2.2rem, 3vw + 1.2rem, 3.2rem);
font-weight: 700;
margin: 0 0 1.2rem;
letter-spacing: -0.02em;
}
p {
margin: 0.5rem 0;
font-size: 1.1rem;
opacity: 0.92;
}
.loader {
margin: 1.5rem auto;
width: 56px;
height: 56px;
border: 4px solid rgba(255, 255, 255, 0.25);
border-top-color: #fff;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
to {
transform: rotate(360deg);
}
}
.runtime code {
background: rgba(0, 0, 0, 0.25);
padding: 0.15rem 0.45rem;
border-radius: 4px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
border: 0;
}
footer {
position: absolute;
bottom: 1rem;
width: 100%;
text-align: center;
font-size: 0.85rem;
opacity: 0.75;
}
</style>
{% endblock %}
{% extends 'base.html' %}
{% load static %}
{% block content %}
<main>
<div class="card">
<h1>Analyzing your requirements and generating your app…</h1>
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
<span class="sr-only">Loading…</span>
<!-- Hero Section -->
<section class="hero-weather text-center">
<div class="container">
<div class="row justify-content-center">
<div class="col-lg-8">
<p class="mb-2 text-uppercase fw-bold opacity-75" style="letter-spacing: 2px;">Current Conditions</p>
<h1 class="display-3 fw-bold mb-0">{{ current.city }}</h1>
<div class="d-flex align-items-center justify-content-center my-4">
<span style="font-size: 6rem;">{{ current.icon }}</span>
<span class="current-temp ms-3">{{ current.temp }}°</span>
</div>
<h2 class="h3 fw-normal opacity-90">{{ current.condition }}</h2>
<div class="mt-4">
<span class="mx-3"><i class="opacity-75">H:</i> {{ current.high }}°</span>
<span class="mx-3"><i class="opacity-75">L:</i> {{ current.low }}°</span>
</div>
</div>
</div>
</div>
<p class="hint">AppWizzy AI is collecting your requirements and applying the first changes.</p>
<p class="hint">This page will refresh automatically as the plan is implemented.</p>
<p class="runtime">
Runtime: Django <code>{{ django_version }}</code> · Python <code>{{ python_version }}</code>
— UTC <code>{{ current_time|date:"Y-m-d H:i:s" }}</code>
</p>
</div>
</main>
<footer>
Page updated: {{ current_time|date:"Y-m-d H:i:s" }} (UTC)
</footer>
{% endblock %}
</section>
<!-- Search Area -->
<section class="search-wrapper">
<div class="container">
<form action="{% url 'index' %}" method="GET">
<div class="position-relative">
<input type="text" name="city" class="form-control search-input" placeholder="Search for a city (e.g., Tokyo, New York...)" value="{{ current.city }}">
<button type="submit" class="search-btn">Search</button>
</div>
</form>
</div>
</section>
<!-- Dashboard Grid -->
<div class="container mt-5 pt-4">
<div class="row g-4">
<!-- Details Card -->
<div class="col-lg-8">
<div class="weather-card p-4 mb-4">
<h3 class="h5 fw-bold mb-4">Hourly Forecast</h3>
<div class="d-flex overflow-auto pb-2">
{% for item in hourly %}
<div class="hourly-item">
<div class="small text-muted mb-2">{{ item.time }}</div>
<div class="fs-2 mb-2">{{ item.icon }}</div>
<div class="fw-bold">{{ item.temp }}°</div>
</div>
{% endfor %}
</div>
</div>
<div class="row g-4">
<div class="col-md-4">
<div class="weather-card p-4 h-100">
<div class="text-muted small mb-2">Feels Like</div>
<div class="h3 fw-bold">{{ current.feels_like }}°</div>
<p class="small text-muted mb-0">Similar to current</p>
</div>
</div>
<div class="col-md-4">
<div class="weather-card p-4 h-100">
<div class="text-muted small mb-2">Humidity</div>
<div class="h3 fw-bold">{{ current.humidity }}%</div>
<div class="progress mt-2" style="height: 6px;">
<div class="progress-bar bg-info" style="width: {{ current.humidity }}%"></div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="weather-card p-4 h-100">
<div class="text-muted small mb-2">Wind Speed</div>
<div class="h3 fw-bold">{{ current.wind_speed }} <span class="fs-6 fw-normal">km/h</span></div>
<p class="small text-muted mb-0">North West</p>
</div>
</div>
</div>
</div>
<!-- 7-Day Forecast -->
<div class="col-lg-4">
<div class="weather-card p-4">
<h3 class="h5 fw-bold mb-4">7-Day Forecast</h3>
<div class="daily-list">
{% for day in daily %}
<div class="day-item">
<div class="fw-medium" style="width: 80px;">{{ day.day }}</div>
<div class="fs-4">{{ day.icon }}</div>
<div class="text-end" style="width: 80px;">
<span class="fw-bold">{{ day.high }}°</span>
<span class="ms-2 opacity-50">{{ day.low }}°</span>
</div>
</div>
{% endfor %}
</div>
<button class="btn btn-primary w-100 mt-4 py-2" style="border-radius: 12px;">Full Forecast</button>
</div>
</div>
</div>
</div>
{% endblock %}

View File

@ -1,7 +1,7 @@
from django.urls import path
from .views import home
from .views import index
urlpatterns = [
path("", home, name="home"),
]
path("", index, name="index"),
]

View File

@ -1,25 +1,53 @@
import os
import platform
from django import get_version as django_version
from django.shortcuts import render
from django.utils import timezone
from datetime import datetime, timedelta
def home(request):
"""Render the landing screen with loader and environment details."""
host_name = request.get_host().lower()
agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic"
now = timezone.now()
context = {
"project_name": "New Style",
"agent_brand": agent_brand,
"django_version": django_version(),
"python_version": platform.python_version(),
"current_time": now,
"host_name": host_name,
"project_description": os.getenv("PROJECT_DESCRIPTION", ""),
"project_image_url": os.getenv("PROJECT_IMAGE_URL", ""),
def index(request):
city = request.GET.get('city', 'London')
# High-quality demo data
current_weather = {
'city': city,
'temp': 22,
'condition': 'Partly Cloudy',
'icon': '',
'high': 24,
'low': 16,
'humidity': 64,
'wind_speed': 12,
'feels_like': 21,
'uv_index': 4,
'visibility': 10,
'pressure': 1012,
'updated_at': datetime.now().strftime("%H:%M")
}
return render(request, "core/index.html", context)
hourly_forecast = []
start_time = datetime.now()
for i in range(12):
time = (start_time + timedelta(hours=i)).strftime("%H:00")
temp = 22 - (i % 3)
hourly_forecast.append({
'time': 'Now' if i == 0 else time,
'temp': temp,
'icon': '☀️' if temp > 20 else ''
})
daily_forecast = []
days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
today_idx = datetime.now().weekday()
for i in range(7):
day_name = days[(today_idx + i) % 7]
daily_forecast.append({
'day': 'Today' if i == 0 else day_name,
'high': 24 - i,
'low': 16 - (i % 2),
'condition': 'Sunny' if i < 3 else 'Cloudy',
'icon': '☀️' if i < 3 else '☁️'
})
context = {
'current': current_weather,
'hourly': hourly_forecast,
'daily': daily_forecast,
}
return render(request, 'core/index.html', context)

View File

@ -1,4 +1,111 @@
/* Custom styles for the application */
body {
font-family: system-ui, -apple-system, sans-serif;
:root {
--primary-color: #0984E3;
--secondary-color: #2D3436;
--accent-color: #FDCB6E;
--bg-light: #F5F6FA;
--text-dark: #2D3436;
--glass-bg: rgba(255, 255, 255, 0.7);
--glass-border: rgba(255, 255, 255, 0.3);
}
body {
font-family: 'Inter', sans-serif;
color: var(--text-dark);
background-color: var(--bg-light);
line-height: 1.6;
}
h1, h2, h3, h4, h5, .navbar-brand {
font-family: 'Outfit', sans-serif;
}
/* Glassmorphism Card */
.weather-card {
background: var(--glass-bg);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid var(--glass-border);
border-radius: 24px;
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
transition: transform 0.3s ease;
}
.weather-card:hover {
transform: translateY(-5px);
}
/* Hero Section */
.hero-weather {
background: linear-gradient(135deg, #0984E3 0%, #74b9ff 100%);
color: white;
padding: 80px 0;
border-radius: 0 0 50px 50px;
margin-bottom: -60px;
}
.current-temp {
font-size: 5rem;
font-weight: 700;
line-height: 1;
}
/* Search Input */
.search-wrapper {
max-width: 600px;
margin: 0 auto;
position: relative;
z-index: 10;
}
.search-input {
height: 60px;
border-radius: 30px;
padding-left: 30px;
border: none;
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
font-size: 1.1rem;
}
.search-btn {
position: absolute;
right: 5px;
top: 5px;
height: 50px;
border-radius: 25px;
padding: 0 25px;
background-color: var(--primary-color);
border: none;
color: white;
font-weight: 600;
}
/* Forecast Grids */
.hourly-item {
min-width: 100px;
text-align: center;
padding: 15px;
}
.day-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 15px 20px;
border-bottom: 1px solid rgba(0,0,0,0.05);
}
.day-item:last-child {
border-bottom: none;
}
/* Badges */
.badge-soft {
padding: 6px 12px;
border-radius: 8px;
font-weight: 500;
}
.badge-soft-info {
background-color: rgba(9, 132, 227, 0.1);
color: var(--primary-color);
}

View File

@ -1,21 +1,111 @@
:root {
--bg-color-start: #6a11cb;
--bg-color-end: #2575fc;
--text-color: #ffffff;
--card-bg-color: rgba(255, 255, 255, 0.01);
--card-border-color: rgba(255, 255, 255, 0.1);
--primary-color: #0984E3;
--secondary-color: #2D3436;
--accent-color: #FDCB6E;
--bg-light: #F5F6FA;
--text-dark: #2D3436;
--glass-bg: rgba(255, 255, 255, 0.7);
--glass-border: rgba(255, 255, 255, 0.3);
}
body {
margin: 0;
font-family: 'Inter', sans-serif;
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
text-align: center;
overflow: hidden;
position: relative;
color: var(--text-dark);
background-color: var(--bg-light);
line-height: 1.6;
}
h1, h2, h3, h4, h5, .navbar-brand {
font-family: 'Outfit', sans-serif;
}
/* Glassmorphism Card */
.weather-card {
background: var(--glass-bg);
backdrop-filter: blur(12px);
-webkit-backdrop-filter: blur(12px);
border: 1px solid var(--glass-border);
border-radius: 24px;
box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
transition: transform 0.3s ease;
}
.weather-card:hover {
transform: translateY(-5px);
}
/* Hero Section */
.hero-weather {
background: linear-gradient(135deg, #0984E3 0%, #74b9ff 100%);
color: white;
padding: 80px 0;
border-radius: 0 0 50px 50px;
margin-bottom: -60px;
}
.current-temp {
font-size: 5rem;
font-weight: 700;
line-height: 1;
}
/* Search Input */
.search-wrapper {
max-width: 600px;
margin: 0 auto;
position: relative;
z-index: 10;
}
.search-input {
height: 60px;
border-radius: 30px;
padding-left: 30px;
border: none;
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
font-size: 1.1rem;
}
.search-btn {
position: absolute;
right: 5px;
top: 5px;
height: 50px;
border-radius: 25px;
padding: 0 25px;
background-color: var(--primary-color);
border: none;
color: white;
font-weight: 600;
}
/* Forecast Grids */
.hourly-item {
min-width: 100px;
text-align: center;
padding: 15px;
}
.day-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 15px 20px;
border-bottom: 1px solid rgba(0,0,0,0.05);
}
.day-item:last-child {
border-bottom: none;
}
/* Badges */
.badge-soft {
padding: 6px 12px;
border-radius: 8px;
font-weight: 500;
}
.badge-soft-info {
background-color: rgba(9, 132, 227, 0.1);
color: var(--primary-color);
}