active_canvas 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +318 -0
- data/Rakefile +6 -0
- data/app/assets/javascripts/active_canvas/editor/ai_panel.js +1607 -0
- data/app/assets/javascripts/active_canvas/editor/asset_manager.js +498 -0
- data/app/assets/javascripts/active_canvas/editor/blocks.js +1083 -0
- data/app/assets/javascripts/active_canvas/editor/code_panel.js +572 -0
- data/app/assets/javascripts/active_canvas/editor/component_toolbar.js +394 -0
- data/app/assets/javascripts/active_canvas/editor/panels.js +460 -0
- data/app/assets/javascripts/active_canvas/editor/utils.js +56 -0
- data/app/assets/javascripts/active_canvas/editor.js +295 -0
- data/app/assets/stylesheets/active_canvas/application.css +15 -0
- data/app/assets/stylesheets/active_canvas/editor.css +2929 -0
- data/app/controllers/active_canvas/admin/ai_controller.rb +181 -0
- data/app/controllers/active_canvas/admin/application_controller.rb +56 -0
- data/app/controllers/active_canvas/admin/media_controller.rb +61 -0
- data/app/controllers/active_canvas/admin/page_types_controller.rb +57 -0
- data/app/controllers/active_canvas/admin/page_versions_controller.rb +23 -0
- data/app/controllers/active_canvas/admin/pages_controller.rb +133 -0
- data/app/controllers/active_canvas/admin/partials_controller.rb +88 -0
- data/app/controllers/active_canvas/admin/settings_controller.rb +256 -0
- data/app/controllers/active_canvas/application_controller.rb +20 -0
- data/app/controllers/active_canvas/pages_controller.rb +18 -0
- data/app/controllers/concerns/active_canvas/current_user.rb +12 -0
- data/app/controllers/concerns/active_canvas/rate_limitable.rb +75 -0
- data/app/controllers/concerns/active_canvas/tailwind_compilation.rb +39 -0
- data/app/helpers/active_canvas/application_helper.rb +4 -0
- data/app/jobs/active_canvas/application_job.rb +4 -0
- data/app/jobs/active_canvas/compile_tailwind_job.rb +64 -0
- data/app/mailers/active_canvas/application_mailer.rb +6 -0
- data/app/models/active_canvas/ai_model.rb +136 -0
- data/app/models/active_canvas/application_record.rb +5 -0
- data/app/models/active_canvas/media.rb +141 -0
- data/app/models/active_canvas/page.rb +85 -0
- data/app/models/active_canvas/page_type.rb +22 -0
- data/app/models/active_canvas/page_version.rb +80 -0
- data/app/models/active_canvas/partial.rb +73 -0
- data/app/models/active_canvas/setting.rb +292 -0
- data/app/services/active_canvas/ai_configuration.rb +40 -0
- data/app/services/active_canvas/ai_models.rb +128 -0
- data/app/services/active_canvas/ai_service.rb +289 -0
- data/app/services/active_canvas/content_sanitizer.rb +112 -0
- data/app/services/active_canvas/tailwind_compiler.rb +156 -0
- data/app/views/active_canvas/admin/media/index.html.erb +401 -0
- data/app/views/active_canvas/admin/media/show.html.erb +297 -0
- data/app/views/active_canvas/admin/page_types/_form.html.erb +25 -0
- data/app/views/active_canvas/admin/page_types/edit.html.erb +13 -0
- data/app/views/active_canvas/admin/page_types/index.html.erb +29 -0
- data/app/views/active_canvas/admin/page_types/new.html.erb +9 -0
- data/app/views/active_canvas/admin/page_types/show.html.erb +18 -0
- data/app/views/active_canvas/admin/page_versions/show.html.erb +469 -0
- data/app/views/active_canvas/admin/pages/_form.html.erb +62 -0
- data/app/views/active_canvas/admin/pages/content.html.erb +139 -0
- data/app/views/active_canvas/admin/pages/edit.html.erb +335 -0
- data/app/views/active_canvas/admin/pages/editor.html.erb +710 -0
- data/app/views/active_canvas/admin/pages/index.html.erb +149 -0
- data/app/views/active_canvas/admin/pages/new.html.erb +19 -0
- data/app/views/active_canvas/admin/pages/show.html.erb +258 -0
- data/app/views/active_canvas/admin/pages/versions.html.erb +333 -0
- data/app/views/active_canvas/admin/partials/edit.html.erb +182 -0
- data/app/views/active_canvas/admin/partials/editor.html.erb +703 -0
- data/app/views/active_canvas/admin/partials/index.html.erb +131 -0
- data/app/views/active_canvas/admin/settings/show.html.erb +1864 -0
- data/app/views/active_canvas/pages/no_homepage.html.erb +45 -0
- data/app/views/active_canvas/pages/show.html.erb +113 -0
- data/app/views/layouts/active_canvas/admin/application.html.erb +960 -0
- data/app/views/layouts/active_canvas/admin/editor.html.erb +826 -0
- data/app/views/layouts/active_canvas/application.html.erb +55 -0
- data/config/routes.rb +48 -0
- data/db/migrate/20260202000001_create_active_canvas_tables.rb +113 -0
- data/db/migrate/20260202000002_create_active_canvas_ai_models.rb +26 -0
- data/lib/active_canvas/configuration.rb +232 -0
- data/lib/active_canvas/engine.rb +44 -0
- data/lib/active_canvas/version.rb +3 -0
- data/lib/active_canvas.rb +26 -0
- data/lib/generators/active_canvas/install/install_generator.rb +263 -0
- data/lib/generators/active_canvas/install/templates/initializer.rb.tt +163 -0
- data/lib/tasks/active_canvas_tasks.rake +69 -0
- metadata +150 -0
|
@@ -0,0 +1,1083 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ActiveCanvas Editor - Custom Blocks
|
|
3
|
+
* Framework-aware blocks for Tailwind, Bootstrap 5, and vanilla CSS
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
(function() {
|
|
7
|
+
'use strict';
|
|
8
|
+
|
|
9
|
+
window.ActiveCanvasEditor = window.ActiveCanvasEditor || {};
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Register all custom blocks with the editor
|
|
13
|
+
* @param {Object} editor - GrapeJS editor instance
|
|
14
|
+
* @param {Object} config - Editor configuration (optional)
|
|
15
|
+
*/
|
|
16
|
+
function addCustomBlocks(editor, config) {
|
|
17
|
+
const bm = editor.BlockManager;
|
|
18
|
+
const framework = config?.cssFramework || 'tailwind';
|
|
19
|
+
|
|
20
|
+
// Add universal blocks (work with any framework)
|
|
21
|
+
addUniversalBlocks(bm);
|
|
22
|
+
|
|
23
|
+
// Add framework-specific blocks
|
|
24
|
+
switch (framework) {
|
|
25
|
+
case 'bootstrap5':
|
|
26
|
+
addBootstrapBlocks(bm);
|
|
27
|
+
break;
|
|
28
|
+
case 'custom':
|
|
29
|
+
addVanillaBlocks(bm);
|
|
30
|
+
break;
|
|
31
|
+
case 'tailwind':
|
|
32
|
+
default:
|
|
33
|
+
addTailwindBlocks(bm);
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Universal blocks that work with any framework
|
|
40
|
+
*/
|
|
41
|
+
function addUniversalBlocks(bm) {
|
|
42
|
+
bm.add('div', {
|
|
43
|
+
label: 'Div Block',
|
|
44
|
+
category: 'Layout',
|
|
45
|
+
content: '<div></div>',
|
|
46
|
+
attributes: { class: 'gjs-fonts gjs-f-b1' }
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
bm.add('link-block', {
|
|
50
|
+
label: 'Link',
|
|
51
|
+
category: 'Basic',
|
|
52
|
+
content: '<a href="#">Link text</a>'
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
bm.add('image', {
|
|
56
|
+
label: 'Image',
|
|
57
|
+
category: 'Basic',
|
|
58
|
+
content: { type: 'image' },
|
|
59
|
+
activate: true
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
bm.add('video', {
|
|
63
|
+
label: 'Video',
|
|
64
|
+
category: 'Basic',
|
|
65
|
+
content: { type: 'video' },
|
|
66
|
+
activate: true
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Tailwind CSS blocks
|
|
72
|
+
*/
|
|
73
|
+
function addTailwindBlocks(bm) {
|
|
74
|
+
// --- Layout ---
|
|
75
|
+
bm.add('section', {
|
|
76
|
+
label: 'Section',
|
|
77
|
+
category: 'Layout',
|
|
78
|
+
content: '<section class="py-16 px-4"><div class="max-w-6xl mx-auto"></div></section>'
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
bm.add('container', {
|
|
82
|
+
label: 'Container',
|
|
83
|
+
category: 'Layout',
|
|
84
|
+
content: '<div class="max-w-6xl mx-auto px-4"></div>'
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
bm.add('flex-row', {
|
|
88
|
+
label: 'Flex Row',
|
|
89
|
+
category: 'Layout',
|
|
90
|
+
content: '<div class="flex flex-row gap-4"></div>'
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
bm.add('flex-col', {
|
|
94
|
+
label: 'Flex Column',
|
|
95
|
+
category: 'Layout',
|
|
96
|
+
content: '<div class="flex flex-col gap-4"></div>'
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
bm.add('grid-2', {
|
|
100
|
+
label: 'Grid 2 Cols',
|
|
101
|
+
category: 'Layout',
|
|
102
|
+
content: '<div class="grid grid-cols-1 md:grid-cols-2 gap-6"></div>'
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
bm.add('grid-3', {
|
|
106
|
+
label: 'Grid 3 Cols',
|
|
107
|
+
category: 'Layout',
|
|
108
|
+
content: '<div class="grid grid-cols-1 md:grid-cols-3 gap-6"></div>'
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
bm.add('grid-4', {
|
|
112
|
+
label: 'Grid 4 Cols',
|
|
113
|
+
category: 'Layout',
|
|
114
|
+
content: '<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"></div>'
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
// --- Typography ---
|
|
118
|
+
bm.add('heading-1', {
|
|
119
|
+
label: 'Heading 1',
|
|
120
|
+
category: 'Typography',
|
|
121
|
+
content: '<h1 class="text-5xl font-bold">Heading 1</h1>'
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
bm.add('heading-2', {
|
|
125
|
+
label: 'Heading 2',
|
|
126
|
+
category: 'Typography',
|
|
127
|
+
content: '<h2 class="text-4xl font-bold">Heading 2</h2>'
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
bm.add('heading-3', {
|
|
131
|
+
label: 'Heading 3',
|
|
132
|
+
category: 'Typography',
|
|
133
|
+
content: '<h3 class="text-3xl font-semibold">Heading 3</h3>'
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
bm.add('paragraph', {
|
|
137
|
+
label: 'Paragraph',
|
|
138
|
+
category: 'Typography',
|
|
139
|
+
content: '<p class="text-base text-gray-600 leading-relaxed">Your paragraph text goes here. Edit this text to add your own content.</p>'
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
bm.add('text-lead', {
|
|
143
|
+
label: 'Lead Text',
|
|
144
|
+
category: 'Typography',
|
|
145
|
+
content: '<p class="text-xl text-gray-500 leading-relaxed">A larger lead paragraph for introductions and important text.</p>'
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
// --- Buttons ---
|
|
149
|
+
bm.add('button-primary', {
|
|
150
|
+
label: 'Primary Button',
|
|
151
|
+
category: 'Buttons',
|
|
152
|
+
content: '<a href="#" class="inline-block bg-blue-600 text-white px-6 py-3 rounded-lg font-semibold hover:bg-blue-700 transition-colors">Button</a>'
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
bm.add('button-secondary', {
|
|
156
|
+
label: 'Secondary Button',
|
|
157
|
+
category: 'Buttons',
|
|
158
|
+
content: '<a href="#" class="inline-block bg-gray-200 text-gray-800 px-6 py-3 rounded-lg font-semibold hover:bg-gray-300 transition-colors">Button</a>'
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
bm.add('button-outline', {
|
|
162
|
+
label: 'Outline Button',
|
|
163
|
+
category: 'Buttons',
|
|
164
|
+
content: '<a href="#" class="inline-block border-2 border-blue-600 text-blue-600 px-6 py-3 rounded-lg font-semibold hover:bg-blue-600 hover:text-white transition-colors">Button</a>'
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// --- Hero Sections ---
|
|
168
|
+
bm.add('hero-simple', {
|
|
169
|
+
label: 'Hero Simple',
|
|
170
|
+
category: 'Sections',
|
|
171
|
+
content: `
|
|
172
|
+
<section class="py-20 px-4 bg-gray-900 text-white text-center">
|
|
173
|
+
<div class="max-w-4xl mx-auto">
|
|
174
|
+
<h1 class="text-5xl font-bold mb-6">Welcome to Your Site</h1>
|
|
175
|
+
<p class="text-xl text-gray-300 mb-8">A beautiful subtitle that describes what you do and why visitors should care.</p>
|
|
176
|
+
<a href="#" class="inline-block bg-blue-600 text-white px-8 py-3 rounded-lg font-semibold hover:bg-blue-700">Get Started</a>
|
|
177
|
+
</div>
|
|
178
|
+
</section>
|
|
179
|
+
`
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
bm.add('hero-split', {
|
|
183
|
+
label: 'Hero Split',
|
|
184
|
+
category: 'Sections',
|
|
185
|
+
content: `
|
|
186
|
+
<section class="py-16 px-4">
|
|
187
|
+
<div class="max-w-6xl mx-auto grid md:grid-cols-2 gap-12 items-center">
|
|
188
|
+
<div>
|
|
189
|
+
<h1 class="text-4xl font-bold mb-4">Build Something Amazing</h1>
|
|
190
|
+
<p class="text-lg text-gray-600 mb-6">Create beautiful, responsive websites without writing code. Drag, drop, and customize.</p>
|
|
191
|
+
<a href="#" class="inline-block bg-blue-600 text-white px-6 py-3 rounded-lg font-semibold">Learn More</a>
|
|
192
|
+
</div>
|
|
193
|
+
<div class="bg-gray-200 rounded-lg aspect-video flex items-center justify-center">
|
|
194
|
+
<span class="text-gray-500">Image Placeholder</span>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
</section>
|
|
198
|
+
`
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
bm.add('hero-centered', {
|
|
202
|
+
label: 'Hero Centered',
|
|
203
|
+
category: 'Sections',
|
|
204
|
+
content: `
|
|
205
|
+
<section class="py-24 px-4 bg-gradient-to-br from-blue-600 to-purple-700 text-white text-center">
|
|
206
|
+
<div class="max-w-3xl mx-auto">
|
|
207
|
+
<span class="inline-block px-4 py-1 bg-white/20 rounded-full text-sm font-medium mb-6">New Release</span>
|
|
208
|
+
<h1 class="text-5xl md:text-6xl font-bold mb-6">The Future is Here</h1>
|
|
209
|
+
<p class="text-xl text-white/80 mb-8">Experience the next generation of web building with our powerful visual editor.</p>
|
|
210
|
+
<div class="flex flex-col sm:flex-row gap-4 justify-center">
|
|
211
|
+
<a href="#" class="bg-white text-blue-600 px-8 py-3 rounded-lg font-semibold hover:bg-gray-100">Get Started Free</a>
|
|
212
|
+
<a href="#" class="border-2 border-white text-white px-8 py-3 rounded-lg font-semibold hover:bg-white/10">Watch Demo</a>
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
</section>
|
|
216
|
+
`
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
// --- Feature Sections ---
|
|
220
|
+
bm.add('features-grid', {
|
|
221
|
+
label: 'Features Grid',
|
|
222
|
+
category: 'Sections',
|
|
223
|
+
content: `
|
|
224
|
+
<section class="py-16 px-4 bg-gray-50">
|
|
225
|
+
<div class="max-w-6xl mx-auto">
|
|
226
|
+
<h2 class="text-3xl font-bold text-center mb-12">Features</h2>
|
|
227
|
+
<div class="grid md:grid-cols-3 gap-8">
|
|
228
|
+
<div class="text-center p-6">
|
|
229
|
+
<div class="w-12 h-12 bg-blue-600 rounded-lg mx-auto mb-4"></div>
|
|
230
|
+
<h3 class="text-xl font-semibold mb-2">Feature One</h3>
|
|
231
|
+
<p class="text-gray-600">Description of this amazing feature and why it matters.</p>
|
|
232
|
+
</div>
|
|
233
|
+
<div class="text-center p-6">
|
|
234
|
+
<div class="w-12 h-12 bg-blue-600 rounded-lg mx-auto mb-4"></div>
|
|
235
|
+
<h3 class="text-xl font-semibold mb-2">Feature Two</h3>
|
|
236
|
+
<p class="text-gray-600">Description of this amazing feature and why it matters.</p>
|
|
237
|
+
</div>
|
|
238
|
+
<div class="text-center p-6">
|
|
239
|
+
<div class="w-12 h-12 bg-blue-600 rounded-lg mx-auto mb-4"></div>
|
|
240
|
+
<h3 class="text-xl font-semibold mb-2">Feature Three</h3>
|
|
241
|
+
<p class="text-gray-600">Description of this amazing feature and why it matters.</p>
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
</div>
|
|
245
|
+
</section>
|
|
246
|
+
`
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
bm.add('features-alternating', {
|
|
250
|
+
label: 'Features Alt',
|
|
251
|
+
category: 'Sections',
|
|
252
|
+
content: `
|
|
253
|
+
<section class="py-16 px-4">
|
|
254
|
+
<div class="max-w-6xl mx-auto space-y-16">
|
|
255
|
+
<div class="grid md:grid-cols-2 gap-12 items-center">
|
|
256
|
+
<div class="bg-gray-200 rounded-lg aspect-video"></div>
|
|
257
|
+
<div>
|
|
258
|
+
<h3 class="text-2xl font-bold mb-4">Feature Title</h3>
|
|
259
|
+
<p class="text-gray-600 mb-4">Detailed description of this feature and its benefits for users.</p>
|
|
260
|
+
<a href="#" class="text-blue-600 font-semibold">Learn more →</a>
|
|
261
|
+
</div>
|
|
262
|
+
</div>
|
|
263
|
+
<div class="grid md:grid-cols-2 gap-12 items-center">
|
|
264
|
+
<div class="order-2 md:order-1">
|
|
265
|
+
<h3 class="text-2xl font-bold mb-4">Another Feature</h3>
|
|
266
|
+
<p class="text-gray-600 mb-4">Detailed description of this feature and its benefits for users.</p>
|
|
267
|
+
<a href="#" class="text-blue-600 font-semibold">Learn more →</a>
|
|
268
|
+
</div>
|
|
269
|
+
<div class="bg-gray-200 rounded-lg aspect-video order-1 md:order-2"></div>
|
|
270
|
+
</div>
|
|
271
|
+
</div>
|
|
272
|
+
</section>
|
|
273
|
+
`
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
// --- Cards ---
|
|
277
|
+
bm.add('card', {
|
|
278
|
+
label: 'Card',
|
|
279
|
+
category: 'Components',
|
|
280
|
+
content: `
|
|
281
|
+
<div class="bg-white rounded-lg shadow-md overflow-hidden max-w-sm">
|
|
282
|
+
<div class="bg-gray-200 h-48 flex items-center justify-center">
|
|
283
|
+
<span class="text-gray-500">Image</span>
|
|
284
|
+
</div>
|
|
285
|
+
<div class="p-6">
|
|
286
|
+
<h3 class="text-xl font-semibold mb-2">Card Title</h3>
|
|
287
|
+
<p class="text-gray-600 mb-4">Some description text for this card component.</p>
|
|
288
|
+
<a href="#" class="text-blue-600 font-semibold">Learn more →</a>
|
|
289
|
+
</div>
|
|
290
|
+
</div>
|
|
291
|
+
`
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
bm.add('cards-row', {
|
|
295
|
+
label: 'Cards Row',
|
|
296
|
+
category: 'Sections',
|
|
297
|
+
content: `
|
|
298
|
+
<section class="py-16 px-4">
|
|
299
|
+
<div class="max-w-6xl mx-auto grid md:grid-cols-3 gap-8">
|
|
300
|
+
<div class="bg-white rounded-lg shadow-md overflow-hidden">
|
|
301
|
+
<div class="bg-gray-200 h-48"></div>
|
|
302
|
+
<div class="p-6">
|
|
303
|
+
<h3 class="text-xl font-semibold mb-2">Card One</h3>
|
|
304
|
+
<p class="text-gray-600">Description text for this card.</p>
|
|
305
|
+
</div>
|
|
306
|
+
</div>
|
|
307
|
+
<div class="bg-white rounded-lg shadow-md overflow-hidden">
|
|
308
|
+
<div class="bg-gray-200 h-48"></div>
|
|
309
|
+
<div class="p-6">
|
|
310
|
+
<h3 class="text-xl font-semibold mb-2">Card Two</h3>
|
|
311
|
+
<p class="text-gray-600">Description text for this card.</p>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
<div class="bg-white rounded-lg shadow-md overflow-hidden">
|
|
315
|
+
<div class="bg-gray-200 h-48"></div>
|
|
316
|
+
<div class="p-6">
|
|
317
|
+
<h3 class="text-xl font-semibold mb-2">Card Three</h3>
|
|
318
|
+
<p class="text-gray-600">Description text for this card.</p>
|
|
319
|
+
</div>
|
|
320
|
+
</div>
|
|
321
|
+
</div>
|
|
322
|
+
</section>
|
|
323
|
+
`
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
// --- CTA ---
|
|
327
|
+
bm.add('cta-simple', {
|
|
328
|
+
label: 'CTA Section',
|
|
329
|
+
category: 'Sections',
|
|
330
|
+
content: `
|
|
331
|
+
<section class="py-16 px-4 bg-blue-600 text-white text-center">
|
|
332
|
+
<div class="max-w-3xl mx-auto">
|
|
333
|
+
<h2 class="text-3xl font-bold mb-4">Ready to Get Started?</h2>
|
|
334
|
+
<p class="text-blue-100 mb-8">Join thousands of satisfied customers using our product.</p>
|
|
335
|
+
<a href="#" class="inline-block bg-white text-blue-600 px-8 py-3 rounded-lg font-semibold hover:bg-gray-100">Start Free Trial</a>
|
|
336
|
+
</div>
|
|
337
|
+
</section>
|
|
338
|
+
`
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
// --- Testimonials ---
|
|
342
|
+
bm.add('testimonial', {
|
|
343
|
+
label: 'Testimonial',
|
|
344
|
+
category: 'Components',
|
|
345
|
+
content: `
|
|
346
|
+
<div class="bg-white p-8 rounded-lg shadow-md max-w-md">
|
|
347
|
+
<p class="text-gray-600 mb-6 italic">"This product has completely transformed how we work. Highly recommended!"</p>
|
|
348
|
+
<div class="flex items-center">
|
|
349
|
+
<div class="w-12 h-12 bg-gray-300 rounded-full mr-4"></div>
|
|
350
|
+
<div>
|
|
351
|
+
<div class="font-semibold">John Doe</div>
|
|
352
|
+
<div class="text-gray-500 text-sm">CEO, Company</div>
|
|
353
|
+
</div>
|
|
354
|
+
</div>
|
|
355
|
+
</div>
|
|
356
|
+
`
|
|
357
|
+
});
|
|
358
|
+
|
|
359
|
+
// --- Navigation ---
|
|
360
|
+
bm.add('navbar', {
|
|
361
|
+
label: 'Navbar',
|
|
362
|
+
category: 'Navigation',
|
|
363
|
+
content: `
|
|
364
|
+
<nav class="py-4 px-4 bg-white shadow-sm">
|
|
365
|
+
<div class="max-w-6xl mx-auto flex justify-between items-center">
|
|
366
|
+
<a href="#" class="text-xl font-bold">YourBrand</a>
|
|
367
|
+
<div class="flex gap-6">
|
|
368
|
+
<a href="#" class="text-gray-600 hover:text-gray-900">Home</a>
|
|
369
|
+
<a href="#" class="text-gray-600 hover:text-gray-900">About</a>
|
|
370
|
+
<a href="#" class="text-gray-600 hover:text-gray-900">Services</a>
|
|
371
|
+
<a href="#" class="text-gray-600 hover:text-gray-900">Contact</a>
|
|
372
|
+
</div>
|
|
373
|
+
<a href="#" class="bg-blue-600 text-white px-4 py-2 rounded-lg font-semibold">Sign Up</a>
|
|
374
|
+
</div>
|
|
375
|
+
</nav>
|
|
376
|
+
`
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
// --- Footer ---
|
|
380
|
+
bm.add('footer-simple', {
|
|
381
|
+
label: 'Footer',
|
|
382
|
+
category: 'Sections',
|
|
383
|
+
content: `
|
|
384
|
+
<footer class="py-8 px-4 bg-gray-900 text-white">
|
|
385
|
+
<div class="max-w-6xl mx-auto flex flex-col md:flex-row justify-between items-center">
|
|
386
|
+
<div class="text-xl font-bold mb-4 md:mb-0">YourBrand</div>
|
|
387
|
+
<nav class="flex gap-6 mb-4 md:mb-0">
|
|
388
|
+
<a href="#" class="text-gray-400 hover:text-white">Home</a>
|
|
389
|
+
<a href="#" class="text-gray-400 hover:text-white">About</a>
|
|
390
|
+
<a href="#" class="text-gray-400 hover:text-white">Services</a>
|
|
391
|
+
<a href="#" class="text-gray-400 hover:text-white">Contact</a>
|
|
392
|
+
</nav>
|
|
393
|
+
<div class="text-gray-400 text-sm">© 2024 YourBrand. All rights reserved.</div>
|
|
394
|
+
</div>
|
|
395
|
+
</footer>
|
|
396
|
+
`
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
// --- Pricing ---
|
|
400
|
+
bm.add('pricing-card', {
|
|
401
|
+
label: 'Pricing Card',
|
|
402
|
+
category: 'Components',
|
|
403
|
+
content: `
|
|
404
|
+
<div class="bg-white rounded-lg shadow-md p-8 text-center max-w-sm">
|
|
405
|
+
<h3 class="text-xl font-semibold mb-2">Pro Plan</h3>
|
|
406
|
+
<div class="text-4xl font-bold mb-4">$29<span class="text-lg text-gray-500">/mo</span></div>
|
|
407
|
+
<ul class="text-gray-600 mb-6 space-y-2">
|
|
408
|
+
<li>Unlimited Projects</li>
|
|
409
|
+
<li>Priority Support</li>
|
|
410
|
+
<li>Advanced Analytics</li>
|
|
411
|
+
<li>Custom Domain</li>
|
|
412
|
+
</ul>
|
|
413
|
+
<a href="#" class="block bg-blue-600 text-white py-3 rounded-lg font-semibold">Get Started</a>
|
|
414
|
+
</div>
|
|
415
|
+
`
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
// --- Forms ---
|
|
419
|
+
bm.add('contact-form', {
|
|
420
|
+
label: 'Contact Form',
|
|
421
|
+
category: 'Forms',
|
|
422
|
+
content: `
|
|
423
|
+
<form class="max-w-lg mx-auto p-8 bg-white rounded-lg shadow-md">
|
|
424
|
+
<h3 class="text-2xl font-bold mb-6">Contact Us</h3>
|
|
425
|
+
<div class="mb-4">
|
|
426
|
+
<label class="block text-gray-700 text-sm font-semibold mb-2">Name</label>
|
|
427
|
+
<input type="text" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Your name">
|
|
428
|
+
</div>
|
|
429
|
+
<div class="mb-4">
|
|
430
|
+
<label class="block text-gray-700 text-sm font-semibold mb-2">Email</label>
|
|
431
|
+
<input type="email" class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="your@email.com">
|
|
432
|
+
</div>
|
|
433
|
+
<div class="mb-4">
|
|
434
|
+
<label class="block text-gray-700 text-sm font-semibold mb-2">Message</label>
|
|
435
|
+
<textarea class="w-full px-4 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 h-32" placeholder="Your message"></textarea>
|
|
436
|
+
</div>
|
|
437
|
+
<button type="submit" class="w-full bg-blue-600 text-white py-3 rounded-lg font-semibold hover:bg-blue-700">Send Message</button>
|
|
438
|
+
</form>
|
|
439
|
+
`
|
|
440
|
+
});
|
|
441
|
+
|
|
442
|
+
bm.add('newsletter', {
|
|
443
|
+
label: 'Newsletter',
|
|
444
|
+
category: 'Forms',
|
|
445
|
+
content: `
|
|
446
|
+
<section class="py-12 px-4 bg-gray-100">
|
|
447
|
+
<div class="max-w-xl mx-auto text-center">
|
|
448
|
+
<h3 class="text-2xl font-bold mb-4">Subscribe to Our Newsletter</h3>
|
|
449
|
+
<p class="text-gray-600 mb-6">Get the latest updates delivered to your inbox.</p>
|
|
450
|
+
<form class="flex gap-2">
|
|
451
|
+
<input type="email" class="flex-1 px-4 py-3 border rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="your@email.com">
|
|
452
|
+
<button type="submit" class="bg-blue-600 text-white px-6 py-3 rounded-lg font-semibold hover:bg-blue-700">Subscribe</button>
|
|
453
|
+
</form>
|
|
454
|
+
</div>
|
|
455
|
+
</section>
|
|
456
|
+
`
|
|
457
|
+
});
|
|
458
|
+
|
|
459
|
+
// --- FAQ ---
|
|
460
|
+
bm.add('faq', {
|
|
461
|
+
label: 'FAQ Section',
|
|
462
|
+
category: 'Sections',
|
|
463
|
+
content: `
|
|
464
|
+
<section class="py-16 px-4">
|
|
465
|
+
<div class="max-w-3xl mx-auto">
|
|
466
|
+
<h2 class="text-3xl font-bold text-center mb-12">Frequently Asked Questions</h2>
|
|
467
|
+
<div class="space-y-4">
|
|
468
|
+
<details class="bg-white rounded-lg shadow-md">
|
|
469
|
+
<summary class="px-6 py-4 font-semibold cursor-pointer">What is your return policy?</summary>
|
|
470
|
+
<p class="px-6 pb-4 text-gray-600">We offer a 30-day money-back guarantee on all purchases.</p>
|
|
471
|
+
</details>
|
|
472
|
+
<details class="bg-white rounded-lg shadow-md">
|
|
473
|
+
<summary class="px-6 py-4 font-semibold cursor-pointer">How do I get started?</summary>
|
|
474
|
+
<p class="px-6 pb-4 text-gray-600">Sign up for a free account and follow our quick start guide.</p>
|
|
475
|
+
</details>
|
|
476
|
+
<details class="bg-white rounded-lg shadow-md">
|
|
477
|
+
<summary class="px-6 py-4 font-semibold cursor-pointer">Do you offer support?</summary>
|
|
478
|
+
<p class="px-6 pb-4 text-gray-600">Yes! We have 24/7 support available via chat, email, and phone.</p>
|
|
479
|
+
</details>
|
|
480
|
+
</div>
|
|
481
|
+
</div>
|
|
482
|
+
</section>
|
|
483
|
+
`
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Bootstrap 5 blocks
|
|
489
|
+
*/
|
|
490
|
+
function addBootstrapBlocks(bm) {
|
|
491
|
+
// --- Layout ---
|
|
492
|
+
bm.add('section', {
|
|
493
|
+
label: 'Section',
|
|
494
|
+
category: 'Layout',
|
|
495
|
+
content: '<section class="py-5"><div class="container"></div></section>'
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
bm.add('container', {
|
|
499
|
+
label: 'Container',
|
|
500
|
+
category: 'Layout',
|
|
501
|
+
content: '<div class="container"></div>'
|
|
502
|
+
});
|
|
503
|
+
|
|
504
|
+
bm.add('container-fluid', {
|
|
505
|
+
label: 'Container Fluid',
|
|
506
|
+
category: 'Layout',
|
|
507
|
+
content: '<div class="container-fluid"></div>'
|
|
508
|
+
});
|
|
509
|
+
|
|
510
|
+
bm.add('row', {
|
|
511
|
+
label: 'Row',
|
|
512
|
+
category: 'Layout',
|
|
513
|
+
content: '<div class="row"></div>'
|
|
514
|
+
});
|
|
515
|
+
|
|
516
|
+
bm.add('col-6', {
|
|
517
|
+
label: '2 Columns',
|
|
518
|
+
category: 'Layout',
|
|
519
|
+
content: '<div class="row"><div class="col-md-6"></div><div class="col-md-6"></div></div>'
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
bm.add('col-4', {
|
|
523
|
+
label: '3 Columns',
|
|
524
|
+
category: 'Layout',
|
|
525
|
+
content: '<div class="row"><div class="col-md-4"></div><div class="col-md-4"></div><div class="col-md-4"></div></div>'
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
bm.add('col-3', {
|
|
529
|
+
label: '4 Columns',
|
|
530
|
+
category: 'Layout',
|
|
531
|
+
content: '<div class="row"><div class="col-md-3"></div><div class="col-md-3"></div><div class="col-md-3"></div><div class="col-md-3"></div></div>'
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
// --- Typography ---
|
|
535
|
+
bm.add('heading-1', {
|
|
536
|
+
label: 'Heading 1',
|
|
537
|
+
category: 'Typography',
|
|
538
|
+
content: '<h1 class="display-4">Heading 1</h1>'
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
bm.add('heading-2', {
|
|
542
|
+
label: 'Heading 2',
|
|
543
|
+
category: 'Typography',
|
|
544
|
+
content: '<h2 class="display-5">Heading 2</h2>'
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
bm.add('heading-3', {
|
|
548
|
+
label: 'Heading 3',
|
|
549
|
+
category: 'Typography',
|
|
550
|
+
content: '<h3 class="display-6">Heading 3</h3>'
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
bm.add('paragraph', {
|
|
554
|
+
label: 'Paragraph',
|
|
555
|
+
category: 'Typography',
|
|
556
|
+
content: '<p class="lead">Your paragraph text goes here. Edit this text to add your own content.</p>'
|
|
557
|
+
});
|
|
558
|
+
|
|
559
|
+
bm.add('text-muted', {
|
|
560
|
+
label: 'Muted Text',
|
|
561
|
+
category: 'Typography',
|
|
562
|
+
content: '<p class="text-muted">Secondary text with muted color.</p>'
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
// --- Buttons ---
|
|
566
|
+
bm.add('button-primary', {
|
|
567
|
+
label: 'Primary Button',
|
|
568
|
+
category: 'Buttons',
|
|
569
|
+
content: '<a href="#" class="btn btn-primary btn-lg">Button</a>'
|
|
570
|
+
});
|
|
571
|
+
|
|
572
|
+
bm.add('button-secondary', {
|
|
573
|
+
label: 'Secondary Button',
|
|
574
|
+
category: 'Buttons',
|
|
575
|
+
content: '<a href="#" class="btn btn-secondary btn-lg">Button</a>'
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
bm.add('button-outline', {
|
|
579
|
+
label: 'Outline Button',
|
|
580
|
+
category: 'Buttons',
|
|
581
|
+
content: '<a href="#" class="btn btn-outline-primary btn-lg">Button</a>'
|
|
582
|
+
});
|
|
583
|
+
|
|
584
|
+
bm.add('button-success', {
|
|
585
|
+
label: 'Success Button',
|
|
586
|
+
category: 'Buttons',
|
|
587
|
+
content: '<a href="#" class="btn btn-success btn-lg">Button</a>'
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
bm.add('button-danger', {
|
|
591
|
+
label: 'Danger Button',
|
|
592
|
+
category: 'Buttons',
|
|
593
|
+
content: '<a href="#" class="btn btn-danger btn-lg">Button</a>'
|
|
594
|
+
});
|
|
595
|
+
|
|
596
|
+
// --- Hero Sections ---
|
|
597
|
+
bm.add('hero-simple', {
|
|
598
|
+
label: 'Hero Simple',
|
|
599
|
+
category: 'Sections',
|
|
600
|
+
content: `
|
|
601
|
+
<section class="py-5 bg-dark text-white text-center">
|
|
602
|
+
<div class="container py-5">
|
|
603
|
+
<h1 class="display-3 fw-bold mb-4">Welcome to Your Site</h1>
|
|
604
|
+
<p class="lead mb-4">A beautiful subtitle that describes what you do and why visitors should care.</p>
|
|
605
|
+
<a href="#" class="btn btn-primary btn-lg">Get Started</a>
|
|
606
|
+
</div>
|
|
607
|
+
</section>
|
|
608
|
+
`
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
bm.add('hero-split', {
|
|
612
|
+
label: 'Hero Split',
|
|
613
|
+
category: 'Sections',
|
|
614
|
+
content: `
|
|
615
|
+
<section class="py-5">
|
|
616
|
+
<div class="container">
|
|
617
|
+
<div class="row align-items-center">
|
|
618
|
+
<div class="col-md-6">
|
|
619
|
+
<h1 class="display-4 fw-bold mb-3">Build Something Amazing</h1>
|
|
620
|
+
<p class="lead text-muted mb-4">Create beautiful, responsive websites without writing code.</p>
|
|
621
|
+
<a href="#" class="btn btn-primary btn-lg">Learn More</a>
|
|
622
|
+
</div>
|
|
623
|
+
<div class="col-md-6">
|
|
624
|
+
<div class="bg-secondary rounded ratio ratio-16x9 d-flex align-items-center justify-content-center">
|
|
625
|
+
<span class="text-white">Image Placeholder</span>
|
|
626
|
+
</div>
|
|
627
|
+
</div>
|
|
628
|
+
</div>
|
|
629
|
+
</div>
|
|
630
|
+
</section>
|
|
631
|
+
`
|
|
632
|
+
});
|
|
633
|
+
|
|
634
|
+
bm.add('jumbotron', {
|
|
635
|
+
label: 'Jumbotron',
|
|
636
|
+
category: 'Sections',
|
|
637
|
+
content: `
|
|
638
|
+
<div class="p-5 mb-4 bg-light rounded-3">
|
|
639
|
+
<div class="container py-5">
|
|
640
|
+
<h1 class="display-4 fw-bold">Custom Jumbotron</h1>
|
|
641
|
+
<p class="col-md-8 fs-4">Using a series of utilities, you can create this jumbotron.</p>
|
|
642
|
+
<a href="#" class="btn btn-primary btn-lg">Call to action</a>
|
|
643
|
+
</div>
|
|
644
|
+
</div>
|
|
645
|
+
`
|
|
646
|
+
});
|
|
647
|
+
|
|
648
|
+
// --- Cards ---
|
|
649
|
+
bm.add('card', {
|
|
650
|
+
label: 'Card',
|
|
651
|
+
category: 'Components',
|
|
652
|
+
content: `
|
|
653
|
+
<div class="card" style="width: 18rem;">
|
|
654
|
+
<div class="bg-secondary" style="height: 180px;"></div>
|
|
655
|
+
<div class="card-body">
|
|
656
|
+
<h5 class="card-title">Card Title</h5>
|
|
657
|
+
<p class="card-text">Some quick example text to build on the card title.</p>
|
|
658
|
+
<a href="#" class="btn btn-primary">Go somewhere</a>
|
|
659
|
+
</div>
|
|
660
|
+
</div>
|
|
661
|
+
`
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
bm.add('cards-row', {
|
|
665
|
+
label: 'Cards Row',
|
|
666
|
+
category: 'Sections',
|
|
667
|
+
content: `
|
|
668
|
+
<section class="py-5">
|
|
669
|
+
<div class="container">
|
|
670
|
+
<div class="row g-4">
|
|
671
|
+
<div class="col-md-4">
|
|
672
|
+
<div class="card h-100">
|
|
673
|
+
<div class="bg-secondary" style="height: 180px;"></div>
|
|
674
|
+
<div class="card-body">
|
|
675
|
+
<h5 class="card-title">Card One</h5>
|
|
676
|
+
<p class="card-text">Description text for this card.</p>
|
|
677
|
+
</div>
|
|
678
|
+
</div>
|
|
679
|
+
</div>
|
|
680
|
+
<div class="col-md-4">
|
|
681
|
+
<div class="card h-100">
|
|
682
|
+
<div class="bg-secondary" style="height: 180px;"></div>
|
|
683
|
+
<div class="card-body">
|
|
684
|
+
<h5 class="card-title">Card Two</h5>
|
|
685
|
+
<p class="card-text">Description text for this card.</p>
|
|
686
|
+
</div>
|
|
687
|
+
</div>
|
|
688
|
+
</div>
|
|
689
|
+
<div class="col-md-4">
|
|
690
|
+
<div class="card h-100">
|
|
691
|
+
<div class="bg-secondary" style="height: 180px;"></div>
|
|
692
|
+
<div class="card-body">
|
|
693
|
+
<h5 class="card-title">Card Three</h5>
|
|
694
|
+
<p class="card-text">Description text for this card.</p>
|
|
695
|
+
</div>
|
|
696
|
+
</div>
|
|
697
|
+
</div>
|
|
698
|
+
</div>
|
|
699
|
+
</div>
|
|
700
|
+
</section>
|
|
701
|
+
`
|
|
702
|
+
});
|
|
703
|
+
|
|
704
|
+
// --- Alerts ---
|
|
705
|
+
bm.add('alert-primary', {
|
|
706
|
+
label: 'Alert Primary',
|
|
707
|
+
category: 'Components',
|
|
708
|
+
content: '<div class="alert alert-primary" role="alert">A simple primary alert—check it out!</div>'
|
|
709
|
+
});
|
|
710
|
+
|
|
711
|
+
bm.add('alert-success', {
|
|
712
|
+
label: 'Alert Success',
|
|
713
|
+
category: 'Components',
|
|
714
|
+
content: '<div class="alert alert-success" role="alert">A simple success alert—check it out!</div>'
|
|
715
|
+
});
|
|
716
|
+
|
|
717
|
+
bm.add('alert-warning', {
|
|
718
|
+
label: 'Alert Warning',
|
|
719
|
+
category: 'Components',
|
|
720
|
+
content: '<div class="alert alert-warning" role="alert">A simple warning alert—check it out!</div>'
|
|
721
|
+
});
|
|
722
|
+
|
|
723
|
+
// --- Navigation ---
|
|
724
|
+
bm.add('navbar', {
|
|
725
|
+
label: 'Navbar',
|
|
726
|
+
category: 'Navigation',
|
|
727
|
+
content: `
|
|
728
|
+
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
|
729
|
+
<div class="container">
|
|
730
|
+
<a class="navbar-brand fw-bold" href="#">YourBrand</a>
|
|
731
|
+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
|
|
732
|
+
<span class="navbar-toggler-icon"></span>
|
|
733
|
+
</button>
|
|
734
|
+
<div class="collapse navbar-collapse" id="navbarNav">
|
|
735
|
+
<ul class="navbar-nav me-auto">
|
|
736
|
+
<li class="nav-item"><a class="nav-link active" href="#">Home</a></li>
|
|
737
|
+
<li class="nav-item"><a class="nav-link" href="#">About</a></li>
|
|
738
|
+
<li class="nav-item"><a class="nav-link" href="#">Services</a></li>
|
|
739
|
+
<li class="nav-item"><a class="nav-link" href="#">Contact</a></li>
|
|
740
|
+
</ul>
|
|
741
|
+
<a href="#" class="btn btn-primary">Sign Up</a>
|
|
742
|
+
</div>
|
|
743
|
+
</div>
|
|
744
|
+
</nav>
|
|
745
|
+
`
|
|
746
|
+
});
|
|
747
|
+
|
|
748
|
+
bm.add('navbar-dark', {
|
|
749
|
+
label: 'Navbar Dark',
|
|
750
|
+
category: 'Navigation',
|
|
751
|
+
content: `
|
|
752
|
+
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
|
753
|
+
<div class="container">
|
|
754
|
+
<a class="navbar-brand fw-bold" href="#">YourBrand</a>
|
|
755
|
+
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarDark">
|
|
756
|
+
<span class="navbar-toggler-icon"></span>
|
|
757
|
+
</button>
|
|
758
|
+
<div class="collapse navbar-collapse" id="navbarDark">
|
|
759
|
+
<ul class="navbar-nav me-auto">
|
|
760
|
+
<li class="nav-item"><a class="nav-link active" href="#">Home</a></li>
|
|
761
|
+
<li class="nav-item"><a class="nav-link" href="#">About</a></li>
|
|
762
|
+
<li class="nav-item"><a class="nav-link" href="#">Services</a></li>
|
|
763
|
+
</ul>
|
|
764
|
+
<a href="#" class="btn btn-outline-light">Sign Up</a>
|
|
765
|
+
</div>
|
|
766
|
+
</div>
|
|
767
|
+
</nav>
|
|
768
|
+
`
|
|
769
|
+
});
|
|
770
|
+
|
|
771
|
+
// --- Footer ---
|
|
772
|
+
bm.add('footer-simple', {
|
|
773
|
+
label: 'Footer',
|
|
774
|
+
category: 'Sections',
|
|
775
|
+
content: `
|
|
776
|
+
<footer class="py-4 bg-dark text-white">
|
|
777
|
+
<div class="container">
|
|
778
|
+
<div class="row align-items-center">
|
|
779
|
+
<div class="col-md-4">
|
|
780
|
+
<span class="fw-bold">YourBrand</span>
|
|
781
|
+
</div>
|
|
782
|
+
<div class="col-md-4 text-center">
|
|
783
|
+
<a href="#" class="text-white-50 me-3">Home</a>
|
|
784
|
+
<a href="#" class="text-white-50 me-3">About</a>
|
|
785
|
+
<a href="#" class="text-white-50 me-3">Services</a>
|
|
786
|
+
<a href="#" class="text-white-50">Contact</a>
|
|
787
|
+
</div>
|
|
788
|
+
<div class="col-md-4 text-end">
|
|
789
|
+
<small class="text-white-50">© 2024 YourBrand</small>
|
|
790
|
+
</div>
|
|
791
|
+
</div>
|
|
792
|
+
</div>
|
|
793
|
+
</footer>
|
|
794
|
+
`
|
|
795
|
+
});
|
|
796
|
+
|
|
797
|
+
// --- Forms ---
|
|
798
|
+
bm.add('contact-form', {
|
|
799
|
+
label: 'Contact Form',
|
|
800
|
+
category: 'Forms',
|
|
801
|
+
content: `
|
|
802
|
+
<div class="card">
|
|
803
|
+
<div class="card-body p-4">
|
|
804
|
+
<h3 class="card-title mb-4">Contact Us</h3>
|
|
805
|
+
<form>
|
|
806
|
+
<div class="mb-3">
|
|
807
|
+
<label class="form-label">Name</label>
|
|
808
|
+
<input type="text" class="form-control" placeholder="Your name">
|
|
809
|
+
</div>
|
|
810
|
+
<div class="mb-3">
|
|
811
|
+
<label class="form-label">Email</label>
|
|
812
|
+
<input type="email" class="form-control" placeholder="your@email.com">
|
|
813
|
+
</div>
|
|
814
|
+
<div class="mb-3">
|
|
815
|
+
<label class="form-label">Message</label>
|
|
816
|
+
<textarea class="form-control" rows="4" placeholder="Your message"></textarea>
|
|
817
|
+
</div>
|
|
818
|
+
<button type="submit" class="btn btn-primary w-100">Send Message</button>
|
|
819
|
+
</form>
|
|
820
|
+
</div>
|
|
821
|
+
</div>
|
|
822
|
+
`
|
|
823
|
+
});
|
|
824
|
+
|
|
825
|
+
bm.add('newsletter', {
|
|
826
|
+
label: 'Newsletter',
|
|
827
|
+
category: 'Forms',
|
|
828
|
+
content: `
|
|
829
|
+
<section class="py-5 bg-light">
|
|
830
|
+
<div class="container">
|
|
831
|
+
<div class="row justify-content-center">
|
|
832
|
+
<div class="col-md-6 text-center">
|
|
833
|
+
<h3 class="mb-3">Subscribe to Our Newsletter</h3>
|
|
834
|
+
<p class="text-muted mb-4">Get the latest updates delivered to your inbox.</p>
|
|
835
|
+
<form class="d-flex gap-2">
|
|
836
|
+
<input type="email" class="form-control" placeholder="your@email.com">
|
|
837
|
+
<button type="submit" class="btn btn-primary">Subscribe</button>
|
|
838
|
+
</form>
|
|
839
|
+
</div>
|
|
840
|
+
</div>
|
|
841
|
+
</div>
|
|
842
|
+
</section>
|
|
843
|
+
`
|
|
844
|
+
});
|
|
845
|
+
|
|
846
|
+
// --- Accordion ---
|
|
847
|
+
bm.add('accordion', {
|
|
848
|
+
label: 'Accordion',
|
|
849
|
+
category: 'Components',
|
|
850
|
+
content: `
|
|
851
|
+
<div class="accordion" id="accordionExample">
|
|
852
|
+
<div class="accordion-item">
|
|
853
|
+
<h2 class="accordion-header">
|
|
854
|
+
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapseOne">
|
|
855
|
+
Accordion Item #1
|
|
856
|
+
</button>
|
|
857
|
+
</h2>
|
|
858
|
+
<div id="collapseOne" class="accordion-collapse collapse show" data-bs-parent="#accordionExample">
|
|
859
|
+
<div class="accordion-body">Content for the first item.</div>
|
|
860
|
+
</div>
|
|
861
|
+
</div>
|
|
862
|
+
<div class="accordion-item">
|
|
863
|
+
<h2 class="accordion-header">
|
|
864
|
+
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#collapseTwo">
|
|
865
|
+
Accordion Item #2
|
|
866
|
+
</button>
|
|
867
|
+
</h2>
|
|
868
|
+
<div id="collapseTwo" class="accordion-collapse collapse" data-bs-parent="#accordionExample">
|
|
869
|
+
<div class="accordion-body">Content for the second item.</div>
|
|
870
|
+
</div>
|
|
871
|
+
</div>
|
|
872
|
+
</div>
|
|
873
|
+
`
|
|
874
|
+
});
|
|
875
|
+
|
|
876
|
+
// --- Pricing ---
|
|
877
|
+
bm.add('pricing-card', {
|
|
878
|
+
label: 'Pricing Card',
|
|
879
|
+
category: 'Components',
|
|
880
|
+
content: `
|
|
881
|
+
<div class="card text-center">
|
|
882
|
+
<div class="card-header">
|
|
883
|
+
<h4 class="my-0 fw-normal">Pro</h4>
|
|
884
|
+
</div>
|
|
885
|
+
<div class="card-body">
|
|
886
|
+
<h1 class="card-title">$29 <small class="text-muted fw-light">/mo</small></h1>
|
|
887
|
+
<ul class="list-unstyled mt-3 mb-4">
|
|
888
|
+
<li>Unlimited projects</li>
|
|
889
|
+
<li>Priority support</li>
|
|
890
|
+
<li>Advanced analytics</li>
|
|
891
|
+
<li>Custom domain</li>
|
|
892
|
+
</ul>
|
|
893
|
+
<a href="#" class="btn btn-lg btn-primary w-100">Get Started</a>
|
|
894
|
+
</div>
|
|
895
|
+
</div>
|
|
896
|
+
`
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
/**
|
|
901
|
+
* Vanilla CSS blocks (no framework)
|
|
902
|
+
*/
|
|
903
|
+
function addVanillaBlocks(bm) {
|
|
904
|
+
// --- Layout ---
|
|
905
|
+
bm.add('section', {
|
|
906
|
+
label: 'Section',
|
|
907
|
+
category: 'Layout',
|
|
908
|
+
content: '<section style="padding: 60px 20px;"><div style="max-width: 1200px; margin: 0 auto;"></div></section>'
|
|
909
|
+
});
|
|
910
|
+
|
|
911
|
+
bm.add('container', {
|
|
912
|
+
label: 'Container',
|
|
913
|
+
category: 'Layout',
|
|
914
|
+
content: '<div style="max-width: 1200px; margin: 0 auto; padding: 0 20px;"></div>'
|
|
915
|
+
});
|
|
916
|
+
|
|
917
|
+
bm.add('flex-row', {
|
|
918
|
+
label: 'Flex Row',
|
|
919
|
+
category: 'Layout',
|
|
920
|
+
content: '<div style="display: flex; flex-direction: row; gap: 20px;"></div>'
|
|
921
|
+
});
|
|
922
|
+
|
|
923
|
+
bm.add('flex-col', {
|
|
924
|
+
label: 'Flex Column',
|
|
925
|
+
category: 'Layout',
|
|
926
|
+
content: '<div style="display: flex; flex-direction: column; gap: 20px;"></div>'
|
|
927
|
+
});
|
|
928
|
+
|
|
929
|
+
bm.add('grid-2', {
|
|
930
|
+
label: 'Grid 2 Cols',
|
|
931
|
+
category: 'Layout',
|
|
932
|
+
content: '<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;"></div>'
|
|
933
|
+
});
|
|
934
|
+
|
|
935
|
+
bm.add('grid-3', {
|
|
936
|
+
label: 'Grid 3 Cols',
|
|
937
|
+
category: 'Layout',
|
|
938
|
+
content: '<div style="display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;"></div>'
|
|
939
|
+
});
|
|
940
|
+
|
|
941
|
+
// --- Typography ---
|
|
942
|
+
bm.add('heading-1', {
|
|
943
|
+
label: 'Heading 1',
|
|
944
|
+
category: 'Typography',
|
|
945
|
+
content: '<h1 style="font-size: 3rem; font-weight: bold; margin-bottom: 1rem;">Heading 1</h1>'
|
|
946
|
+
});
|
|
947
|
+
|
|
948
|
+
bm.add('heading-2', {
|
|
949
|
+
label: 'Heading 2',
|
|
950
|
+
category: 'Typography',
|
|
951
|
+
content: '<h2 style="font-size: 2.25rem; font-weight: bold; margin-bottom: 1rem;">Heading 2</h2>'
|
|
952
|
+
});
|
|
953
|
+
|
|
954
|
+
bm.add('heading-3', {
|
|
955
|
+
label: 'Heading 3',
|
|
956
|
+
category: 'Typography',
|
|
957
|
+
content: '<h3 style="font-size: 1.5rem; font-weight: 600; margin-bottom: 1rem;">Heading 3</h3>'
|
|
958
|
+
});
|
|
959
|
+
|
|
960
|
+
bm.add('paragraph', {
|
|
961
|
+
label: 'Paragraph',
|
|
962
|
+
category: 'Typography',
|
|
963
|
+
content: '<p style="font-size: 1rem; line-height: 1.6; color: #555;">Your paragraph text goes here. Edit this text to add your own content.</p>'
|
|
964
|
+
});
|
|
965
|
+
|
|
966
|
+
// --- Buttons ---
|
|
967
|
+
bm.add('button-primary', {
|
|
968
|
+
label: 'Primary Button',
|
|
969
|
+
category: 'Buttons',
|
|
970
|
+
content: '<a href="#" style="display: inline-block; background: #2563eb; color: white; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 600;">Button</a>'
|
|
971
|
+
});
|
|
972
|
+
|
|
973
|
+
bm.add('button-secondary', {
|
|
974
|
+
label: 'Secondary Button',
|
|
975
|
+
category: 'Buttons',
|
|
976
|
+
content: '<a href="#" style="display: inline-block; background: #e5e7eb; color: #374151; padding: 12px 24px; border-radius: 8px; text-decoration: none; font-weight: 600;">Button</a>'
|
|
977
|
+
});
|
|
978
|
+
|
|
979
|
+
bm.add('button-outline', {
|
|
980
|
+
label: 'Outline Button',
|
|
981
|
+
category: 'Buttons',
|
|
982
|
+
content: '<a href="#" style="display: inline-block; border: 2px solid #2563eb; color: #2563eb; padding: 10px 22px; border-radius: 8px; text-decoration: none; font-weight: 600;">Button</a>'
|
|
983
|
+
});
|
|
984
|
+
|
|
985
|
+
// --- Hero ---
|
|
986
|
+
bm.add('hero-simple', {
|
|
987
|
+
label: 'Hero Simple',
|
|
988
|
+
category: 'Sections',
|
|
989
|
+
content: `
|
|
990
|
+
<section style="padding: 80px 20px; background: #1f2937; color: white; text-align: center;">
|
|
991
|
+
<div style="max-width: 800px; margin: 0 auto;">
|
|
992
|
+
<h1 style="font-size: 3rem; font-weight: bold; margin-bottom: 1.5rem;">Welcome to Your Site</h1>
|
|
993
|
+
<p style="font-size: 1.25rem; color: #9ca3af; margin-bottom: 2rem;">A beautiful subtitle that describes what you do.</p>
|
|
994
|
+
<a href="#" style="display: inline-block; background: #2563eb; color: white; padding: 12px 32px; border-radius: 8px; text-decoration: none; font-weight: 600;">Get Started</a>
|
|
995
|
+
</div>
|
|
996
|
+
</section>
|
|
997
|
+
`
|
|
998
|
+
});
|
|
999
|
+
|
|
1000
|
+
// --- Card ---
|
|
1001
|
+
bm.add('card', {
|
|
1002
|
+
label: 'Card',
|
|
1003
|
+
category: 'Components',
|
|
1004
|
+
content: `
|
|
1005
|
+
<div style="background: white; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); overflow: hidden; max-width: 350px;">
|
|
1006
|
+
<div style="background: #e5e7eb; height: 180px;"></div>
|
|
1007
|
+
<div style="padding: 24px;">
|
|
1008
|
+
<h3 style="font-size: 1.25rem; font-weight: 600; margin-bottom: 0.5rem;">Card Title</h3>
|
|
1009
|
+
<p style="color: #6b7280; margin-bottom: 1rem;">Some description text for this card.</p>
|
|
1010
|
+
<a href="#" style="color: #2563eb; text-decoration: none; font-weight: 600;">Learn more →</a>
|
|
1011
|
+
</div>
|
|
1012
|
+
</div>
|
|
1013
|
+
`
|
|
1014
|
+
});
|
|
1015
|
+
|
|
1016
|
+
// --- Navbar ---
|
|
1017
|
+
bm.add('navbar', {
|
|
1018
|
+
label: 'Navbar',
|
|
1019
|
+
category: 'Navigation',
|
|
1020
|
+
content: `
|
|
1021
|
+
<nav style="padding: 16px 20px; background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">
|
|
1022
|
+
<div style="max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center;">
|
|
1023
|
+
<a href="#" style="font-size: 1.25rem; font-weight: bold; text-decoration: none; color: #111;">YourBrand</a>
|
|
1024
|
+
<div style="display: flex; gap: 24px;">
|
|
1025
|
+
<a href="#" style="color: #555; text-decoration: none;">Home</a>
|
|
1026
|
+
<a href="#" style="color: #555; text-decoration: none;">About</a>
|
|
1027
|
+
<a href="#" style="color: #555; text-decoration: none;">Services</a>
|
|
1028
|
+
<a href="#" style="color: #555; text-decoration: none;">Contact</a>
|
|
1029
|
+
</div>
|
|
1030
|
+
<a href="#" style="display: inline-block; background: #2563eb; color: white; padding: 8px 16px; border-radius: 6px; text-decoration: none; font-weight: 600;">Sign Up</a>
|
|
1031
|
+
</div>
|
|
1032
|
+
</nav>
|
|
1033
|
+
`
|
|
1034
|
+
});
|
|
1035
|
+
|
|
1036
|
+
// --- Footer ---
|
|
1037
|
+
bm.add('footer-simple', {
|
|
1038
|
+
label: 'Footer',
|
|
1039
|
+
category: 'Sections',
|
|
1040
|
+
content: `
|
|
1041
|
+
<footer style="padding: 32px 20px; background: #1f2937; color: white;">
|
|
1042
|
+
<div style="max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px;">
|
|
1043
|
+
<span style="font-weight: bold;">YourBrand</span>
|
|
1044
|
+
<div style="display: flex; gap: 24px;">
|
|
1045
|
+
<a href="#" style="color: #9ca3af; text-decoration: none;">Home</a>
|
|
1046
|
+
<a href="#" style="color: #9ca3af; text-decoration: none;">About</a>
|
|
1047
|
+
<a href="#" style="color: #9ca3af; text-decoration: none;">Contact</a>
|
|
1048
|
+
</div>
|
|
1049
|
+
<span style="color: #9ca3af; font-size: 0.875rem;">© 2024 YourBrand</span>
|
|
1050
|
+
</div>
|
|
1051
|
+
</footer>
|
|
1052
|
+
`
|
|
1053
|
+
});
|
|
1054
|
+
|
|
1055
|
+
// --- Contact Form ---
|
|
1056
|
+
bm.add('contact-form', {
|
|
1057
|
+
label: 'Contact Form',
|
|
1058
|
+
category: 'Forms',
|
|
1059
|
+
content: `
|
|
1060
|
+
<form style="max-width: 500px; margin: 0 auto; padding: 32px; background: white; border-radius: 8px; box-shadow: 0 4px 6px rgba(0,0,0,0.1);">
|
|
1061
|
+
<h3 style="font-size: 1.5rem; font-weight: bold; margin-bottom: 1.5rem;">Contact Us</h3>
|
|
1062
|
+
<div style="margin-bottom: 16px;">
|
|
1063
|
+
<label style="display: block; margin-bottom: 8px; font-weight: 500;">Name</label>
|
|
1064
|
+
<input type="text" placeholder="Your name" style="width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 6px; box-sizing: border-box;">
|
|
1065
|
+
</div>
|
|
1066
|
+
<div style="margin-bottom: 16px;">
|
|
1067
|
+
<label style="display: block; margin-bottom: 8px; font-weight: 500;">Email</label>
|
|
1068
|
+
<input type="email" placeholder="your@email.com" style="width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 6px; box-sizing: border-box;">
|
|
1069
|
+
</div>
|
|
1070
|
+
<div style="margin-bottom: 16px;">
|
|
1071
|
+
<label style="display: block; margin-bottom: 8px; font-weight: 500;">Message</label>
|
|
1072
|
+
<textarea placeholder="Your message" style="width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 6px; height: 120px; box-sizing: border-box;"></textarea>
|
|
1073
|
+
</div>
|
|
1074
|
+
<button type="submit" style="width: 100%; padding: 12px; background: #2563eb; color: white; border: none; border-radius: 6px; font-weight: 600; cursor: pointer;">Send Message</button>
|
|
1075
|
+
</form>
|
|
1076
|
+
`
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
// Expose function
|
|
1081
|
+
window.ActiveCanvasEditor.addCustomBlocks = addCustomBlocks;
|
|
1082
|
+
|
|
1083
|
+
})();
|