-
+
- +7 (978) 123-45-67 +
- +
- +
- order@aqualinia-sev.ru +
diff --git a/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css b/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css index ba6cecfd..7861a9b4 100644 --- a/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css +++ b/wp-content/themes/twentytwentyfour/assets/css/test1-shared-shell.css @@ -23,6 +23,12 @@ flex-direction: column; } +.test1-shared-contacts-page { + min-height: 100vh; + display: flex; + flex-direction: column; +} + .test1-shared-cart-page .site-main { flex: 1 0 auto; } @@ -32,6 +38,11 @@ padding-bottom: 26px; } +.test1-shared-contacts-page .site-main { + flex: 1 0 auto; + padding-bottom: 26px; +} + .test1-shared-cart-page .classic-footer { margin-top: auto; } @@ -40,6 +51,10 @@ margin-top: auto; } +.test1-shared-contacts-page .classic-footer { + margin-top: auto; +} + .test1-shared-shell .site-header { position: sticky; top: 0; diff --git a/wp-content/themes/twentytwentyfour/assets/js/test1-contacts.js b/wp-content/themes/twentytwentyfour/assets/js/test1-contacts.js new file mode 100644 index 00000000..b2474f9b --- /dev/null +++ b/wp-content/themes/twentytwentyfour/assets/js/test1-contacts.js @@ -0,0 +1,18 @@ +(() => { + const contactForm = document.getElementById('contactForm') + const contactSuccess = document.getElementById('contactSuccess') + + if (!contactForm || !contactSuccess) { + return + } + + contactForm.addEventListener('submit', event => { + event.preventDefault() + contactSuccess.classList.add('visible') + + setTimeout(() => { + contactForm.reset() + contactSuccess.classList.remove('visible') + }, 2200) + }) +})() diff --git a/wp-content/themes/twentytwentyfour/functions.php b/wp-content/themes/twentytwentyfour/functions.php index b896b511..faa13b7c 100644 --- a/wp-content/themes/twentytwentyfour/functions.php +++ b/wp-content/themes/twentytwentyfour/functions.php @@ -251,6 +251,29 @@ function twentytwentyfour_faq_template( $template ) { } add_filter( 'template_include', 'twentytwentyfour_faq_template' ); +/** + * Use a standalone PHP template for the page slug "contacts". + * + * @since Twenty Twenty-Four 1.0 + * + * @param string $template Resolved template path. + * @return string + */ +function twentytwentyfour_contacts_template( $template ) { + if ( ! is_page( 'contacts' ) ) { + return $template; + } + + $custom_template = get_theme_file_path( 'page-contacts.php' ); + + if ( file_exists( $custom_template ) ) { + return $custom_template; + } + + return $template; +} +add_filter( 'template_include', 'twentytwentyfour_contacts_template' ); + /** * Use a lightweight custom template for the WooCommerce checkout page. * @@ -304,7 +327,7 @@ add_filter( 'template_include', 'twentytwentyfour_cart_template', 20 ); * @return void */ function twentytwentyfour_test1_assets() { - $use_test1_assets = is_page( array( 'test1', 'faq' ) ); + $use_test1_assets = is_page( array( 'test1', 'faq', 'contacts' ) ); if ( ! $use_test1_assets ) { return; @@ -372,6 +395,20 @@ function twentytwentyfour_test1_assets() { } } + if ( is_page( 'contacts' ) ) { + $contacts_js_file = get_theme_file_path( 'assets/js/test1-contacts.js' ); + + if ( file_exists( $contacts_js_file ) ) { + wp_enqueue_script( + 'twentytwentyfour-test1-contacts-script', + get_theme_file_uri( 'assets/js/test1-contacts.js' ), + array(), + (string) filemtime( $contacts_js_file ), + true + ); + } + } + } add_action( 'wp_enqueue_scripts', 'twentytwentyfour_test1_assets', 100 ); @@ -382,7 +419,7 @@ add_action( 'wp_enqueue_scripts', 'twentytwentyfour_test1_assets', 100 ); * @return void */ function twentytwentyfour_test1_shared_shell_assets() { - if ( ! ( ( function_exists( 'is_checkout' ) && is_checkout() && ! is_order_received_page() ) || ( function_exists( 'is_cart' ) && is_cart() ) || is_page( 'faq' ) ) ) { + if ( ! ( ( function_exists( 'is_checkout' ) && is_checkout() && ! is_order_received_page() ) || ( function_exists( 'is_cart' ) && is_cart() ) || is_page( 'faq' ) || is_page( 'contacts' ) ) ) { return; } diff --git a/wp-content/themes/twentytwentyfour/page-contacts.php b/wp-content/themes/twentytwentyfour/page-contacts.php new file mode 100644 index 00000000..a0ff5b56 --- /dev/null +++ b/wp-content/themes/twentytwentyfour/page-contacts.php @@ -0,0 +1,88 @@ + +> +
+ + + + +> + + + +