mirror of
https://github.com/senju1337/senju.git
synced 2025-12-23 23:39:27 +00:00
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:
commit
19c15b0cb7
3 changed files with 48 additions and 12 deletions
|
|
@ -4,8 +4,13 @@ app = Flask(__name__)
|
|||
|
||||
|
||||
@app.route("/")
|
||||
def index():
|
||||
context = {
|
||||
"number": 1337
|
||||
}
|
||||
return render_template("index.jinja", context=context, title="Senju")
|
||||
def index_view():
|
||||
return render_template("index.jinja", title="Senju")
|
||||
|
||||
|
||||
@app.route("/haiku")
|
||||
def haiku_view():
|
||||
|
||||
return render_template(
|
||||
"haiku.jinja",
|
||||
title="Haiku of the Day")
|
||||
|
|
|
|||
|
|
@ -25,13 +25,24 @@
|
|||
<div class="hidden md:block">
|
||||
<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" -->
|
||||
<a href="#" class="rounded-md bg-gray-900 px-3 py-2 text-sm font-medium text-white"
|
||||
aria-current="page">Start</a>
|
||||
<a href="#"
|
||||
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="#"
|
||||
class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white">Information</a>
|
||||
</div>
|
||||
<a href="{{ url_for('index_view') }}"
|
||||
class="rounded-md px-3 py-2 text-sm font-medium
|
||||
{% if request.endpoint == 'index_view' %} bg-gray-900 text-white {% else %} text-gray-300 hover:bg-gray-700 hover:text-white {% endif %}"
|
||||
>
|
||||
Start
|
||||
</a>
|
||||
|
||||
<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 class="hidden md:block">
|
||||
|
|
|
|||
20
senju/templates/haiku.jinja
Normal file
20
senju/templates/haiku.jinja
Normal 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 %}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue