DmitrMakeev commited on
Commit
3fefdd1
·
verified ·
1 Parent(s): d0c0706

Update builder2.html

Browse files
Files changed (1) hide show
  1. builder2.html +99 -164
builder2.html CHANGED
@@ -69,178 +69,113 @@
69
  }
70
  </style>
71
  </head>
72
- <body>
73
- <div id="gjs" style="height:0px; overflow:hidden;">
74
- <!-- Ваш существующий HTML контент -->
75
- <div class="panel">
76
- <h1 class="welcome">Добро пожаловать!</h1>
77
- <div class="big-title">
78
- <img class="logo" src="https://via.placeholder.com/70x70.png?text=Logo" alt="Logo">
79
- <span>Конструктор лендингов и подписных ВК</span>
 
 
 
 
 
 
80
  </div>
81
- <div class="description">
82
- В связке с WhatsMasterCRM, VK Mini Apps, Автопилот. Ботхелп. Тильда, Геткурс.
83
- </div>
84
- <form class="centered-form">
85
- <input type="text" name="name" placeholder="Имя">
86
- <input type="email" name="email" placeholder="Email">
87
- <input type="tel" name="phone" placeholder="Телефон">
88
- <label class="checkbox-label"><input type="checkbox" name="subscribe" autocomplete="off"> I agree to the newsletter</label>
89
- </form>
90
- <button class="add-button">Зарегистрироваться</button>
91
- <div class="image-container">
92
- <img src="https://via.placeholder.com/150" alt="Placeholder Image 1">
93
- <img src="https://via.placeholder.com/150" alt="Placeholder Image 2">
94
- <img src="https://via.placeholder.com/150" alt="Placeholder Image 3">
95
- </div>
96
- </div>
97
- <style>
98
- .panel {
99
- width: 90%;
100
- max-width: 700px;
101
- border-radius: 3px;
102
- padding: 30px 20px;
103
- margin: 150px auto 0px;
104
- background-color: #d983a6;
105
- box-shadow: 0px 3px 10px 0px rgba(0,0,0,0.25);
106
- color: rgba(255,255,255,0.75);
107
- font: caption;
108
- font-weight: 100;
109
- text-align: center;
110
- }
111
- .welcome {
112
- text-align: center;
113
- font-weight: 100;
114
- margin: 0px;
115
- }
116
- .logo {
117
- width: 70px;
118
- height: 70px;
119
- vertical-align: middle;
120
- border-radius: 50%; /* Скругление углов для логотипа */
121
- }
122
- .big-title {
123
- text-align: center;
124
- font-size: 3.5rem;
125
- margin: 15px 0;
126
- }
127
- .description {
128
- text-align: justify;
129
- font-size: 1rem;
130
- line-height: 1.5rem;
131
- }
132
- .centered-form {
133
- display: inline-block;
134
- text-align: left;
135
- }
136
- .centered-form input {
137
- display: block;
138
- width: 100%;
139
- margin-bottom: 10px;
140
- }
141
- .checkbox-label {
142
- display: flex;
143
- align-items: center;
144
- margin-bottom: 10px;
145
- padding: 0;
146
- }
147
- .checkbox-label input[type="checkbox"] {
148
- margin: 0;
149
- width: 100%;
150
- height: 100%;
151
- flex-basis: 0;
152
- autocomplete: off;
153
- }
154
- .checkbox-label span {
155
- margin-left: 15px; /* Добавление отступа справа */
156
- }
157
- .add-button {
158
- display: block;
159
- margin: 20px auto 0;
160
- padding: 10px 20px;
161
- font-size: 1rem;
162
- color: #fff;
163
- background-color: #007bff;
164
- border: none;
165
- border-radius: 5px;
166
- cursor: pointer;
167
- }
168
- </style>
169
- </div>
170
 
171
- <!-- Интерфейс для выбора скриптов -->
172
- <div class="controls-container">
173
- <label><input type="checkbox" id="script1-checkbox" value="https://example.com/your-additional-script1.js" checked> Соб. хост</label>
174
- <label><input type="checkbox" id="script2-checkbox" value="https://example.com/your-additional-script2.js"> ВК + АП</label>
175
- <label><input type="checkbox" id="script3-checkbox" value="https://example.com/your-additional-script3.js"> Виджет Тильда</label>
176
- <label><input type="checkbox" id="script4-checkbox" value="https://example.com/your-additional-script4.js"> Виджет Геткурс</label>
177
- <button id="export-html">Скачать HTML</button>
178
- </div>
179
 
180
- <script type="text/javascript" src="https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/sav_html.js"></script>
 
 
 
 
181
 
182
- <script type="text/javascript">
183
- var editor = grapesjs.init({
184
- showOffsets: 1,
185
- noticeOnUnload: 0,
186
- container: '#gjs',
187
- height: '100%',
188
- fromElement: true,
189
- storageManager: { autoload: 0 },
190
- plugins: ['grapesjs-plugin-forms', 'grapesjs-custom-code', 'grapesjs-component-code-editor'],
191
- pluginsOpts: {
192
- 'grapesjs-plugin-forms': {
193
- // options
194
- },
195
- 'grapesjs-custom-code': {
196
- blockCustomCode: {
197
- label: 'Custom Code',
198
- category: 'Extra',
199
- attributes: { class: 'fa fa-code' }
200
- },
201
- modalTitle: 'Insert your code',
202
- buttonLabel: 'Save',
203
- placeholderScript: '// Your JavaScript code here', // Плейсхолдер для скрипта
204
- codeViewOptions: {
205
- theme: 'hopscotch',
206
- readOnly: 0
207
- }
208
- },
209
- 'grapesjs-component-code-editor': {
210
- // options
211
  }
212
- }
213
- });
214
 
