Update builder2.html
Browse files- builder2.html +1 -144
builder2.html
CHANGED
@@ -100,147 +100,4 @@
|
|
100 |
max-width: 700px;
|
101 |
border-radius: 3px;
|
102 |
padding: 30px 20px;
|
103 |
-
margin: 150px auto
|
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>
|
|
|
100 |
max-width: 700px;
|
101 |
border-radius: 3px;
|
102 |
padding: 30px 20px;
|
103 |
+
margin: 150px auto 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|