DmitrMakeev commited on
Commit
3befaa2
·
verified ·
1 Parent(s): 253460b

Update builder.html

Browse files
Files changed (1) hide show
  1. builder.html +68 -62
builder.html CHANGED
@@ -84,71 +84,77 @@
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>
 
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
+ plugins: ['gjs-custom-code'],
96
+ pluginsOpts: {
97
+ 'gjs-custom-code': {
98
+ // Опции плагина
99
+ }
100
+ },
101
+ styleManager : {
102
+ sectors: [{
103
+ name: 'General',
104
+ open: false,
105
+ buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom']
106
+ },{
107
+ name: 'Flex',
108
+ open: false,
109
+ buildProps: ['flex-direction', 'flex-wrap', 'justify-content', 'align-items', 'align-content', 'order', 'flex-basis', 'flex-grow', 'flex-shrink', 'align-self']
110
+ },{
111
+ name: 'Dimension',
112
+ open: false,
113
+ buildProps: ['width', 'height', 'max-width', 'min-height', 'margin', 'padding'],
114
+ },{
115
+ name: 'Typography',
116
+ open: false,
117
+ buildProps: ['font-family', 'font-size', 'font-weight', 'letter-spacing', 'color', 'line-height', 'text-shadow'],
118
+ },{
119
+ name: 'Decorations',
120
+ open: false,
121
+ buildProps: ['border-radius-c', 'background-color', 'border-radius', 'border', 'box-shadow', 'background'],
122
+ },{
123
+ name: 'Extra',
124
+ open: false,
125
+ buildProps: ['transition', 'perspective', 'transform'],
126
+ }
127
+ ],
128
+ },
129
+ });
130
 
131
+ // Add blocks for each element
132
+ editor.BlockManager.add('welcome-block', {
133
+ label: 'Welcome Title',
134
+ content: `<h1 class="welcome">Welcome to</h1>`
135
+ });
136
 
137
+ editor.BlockManager.add('big-title-block', {
138
+ label: 'Big Title',
139
+ content: `
140
+ <div class="big-title">
141
+ <svg class="logo" viewBox="0 0 100 100">
142
+ <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"/>
143
+ </svg>
144
+ <span>GrapesJS</span>
145
+ </div>
146
+ `
147
+ });
148
 
149
+ editor.BlockManager.add('description-block', {
150
+ label: 'Description',
151
+ 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>`
152
+ });
153
 
154
+ editor.BlockManager.add('button-block', {
155
+ label: 'Add Button',
156
+ content: `<button class="add-button">Ещё добавь</button>`
157
+ });
158
+ </script>
159
  </body>
160
  </html>