Merge pull request #10 from senju1337/feat/basic-site

feat: add basic page for Haiku and linked it to home
This commit is contained in:
Guts 2025-02-25 15:07:21 +01:00 committed by GitHub
commit 19c15b0cb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 48 additions and 12 deletions

View file

@ -4,8 +4,13 @@ app = Flask(__name__)
@app.route("/") @app.route("/")
def index(): def index_view():
context = { return render_template("index.jinja", title="Senju")
"number": 1337
}
return render_template("index.jinja", context=context, title="Senju") @app.route("/haiku")
def haiku_view():
return render_template(
"haiku.jinja",
title="Haiku of the Day")

View file

@ -25,13 +25,24 @@
<div class="hidden md:block"> <div class="hidden md:block">
<div class="ml-10 flex items-baseline space-x-4"> <div class="ml-10 flex items-baseline space-x-4">
<!-- Current: "bg-gray-900 text-white", Default: "text-gray-300 hover:bg-gray-700 hover:text-white" --> <!-- Current: "bg-gray-900 text-white", Default: "text-gray-300 hover:bg-gray-700 hover:text-white" -->
<a href="#" class="rounded-md bg-gray-900 px-3 py-2 text-sm font-medium text-white" <a href="{{ url_for('index_view') }}"
aria-current="page">Start</a> class="rounded-md px-3 py-2 text-sm font-medium
<a href="#" {% if request.endpoint == 'index_view' %} bg-gray-900 text-white {% else %} text-gray-300 hover:bg-gray-700 hover:text-white {% endif %}"
class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white">Haiku</a> >
<a href="#" Start
class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white">Information</a> </a>
</div>
<a href="{{ url_for('haiku_view') }}"
class="rounded-md px-3 py-2 text-sm font-mediRefs: OPS-11um
{% if request.endpoint == 'haiku_view' %} bg-gray-900 text-white {% else %} text-gray-300 hover:bg-gray-700 hover:text-white {% endif %}"
>
Haiku
</a>
<a href="#"
class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white">
Information
</a> </div>
</div> </div>
</div> </div>
<div class="hidden md:block"> <div class="hidden md:block">

View file

@ -0,0 +1,20 @@
{% extends "base.jinja" %}
{% block content %}
<div class="bg-violet-900 min-h-screen flex items-center justify-center text-white">
<div class="text-center">
<div class="bg-white text-gray-900 p-10 rounded-lg shadow-lg max-w-2xl mx-auto transform -translate-y-10">
<h1 class="text-4xl font-bold text-violet-700 mb-6">Haiku of the Day</h1>
<p class="text-2xl italic leading-relaxed">
An old silent pond<br>
A frog jumps into the pond—<br>
Splash! Silence again.
</p>
</div>
<a href="{{ url_for('index_view') }}" class=" inline-block bg-violet-600 hover:bg-violet-700 text-white font-bold py-2 px-4 rounded-lg">
Back to Home
</a>
</div>
</div>
{% endblock %}