DmitrMakeev commited on
Commit
1918e81
·
verified ·
1 Parent(s): 96ae9f5

Update builder.html

Browse files
Files changed (1) hide show
  1. builder.html +78 -134
builder.html CHANGED
@@ -4,22 +4,14 @@
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 {
15
- height: 100%;
16
- margin: 0;
17
- }
18
  </style>
19
  </head>
20
-
21
  <body>
22
- <div id="gjs" style="height:0px; overflow:hidden;">
23
  <div class="panel">
24
  <h1 class="welcome">Welcome to</h1>
25
  <div class="big-title">
@@ -29,136 +21,88 @@
29
  <span>GrapesJS</span>
30
  </div>
31
  <div class="description">
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">Зарегистрироваться</button>
36
  </div>
37
- <style>
38
- .panel {
39
- width: 90%;
40
- max-width: 700px;
41
- border-radius: 3px;
42
- padding: 30px 20px;
43
- margin: 150px auto 0px;
44
- background-color: #ffe478;
45
- box-shadow: 0px 3px 10px 0px rgba(0,0,0,0.25);
46
- color:rgba(0, 0, 0, 0.75);
47
- font: caption;
48
- font-weight: 100;
49
- }
50
- .welcome {
51
- text-align: center;
52
- font-weight: 100;
53
- margin: 0px;
54
- }
55
- .logo {
56
- width: 70px;
57
- height: 70px;
58
- vertical-align: middle;
59
- }
60
- .logo path {
61
- pointer-events: none;
62
- fill: none;
63
- stroke-linecap: round;
64
- stroke-width: 7;
65
- stroke: #fff
66
- }
67
- .big-title {
68
- text-align: center;
69
- font-size: 3.5rem;
70
- margin: 15px 0;
71
- }
72
- .description {
73
- text-align: justify;
74
- font-size: 1rem;
75
- line-height: 1.5rem;
76
- }
77
- .add-button {
78
- display: block;
79
- margin: 20px auto 0;
80
- padding: 10px 20px;
81
- font-size: 1rem;
82
- color: #fff;
83
- background-color: #02ba24;
84
- border: none;
85
- border-radius: 5px;
86
- cursor: pointer;
87
- }
88
- </style>
89
  </div>
90
 
91
- <script type="text/javascript">
92
- var editor = grapesjs.init({
93
- showOffsets: 1,
94
- noticeOnUnload: 0,
95
- container: '#gjs',
96
- height: '100%',
97
- fromElement: true,
98
- storageManager: { autoload: 0 },
99
- plugins: ['gjs-custom-code'],
100
- pluginsOpts: {
101
- 'gjs-custom-code': {
102
- // Опции плагина
103
- }
104
- },
105
- styleManager : {
106
- sectors: [{
107
- name: 'General',
108
- open: false,
109
- buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom']
110
- },{
111
- name: 'Flex',
112
- open: false,
113
- buildProps: ['flex-direction', 'flex-wrap', 'justify-content', 'align-items', 'align-content', 'order', 'flex-basis', 'flex-grow', 'flex-shrink', 'align-self']
114
- },{
115
- name: 'Dimension',
116
- open: false,
117
- buildProps: ['width', 'height', 'max-width', 'min-height', 'margin', 'padding'],
118
- },{
119
- name: 'Typography',
120
- open: false,
121
- buildProps: ['font-family', 'font-size', 'font-weight', 'letter-spacing', 'color', 'line-height', 'text-shadow'],
122
- },{
123
- name: 'Decorations',
124
- open: false,
125
- buildProps: ['border-radius-c', 'background-color', 'border-radius', 'border', 'box-shadow', 'background'],
126
- },{
127
- name: 'Extra',
128
- open: false,
129
- buildProps: ['transition', 'perspective', 'transform'],
130
- }
131
- ],
132
- },
133
- });
 
 
 
 
 
 
134
 
135
- // Add blocks for each element
136
- editor.BlockManager.add('welcome-block', {
137
- label: 'Welcome Title',
138
- content: `<h1 class="welcome">Welcome to</h1>`
139
- });
140
 
