initial
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
.vrts-settings {
|
||||
display: block;
|
||||
|
||||
h1 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
form h2 {
|
||||
font-weight: 400;
|
||||
font-size: 20px;
|
||||
|
||||
span {
|
||||
display: block;
|
||||
margin-top: 0.75rem;
|
||||
font-size: 13px;
|
||||
line-height: 1.5;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
|
||||
fieldset {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
input {
|
||||
|
||||
&[readonly] {
|
||||
border-color: #8c8f94;
|
||||
background-color: #fff;
|
||||
color: #2c3338;
|
||||
}
|
||||
}
|
||||
|
||||
.form-table {
|
||||
|
||||
th,
|
||||
td {
|
||||
padding: 0 24px 24px 0;
|
||||
}
|
||||
|
||||
td fieldset label {
|
||||
margin: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
&__pro-label {
|
||||
display: inline-block;
|
||||
padding: 0.25rem 0.5rem;
|
||||
font-size: 11px;
|
||||
line-height: 1;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
color: #fff;
|
||||
background: #757575;
|
||||
border-radius: 35px;
|
||||
}
|
||||
|
||||
&__modal {
|
||||
|
||||
&-info {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use Vrts\Core\Utilities\Url_Helpers;
|
||||
|
||||
?>
|
||||
<vrts-settings class="wrap vrts-settings">
|
||||
<h1><?php echo esc_html( $data['title'] ); ?></h1>
|
||||
<form method="post" action="options.php">
|
||||
<?php
|
||||
settings_fields( $data['settings_fields'] );
|
||||
do_settings_sections( $data['settings_sections'] );
|
||||
submit_button();
|
||||
?>
|
||||
</form>
|
||||
<vrts-modal id="vrts-modal-pro-settings" class="vrts-modal vrts-settings__modal" aria-hidden="true">
|
||||
<div class="vrts-modal__overlay" data-a11y-dialog-hide></div>
|
||||
<div class="vrts-modal__content" role="document">
|
||||
<button type="button" class="vrts-modal__close" data-a11y-dialog-hide aria-label="<?php esc_attr_e( 'Close', 'visual-regression-tests' ); ?>"></button>
|
||||
<h2 class="vrts-modal__title">
|
||||
<?php esc_html_e( '🚀 Go Pro for more testing power!', 'visual-regression-tests' ); ?>
|
||||
</h2>
|
||||
<div class="vrts-modal__content-inner">
|
||||
<p class="vrts-settings__modal-info"><?php esc_html_e( 'Upgrade your plan and unlock automatic testing after updates, plus more tools like manual testing to keep your sites running smoothly.', 'visual-regression-tests' ); ?></p>
|
||||
<a href="<?php echo esc_url( Url_Helpers::get_page_url( 'upgrade' ) ); ?>" class="button button-primary vrts-settings__modal-link"><?php esc_html_e( 'Unlock Now', 'visual-regression-tests' ); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
</vrts-modal>
|
||||
</vrts-settings>
|
||||
@@ -0,0 +1,36 @@
|
||||
class VrtsSettings extends window.HTMLElement {
|
||||
constructor() {
|
||||
super();
|
||||
this.resolveElements();
|
||||
this.bindFunctions();
|
||||
this.bindEvents();
|
||||
}
|
||||
|
||||
resolveElements() {
|
||||
this.$proSettingsCheckboxes = this.querySelectorAll(
|
||||
'[data-a11y-dialog-show] input[type="checkbox"]'
|
||||
);
|
||||
}
|
||||
|
||||
bindFunctions() {
|
||||
this.onCheckboxChange = this.onCheckboxChange.bind( this );
|
||||
}
|
||||
|
||||
bindEvents() {
|
||||
this.$proSettingsCheckboxes?.forEach( ( item ) => {
|
||||
item.addEventListener( 'change', this.onCheckboxChange );
|
||||
} );
|
||||
}
|
||||
|
||||
onCheckboxChange( e ) {
|
||||
e.preventDefault();
|
||||
e.currentTarget.checked = ! e.currentTarget.checked;
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
this.$proSettingsCheckboxes?.forEach( ( item ) => {
|
||||
item.removeEventListener( 'change', this.onCheckboxChange );
|
||||
} );
|
||||
}
|
||||
}
|
||||
window.customElements.define( 'vrts-settings', VrtsSettings );
|
||||
Reference in New Issue
Block a user