DmitrMakeev commited on
Commit
1079d7c
·
verified ·
1 Parent(s): 19eb269

Update builder2.html

Browse files
Files changed (1) hide show
  1. builder2.html +7 -46
builder2.html CHANGED
@@ -8,7 +8,8 @@
8
  <script src="https://unpkg.com/grapesjs-plugin-forms"></script>
9
  <script src="https://unpkg.com/grapesjs-custom-code"></script>
10
  <style>
11
- body, html {
 
12
  height: 100%;
13
  margin: 0;
14
  }
@@ -35,7 +36,8 @@
35
  </head>
36
  <body>
37
  <div id="gjs" style="height:0px; overflow:hidden;">
38
- <div class="panel">
 
39
  <h1 class="welcome">Добро пожаловать!</h1>
40
  <div class="big-title">
41
  <img class="logo" src="https://via.placeholder.com/70x70.png?text=Logo" alt="Logo">
@@ -171,52 +173,11 @@
171
  }
172
  });
173
 
174
- function exportHtml() {
175
- const htmlCode = editor.getHtml();
176
- const cssCode = editor.getCss();
177
- const jsCode = editor.getJs();
178
-
179
- // Собираем выбранные скрипты
180
- const selectedScripts = [];
181
- if (document.getElementById('script1-checkbox').checked) {
182
- selectedScripts.push(document.getElementById('script1-checkbox').value);
183
- }
184
- if (document.getElementById('script2-checkbox').checked) {
185
- selectedScripts.push(document.getElementById('script2-checkbox').value);
186
- }
187
- if (document.getElementById('script3-checkbox').checked) {
188
- selectedScripts.push(document.getElementById('script3-checkbox').value);
189
- }
190
-
191
- // Собираем дополнительные скрипты
192
- const additionalScripts = selectedScripts.map(script => `<script src="${script}"><\/script>`).join('');
193
-
194
- // Объединение всего в один HTML-файл
195
- const fullHtml = `
196
- <!DOCTYPE html>
197
- <html>
198
- <head>
199
- <style>${cssCode}</style>
200
- </head>
201
- <body>
202
- ${htmlCode}
203
- <script>${jsCode}<\/script>
204
- ${additionalScripts}
205
- </body>
206
- </html>
207
- `;
208
-
209
- // Сохранение HTML-файла
210
- const blob = new Blob([fullHtml], { type: 'text/html' });
211
- const url = URL.createObjectURL(blob);
212
- const a = document.createElement('a');
213
- a.href = url;
214
- a.download = 'page.html';
215
- a.click();
216
- }
217
-
218
  // Обработчик для кнопки экспорта
219
  document.getElementById('export-html').addEventListener('click', exportHtml);
220
  </script>
 
 
 
221
  </body>
222
  </html>
 
8
  <script src="https://unpkg.com/grapesjs-plugin-forms"></script>
9
  <script src="https://unpkg.com/grapesjs-custom-code"></script>
10
  <style>
11
+ /* Ваш существующий CSS */
12
+ body, html {
13
  height: 100%;
14
  margin: 0;
15
  }
 
36
  </head>
37
  <body>
38
  <div id="gjs" style="height:0px; overflow:hidden;">
39
+ <!-- Ваш существующий HTML контент -->
40
+ <div class="panel">
41
  <h1 class="welcome">Добро пожаловать!</h1>
42
  <div class="big-title">
43
  <img class="logo" src="https://via.placeholder.com/70x70.png?text=Logo" alt="Logo">
 
173
  }
174
  });
175
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  // Обработчик для кнопки экспорта
177
  document.getElementById('export-html').addEventListener('click', exportHtml);
178
  </script>
179
+
180
+ <!-- Вынесенная функция экспорта -->
181
+ <script type="text/javascript" src="https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/sav_html.js"></script>
182
  </body>
183
  </html>