From 45fb75480b37535fbafa7337da1b45ad69f98eed Mon Sep 17 00:00:00 2001 From: BrunoPavlinic98 Date: Fri, 25 Oct 2024 07:37:35 +0200 Subject: [PATCH] Initial commit --- assets/css/setup-wizard.css | 59 +++++++++++++--------- assets/css/toggle-switch.css | 41 +++++++++++++++ assets/js/confetti.js | 2 +- includes/SetupWizard.php | 8 ++- views/setup-wizard/attach-to.php | 1 + views/setup-wizard/display-options.php | 2 + views/setup-wizard/show-action-buttons.php | 4 +- 7 files changed, 91 insertions(+), 26 deletions(-) create mode 100644 assets/css/toggle-switch.css diff --git a/assets/css/setup-wizard.css b/assets/css/setup-wizard.css index 8fbae0d6a..5be5aadae 100644 --- a/assets/css/setup-wizard.css +++ b/assets/css/setup-wizard.css @@ -16,14 +16,11 @@ body.wpo-wcpdf-setup { background-attachment: fixed!important; font-size: 14px; line-height: 22px; - background: #771787; - background: -webkit-linear-gradient(10deg, #3c105d, #771787); - background: -o-linear-gradient(10deg, #3c105d, #771787); - background: linear-gradient(100deg, #3c105d, #771787); + background: #fcfbfe; } body.wpo-wcpdf-setup a:link, body.wpo-wcpdf-setup a:visited { - color: #771787; + color: #6e1edc; text-decoration: none; } @@ -34,8 +31,8 @@ body.wpo-wcpdf-setup a:hover { body.wpo-wcpdf-setup input:focus, body.wpo-wcpdf-setup textarea:focus, body.wpo-wcpdf-setup select:focus { - border-color: #239bb9!important; - box-shadow: 0 0 0 1px #239bb9!important; + border-color: #6e1edc!important; + box-shadow: 0 0 0 1px #6e1edc!important; outline: 2px solid transparent!important; color: black!important; } @@ -64,7 +61,8 @@ body.wpo-wcpdf-setup form { background-color: #fff; padding: 0; overflow: hidden; - box-shadow: 0 20px 50px 20px rgba(0,0,0,0.2); + border-radius: 20px; + box-shadow: 10px 10px 30px rgba(43, 12, 86, 0.1), -10px -10px 30px rgba(43, 12, 86, 0.02); } .wpo-plugin-title { @@ -93,6 +91,10 @@ body.wpo-wcpdf-setup form { margin: 0; } +.wpo-progress-bar li a { + box-shadow: none; +} + .wpo-progress-bar li:first-child { width: calc( ( 12.5% - ( 12.5% - 35px ) ) / 2 + 12.5% ); } @@ -114,7 +116,7 @@ body.wpo-wcpdf-setup form { .wpo-progress-bar li.active::after, .wpo-progress-bar li.completed::after { - background-color: #771787; + background-color: #6e1edc; } .wpo-progress-marker { @@ -144,7 +146,7 @@ body.wpo-wcpdf-setup form { } li.active .wpo-progress-marker::before { - color: #771787; + color: #6e1edc; } li.completed .wpo-progress-marker::before { @@ -152,12 +154,12 @@ li.completed .wpo-progress-marker::before { } .wpo-progress-bar li.completed .wpo-progress-marker { - background-color: #771787; - border-color: #771787; + background-color: #6e1edc; + border-color: #6e1edc; } .wpo-progress-bar li.active .wpo-progress-marker { - border-color: #771787; + border-color: #6e1edc; background-color: #fff; } @@ -212,33 +214,40 @@ li.completed .wpo-progress-marker::before { } .wpo-setup-card .wpo-button-next { - background-color: #1c6c8b; - border: 1px solid #1c6c8b; + background-color: #6e1edc; + border: 1px solid #6e1edc; color: #fff!important; } .wpo-setup-card .wpo-button-previous, .wpo-setup-input span.button { background-color: transparent; - border: 1px solid #1c6c8b; - color: #1c6c8b; + border: 1px solid #6e1edc; + color: #6e1edc; } -.wpo-setup-card .wpo-button-next:hover, .wpo-setup-card .wpo-button-previous:hover, .wpo-setup-input span.button:hover { - background-color: #239bb9; + background-color: #6e1edc; color: #fff!important; text-decoration: none; - border-color: #239bb9; + border-color: #6e1edc; +} + +.wpo-setup-card .wpo-button-next:hover { + background-color: transparent; + color: #6e1edc!important; + text-decoration: none; + border-color: #6e1edc; } .wpo-setup-card .wpo-button-next:focus, .wpo-setup-card .wpo-button-previous:focus, .wpo-setup-input span.button:focus { - background-color: #239bb9; + box-shadow: none; + background-color: #6e1edc; color: #fff!important; - border-color: #239bb9; + border-color: #6e1edc; } .wpo-setup-card .wpo-button-next, @@ -249,7 +258,7 @@ li.completed .wpo-progress-marker::before { .wpo-setup-card .wpo-button-previous { float: left; - color: #1c6c8b!important; + color: #6e1edc!important; } .wpo-setup-card .wpo-skip-step { @@ -264,6 +273,10 @@ li.completed .wpo-progress-marker::before { text-decoration: none; } +.wpo-setup-card .wpo-skip-step:focus { + box-shadow: none; +} + /* Shop address */ .wpo-setup-input .shop-name { diff --git a/assets/css/toggle-switch.css b/assets/css/toggle-switch.css new file mode 100644 index 000000000..bc91e50fd --- /dev/null +++ b/assets/css/toggle-switch.css @@ -0,0 +1,41 @@ +label.slider { + display: inline-block; + background: #ccc; + border: 1px solid #ccc; + width: 32px; + height: 18px; + margin: 0 30px 0 5px; + border-radius: 9px; + vertical-align: middle!important; + box-sizing: border-box; + transition: 0.05s 0.05s; + cursor: pointer; + position: relative; +} + +label.slider::before { + content: ''; + display: block; + width: 16px; + height: 16px; + background: #f9f9f9; + border: 1px solid #fff; + box-sizing: border-box; + border-radius: 50%; + box-shadow: inset 2px 2px 2px rgba(255, 255, 255, 1), inset -1px -1px 2px rgba(0, 0, 0, 0.2); + transition: 0.1s; + transform: translateX(0); +} + +input[type="checkbox"] { + display: none; +} + +input[type="checkbox"]:checked + label.slider { + background: #6e1edc; + border-color: #6e1edc; +} + +input[type="checkbox"]:checked + label.slider::before { + transform: translateX(14px); +} \ No newline at end of file diff --git a/assets/js/confetti.js b/assets/js/confetti.js index 0e1774d4c..4a95e24d9 100644 --- a/assets/js/confetti.js +++ b/assets/js/confetti.js @@ -4,7 +4,7 @@ jQuery(document).ready(function($) { var DEG_TO_RAD = Math.PI / 180; var RAD_TO_DEG = 180 / Math.PI; var colors = [ - ["#771787", "#239bb9"], + ["#6e1edc"], ]; function Vector2(_x, _y) { diff --git a/includes/SetupWizard.php b/includes/SetupWizard.php index b47615fdc..744925076 100644 --- a/includes/SetupWizard.php +++ b/includes/SetupWizard.php @@ -91,6 +91,12 @@ public function setup_wizard() { array( 'dashicons', 'install' ), WPO_WCPDF_VERSION ); + wp_enqueue_style( + 'wpo-wcpdf-toggle-switch', + WPO_WCPDF()->plugin_url() . '/assets/css/toggle-switch'.$suffix.'.css', + array( 'dashicons', 'install' ), + WPO_WCPDF_VERSION + ); wp_register_script( 'wpo-wcpdf-media-upload', WPO_WCPDF()->plugin_url() . '/assets/js/media-upload'.$suffix.'.js', @@ -214,7 +220,7 @@ public function setup_wizard_footer() { public function get_step_link( $step ) { $step_keys = array_keys( $this->steps ); if ( end( $step_keys ) === $this->step && empty( $step ) ) { - return admin_url('admin.php?page=wpo_wcpdf_options_page'); + return admin_url('admin.php?page=wpo_wcpdf_options_page&tab=upgrade'); } return esc_url_raw( add_query_arg( 'step', $step ) ); } diff --git a/views/setup-wizard/attach-to.php b/views/setup-wizard/attach-to.php index 9b53780f7..d099952d0 100644 --- a/views/setup-wizard/attach-to.php +++ b/views/setup-wizard/attach-to.php @@ -21,6 +21,7 @@ + diff --git a/views/setup-wizard/display-options.php b/views/setup-wizard/display-options.php index 8aae2115b..212af97e0 100644 --- a/views/setup-wizard/display-options.php +++ b/views/setup-wizard/display-options.php @@ -36,6 +36,7 @@ name="wcpdf_settings[wpo_wcpdf_documents_settings_invoice][display_email]" value="1"> + @@ -45,6 +46,7 @@ name="wcpdf_settings[wpo_wcpdf_documents_settings_invoice][display_phone]" value="1"> + diff --git a/views/setup-wizard/show-action-buttons.php b/views/setup-wizard/show-action-buttons.php index 54b5b7992..ca8fc7876 100644 --- a/views/setup-wizard/show-action-buttons.php +++ b/views/setup-wizard/show-action-buttons.php @@ -15,5 +15,7 @@ if ( in_array( 'wc_actions', $hidden ) ) $actions = false ?> - name="wc_show_action_buttons" value="1"> + name="wc_show_action_buttons" value="1"> + +