diff --git a/wp-content/plugins/academy-africa/includes/assets/css/error.css b/wp-content/plugins/academy-africa/includes/assets/css/error.css new file mode 100644 index 00000000..c66e62a2 --- /dev/null +++ b/wp-content/plugins/academy-africa/includes/assets/css/error.css @@ -0,0 +1,77 @@ +@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;400;500;600&display=swap"); +.spacer { + margin-top: 100px; } + +.error { + display: flex; + justify-content: space-around; + background-image: url("../images/error.png"); + background-repeat: no-repeat; + background-size: 100% 100%; + background-position: center; + min-height: 700px; + width: 100vw; } + @media only screen and (max-width: 768px) { + .error { + background-size: cover; } } + .error .content { + max-width: 768px; + flex: 2; + width: 100%; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; } + .error .content .code { + color: var(--shades-white, #fff); + text-align: center; + /* Heading/H1/Bold */ + font-size: 48px; + font-style: normal; + margin: 0; + font-weight: 700; + line-height: 56px; + /* 116.667% */ } + .error .content .text { + color: var(--shades-white, #fff); + text-align: center; + margin: 0; + /* Heading/H3/Bold */ + font-size: 33px; + font-style: normal; + font-weight: 700; + line-height: 40px; + /* 121.212% */ } + .error .content .description { + color: var(--shades-black, #000); + text-align: center; + max-width: 300px; + margin: 140px 0 42px; + /* Paragraph/P3/Regular */ + font-family: Hind; + font-size: 18px; + font-style: normal; + font-weight: 400; + line-height: 21.6px; + /* 120% */ } + .error .content .actions { + display: flex; + justify-content: space-around; + margin-bottom: 42px; } + .error .content .actions .button { + color: var(--primary-50, #eff0fd); + /* Buttons */ + font-family: Open Sans; + font-size: 16px; + font-style: normal; + font-weight: 800; + line-height: 19px; + /* 118.75% */ + letter-spacing: 1.6px; + text-transform: uppercase; + padding: 12px 16px; + justify-content: center; + align-items: center; + margin-right: 33px; + background: var(--primary-700, #0c1a81); + text-decoration: none; } diff --git a/wp-content/plugins/academy-africa/includes/assets/images/error.png b/wp-content/plugins/academy-africa/includes/assets/images/error.png new file mode 100644 index 00000000..fd828b37 Binary files /dev/null and b/wp-content/plugins/academy-africa/includes/assets/images/error.png differ diff --git a/wp-content/plugins/academy-africa/includes/plugin.php b/wp-content/plugins/academy-africa/includes/plugin.php index e96d56a6..7527c78a 100644 --- a/wp-content/plugins/academy-africa/includes/plugin.php +++ b/wp-content/plugins/academy-africa/includes/plugin.php @@ -213,7 +213,9 @@ public function init() public function register_widgets($widgets_manager) { require_once(__DIR__ . '/widgets/footer.php'); + require_once(__DIR__ . '/widgets/error.php'); $widgets_manager->register(new \Academy_Africa_Footer()); + $widgets_manager->register(new \Academy_Africa_Error()); } public function register_widget_styles() @@ -243,6 +245,15 @@ public function register_widget_styles() ], filemtime(plugin_dir_path(__FILE__) . 'assets/css/footer.css') ); + + wp_enqueue_style( + 'academy-africa-error', + plugins_url('assets/css/error.css', __FILE__), + [ + 'academy-africa' + ], + filemtime(plugin_dir_path(__FILE__) . 'assets/css/error.css') + ); } /** diff --git a/wp-content/plugins/academy-africa/includes/widgets/error.php b/wp-content/plugins/academy-africa/includes/widgets/error.php new file mode 100644 index 00000000..11ab8c62 --- /dev/null +++ b/wp-content/plugins/academy-africa/includes/widgets/error.php @@ -0,0 +1,121 @@ +start_controls_section( + 'section_header', + [ + 'label' => __('Header', 'academy-africa'), + ] + ); + + $this->add_control( + 'status_code', + [ + 'label' => __('Status Code', 'academy-africa'), + 'type' => \Elementor\Controls_Manager::NUMBER, + 'default' => __("500", 'academy-africa'), + ] + ); + $this->add_control( + 'title', + [ + 'label' => __('Title', 'academy-africa'), + 'type' => \Elementor\Controls_Manager::TEXT, + 'default' => __("INTERNAL SERVER ERROR", 'academy-africa'), + ] + ); + $this->add_control( + 'description', + [ + 'label' => __('Description', 'academy-africa'), + 'type' => \Elementor\Controls_Manager::TEXTAREA, + 'default' => __('Internal Server Error', 'academy-africa'), + ] + ); + + $this->add_control( + 'refreshButtonLabel', + [ + 'label' => __('Refresh Button Label', 'academy-africa'), + 'type' => \Elementor\Controls_Manager::TEXTAREA, + 'default' => __('Refresh', 'academy-africa'), + ] + ); + + $this->add_control( + 'homepageButtonLabel', + [ + 'label' => __('Back to Homepage Button Label', 'academy-africa'), + 'type' => \Elementor\Controls_Manager::TEXTAREA, + 'default' => __('Back to Homepage', 'academy-africa'), + ] + ); + + $this->end_controls_section(); + } + + protected function render() + { + $settings = $this->get_settings_for_display(); + $description = $settings['description']; + $status_code = $settings['status_code']; + $title = $settings['title']; + $refresh = $settings['refreshButtonLabel']; + $home = $settings['homepageButtonLabel']; +?> +
+
+
+

get_render_attribute_string('status_code'); ?>> + +

+

get_render_attribute_string('title'); ?>> + +

+

get_render_attribute_string('description'); ?>> + +

+ +
+ +
+