Update builder.html
Browse files- builder.html +70 -76
builder.html
CHANGED
@@ -4,11 +4,7 @@
|
|
4 |
<meta charset="utf-8">
|
5 |
<title>GrapesJS</title>
|
6 |
<link rel="stylesheet" href="https://unpkg.com/grapesjs/dist/css/grapes.min.css">
|
7 |
-
|
8 |
<script src="https://unpkg.com/grapesjs"></script>
|
9 |
-
|
10 |
-
<script src="path/to/grapesjs-custom-code.min.js"></script>
|
11 |
-
|
12 |
<style>
|
13 |
body,
|
14 |
html {
|
@@ -32,7 +28,7 @@
|
|
32 |
This is a demo content from index.html. For the development, you shouldn't edit this file, instead you can
|
33 |
copy and rename it to _index.html, on next server start the new file will be served, and it will be ignored by git.
|
34 |
</div>
|
35 |
-
<button class="add-button"
|
36 |
</div>
|
37 |
<style>
|
38 |
.panel {
|
@@ -41,9 +37,9 @@
|
|
41 |
border-radius: 3px;
|
42 |
padding: 30px 20px;
|
43 |
margin: 150px auto 0px;
|
44 |
-
background-color: #
|
45 |
box-shadow: 0px 3px 10px 0px rgba(0,0,0,0.25);
|
46 |
-
color:rgba(
|
47 |
font: caption;
|
48 |
font-weight: 100;
|
49 |
}
|
@@ -80,7 +76,7 @@
|
|
80 |
padding: 10px 20px;
|
81 |
font-size: 1rem;
|
82 |
color: #fff;
|
83 |
-
background-color: #
|
84 |
border: none;
|
85 |
border-radius: 5px;
|
86 |
cursor: pointer;
|
@@ -88,73 +84,71 @@
|
|
88 |
</style>
|
89 |
</div>
|
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 |
-
</script>
|
159 |
</body>
|
160 |
</html>
|
|
|
4 |
<meta charset="utf-8">
|
5 |
<title>GrapesJS</title>
|
6 |
<link rel="stylesheet" href="https://unpkg.com/grapesjs/dist/css/grapes.min.css">
|
|
|
7 |
<script src="https://unpkg.com/grapesjs"></script>
|
|
|
|
|
|
|
8 |
<style>
|
9 |
body,
|
10 |
html {
|
|
|
28 |
This is a demo content from index.html. For the development, you shouldn't edit this file, instead you can
|
29 |
copy and rename it to _index.html, on next server start the new file will be served, and it will be ignored by git.
|
30 |
</div>
|
31 |
+
<button class="add-button">Ещё добавь</button>
|
32 |
</div>
|
33 |
<style>
|
34 |
.panel {
|
|
|
37 |
border-radius: 3px;
|
38 |
padding: 30px 20px;
|
39 |
margin: 150px auto 0px;
|
40 |
+
background-color: #d983a6;
|
41 |
box-shadow: 0px 3px 10px 0px rgba(0,0,0,0.25);
|
42 |
+
color:rgba(255,255,255,0.75);
|
43 |
font: caption;
|
44 |
font-weight: 100;
|
45 |
}
|
|
|
76 |
padding: 10px 20px;
|
77 |
font-size: 1rem;
|
78 |
color: #fff;
|
79 |
+
background-color: #007bff;
|
80 |
border: none;
|
81 |
border-radius: 5px;
|
82 |
cursor: pointer;
|
|
|
84 |
</style>
|
85 |
</div>
|
86 |
|
87 |
+
<script type="text/javascript">
|
88 |
+
var editor = grapesjs.init({
|
89 |
+
showOffsets: 1,
|
90 |
+
noticeOnUnload: 0,
|
91 |
+
container: '#gjs',
|
92 |
+
height: '100%',
|
93 |
+
fromElement: true,
|
94 |
+
storageManager: { autoload: 0 },
|
95 |
+
styleManager : {
|
96 |
+
sectors: [{
|
97 |
+
name: 'General',
|
98 |
+
open: false,
|
99 |
+
buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom']
|
100 |
+
},{
|
101 |
+
name: 'Flex',
|
102 |
+
open: false,
|
103 |
+
buildProps: ['flex-direction', 'flex-wrap', 'justify-content', 'align-items', 'align-content', 'order', 'flex-basis', 'flex-grow', 'flex-shrink', 'align-self']
|
104 |
+
},{
|
105 |
+
name: 'Dimension',
|
106 |
+
open: false,
|
107 |
+
buildProps: ['width', 'height', 'max-width', 'min-height', 'margin', 'padding'],
|
108 |
+
},{
|
109 |
+
name: 'Typography',
|
110 |
+
open: false,
|
111 |
+
buildProps: ['font-family', 'font-size', 'font-weight', 'letter-spacing', 'color', 'line-height', 'text-shadow'],
|
112 |
+
},{
|
113 |
+
name: 'Decorations',
|
114 |
+
open: false,
|
115 |
+
buildProps: ['border-radius-c', 'background-color', 'border-radius', 'border', 'box-shadow', 'background'],
|
116 |
+
},{
|
117 |
+
name: 'Extra',
|
118 |
+
open: false,
|
119 |
+
buildProps: ['transition', 'perspective', 'transform'],
|
120 |
+
}
|
121 |
+
],
|
122 |
+
},
|
123 |
+
});
|
124 |
+
|
125 |
+
// Add blocks for each element
|
126 |
+
editor.BlockManager.add('welcome-block', {
|
127 |
+
label: 'Welcome Title',
|
128 |
+
content: `<h1 class="welcome">Welcome to</h1>`
|
129 |
+
});
|
130 |
+
|
131 |
+
editor.BlockManager.add('big-title-block', {
|
132 |
+
label: 'Big Title',
|
133 |
+
content: `
|
134 |
+
<div class="big-title">
|
135 |
+
<svg class="logo" viewBox="0 0 100 100">
|
136 |
+
<path d="M40 5l-12.9 7.4 -12.9 7.4c-1.4 0.8-2.7 2.3-3.7 3.9 -0.9 1.6-1.5 3.5-1.5 5.1v14.9 14.9c0 1.7 0.6 3.5 1.5 5.1 0.9 1.6 2.2 3.1 3.7 3.9l12.9 7.4 12.9 7.4c1.4 0.8 3.3 1.2 5.2 1.2 1.9 0 3.8-0.4 5.2-1.2l12.9-7.4 12.9-7.4c1.4-0.8 2.7-2.2 3.7-3.9 0.9-1.6 1.5-3.5 1.5-5.1v-14.9 -12.7c0-4.6-3.8-6-6.8-4.2l-28 16.2"/>
|
137 |
+
</svg>
|
138 |
+
<span>GrapesJS</span>
|
139 |
+
</div>
|
140 |
+
`
|
141 |
+
});
|
142 |
+
|
143 |
+
editor.BlockManager.add('description-block', {
|
144 |
+
label: 'Description',
|
145 |
+
content: `<div class="description">This is a demo content from index.html. For the development, you shouldn't edit this file, instead you can copy and rename it to _index.html, on next server start the new file will be served, and it will be ignored by git.</div>`
|
146 |
+
});
|
147 |
+
|
148 |
+
editor.BlockManager.add('button-block', {
|
149 |
+
label: 'Add Button',
|
150 |
+
content: `<button class="add-button">Ещё добавь</button>`
|
151 |
+
});
|
152 |
+
</script>
|
|
|
|
|
153 |
</body>
|
154 |
</html>
|