forked from sqlpage/SQLPage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path02_hero_component.sql
177 lines (175 loc) · 5.64 KB
/
02_hero_component.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
-- Hero
INSERT INTO
component(name, icon, description)
VALUES
(
'hero',
'home',
'Display a large title and description for your page, with an optional large illustrative image. Useful in your home page, for instance.'
);
INSERT INTO
parameter(
component,
name,
description,
type,
top_level,
optional
)
SELECT
'hero',
*
FROM
(
VALUES
-- top level
(
'title',
'The title of your page. Will be shown in very large characters at the top.',
'TEXT',
TRUE,
TRUE
),
(
'description',
'A description of the page. Displayed below the title, in smaller characters and slightly greyed out.',
'TEXT',
TRUE,
TRUE
),
(
'description_md',
'A description of the page. Displayed below the title, in smaller characters and slightly greyed out - formatted using markdown.',
'TEXT',
TRUE,
TRUE
),
(
'image',
'The URL of an image to display next to the page title.',
'URL',
TRUE,
TRUE
),
(
'video',
'The URL of a video to display next to the page title.',
'URL',
TRUE,
TRUE
),
(
'link',
'Creates a large "call to action" button below the description, linking to the specified URL.',
'URL',
TRUE,
TRUE
),
(
'link_text',
'The text to display in the call to action button. Defaults to "Go".',
'TEXT',
TRUE,
TRUE
),
(
'poster',
'URL of the image to be displayed before the video starts. Ignored if no video is present.',
'URL',
TRUE,
TRUE
),
(
'nocontrols',
'Hide the video controls (play, pause, volume, etc.), and autoplay the video.',
'BOOLEAN',
TRUE,
TRUE
),
('muted', 'Mute the video', 'BOOLEAN', TRUE, TRUE),
('autoplay', 'Automatically start playing the video', 'BOOLEAN', TRUE, TRUE),
('loop', 'Loop the video', 'BOOLEAN', TRUE, TRUE),
(
'reverse',
'Reverse the order of the image and text: the image will be on the left, and the text on the right.',
'BOOLEAN',
TRUE,
TRUE
),
-- item level
(
'title',
'The name of a single feature section highlighted by this hero.',
'TEXT',
FALSE,
TRUE
),
(
'description',
'Description of the feature section.',
'TEXT',
FALSE,
TRUE
),
(
'description_md',
'Description of the feature section - formatted using markdown.',
'TEXT',
FALSE,
TRUE
),
(
'icon',
'Icon of the feature section.',
'ICON',
FALSE,
TRUE
),
(
'link',
'An URL to which the user should be taken when they click on the section title.',
'TEXT',
FALSE,
TRUE
)
) x;
INSERT INTO
example(component, description, properties)
VALUES
(
'hero',
'The simplest possible hero section',
json(
'[{
"component":"hero",
"title": "Welcome",
"description": "This is a very simple site built with SQLPage."
}]'
)
),
(
'hero',
'A hero with a background image.',
json(
'[{
"component":"hero",
"title": "SQLPage",
"description_md": "Documentation for the *SQLPage* low-code web application framework.",
"image": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e4/Lac_de_Zoug.jpg/640px-Lac_de_Zoug.jpg",
"link": "/documentation.sql",
"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-page.com) in a weekend.", "icon": "sofa", "color": "blue", "link": "/"}' || ']'
)
),
(
'hero',
'A hero with a video',
json(
'[{
"component":"hero",
"title": "Databases",
"reverse": true,
"description_md": "# “The goal is to turn data into information, and information into insight.”",
"poster": "https://upload.wikimedia.org/wikipedia/commons/thumb/e/e4/Lac_de_Zoug.jpg/640px-Lac_de_Zoug.jpg",
"video": "/sqlpage_introduction_video.webm"
}]')
);