215
- // Добавляем команду для открытия редактора кода
216
- editor.Commands.add('open-code', {
217
- run: function(editor) {
218
- editor.runCommand('open-code-editor');
219
- }
220
- });
221
 
222
- // Добавляем кнопку для открытия редактора кода
223
- const pn = editor.Panels;
224
- const panelViews = pn.addPanel({
225
- id: "views",
226
- });
227
- panelViews.get("buttons").add([
228
- {
229
- attributes: {
230
- title: "Open Code",
231
- },
232
- className: "fa fa-file-code-o",
233
- command: "open-code",
234
- togglable: false, // Не закрывать при повторном нажатии
235
- id: "open-code",
236
- },
237
- ]);
238
 
239
- // Обработчик для кнопки экспорта
240
- document.getElementById('export-html').addEventListener('click', exportHtml);
241
- </script>
242
 
243
- <!-- Функцию экспорта вынес в sav_html.js-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
244
 
245
- </body>
 
 
 
 
 
 
246
  </html>
 
69
  }
70
  </style>
71
  </head>
72
+ <body>
73
+ <div id="gjs" style="height:0px; overflow:hidden;">
74
+ <div class="panel">
75
+ <h1 class="welcome">Welcome to</h1>
76
+ <div class="big-title">
77
+ <svg class="logo" viewBox="0 0 100 100">
78
+ <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"/>
79
+ </svg>
80
+ <span>GrapesJS</span>
81
+ </div>
82
+ <div class="description">
83
+ This is a demo content from index.html. For the development, you shouldn't edit this file, instead you can
84
+ copy and rename it to _index.html, on next server start the new file will be served, and it will be ignored by git.
85
+ </div>
86
  </div>
87
+ <style>
88
+ .panel {
89
+ width: 90%;
90
+ max-width: 700px;
91
+ border-radius: 3px;
92
+ padding: 30px 20px;
93
+ margin: 150px auto 0px;
94
+ background-color: #d983a6;
95
+ box-shadow: 0px 3px 10px 0px rgba(0,0,0,0.25);
96
+ color:rgba(255,255,255,0.75);
97
+ font: caption;
98
+ font-weight: 100;
99
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
 
101
+ .welcome {
102
+ text-align: center;
103
+ font-weight: 100;
104
+ margin: 0px;
105
+ }
 
 
 
106
 
107
+ .logo {
108
+ width: 70px;
109
+ height: 70px;
110
+ vertical-align: middle;
111
+ }
112
 
113
+ .logo path {
114
+ pointer-events: none;
115
+ fill: none;
116
+ stroke-linecap: round;
117
+ stroke-width: 7;
118
+ stroke: #fff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  }
 
 
120
 
121
+ .big-title {
122
+ text-align: center;
123
+ font-size: 3.5rem;
124
+ margin: 15px 0;
125
+ }
 
126
 
127
+ .description {
128
+ text-align: justify;
129
+ font-size: 1rem;
130
+ line-height: 1.5rem;
131
+ }
 
 
 
 
 
 
 
 
 
 
 
132
 
133
+ </style>
134
+ </div>
 
135
 
136
+ <script type="text/javascript">
137
+ var editor = grapesjs.init({
138
+ showOffsets: 1,
139
+ noticeOnUnload: 0,
140
+ container: '#gjs',
141
+ height: '100%',
142
+ fromElement: true,
143
+ storageManager: { autoload: 0 },
144
+ styleManager : {
145
+ sectors: [{
146
+ name: 'General',
147
+ open: false,
148
+ buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom']
149
+ },{
150
+ name: 'Flex',
151
+ open: false,
152
+ buildProps: ['flex-direction', 'flex-wrap', 'justify-content', 'align-items', 'align-content', 'order', 'flex-basis', 'flex-grow', 'flex-shrink', 'align-self']
153
+ },{
154
+ name: 'Dimension',
155
+ open: false,
156
+ buildProps: ['width', 'height', 'max-width', 'min-height', 'margin', 'padding'],
157
+ },{
158
+ name: 'Typography',
159
+ open: false,
160
+ buildProps: ['font-family', 'font-size', 'font-weight', 'letter-spacing', 'color', 'line-height', 'text-shadow'],
161
+ },{
162
+ name: 'Decorations',
163
+ open: false,
164
+ buildProps: ['border-radius-c', 'background-color', 'border-radius', 'border', 'box-shadow', 'background'],
165
+ },{
166
+ name: 'Extra',
167
+ open: false,
168
+ buildProps: ['transition', 'perspective', 'transform'],
169
+ }
170
+ ],
171
+ },
172
+ });
173
 
174
+ editor.BlockManager.add('testBlock', {
175
+ label: 'Block',
176
+ attributes: { class:'gjs-fonts gjs-f-b1' },
177
+ content: `<div style="padding-top:50px; padding-bottom:50px; text-align:center">Test block</div>`
178
+ })
179
+ </script>
180
+ </body>
181
  </html>