141
- editor.BlockManager.add('big-title-block', {
142
- label: 'Big Title',
143
- content: `
144
- <div class="big-title">
145
- <svg class="logo" viewBox="0 0 100 100">
146
- <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"/>
147
- </svg>
148
- <span>GrapesJS</span>
149
- </div>
150
- `
151
- });
152
 
153
- editor.BlockManager.add('description-block', {
154
- label: 'Description',
155
- 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>`
156
- });
157
 
158
- editor.BlockManager.add('button-block', {
159
- label: 'Add Button',
160
- content: `<button class="add-button">Ещё добавь</button>`
161
- });
162
- </script>
163
  </body>
164
- </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
+ <script src="https://unpkg.com/grapesjs-custom-code/dist/grapesjs-custom-code.min.js"></script>
 
 
9
  <style>
10
+ body, html { height: 100%; margin: 0; }
 
 
 
 
11
  </style>
12
  </head>
 
13
  <body>
14
+ <div id="gjs" style="height:100vh; overflow:hidden;">
15
  <div class="panel">
16
  <h1 class="welcome">Welcome to</h1>
17
  <div class="big-title">
 
21
  <span>GrapesJS</span>
22
  </div>
23
  <div class="description">
24
+ 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.
 
25
  </div>
26
  <button class="add-button">Зарегистрироваться</button>
27
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
  </div>
29
 
30
+ <script type="text/javascript">
31
+ var editor = grapesjs.init({
32
+ showOffsets: 1,
33
+ noticeOnUnload: 0,
34
+ container: '#gjs',
35
+ height: '100%',
36
+ fromElement: true,
37
+ storageManager: { autoload: 0 },
38
+ plugins: ['gjs-custom-code'],
39
+ pluginsOpts: {
40
+ 'gjs-custom-code': {
41
+ // Опции плагина
42
+ }
43
+ },
44
+ styleManager: {
45
+ sectors: [
46
+ {
47
+ name: 'General',
48
+ open: false,
49
+ buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom']
50
+ },
51
+ {
52
+ name: 'Flex',
53
+ open: false,
54
+ buildProps: ['flex-direction', 'flex-wrap', 'justify-content', 'align-items', 'align-content', 'order', 'flex-basis', 'flex-grow', 'flex-shrink', 'align-self']
55
+ },
56
+ {
57
+ name: 'Dimension',
58
+ open: false,
59
+ buildProps: ['width', 'height', 'max-width', 'min-height', 'margin', 'padding'],
60
+ },
61
+ {
62
+ name: 'Typography',
63
+ open: false,
64
+ buildProps: ['font-family', 'font-size', 'font-weight', 'letter-spacing', 'color', 'line-height', 'text-shadow'],
65
+ },
66
+ {
67
+ name: 'Decorations',
68
+ open: false,
69
+ buildProps: ['border-radius-c', 'background-color', 'border-radius', 'border', 'box-shadow', 'background'],
70
+ },
71
+ {
72
+ name: 'Extra',
73
+ open: false,
74
+ buildProps: ['transition', 'perspective', 'transform'],
75
+ }
76
+ ],
77
+ },
78
+ });
79
 
80
+ editor.BlockManager.add('welcome-block', {
81
+ label: 'Welcome Title',
82
+ content: `<h1 class="welcome">Welcome to</h1>`
83
+ });
 
84
 
85
+ editor.BlockManager.add('big-title-block', {
86
+ label: 'Big Title',
87
+ content: `
88
+ <div class="big-title">
89
+ <svg class="logo" viewBox="0 0 100 100">
90
+ <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"/>
91
+ </svg>
92
+ <span>GrapesJS</span>
93
+ </div>
94
+ `
95
+ });
96
 
97
+ editor.BlockManager.add('description-block', {
98
+ label: 'Description',
99
+ 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>`
100
+ });
101
 
102
+ editor.BlockManager.add('button-block', {
103
+ label: 'Add Button',
104
+ content: `<button class="add-button">Ещё добавь</button>`
105
+ });
106
+ </script>
107
  </body>
108
+ </html>