Update pages.html
Browse files- pages.html +34 -40
pages.html
CHANGED
@@ -485,13 +485,45 @@ editor.Components.addType('custom-button', {
|
|
485 |
// HTML-код кнопки с добавленными стилями
|
486 |
content: `
|
487 |
<div class="container">
|
488 |
-
<button type="submit" class="btn
|
489 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
490 |
`,
|
491 |
// Скрипт для обработки нажатия кнопки и загрузки зависимостей
|
492 |
script: function(props) {
|
493 |
const initButton = () => {
|
494 |
-
const button = this.querySelector('.btn
|
495 |
|
496 |
button.addEventListener('click', () => {
|
497 |
console.log('Button clicked with props:', props);
|
@@ -563,47 +595,9 @@ editor.Components.addType('custom-button', {
|
|
563 |
name: 'new_w',
|
564 |
label: 'Открвывать в новом окне браузера 0-НЕТ,1-ДА',
|
565 |
changeProp: true
|
566 |
-
},
|
567 |
-
// Добавляем настройки для стилей кнопки
|
568 |
-
{
|
569 |
-
type: 'color',
|
570 |
-
name: 'bgColor',
|
571 |
-
label: 'Цвет фона кнопки',
|
572 |
-
changeProp: true
|
573 |
-
},
|
574 |
-
{
|
575 |
-
type: 'color',
|
576 |
-
name: 'textColor',
|
577 |
-
label: 'Цвет текста кнопки',
|
578 |
-
changeProp: true
|
579 |
-
},
|
580 |
-
{
|
581 |
-
type: 'number',
|
582 |
-
name: 'fontSize',
|
583 |
-
label: 'Размер шрифта кнопки',
|
584 |
-
changeProp: true
|
585 |
}
|
586 |
]
|
587 |
}
|
588 |
-
},
|
589 |
-
// Добавляем обработчик для применения стилей
|
590 |
-
view: {
|
591 |
-
onRender({ el, model }) {
|
592 |
-
const bgColor = model.get('bgColor');
|
593 |
-
const textColor = model.get('textColor');
|
594 |
-
const fontSize = model.get('fontSize');
|
595 |
-
|
596 |
-
const button = el.querySelector('.btn-primary');
|
597 |
-
if (bgColor) {
|
598 |
-
button.style.backgroundColor = bgColor;
|
599 |
-
}
|
600 |
-
if (textColor) {
|
601 |
-
button.style.color = textColor;
|
602 |
-
}
|
603 |
-
if (fontSize) {
|
604 |
-
button.style.fontSize = `${fontSize}px`;
|
605 |
-
}
|
606 |
-
}
|
607 |
}
|
608 |
});
|
609 |
// Создаем блок для компонента кнопки
|
|
|
485 |
// HTML-код кнопки с добавленными стилями
|
486 |
content: `
|
487 |
<div class="container">
|
488 |
+
<button type="submit" class="atuin-btn">ПЕРЕЙТИ К ОПЛАТЕ</button>
|
489 |
</div>
|
490 |
+
`,
|
491 |
+
// CSS-стили для кнопки
|
492 |
+
style: `
|
493 |
+
.atuin-btn {
|
494 |
+
display: inline-flex;
|
495 |
+
margin: 10px;
|
496 |
+
text-decoration: none;
|
497 |
+
position: relative;
|
498 |
+
font-size: 20px;
|
499 |
+
line-height: 20px;
|
500 |
+
padding: 12px 30px;
|
501 |
+
color: #FFF;
|
502 |
+
font-weight: bold;
|
503 |
+
text-transform: uppercase;
|
504 |
+
font-family: 'Roboto', Тahoma, sans-serif;
|
505 |
+
background: #337AB7;
|
506 |
+
cursor: pointer;
|
507 |
+
border: 2px solid #BFE2FF;
|
508 |
+
outline: 1px solid;
|
509 |
+
outline-color: #337AB7;
|
510 |
+
outline-offset: 0px;
|
511 |
+
text-shadow: none;
|
512 |
+
transition: all 1.5s cubic-bezier(0.19, 1, 0.22, 1);
|
513 |
+
}
|
514 |
+
.atuin-btn:hover,
|
515 |
+
.atuin-btn:active,
|
516 |
+
.atuin-btn:focus {
|
517 |
+
box-shadow: inset 0 0 20px #BFE2FF;
|
518 |
+
outline-color: rgba(255, 255, 255, 0);
|
519 |
+
outline-offset: 15px;
|
520 |
+
color: #FFF;
|
521 |
+
}
|
522 |
`,
|
523 |
// Скрипт для обработки нажатия кнопки и загрузки зависимостей
|
524 |
script: function(props) {
|
525 |
const initButton = () => {
|
526 |
+
const button = this.querySelector('.atuin-btn');
|
527 |
|
528 |
button.addEventListener('click', () => {
|
529 |
console.log('Button clicked with props:', props);
|
|
|
595 |
name: 'new_w',
|
596 |
label: 'Открвывать в новом окне браузера 0-НЕТ,1-ДА',
|
597 |
changeProp: true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
598 |
}
|
599 |
]
|
600 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
601 |
}
|
602 |
});
|
603 |
// Создаем блок для компонента кнопки
|