DmitrMakeev commited on
Commit
59f3936
·
verified ·
1 Parent(s): 4fce68b

Update builder2.html

Browse files
Files changed (1) hide show
  1. builder2.html +24 -221
builder2.html CHANGED
@@ -1,246 +1,49 @@
1
  <!DOCTYPE html>
2
  <html lang="en">
3
  <head>
4
- <meta charset="utf-8">
5
- <title>GrapesJS with Forms Plugin</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-plugin-forms"></script>
9
- <script src="https://unpkg.com/grapesjs-custom-code"></script>
10
- <!-- Change code view -->
11
- <script src="https://unpkg.com/grapesjs-parser-postcss"></script>
12
- <link
13
- href="https://unpkg.com/grapesjs-component-code-editor/dist/grapesjs-component-code-editor.min.css"
14
- rel="stylesheet"
15
- />
16
  <script src="https://unpkg.com/grapesjs-component-code-editor"></script>
17
  <style>
18
- /* Ваш существующий CSS */
19
  body, html {
20
- height: 100%;
21
  margin: 0;
22
- }
23
- .image-container {
24
- display: flex;
25
- justify-content: space-between;
26
- margin-top: 20px; /* Поднятие картинок выше формы */
27
- }
28
- .image-container img {
29
- width: 30%;
30
- height: auto;
31
- margin: 0 10px; /* Увеличение расстояния между картинками */
32
- }
33
- @media (max-width: 768px) {
34
- .image-container {
35
- flex-direction: column;
36
- }
37
- .image-container img {
38
- width: 100%;
39
- margin: 10px 0; /* Увеличение расстояния между картинками на мобильных устройствах */
40
- }
41
- }
42
- /* Стили для контейнера управления */
43
- .controls-container {
44
- background-color: #302f2f; /* Черный фон контейнера */
45
- padding: 15px 0; /* Отступы сверху и снизу */
46
- text-align: center; /* Выравнивание по центру */
47
- }
48
- .controls-container label,
49
- .controls-container button {
50
- margin-left: 15px; /* Отступ слева */
51
- }
52
- /* Стили для кнопки "Скачать HTML" */
53
- #export-html {
54
- background-color: #ccc; /* Серый фон кнопки */
55
- color: #000; /* Черный цвет текста кнопки */
56
- border: none;
57
- padding: 10px 15px; /* Размер кнопки */
58
- font-size: 16px; /* Размер текста кнопки */
59
- cursor: pointer;
60
- border-radius: 5px; /* Скругление углов */
61
- transition: background-color 0.3s ease; /* Плавный переход при наведении */
62
- }
63
- #export-html:hover {
64
- background-color: #bbb; /* Фон кнопки при наведении */
65
- }
66
- /* Стили для надписей возле галочек */
67
- .controls-container label {
68
- color: #fff; /* Белый цвет текста */
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>
 
1
  <!DOCTYPE html>
2
  <html lang="en">
3
  <head>
4
+ <meta charset="UTF-8">
5
+ <title>GrapesJS with Code Editor</title>
6
+ <link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
7
  <script src="https://unpkg.com/grapesjs"></script>
8
+ <link href="https://unpkg.com/grapesjs-component-code-editor/dist/grapesjs-component-code-editor.min.css" rel="stylesheet">
 
 
 
 
 
 
 
9
  <script src="https://unpkg.com/grapesjs-component-code-editor"></script>
10
  <style>
 
11
  body, html {
 
12
  margin: 0;
13
+ height: 100%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
  }
15
  </style>
16
  </head>
17
  <body>
18
+ <div id="gjs"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  <script type="text/javascript">
20
+ const editor = grapesjs.init({
 
 
21
  container: '#gjs',
22
  height: '100%',
23
  fromElement: true,
24
+ storageManager: false,
25
+ panels: {
26
+ defaults: [
27
+ {
28
+ buttons: [
29
+ {
30
+ attributes: { title: 'Open Code' },
31
+ className: 'fa fa-code',
32
+ command: 'open-code',
33
+ id: 'open-code'
34
+ }
35
+ ],
36
+ id: 'views'
 
 
 
 
 
37
  }
38
+ ]
39
+ },
40
+ plugins: ['grapesjs-component-code-editor'],
41
+ pluginsOpts: {
42
  'grapesjs-component-code-editor': {
43
  // options
44
  }
45
  }
46
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  </script>
 
 
 
48
  </body>
49
  </html>