Skip to content

Commit 9bcf1a5

Browse files
committed
allow reversing the order of text and images in the hero component
closes #383
1 parent e7970ad commit 9bcf1a5

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 0.24.1
44

5+
- hero component: allow reversing the order of text and images. Allows hero components with the text on the right and the image on the left.
56
- Reduce the max item width in the datagrid component for a better and more compact display on small screens. This makes the datagrid component more mobile-friendly. If you have a datagrid with long text items, this may impact the layout of your page. You can override this behavior by manually changing the `--tblr-datagrid-item-width` CSS variable in your custom CSS.
67
- Apply migrations before initializing the on-database file system. This allows migrations to create files in the database file system.
78
- Added a [new example](https://github.com/lovasoa/SQLpage/tree/main/examples/CRUD%20-%20Authentication) to the documentation

examples/official-site/sqlpage/migrations/02_hero_component.sql

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ FROM
9090
('muted', 'Mute the video', 'BOOLEAN', TRUE, TRUE),
9191
('autoplay', 'Automatically start playing the video', 'BOOLEAN', TRUE, TRUE),
9292
('loop', 'Loop the video', 'BOOLEAN', TRUE, TRUE),
93+
(
94+
'reverse',
95+
'Reverse the order of the image and text: the image will be on the left, and the text on the right.',
96+
'BOOLEAN',
97+
TRUE,
98+
TRUE
99+
),
93100
-- item level
94101
(
95102
'title',
@@ -154,4 +161,17 @@ VALUES
154161
"link": "/documentation.sql",
155162
"link_text": "Read Documentation !"},' || '{"title": "Fast", "description": "Pages load instantly, even on slow mobile networks.", "icon": "car", "color": "red", "link": "/"},' || '{"title": "Beautiful", "description": "Uses pre-defined components that look professional.", "icon": "eye", "color": "green", "link": "/"},' || '{"title": "Easy", "description_md": "You can teach yourself enough SQL to use [**SQLPage**](https://sql.ophir.dev) in a weekend.", "icon": "sofa", "color": "blue", "link": "/"}' || ']'
156163
)
164+
),
165+
(
166+
'hero',
167+
'A hero with a video',
168+
json(
169+
'[{
170+
"component":"hero",
171+
"title": "Databases",
172+
"reverse": true,
173+
"description_md": "# “The goal is to turn data into information, and information into insight.”",
174+
"poster": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e4/Lac_de_Zoug.jpg/640px-Lac_de_Zoug.jpg",
175+
"video": "/sqlpage_introduction_video.webm"
176+
}]')
157177
);

sqlpage/templates/hero.handlebars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<header class="row align-items-center" {{#if id}} id="{{id}}"{{/if}}>
1+
<header class="row align-items-center{{#if reverse}} flex-row-reverse{{/if}}" {{#if id}} id="{{id}}"{{/if}}>
22
<div class="hero-title col text-center">
33
<h1 class="lh-lg" style="font-size: 3rem">{{title}}</h1>
44
<div class="fs-1 mx-5 text-muted">

0 commit comments

Comments
 (0)