DmitrMakeev commited on
Commit
e44859a
·
verified ·
1 Parent(s): 0db5454

Update pages.html

Browse files
Files changed (1) hide show
  1. pages.html +3 -51
pages.html CHANGED
@@ -41,7 +41,6 @@
41
 
42
  <script src="https://unpkg.com/grapesjs-rulers"></script>
43
 
44
- <script src="https://unpkg.com/grapesjs-click"></script>
45
 
46
 
47
  <link href="https://unpkg.com/grapesjs-plugin-toolbox/dist/grapesjs-plugin-toolbox.min.css" rel="stylesheet">
@@ -1196,20 +1195,6 @@ z-index: 1000; /* Убедитесь, что кнопка находится п
1196
 
1197
 
1198
 
1199
- <style>
1200
- /* Ваши стили */
1201
- #grabbed-info {
1202
- position: fixed;
1203
- background-color: #fff;
1204
- border: 1px solid #ccc;
1205
- padding: 10px;
1206
- box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
1207
- z-index: 1000;
1208
- }
1209
- </style>
1210
-
1211
- <div id="grabbed-info"></div>
1212
-
1213
  <script type="text/javascript">
1214
  var editor = grapesjs.init({
1215
  container: '#gjs',
@@ -1232,8 +1217,7 @@ z-index: 1000; /* Убедитесь, что кнопка находится п
1232
  "grapesjs-tooltip", // Плагин подсказок
1233
  "grapesjs-script-editor", // Плагин редактора скриптов
1234
  "grapesjs-rulers", // Добавляем плагин линеек
1235
- "grapesjs-tui-image-editor", // Добавляем плагин редактора изображений
1236
- "grapesjs-click" // Добавляем плагин grapesjs-click
1237
  ],
1238
  pluginsOpts: {
1239
  "gjs-blocks-basic": {
@@ -1328,12 +1312,11 @@ z-index: 1000; /* Убедитесь, что кнопка находится п
1328
  hideHeader: true,
1329
  addToAssets: true,
1330
  upload: false
1331
- },
1332
- "grapesjs-click": {
1333
- // Настройки для grapesjs-click
1334
  }
1335
  }
1336
  });
 
 
1337
 
1338
  // Добавляем кнопку линейки в верхнюю панель инструментов с использованием SVG-иконки
1339
  editor.Panels.addButton('options', {
@@ -1345,37 +1328,6 @@ z-index: 1000; /* Убедитесь, что кнопка находится п
1345
  command: 'ruler-visibility', // Команда для переключения видимости линеек
1346
  attributes: { title: 'Toggle Rulers' }
1347
  });
1348
-
1349
- // Функция для обновления информации о положении элемента
1350
- function updatePositionInfo(component) {
1351
- const positionInfo = document.getElementById('position-info');
1352
- if (component) {
1353
- const { x, y, width, height } = component.getBoundingRect();
1354
- const { width: canvasWidth, height: canvasHeight } = editor.Canvas.getCanvasElement().getBoundingClientRect();
1355
- const xPercent = (x / canvasWidth * 100).toFixed(2);
1356
- const yPercent = (y / canvasHeight * 100).toFixed(2);
1357
- positionInfo.textContent = `Position: X: ${x}px (${xPercent}%), Y: ${y}px (${yPercent}%), Width: ${width}px, Height: ${height}px`;
1358
- } else {
1359
- positionInfo.textContent = 'Position: ';
1360
- }
1361
- }
1362
-
1363
- // Подписываемся на события перетаскивания и выбора элемента
1364
- editor.on('component:drag:start', (component) => {
1365
- updatePositionInfo(component);
1366
- });
1367
-
1368
- editor.on('component:drag', (component) => {
1369
- updatePositionInfo(component);
1370
- });
1371
-
1372
- editor.on('component:drag:stop', (component) => {
1373
- updatePositionInfo(component);
1374
- });
1375
-
1376
- editor.on('component:selected', (component) => {
1377
- updatePositionInfo(component);
1378
- });
1379
  </script>
1380
 
1381
  <script type="text/javascript" src="https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/rus/rus.js"></script>
 
41
 
42
  <script src="https://unpkg.com/grapesjs-rulers"></script>
43
 
 
44
 
45
 
46
  <link href="https://unpkg.com/grapesjs-plugin-toolbox/dist/grapesjs-plugin-toolbox.min.css" rel="stylesheet">
 
1195
 
1196
 
1197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1198
  <script type="text/javascript">
1199
  var editor = grapesjs.init({
1200
  container: '#gjs',
 
1217
  "grapesjs-tooltip", // Плагин подсказок
1218
  "grapesjs-script-editor", // Плагин редактора скриптов
1219
  "grapesjs-rulers", // Добавляем плагин линеек
1220
+ "grapesjs-tui-image-editor" // Добавляем плагин редактора изображений
 
1221
  ],
1222
  pluginsOpts: {
1223
  "gjs-blocks-basic": {
 
1312
  hideHeader: true,
1313
  addToAssets: true,
1314
  upload: false
 
 
 
1315
  }
1316
  }
1317
  });
1318
+ </script>
1319
+ <script>
1320
 
1321
  // Добавляем кнопку линейки в верхнюю панель инструментов с использованием SVG-иконки
1322
  editor.Panels.addButton('options', {
 
1328
  command: 'ruler-visibility', // Команда для переключения видимости линеек
1329
  attributes: { title: 'Toggle Rulers' }
1330
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1331
  </script>
1332
 
1333
  <script type="text/javascript" src="https://huggingface.co/spaces/DMTuit/psy_vk/resolve/main/js/rus/rus.js"></script>