DmitrMakeev commited on
Commit
57b52c6
·
verified ·
1 Parent(s): ddc5b7c

Update builder.html

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