From a70c24398a773aeb68911a0f8e666124bf2b777a Mon Sep 17 00:00:00 2001 From: "Waylon S. Walker" Date: Sat, 6 Apr 2024 15:20:33 -0500 Subject: [PATCH 1/5] 0.1.3 fix mobile style --- CHANGELOG.md | 4 ++++ htmx_patterns/__about__.py | 2 +- templates/base.html | 8 +++++--- templates/boosted/person.html | 2 +- templates/index.html | 8 ++++---- templates/infinite/persons.html | 4 ++-- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 255ce3d..612602f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # HTMX-PATTERNS CHANGELOG +## 0.1.3 + +* fix mobile style + ## 0.1.2 * fix seo image size diff --git a/htmx_patterns/__about__.py b/htmx_patterns/__about__.py index 9df1c0f..2add7af 100644 --- a/htmx_patterns/__about__.py +++ b/htmx_patterns/__about__.py @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2024-present Waylon S. Walker # # SPDX-License-Identifier: MIT -__version__ = "0.1.2" +__version__ = "0.1.3" diff --git a/templates/base.html b/templates/base.html index bd78c05..abc126c 100644 --- a/templates/base.html +++ b/templates/base.html @@ -41,18 +41,20 @@ } %} + class="justify-center items-center min-h-screen bg-gray-900 bg-no-repeat bg-cover bg-gradient-to-b from-pink-950/50 min-w-screen text-shadow-xl text-shadow-zinc-950 w-screen h-screen">
- + {% block content %} + {{ body | safe }} + {% endblock %} +
+
+
+ diff --git a/templates/boosted/person.html b/templates/boosted/person.html index 2ad2ae2..7d47ae0 100644 --- a/templates/boosted/person.html +++ b/templates/boosted/person.html @@ -2,60 +2,62 @@ {% block title %}Contact - {{ person_id }} - {{ person.name }}{% endblock %} {% block content %}

+ class="inline-block px-4 pb-0 mx-auto mb-0 text-center text-6xl sm:text-8xl font-thin text-transparent bg-clip-text bg-gradient-to-r from-terminal-600 via-terminal-500 to-terminal-900 ring-red-700 text-shadow-xl text-shadow-zinc-950 ring-5 leading-none"> HTMX PATTERNS - BOOSTED

-

+

Contact - {{ person_id }}

-

- {{ person.name }} - +{% if person is not none %} +

+ {{ person.name.upper() }} - {{ person.phone_number }}

+{% else %} +

+ Person not found +

+{% endif %} -

+{% macro link(id, text, boosted=false) -%} + + {{ text }} + +{%- endmacro %} + +

Boosted Links

- {% if prev_id is not none %} - - Previous - - {% else %} - - Previous - - {% endif %} - - - Next - + {{ link(prev_id, 'Previous', boosted=True) }} + {{ link(next_id, 'Next', boosted=True) }}
-

+

Normal Links

- {% if prev_id is not none %} - - Previous - - {% else %} - - Previous - - {% endif %} - - - Next - + {{ link(prev_id, 'Previous', boosted=False) }} + {{ link(next_id, 'Next', boosted=False) }}
{% endblock %} diff --git a/templates/index.html b/templates/index.html index eccd008..050723a 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,19 +1,34 @@ {% extends "base.html" %} {% block content %}

+ class="inline-block px-4 pb-0 mx-auto mb-0 text-center text-6xl sm:text-8xl font-thin text-transparent bg-clip-text bg-gradient-to-r from-terminal-600 via-terminal-500 to-terminal-900 ring-red-700 text-shadow-xl text-shadow-zinc-950 ring-5 leading-none"> HTMX PATTERNS

-

+

A collection of HTMX patterns

+

+ These are patterns that I have written based on content from the hypermedia.systems + book. There is lots of code duplication as each pattern is meant to be standalone. +

+ +

+ I currently make use of htmx with fastapi, sqlmodel, sqlite, and tailwindcss + for many of my projects. These patterns are here to serve for reference to + myself implemented using this stack in the most pure way possible to remain + simple and understandable. Sometimes real projects get complicated and are + hard to bring in new features correctly. This is a playground with completely + separate routers, models, and templates for each project. +

+