commit 4f4b5f2c0aef66114e61fe2b2fe6e72ac8b5e749 Author: jimagie Date: Thu Oct 22 19:36:36 2026 +0500 Smilia: children's dental clinic website (WordPress theme and plugin) diff --git a/wp-content/plugins/smilia-core/assets/img/faq/cloud-1.svg b/wp-content/plugins/smilia-core/assets/img/faq/cloud-1.svg new file mode 100644 index 0000000..747ad58 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/faq/cloud-1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/faq/cloud-2.svg b/wp-content/plugins/smilia-core/assets/img/faq/cloud-2.svg new file mode 100644 index 0000000..df3c015 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/faq/cloud-2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/faq/cloud-3.svg b/wp-content/plugins/smilia-core/assets/img/faq/cloud-3.svg new file mode 100644 index 0000000..a00d1ed --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/faq/cloud-3.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/faq/cloud-4.svg b/wp-content/plugins/smilia-core/assets/img/faq/cloud-4.svg new file mode 100644 index 0000000..dc67499 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/faq/cloud-4.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/faq/cloud-5.svg b/wp-content/plugins/smilia-core/assets/img/faq/cloud-5.svg new file mode 100644 index 0000000..1d52a77 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/faq/cloud-5.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/faq/cloud-6.svg b/wp-content/plugins/smilia-core/assets/img/faq/cloud-6.svg new file mode 100644 index 0000000..127c0af --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/faq/cloud-6.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/faq/paper-tile.webp b/wp-content/plugins/smilia-core/assets/img/faq/paper-tile.webp new file mode 100644 index 0000000..a2f1236 Binary files /dev/null and b/wp-content/plugins/smilia-core/assets/img/faq/paper-tile.webp differ diff --git a/wp-content/plugins/smilia-core/assets/img/new-patients/clip-back.svg b/wp-content/plugins/smilia-core/assets/img/new-patients/clip-back.svg new file mode 100644 index 0000000..d600fef --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/new-patients/clip-back.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/new-patients/clip-front.svg b/wp-content/plugins/smilia-core/assets/img/new-patients/clip-front.svg new file mode 100644 index 0000000..f933f24 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/new-patients/clip-front.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/new-patients/paper.webp b/wp-content/plugins/smilia-core/assets/img/new-patients/paper.webp new file mode 100644 index 0000000..da5a7b8 Binary files /dev/null and b/wp-content/plugins/smilia-core/assets/img/new-patients/paper.webp differ diff --git a/wp-content/plugins/smilia-core/assets/img/plan-visit/map-v5-paper.webp b/wp-content/plugins/smilia-core/assets/img/plan-visit/map-v5-paper.webp new file mode 100644 index 0000000..4c8ac92 Binary files /dev/null and b/wp-content/plugins/smilia-core/assets/img/plan-visit/map-v5-paper.webp differ diff --git a/wp-content/plugins/smilia-core/assets/img/prices/calendar.svg b/wp-content/plugins/smilia-core/assets/img/prices/calendar.svg new file mode 100644 index 0000000..e0f5ab3 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/prices/calendar.svg @@ -0,0 +1,12 @@ + + Календарь платежей + + + + + + + + + + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/prices/tooth-card.svg b/wp-content/plugins/smilia-core/assets/img/prices/tooth-card.svg new file mode 100644 index 0000000..9fe16cd --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/prices/tooth-card.svg @@ -0,0 +1,14 @@ + + Оплата стоматологического лечения + + + + + + + + + + + + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/reviews/booksy.svg b/wp-content/plugins/smilia-core/assets/img/reviews/booksy.svg new file mode 100644 index 0000000..60b74ae --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/reviews/booksy.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/reviews/chalk-left.svg b/wp-content/plugins/smilia-core/assets/img/reviews/chalk-left.svg new file mode 100644 index 0000000..92b88ac --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/reviews/chalk-left.svg @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/reviews/chalk-right.svg b/wp-content/plugins/smilia-core/assets/img/reviews/chalk-right.svg new file mode 100644 index 0000000..78d1968 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/reviews/chalk-right.svg @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/reviews/google-g.svg b/wp-content/plugins/smilia-core/assets/img/reviews/google-g.svg new file mode 100644 index 0000000..dc6652d --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/reviews/google-g.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/reviews/znanylekarz-mark.svg b/wp-content/plugins/smilia-core/assets/img/reviews/znanylekarz-mark.svg new file mode 100644 index 0000000..0238647 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/reviews/znanylekarz-mark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/service/caries-treatment.svg b/wp-content/plugins/smilia-core/assets/img/service/caries-treatment.svg new file mode 100644 index 0000000..3034635 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/service/caries-treatment.svg @@ -0,0 +1 @@ +Лечение кариеса diff --git a/wp-content/plugins/smilia-core/assets/img/service/dental-trauma.svg b/wp-content/plugins/smilia-core/assets/img/service/dental-trauma.svg new file mode 100644 index 0000000..13a88ee --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/service/dental-trauma.svg @@ -0,0 +1 @@ +Травмы зубов diff --git a/wp-content/plugins/smilia-core/assets/img/service/first-visit.svg b/wp-content/plugins/smilia-core/assets/img/service/first-visit.svg new file mode 100644 index 0000000..4ef6b01 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/service/first-visit.svg @@ -0,0 +1 @@ +Первый визит diff --git a/wp-content/plugins/smilia-core/assets/img/service/orthodontics.svg b/wp-content/plugins/smilia-core/assets/img/service/orthodontics.svg new file mode 100644 index 0000000..157f527 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/service/orthodontics.svg @@ -0,0 +1 @@ +Ортодонтия diff --git a/wp-content/plugins/smilia-core/assets/img/service/sedation.svg b/wp-content/plugins/smilia-core/assets/img/service/sedation.svg new file mode 100644 index 0000000..3e318d7 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/service/sedation.svg @@ -0,0 +1 @@ +Седация diff --git a/wp-content/plugins/smilia-core/assets/img/service/tooth-cleaning.svg b/wp-content/plugins/smilia-core/assets/img/service/tooth-cleaning.svg new file mode 100644 index 0000000..d56d283 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/service/tooth-cleaning.svg @@ -0,0 +1 @@ +Осмотр и профилактика diff --git a/wp-content/plugins/smilia-core/assets/img/visit/kid-1.svg b/wp-content/plugins/smilia-core/assets/img/visit/kid-1.svg new file mode 100644 index 0000000..79bb324 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/visit/kid-1.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/visit/kid-2.svg b/wp-content/plugins/smilia-core/assets/img/visit/kid-2.svg new file mode 100644 index 0000000..3c20eab --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/visit/kid-2.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/visit/kid-3.svg b/wp-content/plugins/smilia-core/assets/img/visit/kid-3.svg new file mode 100644 index 0000000..b33583e --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/visit/kid-3.svg @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/assets/img/visit/kid-4.svg b/wp-content/plugins/smilia-core/assets/img/visit/kid-4.svg new file mode 100644 index 0000000..24a95f2 --- /dev/null +++ b/wp-content/plugins/smilia-core/assets/img/visit/kid-4.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/composer.json b/wp-content/plugins/smilia-core/composer.json new file mode 100644 index 0000000..97e397e --- /dev/null +++ b/wp-content/plugins/smilia-core/composer.json @@ -0,0 +1,12 @@ +{ + "name": "smilia/smilia-core", + "type": "wordpress-plugin", + "require": { + "php": ">=8.2", + "altcha-org/altcha": "^2.3" + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-blocks.php b/wp-content/plugins/smilia-core/includes/class-blocks.php new file mode 100644 index 0000000..a36d154 --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-blocks.php @@ -0,0 +1,98 @@ +get_all_registered() as $name => $type ) { + if ( ! str_starts_with( $name, 'smilia/' ) ) { + continue; + } + foreach ( (array) $type->editor_script_handles as $handle ) { + wp_set_script_translations( $handle, 'smilia-core', SMILIA_CORE_DIR . '/languages' ); + } + } + } + + public function keep_wide_sizes( string $image ): string { + if ( false === strpos( $image, 'service-page__method-photo' ) ) { + return $image; + } + $processor = new \WP_HTML_Tag_Processor( $image ); + if ( $processor->next_tag( 'img' ) ) { + $sizes = (string) $processor->get_attribute( 'sizes' ); + if ( str_starts_with( $sizes, 'auto,' ) ) { + $processor->set_attribute( 'sizes', trim( substr( $sizes, 5 ) ) ); + } + } + return $processor->get_updated_html(); + } + + public function asset_version( array $metadata ): array { + if ( empty( $metadata['file'] ) || ! str_starts_with( wp_normalize_path( $metadata['file'] ), wp_normalize_path( self::DIR ) ) ) { + return $metadata; + } + $asset = dirname( $metadata['file'] ) . '/index.asset.php'; + if ( is_readable( $asset ) ) { + $data = include $asset; + if ( is_array( $data ) && ! empty( $data['version'] ) ) { + $metadata['version'] = (string) $data['version']; + } + } + return $metadata; + } + + public function editor_data(): void { + wp_add_inline_script( + 'wp-blocks', + 'window.smiliaBlocks = ' . wp_json_encode( + array( + 'images' => plugins_url( 'assets/img/', SMILIA_CORE_FILE ), + 'admin' => admin_url(), + ) + ) . ';' + ); + } + + public function add_category( array $categories ): array { + array_unshift( + $categories, + array( + 'slug' => 'smilia', + 'title' => __( 'Smilia', 'smilia-core' ), + 'icon' => null, + ) + ); + return $categories; + } + + public function editor_settings( array $settings, WP_Block_Editor_Context $context ): array { + $settings['enableOpenverseMediaCategory'] = false; + if ( $context->post instanceof WP_Post && 'page' === $context->post->post_type ) { + $settings['templateLock'] = current_user_can( 'manage_options' ) ? 'all' : 'contentOnly'; + } + return $settings; + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-booking.php b/wp-content/plugins/smilia-core/includes/class-booking.php new file mode 100644 index 0000000..88958be --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-booking.php @@ -0,0 +1,352 @@ + __( 'Первый визит, знакомство', 'smilia-core' ), + 'checkup' => __( 'Осмотр и гигиена', 'smilia-core' ), + 'pain' => __( 'Болит или сколот зуб', 'smilia-core' ), + 'caries' => __( 'Лечение кариеса', 'smilia-core' ), + 'bite' => __( 'Прикус, пластинка, брекеты', 'smilia-core' ), + 'other' => __( 'Другое', 'smilia-core' ), + ); + } + + public static function form_data(): array { + $started = (string) time(); + return array( + 'endpoint' => function_exists( 'pll_current_language' ) && pll_current_language() + ? add_query_arg( 'lang', pll_current_language(), rest_url( self::ROUTE_NAMESPACE . self::ROUTE ) ) + : rest_url( self::ROUTE_NAMESPACE . self::ROUTE ), + 'nonce' => wp_create_nonce( self::NONCE_ACTION ), + 'rest' => wp_create_nonce( 'wp_rest' ), + 'started' => $started . '.' . self::sign( $started ), + 'captcha' => Captcha::endpoint(), + 'script' => Captcha::script(), + 'concerns' => self::concerns(), + 'phone' => array( + 'code' => self::PHONE_CODE, + 'digits' => self::PHONE_DIGITS, + 'example' => '+48 512 345 678', + ), + 'consent' => Markup::url( '/consent/' ), + 'privacy' => Markup::url( '/privacy-policy/' ), + ); + } + + public function register(): void { + add_action( 'rest_api_init', array( $this, 'register_route' ) ); + add_action( self::CLEANUP_HOOK, array( $this, 'cleanup' ) ); + add_action( 'add_meta_boxes_' . Post_Types::BOOKING, array( $this, 'add_box' ) ); + add_filter( 'manage_' . Post_Types::BOOKING . '_posts_columns', array( $this, 'columns' ) ); + add_action( 'manage_' . Post_Types::BOOKING . '_posts_custom_column', array( $this, 'column' ), 10, 2 ); + } + + private static function route_args(): array { + $limits = array( + 'smilia_nonce' => 40, + 'started' => 100, + 'website' => 200, + 'name' => 120, + 'phone' => 40, + 'age' => 20, + 'concern' => 40, + 'page' => 2048, + 'consent' => 2, + 'altcha' => 4000, + ); + $args = array(); + foreach ( $limits as $name => $length ) { + $args[ $name ] = array( + 'type' => 'string', + 'maxLength' => $length, + 'default' => '', + ); + } + return $args; + } + + public function register_route(): void { + register_rest_route( + self::ROUTE_NAMESPACE, + self::ROUTE, + array( + 'methods' => 'POST', + 'callback' => array( $this, 'handle' ), + 'permission_callback' => '__return_true', + 'args' => self::route_args(), + ) + ); + } + + public function handle( WP_REST_Request $request ): WP_REST_Response { + if ( ! $this->same_origin( $request ) ) { + return $this->fail( 403, '', __( 'Заявку можно отправить только с сайта клиники.', 'smilia-core' ) ); + } + + if ( ! wp_verify_nonce( (string) $request->get_param( 'smilia_nonce' ), self::NONCE_ACTION ) ) { + return $this->fail( 403, '', __( 'Страница устарела. Обновите её и отправьте заявку ещё раз.', 'smilia-core' ) ); + } + + $started = $this->started_at( (string) $request->get_param( 'started' ) ); + if ( null === $started || time() - $started > self::MAX_AGE ) { + return $this->fail( 400, '', __( 'Страница устарела. Обновите её и отправьте заявку ещё раз.', 'smilia-core' ) ); + } + + if ( '' !== trim( (string) $request->get_param( 'website' ) ) || time() - $started < self::MIN_SECONDS ) { + return $this->success(); + } + + $name = sanitize_text_field( (string) $request->get_param( 'name' ) ); + $phone = sanitize_text_field( (string) $request->get_param( 'phone' ) ); + $age = sanitize_text_field( (string) $request->get_param( 'age' ) ); + $concern = sanitize_key( (string) $request->get_param( 'concern' ) ); + $page = esc_url_raw( (string) $request->get_param( 'page' ) ); + + if ( mb_strlen( $name ) < 2 || mb_strlen( $name ) > 80 ) { + return $this->fail( 422, 'name', __( 'Проверьте имя.', 'smilia-core' ) ); + } + $phone = self::normalize_phone( $phone ); + if ( '' === $phone ) { + return $this->fail( 422, 'phone', __( 'Проверьте номер телефона.', 'smilia-core' ) ); + } + if ( mb_strlen( $age ) > 20 ) { + return $this->fail( 422, 'age', __( 'Проверьте возраст ребёнка.', 'smilia-core' ) ); + } + if ( ! array_key_exists( $concern, self::concerns() ) ) { + return $this->fail( 422, 'concern', __( 'Выберите, что беспокоит.', 'smilia-core' ) ); + } + if ( '1' !== (string) $request->get_param( 'consent' ) ) { + return $this->fail( 422, 'consent', __( 'Нужно ваше согласие на обработку персональных данных.', 'smilia-core' ) ); + } + if ( ! Captcha::verify( (string) $request->get_param( 'altcha' ) ) ) { + return $this->fail( 422, '', __( 'Не удалось подтвердить отправку. Обновите страницу и отправьте заявку ещё раз.', 'smilia-core' ) ); + } + + $time = current_time( 'mysql' ); + $post_id = wp_insert_post( + array( + 'post_type' => Post_Types::BOOKING, + 'post_status' => 'private', + 'post_title' => $name . ', ' . $phone, + 'meta_input' => array( + 'smilia_phone' => $phone, + 'smilia_age' => $age, + 'smilia_concern' => $concern, + 'smilia_page' => $page, + 'smilia_consent' => 'yes', + 'smilia_consent_version' => self::CONSENT_VERSION, + 'smilia_consent_url' => Markup::url( '/consent/' ), + 'smilia_consent_time' => $time, + ), + ), + true + ); + if ( is_wp_error( $post_id ) ) { + return $this->fail( 500, '', __( 'Не получилось отправить заявку. Позвоните нам, пожалуйста.', 'smilia-core' ) ); + } + + $this->log_consent( $time, $phone, $page ); + $this->notify( $name, $phone, $age, $concern, $page, $time ); + + return $this->success(); + } + + private function same_origin( WP_REST_Request $request ): bool { + $home = wp_parse_url( home_url(), PHP_URL_HOST ); + $source = (string) ( $request->get_header( 'origin' ) ?: $request->get_header( 'referer' ) ); + return '' !== $source && wp_parse_url( $source, PHP_URL_HOST ) === $home; + } + + private static function sign( string $value ): string { + return substr( hash_hmac( 'sha256', $value, wp_salt( 'nonce' ) ), 0, 20 ); + } + + private function started_at( string $token ): ?int { + $parts = explode( '.', $token, 2 ); + if ( 2 !== count( $parts ) || ! ctype_digit( $parts[0] ) || ! hash_equals( self::sign( $parts[0] ), $parts[1] ) ) { + return null; + } + return (int) $parts[0]; + } + + private static function normalize_phone( string $phone ): string { + $digits = (string) preg_replace( '/\D/', '', $phone ); + if ( str_starts_with( $digits, '00' . self::PHONE_CODE ) ) { + $digits = substr( $digits, 2 ); + } + if ( self::PHONE_DIGITS === strlen( $digits ) ) { + $digits = self::PHONE_CODE . $digits; + } + return preg_match( '/^' . self::PHONE_CODE . '\d{' . self::PHONE_DIGITS . '}$/', $digits ) ? '+' . $digits : ''; + } + + private function success(): WP_REST_Response { + return new WP_REST_Response( + array( + 'ok' => true, + 'message' => Settings::get( 'booking_thanks' ), + ), + 200 + ); + } + + private function fail( int $status, string $field, string $message ): WP_REST_Response { + return new WP_REST_Response( + array( + 'ok' => false, + 'field' => $field, + 'message' => $message, + ), + $status + ); + } + + private static function consent_dir(): string { + return defined( 'SMILIA_CONSENT_DIR' ) ? (string) SMILIA_CONSENT_DIR : ''; + } + + private function log_consent( string $time, string $phone, string $page ): void { + $dir = self::consent_dir(); + if ( '' === $dir || ! is_dir( $dir ) || ! wp_is_writable( $dir ) ) { + return; + } + $line = wp_json_encode( + array( + 'time' => $time, + 'consent' => true, + 'consent_version' => self::CONSENT_VERSION, + 'consent_url' => Markup::url( '/consent/' ), + 'page' => $page, + 'phone' => $phone, + ), + JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES + ); + file_put_contents( trailingslashit( $dir ) . 'consents-' . gmdate( 'Y-m' ) . '.jsonl', $line . "\n", FILE_APPEND | LOCK_EX ); + } + + private function notify( string $name, string $phone, string $age, string $concern, string $page, string $time ): void { + $lines = array( + __( 'Новая заявка на приём', 'smilia-core' ), + __( 'Имя:', 'smilia-core' ) . ' ' . $name, + __( 'Телефон:', 'smilia-core' ) . ' ' . $phone, + __( 'Возраст ребёнка:', 'smilia-core' ) . ' ' . ( '' !== $age ? $age : '-' ), + __( 'Что беспокоит:', 'smilia-core' ) . ' ' . self::concerns()[ $concern ], + __( 'Страница:', 'smilia-core' ) . ' ' . $page, + sprintf( + __( 'Согласие на обработку персональных данных: да, %1$s, текст от %2$s, %3$s', 'smilia-core' ), + $time, + self::CONSENT_VERSION, + Markup::url( '/consent/' ) + ), + ); + $email = Settings::get( 'booking_email' ); + wp_mail( is_email( $email ) ? $email : (string) get_option( 'admin_email' ),__( 'Smilia: новая заявка', 'smilia-core' ), implode( "\n", $lines ) ); + } + + public function add_box(): void { + add_meta_box( 'smilia_booking_box', __( 'Заявка', 'smilia-core' ), array( $this, 'render_box' ), Post_Types::BOOKING, 'normal' ); + remove_meta_box( 'submitdiv', Post_Types::BOOKING, 'side' ); + } + + public function render_box( WP_Post $post ): void { + $rows = array( + __( 'Телефон', 'smilia-core' ) => get_post_meta( $post->ID, 'smilia_phone', true ), + __( 'Возраст ребёнка', 'smilia-core' ) => get_post_meta( $post->ID, 'smilia_age', true ), + __( 'Что беспокоит', 'smilia-core' ) => self::concerns()[ get_post_meta( $post->ID, 'smilia_concern', true ) ] ?? '', + __( 'Страница', 'smilia-core' ) => get_post_meta( $post->ID, 'smilia_page', true ), + __( 'Согласие', 'smilia-core' ) => sprintf( '%s, %s, %s', get_post_meta( $post->ID, 'smilia_consent_time', true ), get_post_meta( $post->ID, 'smilia_consent_version', true ), get_post_meta( $post->ID, 'smilia_consent_url', true ) ), + ); + echo ''; + foreach ( $rows as $label => $value ) { + printf( '', esc_html( $label ), esc_html( (string) $value ) ); + } + echo '
%s%s
'; + } + + public function columns( array $columns ): array { + return array( + 'cb' => $columns['cb'] ?? '', + 'title' => __( 'Имя и телефон', 'smilia-core' ), + 'smilia_concern' => __( 'Что беспокоит', 'smilia-core' ), + 'date' => $columns['date'] ?? __( 'Дата', 'smilia-core' ), + ); + } + + public function column( string $column, int $post_id ): void { + if ( 'smilia_concern' === $column ) { + echo esc_html( self::concerns()[ get_post_meta( $post_id, 'smilia_concern', true ) ] ?? '' ); + } + } + + public static function schedule_cleanup(): void { + if ( ! wp_next_scheduled( self::CLEANUP_HOOK ) ) { + wp_schedule_event( time() + HOUR_IN_SECONDS, 'daily', self::CLEANUP_HOOK ); + } + } + + public static function unschedule_cleanup(): void { + wp_clear_scheduled_hook( self::CLEANUP_HOOK ); + } + + public function cleanup(): void { + $old = get_posts( + array( + 'post_type' => Post_Types::BOOKING, + 'post_status' => 'any', + 'posts_per_page' => 200, + 'fields' => 'ids', + 'date_query' => array( + array( + 'before' => self::RETENTION_DAYS . ' days ago', + ), + ), + ) + ); + foreach ( $old as $post_id ) { + wp_delete_post( (int) $post_id, true ); + } + Captcha::cleanup(); + + $dir = self::consent_dir(); + if ( '' === $dir || ! is_dir( $dir ) ) { + return; + } + $cutoff = wp_date( 'Y-m-d H:i:s', time() - self::RETENTION_DAYS * DAY_IN_SECONDS ); + foreach ( glob( trailingslashit( $dir ) . 'consents-*.jsonl' ) ?: array() as $file ) { + $kept = array(); + foreach ( file( $file, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES ) ?: array() as $line ) { + $row = json_decode( $line, true ); + if ( is_array( $row ) && isset( $row['time'] ) && (string) $row['time'] >= $cutoff ) { + $kept[] = $line; + } + } + if ( ! $kept ) { + wp_delete_file( $file ); + } elseif ( count( $kept ) !== count( file( $file ) ) ) { + file_put_contents( $file, implode( "\n", $kept ) . "\n", LOCK_EX ); + } + } + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-captcha.php b/wp-content/plugins/smilia-core/includes/class-captcha.php new file mode 100644 index 0000000..801dd5b --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-captcha.php @@ -0,0 +1,104 @@ + 'GET', + 'callback' => array( $this, 'handle' ), + 'permission_callback' => '__return_true', + ) + ); + } + + public function handle(): WP_REST_Response { + $response = new WP_REST_Response( self::challenge(), 200 ); + $response->header( 'Cache-Control', 'no-store' ); + return $response; + } + + public static function endpoint(): string { + return rest_url( Booking::ROUTE_NAMESPACE . self::ROUTE ); + } + + public static function script(): string { + $path = 'build/blocks/altcha/altcha.min.js'; + return plugins_url( $path, SMILIA_CORE_FILE ) . '?ver=' . (int) filemtime( SMILIA_CORE_DIR . '/' . $path ); + } + + public static function challenge(): array { + return ( new Altcha( hmacSignatureSecret: self::secret() ) )->createChallenge( + new CreateChallengeOptions( + algorithm: new Pbkdf2(), + cost: self::COST, + counter: random_int( self::COUNTER_MIN, self::COUNTER_MAX ), + expiresAt: time() + self::TTL, + ) + )->toArray(); + } + + public static function verify( string $raw ): bool { + if ( '' === $raw || strlen( $raw ) > self::MAX_PAYLOAD ) { + return false; + } + try { + $payload = Payload::fromBase64( $raw ); + $result = ( new Altcha( hmacSignatureSecret: self::secret() ) )->verifySolution( + new VerifySolutionOptions( + algorithm: new Pbkdf2(), + payload: $payload, + ) + ); + } catch ( \Throwable $error ) { + return false; + } + if ( ! $result->verified || null === $payload->challenge->signature ) { + return false; + } + return add_option( self::USED_PREFIX . hash( 'sha256', $payload->challenge->signature ), (string) time(), '', false ); + } + + public static function cleanup(): void { + global $wpdb; + $wpdb->query( + $wpdb->prepare( + "DELETE FROM {$wpdb->options} WHERE option_name LIKE %s AND CAST(option_value AS UNSIGNED) < %d", + $wpdb->esc_like( self::USED_PREFIX ) . '%', + time() - self::USED_KEEP + ) + ); + wp_cache_delete( 'alloptions', 'options' ); + } + + private static function secret(): string { + return hash_hmac( 'sha256', 'smilia-captcha', wp_salt( 'auth' ) ); + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-content.php b/wp-content/plugins/smilia-core/includes/class-content.php new file mode 100644 index 0000000..73d3407 --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-content.php @@ -0,0 +1,197 @@ +post_type : get_post_type( $post_id ); + if ( in_array( $type, self::TRACKED, true ) ) { + self::flush_all(); + } + } + + public static function flush_all(): void { + update_option( self::VERSION, (string) microtime( true ), true ); + } + + private static function language(): ?string { + if ( ! function_exists( 'pll_current_language' ) ) { + return get_locale(); + } + $language = pll_current_language(); + if ( ! $language && function_exists( 'pll_get_post_language' ) && get_post() ) { + $language = pll_get_post_language( get_post()->ID ); + } + return $language ? $language : null; + } + + private static function key( string $name, string $language ): string { + return self::CACHE_PREFIX . md5( $name . '|' . get_option( self::VERSION, '0' ) . '|' . $language ); + } + + private static function service_items(): array { + return self::remember( + 'services', + static function (): array { + return array_map( + static fn( WP_Post $post ): array => array( + 'id' => $post->ID, + 'slug' => $post->post_name, + 'title' => get_the_title( $post ), + 'url' => get_permalink( $post ), + 'summary' => get_the_excerpt( $post ), + 'image_id' => (int) get_post_thumbnail_id( $post ), + 'tone' => (string) get_post_meta( $post->ID, Meta_Fields::TONE, true ), + ), + self::posts( Post_Types::SERVICE ) + ); + } + ); + } + + public static function services(): array { + return self::with_images( self::service_items() ); + } + + public static function service_urls(): array { + return array_column( self::service_items(), 'url', 'slug' ); + } + + public static function doctors(): array { + $items = self::remember( + 'doctors', + static function (): array { + return array_map( + static fn( WP_Post $post ): array => array( + 'id' => $post->ID, + 'name' => get_the_title( $post ), + 'url' => get_permalink( $post ), + 'position' => (string) get_post_meta( $post->ID, Meta_Fields::POSITION, true ), + 'image_id' => (int) get_post_thumbnail_id( $post ), + 'tone' => (string) get_post_meta( $post->ID, Meta_Fields::TONE, true ), + ), + self::posts( Post_Types::DOCTOR ) + ); + } + ); + return self::with_images( $items ); + } + + public static function reviews( int $limit = 3 ): array { + $all = self::remember( + 'reviews', + static function (): array { + return array_map( + static fn( WP_Post $post ): array => array( + 'id' => $post->ID, + 'author' => get_the_title( $post ), + 'text' => wp_strip_all_tags( $post->post_content ), + 'topic' => (string) get_post_meta( $post->ID, Meta_Fields::TOPIC, true ), + 'source' => (string) get_post_meta( $post->ID, Meta_Fields::SOURCE, true ), + ), + self::posts( Post_Types::REVIEW ) + ); + } + ); + return array_slice( $all, 0, $limit ); + } + + public static function faq( string $group ): array { + $group = sanitize_key( $group ); + return self::remember( + 'faq_' . $group, + static function () use ( $group ): array { + return array_map( + static fn( WP_Post $post ): array => array( + 'id' => $post->ID, + 'question' => get_the_title( $post ), + 'answer' => apply_filters( 'the_content', $post->post_content ), + ), + self::posts( + Post_Types::FAQ, + array( + 'tax_query' => array( + array( + 'taxonomy' => Post_Types::FAQ_GROUP, + 'field' => 'slug', + 'terms' => $group, + ), + ), + ) + ) + ); + } + ); + } + + private static function posts( string $post_type, array $extra = array() ): array { + $language = function_exists( 'pll_current_language' ) ? self::language() : null; + if ( $language ) { + $extra['lang'] = $language; + } + $query = new WP_Query( + array_merge( + array( + 'post_type' => $post_type, + 'post_status' => 'publish', + 'posts_per_page' => 50, + 'orderby' => array( + 'menu_order' => 'ASC', + 'date' => 'DESC', + ), + 'no_found_rows' => true, + 'update_post_term_cache' => false, + ), + $extra + ) + ); + return $query->posts; + } + + private static function with_images( array $items ): array { + $ids = array_filter( array_column( $items, 'image_id' ) ); + if ( $ids ) { + _prime_post_caches( $ids, false, true ); + } + return $items; + } + + private static function remember( string $key, callable $build ): array { + $language = self::language(); + if ( null === $language ) { + return $build(); + } + $cache_key = self::key( $key, $language ); + $cached = get_transient( $cache_key ); + if ( is_array( $cached ) ) { + return $cached; + } + $value = $build(); + set_transient( $cache_key, $value, self::CACHE_TTL ); + return $value; + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-demo-access.php b/wp-content/plugins/smilia-core/includes/class-demo-access.php new file mode 100644 index 0000000..b94dd90 --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-demo-access.php @@ -0,0 +1,239 @@ + 'en_US', + 'pl' => 'pl_PL', + 'ru' => 'ru_RU', + ); + + private const LOCALE_COOKIE = 'smilia_demo_locale'; + + private const DENIED_CAPS = array( + 'install_plugins', + 'update_plugins', + 'delete_plugins', + 'edit_plugins', + 'upload_plugins', + 'install_themes', + 'update_themes', + 'delete_themes', + 'edit_themes', + 'upload_themes', + 'update_core', + 'update_languages', + 'install_languages', + 'create_users', + 'delete_users', + 'edit_users', + 'promote_users', + 'remove_users', + 'add_users', + 'export', + 'import', + 'edit_files', + 'unfiltered_upload', + 'export_others_personal_data', + 'erase_others_personal_data', + 'manage_privacy_options', + ); + + private const WRITE_SQL = '/^\s*(?:INSERT|UPDATE|DELETE|REPLACE|ALTER|CREATE|DROP|TRUNCATE|RENAME|GRANT|REVOKE|LOCK|LOAD)\b/i'; + + public static function enabled(): bool { + return defined( 'SMILIA_DEMO' ) && SMILIA_DEMO; + } + + public function register(): void { + if ( ! self::enabled() ) { + return; + } + add_filter( 'query', array( $this, 'guard_query' ), PHP_INT_MAX ); + add_filter( 'user_has_cap', array( $this, 'limit_caps' ), PHP_INT_MAX ); + add_filter( 'rest_pre_dispatch', array( $this, 'guard_rest' ), 0, 3 ); + add_action( 'admin_init', array( $this, 'guard_admin' ), 0 ); + add_action( 'template_redirect', array( $this, 'redirect_front' ), 0 ); + add_filter( 'rest_authentication_errors', array( $this, 'guard_rest_auth' ), PHP_INT_MAX ); + add_filter( 'allow_password_reset', '__return_false' ); + add_filter( 'show_password_fields', '__return_false' ); + add_filter( 'pre_wp_mail', '__return_false' ); + add_filter( 'pre_option_blog_public', '__return_zero' ); + add_action( 'admin_notices', array( $this, 'notice' ) ); + add_action( 'enqueue_block_editor_assets', array( $this, 'quiet_editor_errors' ) ); + add_filter( 'login_message', array( $this, 'login_message' ) ); + add_filter( 'lost_password_html_link', '__return_empty_string' ); + add_action( 'login_form_login', array( $this, 'auto_login' ) ); + add_filter( 'get_user_metadata', array( $this, 'user_locale' ), 10, 3 ); + add_action( 'init', array( $this, 'remember_locale' ), 0 ); + foreach ( array( 'lostpassword', 'retrievepassword', 'rp', 'resetpass', 'register' ) as $action ) { + add_action( 'login_form_' . $action, array( $this, 'deny' ) ); + } + } + + public static function install(): int { + global $wpdb; + $admin = get_role( 'administrator' ); + if ( ! $admin ) { + return 0; + } + remove_role( self::ROLE ); + add_role( self::ROLE, __( 'Демо-просмотр', 'smilia-core' ), array_diff_key( $admin->capabilities, array_flip( self::DENIED_CAPS ) ) ); + $user_id = wp_insert_user( + array( + 'user_login' => self::LOGIN, + 'user_pass' => wp_generate_password( 64, true, true ), + 'user_email' => self::LOGIN . '@smilia.invalid', + 'display_name' => 'Drill and Fill', + 'role' => self::ROLE, + 'locale' => 'en_US', + ) + ); + if ( is_wp_error( $user_id ) ) { + return 0; + } + $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->posts} SET post_author = %d", $user_id ) ); + return (int) $user_id; + } + + public function guard_query( $query ) { + if ( ! is_string( $query ) || ! preg_match( self::WRITE_SQL, $query ) || $this->login_request() || ( defined( 'WP_CLI' ) && WP_CLI ) ) { + return $query; + } + global $wpdb; + if ( false !== strpos( $query, $wpdb->options ) && preg_match( "/'_(?:site_)?transient_/", $query ) ) { + return $query; + } + return ''; + } + + public function limit_caps( array $allcaps ): array { + foreach ( self::DENIED_CAPS as $cap ) { + unset( $allcaps[ $cap ] ); + } + return $allcaps; + } + + public function guard_rest( $result, $server, $request ) { + if ( in_array( $request->get_method(), array( 'GET', 'HEAD', 'OPTIONS' ), true ) ) { + return $result; + } + return new WP_Error( 'smilia_demo', self::message(), array( 'status' => 403 ) ); + } + + public function redirect_front(): void { + $public = defined( 'SMILIA_PUBLIC_URL' ) ? (string) SMILIA_PUBLIC_URL : ''; + if ( '' === $public ) { + status_header( 404 ); + exit; + } + $uri = isset( $_SERVER['REQUEST_URI'] ) ? '/' . ltrim( esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ), '/' ) : '/'; + wp_redirect( untrailingslashit( $public ) . $uri, 301, 'Smilia' ); + exit; + } + + public function guard_rest_auth( $result ) { + if ( is_wp_error( $result ) || is_user_logged_in() ) { + return $result; + } + return new WP_Error( 'smilia_demo', self::message(), array( 'status' => 401 ) ); + } + + public function guard_admin(): void { + $method = isset( $_SERVER['REQUEST_METHOD'] ) ? strtoupper( sanitize_key( wp_unslash( $_SERVER['REQUEST_METHOD'] ) ) ) : 'GET'; + if ( wp_doing_ajax() ) { + $action = isset( $_REQUEST['action'] ) ? sanitize_key( wp_unslash( $_REQUEST['action'] ) ) : ''; + if ( in_array( $action, array( 'heartbeat', 'rest-nonce' ), true ) ) { + return; + } + wp_send_json_error( array( 'message' => self::message() ), 403 ); + } + $writes_on_load = array( 'post-new.php', 'media-new.php', 'erase-personal-data.php', 'export-personal-data.php' ); + if ( in_array( $GLOBALS['pagenow'] ?? '', $writes_on_load, true ) ) { + $this->deny(); + } + $read = in_array( $method, array( 'GET', 'HEAD' ), true ) && ! isset( $_REQUEST['_wpnonce'] ) && ! isset( $_REQUEST['_ajax_nonce'] ); + if ( ! $read ) { + $this->deny(); + } + } + + public function auto_login(): void { + $method = isset( $_SERVER['REQUEST_METHOD'] ) ? strtoupper( sanitize_key( wp_unslash( $_SERVER['REQUEST_METHOD'] ) ) ) : 'GET'; + $user = get_user_by( 'login', self::LOGIN ); + if ( 'GET' !== $method || isset( $_GET['loggedout'] ) || ! $user ) { + return; + } + wp_set_current_user( $user->ID ); + wp_set_auth_cookie( $user->ID, false, true ); + $redirect = isset( $_GET['redirect_to'] ) ? esc_url_raw( wp_unslash( $_GET['redirect_to'] ) ) : ''; + $redirect = wp_validate_redirect( $redirect, '' ); + wp_safe_redirect( '' !== $redirect ? $redirect : admin_url() ); + exit; + } + + public function user_locale( $value, $object_id, $meta_key ) { + $locale = self::requested_locale(); + if ( 'locale' !== $meta_key || '' === $locale ) { + return $value; + } + $user = get_userdata( (int) $object_id ); + return $user && self::LOGIN === $user->user_login ? array( $locale ) : $value; + } + + public function remember_locale(): void { + $code = isset( $_GET['locale'] ) ? sanitize_key( wp_unslash( $_GET['locale'] ) ) : ''; + if ( isset( self::LOCALES[ $code ] ) && ! headers_sent() ) { + setcookie( self::LOCALE_COOKIE, $code, 0, COOKIEPATH ? COOKIEPATH : '/', COOKIE_DOMAIN, true, true ); + } + } + + private static function requested_locale(): string { + $code = isset( $_GET['locale'] ) ? sanitize_key( wp_unslash( $_GET['locale'] ) ) : ''; + if ( ! isset( self::LOCALES[ $code ] ) ) { + $code = isset( $_COOKIE[ self::LOCALE_COOKIE ] ) ? sanitize_key( wp_unslash( $_COOKIE[ self::LOCALE_COOKIE ] ) ) : ''; + } + return self::LOCALES[ $code ] ?? ''; + } + + public function deny(): void { + wp_die( esc_html( self::message() ), esc_html__( 'Демо-доступ', 'smilia-core' ), array( 'response' => 403, 'back_link' => true ) ); + } + + public function quiet_editor_errors(): void { + $blank = array( ' ' ); + $data = array( + 'Updating failed.' => $blank, + 'Publishing failed.' => $blank, + 'Scheduling failed.' => $blank, + ); + wp_add_inline_script( 'wp-editor', 'wp.i18n.setLocaleData( ' . wp_json_encode( $data ) . ' );' ); + wp_add_inline_script( 'wp-edit-post', "wp.data.dispatch( 'core/preferences' ).set( 'core/edit-post', 'welcomeGuide', false );" ); + } + + public function notice(): void { + printf( '

%s

', esc_html( self::message() ) ); + } + + public function login_message( string $message ): string { + return $message . sprintf( '

%s

', esc_html( self::message() ) ); + } + + private function login_request(): bool { + return isset( $GLOBALS['pagenow'] ) && 'wp-login.php' === $GLOBALS['pagenow']; + } + + private static function message(): string { + return __( 'Изменения не сохраняются.', 'smilia-core' ); + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-i18n.php b/wp-content/plugins/smilia-core/includes/class-i18n.php new file mode 100644 index 0000000..d039c0f --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-i18n.php @@ -0,0 +1,168 @@ + true, + 'booking_title' => false, + 'booking_lead' => true, + 'booking_submit' => false, + 'booking_done' => false, + 'booking_thanks' => true, + ); + + public function register(): void { + add_filter( 'pll_get_post_types', array( $this, 'post_types' ), 10, 2 ); + add_filter( 'pll_get_taxonomies', array( $this, 'taxonomies' ) ); + add_filter( 'pll_filtered_rest_routes', array( $this, 'rest_routes' ) ); + add_filter( 'block_core_breadcrumbs_items', array( $this, 'breadcrumb_home' ) ); + add_filter( 'do_redirect_guess_404_permalink', '__return_false' ); + add_filter( 'wp_unique_post_slug', array( $this, 'shared_slug' ), 10, 6 ); + add_action( 'pre_get_posts', array( $this, 'query_language' ) ); + add_filter( 'pll_rel_hreflang_attributes', array( $this, 'default_hreflang' ) ); + add_action( 'pll_language_defined', array( $this, 'rest_locale' ), 10, 2 ); + add_action( 'admin_init', array( $this, 'register_strings' ) ); + } + + public function post_types( array $types, bool $is_settings ): array { + $own = array( Post_Types::SERVICE, Post_Types::DOCTOR, Post_Types::REVIEW, Post_Types::FAQ ); + if ( $is_settings ) { + return array_diff( $types, $own, array( Post_Types::BOOKING ) ); + } + unset( $types[ Post_Types::BOOKING ] ); + return array_merge( $types, array_combine( $own, $own ) ); + } + + public function rest_routes( array $routes ): array { + $routes['block-renderer'] = 'wp/v2/block-renderer'; + return $routes; + } + + public function breadcrumb_home( array $items ): array { + if ( isset( $items[0]['url'] ) && function_exists( 'pll_home_url' ) ) { + $items[0]['url'] = pll_home_url(); + } + return $items; + } + + public function taxonomies( array $taxonomies ): array { + unset( $taxonomies[ Post_Types::FAQ_GROUP ] ); + return $taxonomies; + } + + public function shared_slug( string $slug, int $post_id, string $status, string $post_type, int $parent, string $original ): string { + if ( $slug === $original || ! function_exists( 'pll_get_post_language' ) || ! pll_is_translated_post_type( $post_type ) ) { + return $slug; + } + $language = pll_get_post_language( $post_id ); + if ( ! $language ) { + return $slug; + } + global $wpdb; + $same = $wpdb->get_col( + $wpdb->prepare( + "SELECT ID FROM {$wpdb->posts} WHERE post_name = %s AND post_type = %s AND post_parent = %d AND ID <> %d", + $original, + $post_type, + $parent, + $post_id + ) + ); + foreach ( $same as $other ) { + if ( pll_get_post_language( (int) $other ) === $language ) { + return $slug; + } + } + return $original; + } + + public function query_language( \WP_Query $query ): void { + if ( is_admin() || ! $query->is_main_query() || ! function_exists( 'pll_current_language' ) || ! pll_current_language() ) { + return; + } + $is_page = '' !== (string) $query->get( 'pagename' ); + $name = $is_page ? basename( (string) $query->get( 'pagename' ) ) : (string) $query->get( 'name' ); + $post_type = $is_page ? 'page' : $query->get( 'post_type' ); + if ( '' === $name || ! is_string( $post_type ) || '' === $post_type || ! pll_is_translated_post_type( $post_type ) ) { + return; + } + $ids = get_posts( + array( + 'post_type' => $post_type, + 'post_name__in' => array( $name ), + 'lang' => pll_current_language(), + 'post_status' => 'any', + 'fields' => 'ids', + 'numberposts' => -1, + 'suppress_filters' => false, + ) + ); + if ( ! $ids ) { + return; + } + if ( $is_page ) { + $path = trim( (string) $query->get( 'pagename' ), '/' ); + $page = null; + foreach ( $ids as $id ) { + if ( get_page_uri( (int) $id ) === $path ) { + $page = (int) $id; + break; + } + } + if ( null === $page ) { + return; + } + $query->set( 'pagename', '' ); + $query->set( 'page_id', $page ); + $query->queried_object = get_post( $page ); + $query->queried_object_id = $page; + return; + } + $query->set( 'p', (int) $ids[0] ); + } + + public function rest_locale( string $slug, object $language ): void { + if ( defined( 'REST_REQUEST' ) && REST_REQUEST && ! empty( $language->locale ) ) { + switch_to_locale( $language->locale ); + } + } + + public function default_hreflang( array $hreflangs ): array { + if ( Seo::is_service_page() ) { + return array(); + } + $default = function_exists( 'pll_default_language' ) ? pll_default_language( 'locale' ) : ''; + foreach ( $hreflangs as $code => $url ) { + if ( $default && 0 === strpos( str_replace( '_', '-', $default ), $code ) ) { + $hreflangs['x-default'] = $url; + } + } + return $hreflangs; + } + + public function register_strings(): void { + if ( ! function_exists( 'pll_register_string' ) ) { + return; + } + $fields = Settings::fields(); + foreach ( self::STRINGS as $key => $multiline ) { + $value = Settings::raw( $key ); + if ( '' !== $value ) { + pll_register_string( (string) $fields[ $key ][0], $value, self::GROUP, $multiline ); + } + } + } + + public static function translate( string $key, string $value ): string { + if ( '' === $value || ! isset( self::STRINGS[ $key ] ) || ! function_exists( 'pll__' ) ) { + return $value; + } + return pll__( $value ); + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-markup.php b/wp-content/plugins/smilia-core/includes/class-markup.php new file mode 100644 index 0000000..8d143a9 --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-markup.php @@ -0,0 +1,114 @@ +%s', + esc_attr( sprintf( __( 'Изменить: %s', 'smilia-core' ), get_the_title( $post_id ) ) ), + esc_html__( 'Изменить', 'smilia-core' ) + ); + } + + public static function trail( ?WP_Post $post = null ): array { + $post = $post ?? get_post(); + if ( ! $post instanceof WP_Post ) { + return array(); + } + $home = function_exists( 'pll_home_url' ) ? pll_home_url() : home_url( '/' ); + $trail = array( + array( + 'title' => __( 'Home' ), + 'url' => $home, + ), + ); + if ( (int) get_option( 'page_on_front' ) === $post->ID || ( function_exists( 'pll_get_post' ) && (int) pll_get_post( (int) get_option( 'page_on_front' ) ) === $post->ID ) ) { + return $trail; + } + foreach ( array_reverse( get_post_ancestors( $post ) ) as $ancestor ) { + $trail[] = array( + 'title' => get_the_title( $ancestor ), + 'url' => get_permalink( $ancestor ), + ); + } + $trail[] = array( + 'title' => get_the_title( $post ), + 'url' => get_permalink( $post ), + ); + return $trail; + } + + public static function wave(): void { + echo ''; + } + + public static function asset( string $path ): string { + $url = plugins_url( 'assets/img/' . $path, SMILIA_CORE_FILE ); + $file = SMILIA_CORE_DIR . '/assets/img/' . $path; + return is_readable( $file ) ? add_query_arg( 'ver', (string) filemtime( $file ), $url ) : $url; + } + + public static function asset_svg( string $path, string $class_name = '', string $alt = '', string $loading = 'lazy' ): void { + Picture::svg( SMILIA_CORE_DIR . '/assets/img/' . $path, self::asset( $path ), $class_name, $alt, $loading ); + } + + public static function image( int $attachment_id, string $size, string $sizes, array $attr = array() ): void { + if ( $attachment_id <= 0 ) { + return; + } + echo wp_get_attachment_image( + $attachment_id, + $size, + false, + array_merge( + array( + 'sizes' => $sizes, + 'decoding' => 'async', + 'loading' => 'lazy', + ), + $attr + ) + ); + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-meta-fields.php b/wp-content/plugins/smilia-core/includes/class-meta-fields.php new file mode 100644 index 0000000..ed89792 --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-meta-fields.php @@ -0,0 +1,205 @@ + __( 'Бирюзовый', 'smilia-core' ), + 'pink' => __( 'Розовый', 'smilia-core' ), + 'yellow' => __( 'Жёлтый', 'smilia-core' ), + 'lavender' => __( 'Лавандовый', 'smilia-core' ), + 'peach' => __( 'Персиковый', 'smilia-core' ), + ); + } + + public static function sources(): array { + return array( + 'google' => 'Google', + 'booksy' => 'Booksy', + 'znanylekarz' => 'ZnanyLekarz', + ); + } + + public function register(): void { + add_action( 'init', array( $this, 'register_meta' ) ); + add_action( 'enqueue_block_editor_assets', array( $this, 'enqueue_panels' ) ); + add_filter( 'pll_copy_post_metas', array( $this, 'translation_metas' ) ); + } + + public function register_meta(): void { + foreach ( $this->definitions() as $post_type => $panels ) { + foreach ( $panels as $panel ) { + foreach ( $panel['fields'] as $field ) { + register_post_meta( + $post_type, + $field['key'], + array( + 'type' => 'string', + 'single' => true, + 'default' => $field['default'], + 'show_in_rest' => true, + 'sanitize_callback' => $field['sanitize'], + 'auth_callback' => static fn( $allowed, $meta_key, $post_id ): bool => current_user_can( 'edit_post', (int) $post_id ), + ) + ); + } + } + } + } + + public static function roles(): array { + return array( + 'physician' => __( 'Врач (в разметке Physician)', 'smilia-core' ), + 'person' => __( 'Специалист без врачебной степени (в разметке Person)', 'smilia-core' ), + ); + } + + public function sanitize_role( $value ): string { + $value = sanitize_key( (string) $value ); + return array_key_exists( $value, self::roles() ) ? $value : 'physician'; + } + + public function sanitize_tone( $value ): string { + $value = sanitize_key( (string) $value ); + return array_key_exists( $value, self::tones() ) ? $value : 'teal'; + } + + public function sanitize_source( $value ): string { + $value = sanitize_key( (string) $value ); + return array_key_exists( $value, self::sources() ) ? $value : ''; + } + + public function translation_metas( array $keys ): array { + $local = array( self::POSITION, self::EDUCATION, self::CREDENTIALS, self::TOPICS, self::TOPIC, self::SEO_TITLE ); + return array_values( array_unique( array_merge( array_diff( $keys, $local ), array( self::TONE, self::ROLE ) ) ) ); + } + + public function enqueue_panels(): void { + $screen = get_current_screen(); + $panels = $this->panels(); + if ( ! $screen || ! isset( $panels[ $screen->post_type ] ) ) { + return; + } + $asset = SMILIA_CORE_DIR . '/build/blocks/editor-fields/index.asset.php'; + if ( ! is_readable( $asset ) ) { + return; + } + $data = include $asset; + wp_enqueue_script( + 'smilia-editor-fields', + plugins_url( 'build/blocks/editor-fields/index.js', SMILIA_CORE_FILE ), + $data['dependencies'], + $data['version'], + true + ); + wp_add_inline_script( 'smilia-editor-fields', 'window.smiliaMetaPanels = ' . wp_json_encode( $panels ) . ';', 'before' ); + } + + private function options( array $options ): array { + $list = array(); + foreach ( $options as $value => $label ) { + $list[] = array( + 'value' => (string) $value, + 'label' => $label, + ); + } + return $list; + } + + private function field( string $key, string $control, string $label, callable|string $sanitize, array $extra = array() ): array { + return array_merge( + array( + 'key' => $key, + 'control' => $control, + 'label' => $label, + 'sanitize' => $sanitize, + 'default' => '', + ), + $extra + ); + } + + private function seo_panel( string $name ): array { + return array( + 'name' => $name, + 'title' => __( 'Для поисковиков', 'smilia-core' ), + 'fields' => array( + $this->field( self::SEO_TITLE, 'text', __( 'Заголовок для поисковиков (до 50 знаков, название сайта добавится само)', 'smilia-core' ), 'sanitize_text_field' ), + ), + 'help' => __( 'Описание для поисковиков (120-160 знаков) вводится в поле «Отрывок».', 'smilia-core' ), + ); + } + + private function tone_field( string $label ): array { + return $this->field( self::TONE, 'select', $label, array( $this, 'sanitize_tone' ), array( 'options' => $this->options( self::tones() ), 'default' => 'teal' ) ); + } + + private function definitions(): array { + return array( + Post_Types::SERVICE => array( + array( + 'name' => 'smilia-service', + 'title' => __( 'Оформление', 'smilia-core' ), + 'fields' => array( $this->tone_field( __( 'Цвет каймы', 'smilia-core' ) ) ), + ), + $this->seo_panel( 'smilia-service-seo' ), + ), + Post_Types::DOCTOR => array( + array( + 'name' => 'smilia-doctor', + 'title' => __( 'О враче', 'smilia-core' ), + 'fields' => array( + $this->field( self::POSITION, 'text', __( 'Должность', 'smilia-core' ), 'sanitize_text_field' ), + $this->tone_field( __( 'Цвет карточки', 'smilia-core' ) ), + $this->field( self::ROLE, 'select', __( 'Кто это (для микроразметки)', 'smilia-core' ), array( $this, 'sanitize_role' ), array( 'options' => $this->options( self::roles() ), 'default' => 'physician' ) ), + $this->field( self::EDUCATION, 'textarea', __( 'Образование (каждое с новой строки)', 'smilia-core' ), 'sanitize_textarea_field' ), + $this->field( self::CREDENTIALS, 'textarea', __( 'Специализации и квалификации (каждая с новой строки)', 'smilia-core' ), 'sanitize_textarea_field' ), + $this->field( self::TOPICS, 'textarea', __( 'Чем занимается (темы, каждая с новой строки)', 'smilia-core' ), 'sanitize_textarea_field' ), + ), + 'help' => __( 'Эти поля попадают в микроразметку врача для поисковиков. Пишите только то, что указано в тексте страницы врача.', 'smilia-core' ), + ), + $this->seo_panel( 'smilia-doctor-seo' ), + ), + Post_Types::REVIEW => array( + array( + 'name' => 'smilia-review', + 'title' => __( 'Об отзыве', 'smilia-core' ), + 'fields' => array( + $this->field( self::TOPIC, 'text', __( 'Тема (например, «Первый визит»)', 'smilia-core' ), 'sanitize_text_field' ), + $this->field( self::SOURCE, 'select', __( 'Где оставлен', 'smilia-core' ), array( $this, 'sanitize_source' ), array( 'options' => $this->options( array( '' => __( 'Не выбрано', 'smilia-core' ) ) + self::sources() ) ) ), + ), + ), + ), + 'page' => array( + $this->seo_panel( 'smilia-page-seo' ), + ), + ); + } + + private function panels(): array { + $panels = $this->definitions(); + foreach ( $panels as $post_type => $list ) { + foreach ( $list as $i => $panel ) { + foreach ( $panel['fields'] as $j => $field ) { + unset( $panels[ $post_type ][ $i ]['fields'][ $j ]['sanitize'] ); + } + } + } + return $panels; + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-picture.php b/wp-content/plugins/smilia-core/includes/class-picture.php new file mode 100644 index 0000000..84e5742 --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-picture.php @@ -0,0 +1,34 @@ +', + esc_attr( $class_name ), + esc_url( $url ), + esc_attr( $alt ), + (int) $size[0], + (int) $size[1], + esc_attr( $loading ) + ); + } + + private static function svg_size( string $path ): array { + if ( ! isset( self::$svg_sizes[ $path ] ) ) { + $head = is_readable( $path ) ? (string) file_get_contents( $path, false, null, 0, 600 ) : ''; + self::$svg_sizes[ $path ] = preg_match( '/viewBox="[\d.\-]+\s+[\d.\-]+\s+([\d.]+)\s+([\d.]+)"/', $head, $m ) + ? array( (int) round( (float) $m[1] ), (int) round( (float) $m[2] ) ) + : array( 100, 100 ); + } + return self::$svg_sizes[ $path ]; + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-plugin.php b/wp-content/plugins/smilia-core/includes/class-plugin.php new file mode 100644 index 0000000..23033aa --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-plugin.php @@ -0,0 +1,47 @@ +register(); + ( new Meta_Fields() )->register(); + ( new Settings() )->register(); + ( new Content() )->register(); + ( new Blocks() )->register(); + ( new Booking() )->register(); + ( new Captcha() )->register(); + ( new Seo() )->register(); + ( new Sitemap() )->register(); + ( new I18n() )->register(); + ( new Demo_Access() )->register(); + } + + public function load_textdomain(): void { + load_plugin_textdomain( 'smilia-core', false, dirname( plugin_basename( SMILIA_CORE_FILE ) ) . '/languages' ); + } + + public static function activate(): void { + ( new Post_Types() )->register_types(); + flush_rewrite_rules(); + Booking::schedule_cleanup(); + } + + public static function deactivate(): void { + flush_rewrite_rules(); + Booking::unschedule_cleanup(); + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-post-types.php b/wp-content/plugins/smilia-core/includes/class-post-types.php new file mode 100644 index 0000000..2e70dc4 --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-post-types.php @@ -0,0 +1,130 @@ + $this->labels( __( 'Услуги', 'smilia-core' ), __( 'Услуга', 'smilia-core' ) ), + 'public' => true, + 'show_in_rest' => true, + 'has_archive' => false, + 'menu_icon' => 'dashicons-heart', + 'menu_position' => 20, + 'rewrite' => array( + 'slug' => 'services', + 'with_front' => false, + ), + 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'page-attributes', 'custom-fields' ), + ) + ); + + register_post_type( + self::DOCTOR, + array( + 'labels' => $this->labels( __( 'Врачи', 'smilia-core' ), __( 'Врач', 'smilia-core' ) ), + 'public' => true, + 'show_in_rest' => true, + 'has_archive' => false, + 'menu_icon' => 'dashicons-id', + 'menu_position' => 21, + 'rewrite' => array( + 'slug' => 'doctors', + 'with_front' => false, + ), + 'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'page-attributes', 'custom-fields' ), + ) + ); + + register_post_type( + self::REVIEW, + array( + 'labels' => $this->labels( __( 'Отзывы', 'smilia-core' ), __( 'Отзыв', 'smilia-core' ) ), + 'public' => false, + 'show_ui' => true, + 'show_in_rest' => true, + 'exclude_from_search' => true, + 'menu_icon' => 'dashicons-format-quote', + 'menu_position' => 22, + 'supports' => array( 'title', 'editor', 'page-attributes', 'custom-fields' ), + ) + ); + + register_post_type( + self::FAQ, + array( + 'labels' => $this->labels( __( 'Вопросы', 'smilia-core' ), __( 'Вопрос', 'smilia-core' ) ), + 'public' => false, + 'show_ui' => true, + 'show_in_rest' => true, + 'exclude_from_search' => true, + 'menu_icon' => 'dashicons-editor-help', + 'menu_position' => 23, + 'supports' => array( 'title', 'editor', 'page-attributes' ), + ) + ); + + register_taxonomy( + self::FAQ_GROUP, + self::FAQ, + array( + 'labels' => array( + 'name' => __( 'Группы вопросов', 'smilia-core' ), + 'singular_name' => __( 'Группа вопросов', 'smilia-core' ), + ), + 'public' => false, + 'show_ui' => true, + 'show_in_rest' => true, + 'show_admin_column' => true, + 'hierarchical' => true, + ) + ); + + register_post_type( + self::BOOKING, + array( + 'labels' => $this->labels( __( 'Заявки', 'smilia-core' ), __( 'Заявка', 'smilia-core' ) ), + 'public' => false, + 'show_ui' => true, + 'show_in_rest' => false, + 'exclude_from_search' => true, + 'menu_icon' => 'dashicons-calendar-alt', + 'menu_position' => 24, + 'supports' => array( 'title' ), + 'capability_type' => 'post', + 'capabilities' => array( + 'create_posts' => 'do_not_allow', + ), + 'map_meta_cap' => true, + ) + ); + } + + private function labels( string $plural, string $singular ): array { + return array( + 'name' => $plural, + 'singular_name' => $singular, + 'menu_name' => $plural, + 'add_new_item' => sprintf( __( 'Добавить: %s', 'smilia-core' ), $singular ), + 'edit_item' => sprintf( __( 'Редактировать: %s', 'smilia-core' ), $singular ), + 'all_items' => sprintf( __( 'Все: %s', 'smilia-core' ), mb_strtolower( $plural ) ), + ); + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-prices.php b/wp-content/plugins/smilia-core/includes/class-prices.php new file mode 100644 index 0000000..a5fbec1 --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-prices.php @@ -0,0 +1,53 @@ + $name, + 'price' => self::format( $raw ), + 'amount' => ctype_digit( preg_replace( '/\s/', '', $raw ) ) && '' !== $raw ? (int) preg_replace( '/\s/', '', $raw ) : null, + ); + } + if ( '' === $title || ! $items ) { + continue; + } + $service = sanitize_title( (string) ( $group['service'] ?? '' ) ); + $result[] = array( + 'title' => $title, + 'service' => $service, + 'url' => $urls[ $service ] ?? '', + 'items' => $items, + ); + } + return $result; + } + + private static function plain( string $value ): string { + return trim( html_entity_decode( wp_strip_all_tags( $value ), ENT_QUOTES | ENT_HTML5, 'UTF-8' ) ); + } + + public static function format( string $price ): string { + $price = self::plain( $price ); + $digits = preg_replace( '/[^\d]/', '', $price ); + if ( '' === $price || $digits !== preg_replace( '/\s/', '', $price ) ) { + return $price; + } + return sprintf( __( 'от %s zł', 'smilia-core' ), number_format_i18n( (int) $digits ) ); + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-schema.php b/wp-content/plugins/smilia-core/includes/class-schema.php new file mode 100644 index 0000000..71efd61 --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-schema.php @@ -0,0 +1,946 @@ + 'Polski', + 'en' => 'English', + 'ru' => 'Русский', + ); + + private const SOURCES = array( + 'google' => 'Google', + 'booksy' => 'Booksy', + 'znanylekarz' => 'ZnanyLekarz', + ); + + private const NEW_PATIENTS = array( + 'pl' => 'Nowi pacjenci', + 'en' => 'New patients', + 'ru' => 'Новые пациенты', + ); + + private static ?array $price_span = null; + + private static ?array $price_groups = null; + + public static function graph( WP_Post $post ): array { + $home = home_url( '/' ); + $url = (string) wp_get_canonical_url( $post ); + $trail = Markup::trail( $post ); + $reviews = self::reviews( $post, $home ); + $catalog = self::price_catalog( $post, $url ); + + $service = self::service( $post, $home, $url ); + $procedure = self::procedure( $post, $url ); + $person = self::doctor( $post, $home, $url ); + + $nodes = array( + self::page( $post, $home, $url, array( + 'service' => $service, + 'procedure' => $procedure, + 'person' => $person, + 'catalog' => $catalog, + 'board' => $reviews['board'], + ) ), + ); + foreach ( array( $person, $service, $procedure ) as $extra ) { + if ( $extra ) { + $nodes[] = $extra; + } + } + $nodes[] = self::clinic( $home, $reviews['nodes'], $catalog ? array( '@id' => $catalog['@id'] ) : array() ); + $faq = self::faq( $post, $url ); + if ( $faq ) { + $nodes[] = $faq; + } + $others = self::other_doctors( $post, $url ); + if ( $others ) { + $nodes[] = $others; + } + if ( count( $trail ) > 1 ) { + $nodes[] = self::breadcrumb( $url, $trail ); + } + $nodes[] = self::website( $home ); + + return array( + '@context' => 'https://schema.org', + '@graph' => $nodes, + ); + } + + private static function website( string $home ): array { + $node = array( + '@type' => 'WebSite', + '@id' => $home . '#website', + 'url' => $home, + 'name' => get_bloginfo( 'name' ), + 'inLanguage' => self::locales(), + ); + $description = get_bloginfo( 'description' ); + if ( '' !== $description ) { + $node['description'] = $description; + } + return $node; + } + + private static function page( WP_Post $post, string $home, string $url, array $parts ): array { + $page = array( + '@type' => 'WebPage', + '@id' => $url . '#webpage', + 'url' => $url, + 'name' => wp_get_document_title(), + 'inLanguage' => get_bloginfo( 'language' ), + 'datePublished' => get_post_time( DATE_W3C, true, $post ), + 'dateModified' => get_post_modified_time( DATE_W3C, true, $post ), + ); + $description = Seo::description( $post ); + if ( '' !== $description ) { + $page['description'] = $description; + } + $image = self::post_image( $post ); + if ( $image ) { + $page['primaryImageOfPage'] = $image; + $page['image'] = $image; + } + $translations = self::translations( $post ); + if ( $translations ) { + $page['workTranslation'] = $translations; + } + if ( $parts['person'] ) { + $page['@type'] = 'ProfilePage'; + $page['mainEntity'] = array( '@id' => $parts['person']['@id'] ); + } elseif ( $parts['service'] ) { + $page['@type'] = 'MedicalWebPage'; + $page['specialty'] = array( 'https://schema.org/Dentistry', 'https://schema.org/Pediatric' ); + $page['mainEntity'] = array( '@id' => $parts['service']['@id'] ); + if ( $parts['procedure'] ) { + $page['about'] = array( '@id' => $parts['procedure']['@id'] ); + } + } elseif ( has_block( 'smilia/contacts-hero', $post ) ) { + $page['@type'] = 'ContactPage'; + $page['mainEntity'] = array( '@id' => $home . '#clinic' ); + } elseif ( $parts['catalog'] ) { + $page['@type'] = 'CollectionPage'; + $page['mainEntity'] = $parts['catalog']; + } elseif ( $parts['board'] ) { + $page['@type'] = 'CollectionPage'; + $page['mainEntity'] = $parts['board']; + } elseif ( has_block( 'smilia/prepare', $post ) ) { + $page['@type'] = 'MedicalWebPage'; + $page['audience'] = array( + '@type' => 'PeopleAudience', + 'audienceType' => self::NEW_PATIENTS[ self::language() ] ?? self::NEW_PATIENTS['en'], + ); + } elseif ( (int) $post->ID === self::front_id() ) { + $page['mainEntity'] = array( '@id' => $home . '#clinic' ); + } + return $page; + } + + private static function language(): string { + return function_exists( 'pll_current_language' ) ? (string) pll_current_language() : ''; + } + + private static function front_id(): int { + $front = (int) get_option( 'page_on_front' ); + if ( $front && function_exists( 'pll_get_post' ) ) { + $front = (int) pll_get_post( $front ) ?: $front; + } + return $front; + } + + private static function breadcrumb( string $url, array $trail ): array { + return array( + '@type' => 'BreadcrumbList', + '@id' => $url . '#breadcrumb', + 'itemListElement' => array_map( + static fn( array $crumb, int $index ): array => array( + '@type' => 'ListItem', + 'position' => $index + 1, + 'name' => $crumb['title'], + 'item' => $crumb['url'], + ), + $trail, + array_keys( $trail ) + ), + ); + } + + private static function clinic( string $home, array $reviews, array $catalog ): array { + $clinic = array( + '@type' => 'Dentist', + '@id' => $home . '#clinic', + 'name' => get_bloginfo( 'name' ), + 'url' => $home, + 'logo' => self::logo(), + ); + $description = get_bloginfo( 'description' ); + if ( '' !== $description ) { + $clinic['description'] = $description; + } + $images = self::clinic_images(); + if ( $images ) { + $clinic['image'] = 1 === count( $images ) ? $images[0] : $images; + } + $phone = Settings::get( 'phone_main' ); + if ( '' !== $phone ) { + $clinic['telephone'] = $phone; + } + $email = Settings::get( 'email' ); + if ( '' !== $email ) { + $clinic['email'] = $email; + } + $address = self::address( Settings::get( 'address' ) ); + if ( $address ) { + $clinic['address'] = $address; + $clinic['hasMap'] = add_query_arg( + array( + 'api' => 1, + 'query' => rawurlencode( Settings::get( 'address' ) ), + ), + 'https://www.google.com/maps/search/' + ); + if ( isset( $address['addressLocality'] ) ) { + $clinic['areaServed'] = array( + '@type' => 'City', + 'name' => $address['addressLocality'], + ); + } + } + $geo = self::geo(); + if ( $geo ) { + $clinic['geo'] = $geo; + } + $points = array(); + if ( '' !== $phone ) { + $points[] = array( + '@type' => 'ContactPoint', + 'contactType' => 'customer service', + 'telephone' => $phone, + 'availableLanguage' => self::languages(), + ); + } + $whatsapp = Settings::get( 'whatsapp' ); + if ( '' !== $whatsapp ) { + $points[] = array( + '@type' => 'ContactPoint', + 'contactType' => 'customer service', + 'telephone' => $whatsapp, + 'url' => 'https://wa.me/' . preg_replace( '/\D/', '', $whatsapp ), + 'availableLanguage' => self::languages(), + ); + } + if ( $points ) { + $clinic['contactPoint'] = $points; + } + $hours = self::opening_hours(); + if ( $hours ) { + $clinic['openingHoursSpecification'] = $hours; + } + $profiles = array_values( Settings::profiles() ); + if ( $profiles ) { + $clinic['sameAs'] = $profiles; + } + $span = self::price_span(); + if ( $span ) { + $clinic['priceRange'] = $span['min'] . '-' . $span['max'] . ' PLN'; + $clinic['currenciesAccepted'] = 'PLN'; + } + if ( $reviews ) { + $clinic['review'] = $reviews; + } + $clinic['medicalSpecialty'] = array( 'https://schema.org/Dentistry', 'https://schema.org/Pediatric' ); + $clinic['isAcceptingNewPatients'] = true; + $clinic['knowsLanguage'] = self::languages(); + + $services = array(); + foreach ( Content::services() as $service ) { + $services[] = array( + '@type' => 'Service', + '@id' => $service['url'] . '#service', + 'name' => $service['title'], + 'url' => $service['url'], + ); + } + if ( $catalog ) { + $clinic['hasOfferCatalog'] = $catalog; + } elseif ( $services ) { + $clinic['hasOfferCatalog'] = array( + '@type' => 'OfferCatalog', + 'name' => get_bloginfo( 'name' ), + 'itemListElement' => $services, + ); + } + $employees = array(); + foreach ( Content::doctors() as $doctor ) { + $employees[] = array( + '@type' => self::person_types( (int) $doctor['id'] ), + '@id' => $doctor['url'] . '#person', + 'name' => $doctor['name'], + 'url' => $doctor['url'], + 'jobTitle' => $doctor['position'], + ); + } + if ( $employees ) { + $clinic['employee'] = $employees; + } + return $clinic; + } + + private static function logo(): array|string { + $icon = (int) get_option( 'site_icon' ); + $src = $icon > 0 ? wp_get_attachment_image_src( $icon, 'full' ) : false; + if ( ! $src ) { + return get_theme_file_uri( 'assets/img/smilia-mark.svg' ); + } + return array( + '@type' => 'ImageObject', + 'url' => $src[0], + 'width' => (int) $src[1], + 'height' => (int) $src[2], + ); + } + + private static function clinic_images(): array { + $front = self::front_id(); + if ( $front <= 0 ) { + return array(); + } + $ids = array( (int) get_post_thumbnail_id( $front ) ); + $queue = parse_blocks( (string) get_post_field( 'post_content', $front ) ); + while ( $queue ) { + $block = array_shift( $queue ); + if ( 'smilia/office-photo' === $block['blockName'] ) { + $ids[] = (int) ( $block['attrs']['imageId'] ?? 0 ); + } + $queue = array_merge( $queue, $block['innerBlocks'] ); + } + $images = array(); + foreach ( array_unique( array_filter( $ids ) ) as $id ) { + $image = self::attachment( $id, Seo::IMAGE_SIZE ); + if ( $image ) { + $images[] = $image; + } + } + return $images; + } + + private static function geo(): array { + if ( ! preg_match( '/^\s*(-?\d{1,2}(?:\.\d+)?)\s*,\s*(-?\d{1,3}(?:\.\d+)?)\s*$/', Settings::raw( 'geo' ), $match ) ) { + return array(); + } + return array( + '@type' => 'GeoCoordinates', + 'latitude' => (float) $match[1], + 'longitude' => (float) $match[2], + ); + } + + private static function post_image( WP_Post $post ): ?array { + $id = (int) get_post_thumbnail_id( $post ); + return $id > 0 ? self::attachment( $id, Seo::IMAGE_SIZE ) : null; + } + + private static function attachment( int $id, string $size ): ?array { + $src = wp_get_attachment_image_src( $id, $size ); + if ( ! $src ) { + return null; + } + $node = array( + '@type' => 'ImageObject', + 'url' => $src[0], + 'contentUrl' => $src[0], + 'width' => (int) $src[1], + 'height' => (int) $src[2], + ); + $alt = trim( (string) get_post_meta( $id, '_wp_attachment_image_alt', true ) ); + if ( '' !== $alt ) { + $node['caption'] = $alt; + } + return $node; + } + + private static function address( string $address ): array { + if ( '' === $address ) { + return array(); + } + $result = array( + '@type' => 'PostalAddress', + 'streetAddress' => $address, + 'addressCountry' => 'PL', + ); + if ( preg_match( '/^(.+),\s*(\d{2}-\d{3})\s+(.+)$/u', $address, $parts ) ) { + $result['streetAddress'] = trim( $parts[1] ); + $result['postalCode'] = $parts[2]; + $result['addressLocality'] = trim( $parts[3] ); + } + return $result; + } + + private static function opening_hours(): array { + $rows = Settings::hours(); + if ( count( $rows ) !== count( self::DAYS ) ) { + return array(); + } + $result = array(); + foreach ( $rows as $index => $row ) { + if ( ! preg_match( '/(\d{1,2}:\d{2})\s*[–-]\s*(\d{1,2}:\d{2})/u', $row['time'], $time ) ) { + continue; + } + $result[] = array( + '@type' => 'OpeningHoursSpecification', + 'dayOfWeek' => 'https://schema.org/' . self::DAYS[ $index ], + 'opens' => str_pad( $time[1], 5, '0', STR_PAD_LEFT ), + 'closes' => str_pad( $time[2], 5, '0', STR_PAD_LEFT ), + ); + } + return $result; + } + + private static function locales(): array { + if ( ! function_exists( 'pll_languages_list' ) ) { + return array( get_bloginfo( 'language' ) ); + } + return array_values( array_map( static fn( string $locale ): string => str_replace( '_', '-', $locale ), (array) pll_languages_list( array( 'fields' => 'locale' ) ) ) ); + } + + private static function languages(): array { + $slugs = function_exists( 'pll_languages_list' ) ? (array) pll_languages_list( array( 'fields' => 'slug' ) ) : array(); + $list = array(); + foreach ( $slugs as $slug ) { + $list[] = array( + '@type' => 'Language', + 'name' => self::LANGUAGE_NAMES[ $slug ] ?? $slug, + 'alternateName' => $slug, + ); + } + return $list; + } + + private static function translations( WP_Post $post ): array { + if ( ! function_exists( 'pll_languages_list' ) || ! function_exists( 'pll_get_post' ) ) { + return array(); + } + $current = function_exists( 'pll_get_post_language' ) ? (string) pll_get_post_language( $post->ID ) : ''; + $result = array(); + foreach ( (array) pll_languages_list( array( 'fields' => 'slug' ) ) as $slug ) { + if ( $slug === $current ) { + continue; + } + $other = (int) pll_get_post( $post->ID, $slug ); + if ( $other <= 0 ) { + continue; + } + $link = get_permalink( $other ); + $result[] = array( + '@type' => 'WebPage', + '@id' => $link . '#webpage', + 'url' => $link, + 'inLanguage' => str_replace( '_', '-', (string) pll_get_post_language( $other, 'locale' ) ), + ); + } + return $result; + } + + private static function block_attributes( WP_Post $post, string $name ): array { + foreach ( parse_blocks( $post->post_content ) as $block ) { + if ( $name === $block['blockName'] ) { + return (array) $block['attrs']; + } + } + return array(); + } + + private static function lines( string $value ): array { + return array_values( array_filter( array_map( 'trim', (array) preg_split( '/\R/u', wp_strip_all_tags( $value ) ) ) ) ); + } + + private static function service( WP_Post $post, string $home, string $url ): array { + if ( Post_Types::SERVICE !== $post->post_type ) { + return array(); + } + $attributes = self::block_attributes( $post, 'smilia/service-page' ); + $offers = array(); + $amounts = array(); + foreach ( (array) ( $attributes['methods'] ?? array() ) as $method ) { + $price = (string) preg_replace( '/[\s\x{a0}]+/u', '', (string) ( $method['price'] ?? '' ) ); + if ( ! preg_match( '/\d+(?:[.,]\d+)?/', $price, $found ) ) { + continue; + } + $amount = (float) str_replace( ',', '.', $found[0] ); + $amounts[] = $amount; + $offers[] = array( + '@type' => 'Offer', + 'name' => wp_strip_all_tags( (string) ( $method['title'] ?? '' ) ), + 'priceSpecification' => array( + '@type' => 'PriceSpecification', + 'minPrice' => $amount, + 'priceCurrency' => 'PLN', + ), + ); + } + if ( ! $offers ) { + $link = get_permalink( $post ); + foreach ( self::price_groups() as $group ) { + if ( $link !== $group['url'] ) { + continue; + } + foreach ( $group['items'] as $item ) { + if ( null === $item['amount'] ) { + continue; + } + $amounts[] = $item['amount']; + $offers[] = array( + '@type' => 'Offer', + 'name' => $item['name'], + 'priceSpecification' => array( + '@type' => 'PriceSpecification', + 'minPrice' => $item['amount'], + 'priceCurrency' => 'PLN', + ), + ); + } + } + } + $title = get_the_title( $post ); + $node = array( + '@type' => 'Service', + '@id' => $url . '#service', + 'name' => $title, + 'serviceType' => $title, + 'url' => $url, + 'provider' => array( '@id' => $home . '#clinic' ), + 'audience' => array( + '@type' => 'PeopleAudience', + 'audienceType' => self::audience_label(), + ), + 'availableChannel' => array( + '@type' => 'ServiceChannel', + 'serviceUrl' => $url, + 'availableLanguage' => self::languages(), + ), + ); + $phone = Settings::get( 'phone_main' ); + if ( '' !== $phone ) { + $node['availableChannel']['servicePhone'] = array( + '@type' => 'ContactPoint', + 'telephone' => $phone, + 'contactType' => 'customer service', + ); + } + $city = self::address( Settings::get( 'address' ) )['addressLocality'] ?? ''; + if ( '' !== $city ) { + $node['areaServed'] = array( + '@type' => 'City', + 'name' => $city, + ); + } + $description = Seo::description( $post ); + if ( '' !== $description ) { + $node['description'] = $description; + } + $image = self::post_image( $post ); + if ( $image ) { + $node['image'] = $image; + } + if ( 1 === count( $offers ) ) { + $node['offers'] = $offers[0]; + } elseif ( $offers ) { + $node['hasOfferCatalog'] = array( + '@type' => 'OfferCatalog', + 'name' => $title, + 'itemListElement' => $offers, + ); + $node['offers'] = array( + '@type' => 'AggregateOffer', + 'lowPrice' => min( $amounts ), + 'highPrice' => max( $amounts ), + 'priceCurrency' => 'PLN', + 'offerCount' => count( $offers ), + ); + } + return $node; + } + + private static function audience_label(): string { + return array( + 'pl' => 'Dzieci', + 'en' => 'Children', + 'ru' => 'Дети', + )[ self::language() ] ?? 'Children'; + } + + private static function procedure( WP_Post $post, string $url ): array { + if ( Post_Types::SERVICE !== $post->post_type ) { + return array(); + } + $attributes = self::block_attributes( $post, 'smilia/service-page' ); + $steps = array(); + foreach ( (array) ( $attributes['steps'] ?? array() ) as $index => $step ) { + if ( ! is_array( $step ) ) { + continue; + } + $line = trim( wp_strip_all_tags( (string) ( $step['title'] ?? '' ) ) . '. ' . wp_strip_all_tags( (string) ( $step['text'] ?? '' ) ) ); + if ( '' !== trim( $line, '. ' ) ) { + $steps[] = ( $index + 1 ) . '. ' . $line; + } + } + $intro = trim( wp_strip_all_tags( (string) ( $attributes['intro'] ?? '' ) ) ); + if ( ! $steps && '' === $intro ) { + return array(); + } + $node = array( + '@type' => 'MedicalProcedure', + '@id' => $url . '#procedure', + 'name' => get_the_title( $post ), + 'url' => $url, + 'relevantSpecialty' => array( 'https://schema.org/Dentistry', 'https://schema.org/Pediatric' ), + ); + if ( '' !== $intro ) { + $node['description'] = $intro; + } + if ( $steps ) { + $node['howPerformed'] = implode( ' ', $steps ); + } + return $node; + } + + private static function doctor( WP_Post $post, string $home, string $url ): array { + if ( Post_Types::DOCTOR !== $post->post_type ) { + return array(); + } + $name = get_the_title( $post ); + $position = (string) get_post_meta( $post->ID, Meta_Fields::POSITION, true ); + $node = array( + '@type' => self::person_types( $post->ID ), + '@id' => $url . '#person', + 'name' => $name, + 'url' => $url, + 'jobTitle' => $position, + 'worksFor' => array( '@id' => $home . '#clinic' ), + ); + $parts = preg_split( '/\s+/u', trim( $name ), 2 ); + if ( 2 === count( $parts ) ) { + $node['givenName'] = $parts[0]; + $node['familyName'] = $parts[1]; + } + $description = Seo::description( $post ); + if ( '' !== $description ) { + $node['description'] = $description; + } + $thumb = (int) get_post_thumbnail_id( $post ); + $photo = $thumb > 0 ? self::attachment( $thumb, 'full' ) : null; + if ( $photo ) { + $node['image'] = $photo; + } + if ( is_array( $node['@type'] ) ) { + $node['practicesAt'] = array( '@id' => $home . '#clinic' ); + $node['medicalSpecialty'] = array( 'https://schema.org/Dentistry', 'https://schema.org/Pediatric' ); + $node['isAcceptingNewPatients'] = true; + } + $education = self::lines( (string) get_post_meta( $post->ID, Meta_Fields::EDUCATION, true ) ); + if ( $education ) { + $node['alumniOf'] = array_map( + static fn( string $school ): array => array( + '@type' => 'CollegeOrUniversity', + 'name' => $school, + ), + $education + ); + } + $credentials = self::lines( (string) get_post_meta( $post->ID, Meta_Fields::CREDENTIALS, true ) ); + if ( $credentials ) { + $node['hasCredential'] = array_map( + static fn( string $credential ): array => array( + '@type' => 'EducationalOccupationalCredential', + 'name' => $credential, + ), + $credentials + ); + } + $topics = self::lines( (string) get_post_meta( $post->ID, Meta_Fields::TOPICS, true ) ); + if ( $topics ) { + $node['knowsAbout'] = $topics; + } + $city = self::address( Settings::get( 'address' ) )['addressLocality'] ?? ''; + $experience = trim( wp_strip_all_tags( (string) ( self::block_attributes( $post, 'smilia/doctor-page' )['experience'] ?? '' ) ) ); + if ( '' !== $position ) { + $occupation = array( + '@type' => 'Occupation', + 'name' => $position, + ); + if ( '' !== $experience ) { + $occupation['description'] = $experience; + } + if ( '' !== $city ) { + $occupation['occupationLocation'] = array( + '@type' => 'City', + 'name' => $city, + ); + } + $node['hasOccupation'] = $occupation; + } + return $node; + } + + private static function person_types( int $post_id ): array|string { + return 'person' === (string) get_post_meta( $post_id, Meta_Fields::ROLE, true ) ? 'Person' : array( 'Person', 'IndividualPhysician' ); + } + + private static function other_doctors( WP_Post $post, string $url ): array { + if ( Post_Types::DOCTOR !== $post->post_type ) { + return array(); + } + $items = array(); + foreach ( Content::doctors() as $doctor ) { + if ( (int) $doctor['id'] === (int) $post->ID ) { + continue; + } + $items[] = array( + '@type' => 'ListItem', + 'position' => count( $items ) + 1, + 'name' => $doctor['name'], + 'url' => $doctor['url'], + ); + } + if ( ! $items ) { + return array(); + } + $title = trim( wp_strip_all_tags( (string) ( self::block_attributes( $post, 'smilia/doctor-page' )['othersTitle'] ?? '' ) ) ); + $list = array( + '@type' => 'ItemList', + '@id' => $url . '#doctors', + 'itemListElement' => $items, + ); + if ( '' !== $title ) { + $list['name'] = $title; + } + return $list; + } + + private static function faq( WP_Post $post, string $url ): array { + $questions = array(); + $title = ''; + foreach ( parse_blocks( $post->post_content ) as $block ) { + if ( 'smilia/faq' !== $block['blockName'] ) { + continue; + } + if ( '' === $title ) { + $type = \WP_Block_Type_Registry::get_instance()->get_registered( 'smilia/faq' ); + $attrs = $type ? $type->prepare_attributes_for_render( (array) $block['attrs'] ) : (array) $block['attrs']; + $title = trim( preg_replace( '/\s+/u', ' ', wp_strip_all_tags( str_replace( '
', ' ', (string) ( $attrs['title'] ?? '' ) ) ) ) ); + } + $questions = array_merge( $questions, self::questions( $block ) ); + } + if ( ! $questions ) { + return array(); + } + $node = array( + '@type' => 'FAQPage', + '@id' => $url . '#faq', + 'inLanguage' => get_bloginfo( 'language' ), + 'mainEntity' => $questions, + ); + if ( '' !== $title ) { + $node['name'] = $title; + } + return $node; + } + + private static function questions( array $block ): array { + return array_map( + static fn( array $item ): array => array( + '@type' => 'Question', + 'name' => $item['question'], + 'acceptedAnswer' => array( + '@type' => 'Answer', + 'text' => trim( wp_strip_all_tags( preg_replace( '#]*)?>.*?#is', '', $item['answer'] ) ) ), + ), + ), + Content::faq( (string) ( $block['attrs']['group'] ?? 'home' ) ) + ); + } + + private static function reviews( WP_Post $post, string $home ): array { + $empty = array( + 'board' => array(), + 'nodes' => array(), + ); + $board = has_block( 'smilia/reviews-board', $post ); + $limit = $board ? 100 : ( has_block( 'smilia/reviews', $post ) ? 3 : 0 ); + if ( $limit <= 0 ) { + return $empty; + } + $nodes = array(); + foreach ( Content::reviews( $limit ) as $review ) { + $node = array( + '@type' => 'Review', + '@id' => $home . '#review-' . (int) $review['id'], + 'author' => array( + '@type' => 'Person', + 'name' => $review['author'], + ), + 'reviewBody' => $review['text'], + 'datePublished' => get_post_time( DATE_W3C, true, (int) $review['id'] ), + 'inLanguage' => get_bloginfo( 'language' ), + ); + if ( '' !== $review['topic'] ) { + $node['name'] = $review['topic']; + } + if ( isset( self::SOURCES[ $review['source'] ] ) ) { + $publisher = array( + '@type' => 'Organization', + 'name' => self::SOURCES[ $review['source'] ], + ); + $link = Settings::get( 'review_' . $review['source'] ); + if ( '' !== $link ) { + $publisher['url'] = $link; + } + $node['publisher'] = $publisher; + } + $nodes[] = $node; + } + if ( ! $nodes ) { + return $empty; + } + if ( ! $board ) { + return array( + 'board' => array(), + 'nodes' => $nodes, + ); + } + return array( + 'board' => array( + '@type' => 'ItemList', + 'name' => get_the_title( $post ), + 'itemListElement' => array_map( + static fn( array $node, int $index ): array => array( + '@type' => 'ListItem', + 'position' => $index + 1, + 'item' => array( '@id' => $node['@id'] ), + ), + $nodes, + array_keys( $nodes ) + ), + ), + 'nodes' => $nodes, + ); + } + + private static function price_catalog( WP_Post $post, string $url ): array { + $attributes = self::block_attributes( $post, 'smilia/prices' ); + if ( ! $attributes ) { + return array(); + } + $sections = array(); + foreach ( Prices::groups( (array) ( $attributes['groups'] ?? array() ) ) as $group ) { + $offers = array(); + foreach ( $group['items'] as $item ) { + if ( null === $item['amount'] ) { + continue; + } + $offer = array( + '@type' => 'Offer', + 'name' => $item['name'], + 'priceSpecification' => array( + '@type' => 'PriceSpecification', + 'minPrice' => $item['amount'], + 'priceCurrency' => 'PLN', + ), + ); + if ( '' !== $group['url'] ) { + $offer['itemOffered'] = array( + '@type' => 'Service', + '@id' => $group['url'] . '#service', + 'name' => $group['title'], + 'url' => $group['url'], + ); + } + $offers[] = $offer; + } + if ( ! $offers ) { + continue; + } + $section = array( + '@type' => 'OfferCatalog', + 'name' => $group['title'], + 'itemListElement' => $offers, + ); + if ( '' !== $group['url'] ) { + $section['url'] = $group['url']; + } + $sections[] = $section; + } + if ( ! $sections ) { + return array(); + } + return array( + '@type' => 'OfferCatalog', + '@id' => $url . '#catalog', + 'name' => get_the_title( $post ), + 'itemListElement' => $sections, + ); + } + + private static function price_groups(): array { + if ( null !== self::$price_groups ) { + return self::$price_groups; + } + $pages = get_posts( + array( + 'post_type' => 'page', + 'name' => 'prices', + 'post_status' => 'publish', + 'numberposts' => 1, + 'lang' => self::language(), + ) + ); + self::$price_groups = $pages ? Prices::groups( (array) ( self::block_attributes( $pages[0], 'smilia/prices' )['groups'] ?? array() ) ) : array(); + return self::$price_groups; + } + + private static function price_span(): ?array { + if ( null !== self::$price_span ) { + return self::$price_span ?: null; + } + self::$price_span = array(); + $pages = get_posts( + array( + 'post_type' => 'page', + 'name' => 'prices', + 'post_status' => 'publish', + 'numberposts' => 1, + 'lang' => '', + ) + ); + if ( ! $pages ) { + return null; + } + $amounts = array(); + foreach ( (array) ( self::block_attributes( $pages[0], 'smilia/prices' )['groups'] ?? array() ) as $group ) { + foreach ( Prices::groups( array( $group ) ) as $parsed ) { + foreach ( $parsed['items'] as $item ) { + if ( null !== $item['amount'] ) { + $amounts[] = $item['amount']; + } + } + } + } + if ( $amounts ) { + self::$price_span = array( + 'min' => min( $amounts ), + 'max' => max( $amounts ), + ); + } + return self::$price_span ?: null; + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-seo.php b/wp-content/plugins/smilia-core/includes/class-seo.php new file mode 100644 index 0000000..10cc8cd --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-seo.php @@ -0,0 +1,126 @@ + $custom, + 'site' => get_bloginfo( 'name' ), + ); + } + if ( is_front_page() && ! empty( $parts['tagline'] ) ) { + return array( + 'title' => $parts['tagline'], + 'site' => get_bloginfo( 'name' ), + ); + } + return $parts; + } + + public function supports(): void { + add_post_type_support( 'page', 'excerpt' ); + } + + public function image_size(): void { + add_image_size( self::IMAGE_SIZE, 1200, 630, true ); + } + + public static function is_service_page(): bool { + return is_page() && in_array( (string) get_post_field( 'post_name', get_queried_object_id() ), self::SERVICE_PAGES, true ); + } + + public function meta(): void { + if ( ! is_singular() || self::is_service_page() ) { + return; + } + $post = get_queried_object(); + $description = self::description( $post ); + $image = self::image( $post ); + $url = (string) wp_get_canonical_url( $post ); + + $tags = array( + array( 'name', 'description', $description ), + array( 'property', 'og:type', is_singular( 'post' ) ? 'article' : 'website' ), + array( 'property', 'og:site_name', get_bloginfo( 'name' ) ), + array( 'property', 'og:title', wp_get_document_title() ), + array( 'property', 'og:description', $description ), + array( 'property', 'og:url', $url ), + array( 'property', 'og:locale', get_locale() ), + ); + foreach ( self::alternate_locales() as $locale ) { + $tags[] = array( 'property', 'og:locale:alternate', $locale ); + } + if ( $image ) { + $tags[] = array( 'property', 'og:image', $image[0] ); + $tags[] = array( 'property', 'og:image:width', (string) $image[1] ); + $tags[] = array( 'property', 'og:image:height', (string) $image[2] ); + } + $tags[] = array( 'name', 'twitter:card', $image ? 'summary_large_image' : 'summary' ); + + foreach ( $tags as list( $attribute, $name, $content ) ) { + if ( '' !== $content ) { + printf( '' . "\n", esc_attr( $attribute ), esc_attr( $name ), esc_attr( $content ) ); + } + } + } + + public function schema(): void { + if ( ! is_singular() || self::is_service_page() ) { + return; + } + printf( + '' . "\n", + wp_json_encode( Schema::graph( get_queried_object() ), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG ) + ); + } + + public static function description( \WP_Post $post ): string { + return trim( wp_strip_all_tags( has_excerpt( $post ) ? $post->post_excerpt : '' ) ); + } + + private static function image( \WP_Post $post ): ?array { + $id = (int) get_post_thumbnail_id( $post ); + if ( $id <= 0 ) { + $front = (int) get_option( 'page_on_front' ); + if ( $front && function_exists( 'pll_get_post' ) ) { + $front = (int) pll_get_post( $front ) ?: $front; + } + $id = $front > 0 ? (int) get_post_thumbnail_id( $front ) : 0; + } + if ( $id <= 0 ) { + return null; + } + $image = wp_get_attachment_image_src( $id, self::IMAGE_SIZE ); + return $image ? array( $image[0], (int) $image[1], (int) $image[2] ) : null; + } + + private static function alternate_locales(): array { + if ( ! function_exists( 'pll_languages_list' ) ) { + return array(); + } + return array_values( array_diff( (array) pll_languages_list( array( 'fields' => 'locale' ) ), array( get_locale() ) ) ); + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-settings.php b/wp-content/plugins/smilia-core/includes/class-settings.php new file mode 100644 index 0000000..24e6c44 --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-settings.php @@ -0,0 +1,178 @@ + array( __( 'Телефон регистратуры', 'smilia-core' ), 'text' ), + 'phone_new' => array( __( 'Телефон для новых пациентов', 'smilia-core' ), 'text' ), + 'phone_current' => array( __( 'Телефон для действующих пациентов', 'smilia-core' ), 'text' ), + 'whatsapp' => array( __( 'WhatsApp', 'smilia-core' ), 'text' ), + 'email' => array( __( 'Email', 'smilia-core' ), 'email' ), + 'address' => array( __( 'Адрес', 'smilia-core' ), 'text' ), + 'geo' => array( __( 'Координаты клиники (широта, долгота)', 'smilia-core' ), 'text' ), + 'instagram' => array( __( 'Instagram', 'smilia-core' ), 'url' ), + 'facebook' => array( __( 'Facebook', 'smilia-core' ), 'url' ), + 'review_google' => array( __( 'Google: страница для отзыва', 'smilia-core' ), 'url' ), + 'review_booksy' => array( __( 'Booksy: страница для отзыва', 'smilia-core' ), 'url' ), + 'review_znanylekarz' => array( __( 'ZnanyLekarz: страница для отзыва', 'smilia-core' ), 'url' ), + 'hours' => array( __( 'Часы работы (семь строк «День|Время» с понедельника, один промежуток на день)', 'smilia-core' ), 'textarea' ), + 'booking_title' => array( __( 'Заголовок', 'smilia-core' ), 'text', __( 'Запись на детский приём', 'smilia-core' ), 'smilia_booking' ), + 'booking_lead' => array( __( 'Текст под заголовком', 'smilia-core' ), 'textarea', __( 'Администратор перезвонит и поможет подобрать удобное время.', 'smilia-core' ), 'smilia_booking' ), + 'booking_submit' => array( __( 'Кнопка отправки', 'smilia-core' ), 'text', __( 'Отправить заявку', 'smilia-core' ), 'smilia_booking' ), + 'booking_done' => array( __( 'Заголовок после отправки', 'smilia-core' ), 'text', __( 'Заявка отправлена', 'smilia-core' ), 'smilia_booking' ), + 'booking_thanks' => array( __( 'Текст после отправки', 'smilia-core' ), 'textarea', __( 'Спасибо! Администратор перезвонит в рабочее время.', 'smilia-core' ), 'smilia_booking' ), + 'booking_email' => array( __( 'Почта для заявок (пусто: почта администратора сайта)', 'smilia-core' ), 'email', '', 'smilia_booking' ), + ); + } + + public static function sections(): array { + return array( + 'smilia_main' => '', + 'smilia_booking' => __( 'Окно записи', 'smilia-core' ), + ); + } + + public static function get( string $key ): string { + $value = self::raw( $key ); + if ( '' !== $value ) { + return I18n::translate( $key, $value ); + } + $field = self::fields()[ $key ] ?? array(); + return isset( $field[2] ) ? (string) $field[2] : ''; + } + + public static function profiles(): array { + return array_filter( + array( + 'instagram' => self::get( 'instagram' ), + 'facebook' => self::get( 'facebook' ), + ), + static fn( string $link ): bool => '' !== trim( (string) wp_parse_url( $link, PHP_URL_PATH ), '/' ) + ); + } + + public static function raw( string $key ): string { + $options = get_option( self::OPTION, array() ); + return is_array( $options ) && isset( $options[ $key ] ) ? trim( (string) $options[ $key ] ) : ''; + } + + public static function hours(): array { + $rows = array(); + foreach ( preg_split( '/\R/u', self::get( 'hours' ) ) as $line ) { + $parts = array_map( 'trim', explode( '|', $line, 2 ) ); + if ( 2 === count( $parts ) && '' !== $parts[0] ) { + $rows[] = array( + 'day' => $parts[0], + 'time' => $parts[1], + ); + } + } + return $rows; + } + + public static function schedule(): array { + $result = array(); + foreach ( self::hours() as $row ) { + $open = preg_match( '/(\d{1,2}):(\d{2})\D+(\d{1,2}):(\d{2})/u', $row['time'], $match ); + $result[] = array( + 'day' => $row['day'], + 'open' => $open ? (int) $match[1] * 60 + (int) $match[2] : null, + 'close' => $open ? (int) $match[3] * 60 + (int) $match[4] : null, + ); + } + return $result; + } + + public static function tel( string $phone ): string { + $plus = str_starts_with( trim( $phone ), '+' ) ? '+' : ''; + return 'tel:' . $plus . preg_replace( '/\D/', '', $phone ); + } + + public function register(): void { + add_action( 'admin_init', array( $this, 'register_setting' ) ); + add_action( 'admin_menu', array( $this, 'add_page' ) ); + } + + public function register_setting(): void { + register_setting( + self::PAGE, + self::OPTION, + array( + 'type' => 'object', + 'sanitize_callback' => array( $this, 'sanitize' ), + 'default' => array(), + ) + ); + foreach ( self::sections() as $section => $title ) { + add_settings_section( $section, $title, '__return_false', self::PAGE ); + } + foreach ( self::fields() as $key => $field ) { + add_settings_field( + $key, + $field[0], + array( $this, 'render_field' ), + self::PAGE, + $field[3] ?? 'smilia_main', + array( + 'key' => $key, + 'type' => $field[1], + 'label_for' => self::OPTION . '_' . $key, + ) + ); + } + } + + public function sanitize( $input ): array { + $clean = array(); + if ( ! is_array( $input ) ) { + return $clean; + } + foreach ( self::fields() as $key => $field ) { + $value = isset( $input[ $key ] ) ? (string) $input[ $key ] : ''; + $clean[ $key ] = match ( $field[1] ) { + 'email' => sanitize_email( $value ), + 'url' => esc_url_raw( $value ), + 'number' => (string) absint( $value ), + 'textarea' => sanitize_textarea_field( $value ), + default => sanitize_text_field( $value ), + }; + } + return $clean; + } + + public function add_page(): void { + add_options_page( __( 'Клиника', 'smilia-core' ), __( 'Клиника', 'smilia-core' ), 'manage_options', self::PAGE, array( $this, 'render_page' ) ); + } + + public function render_field( array $args ): void { + $name = self::OPTION . '[' . $args['key'] . ']'; + $id = $args['label_for']; + $options = get_option( self::OPTION, array() ); + $value = is_array( $options ) && isset( $options[ $args['key'] ] ) ? (string) $options[ $args['key'] ] : ''; + $default = (string) ( self::fields()[ $args['key'] ][2] ?? '' ); + if ( 'textarea' === $args['type'] ) { + printf( '', 'hours' === $args['key'] ? 7 : 3, esc_attr( $id ), esc_attr( $name ), esc_attr( $default ), esc_textarea( $value ) ); + return; + } + printf( '', esc_attr( 'number' === $args['type'] ? 'number' : 'text' ), esc_attr( $id ), esc_attr( $name ), esc_attr( $value ), esc_attr( $default ) ); + } + + public function render_page(): void { + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + echo '

' . esc_html__( 'Клиника', 'smilia-core' ) . '

'; + settings_fields( self::PAGE ); + do_settings_sections( self::PAGE ); + submit_button(); + echo '
'; + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-sitemap-renderer.php b/wp-content/plugins/smilia-core/includes/class-sitemap-renderer.php new file mode 100644 index 0000000..3420edc --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-sitemap-renderer.php @@ -0,0 +1,35 @@ +' . $this->stylesheet . '' + ); + foreach ( $url_list as $item ) { + $url = $urlset->addChild( 'url' ); + $url->addChild( 'loc', esc_url( $item['loc'] ) ); + foreach ( array( 'lastmod', 'changefreq', 'priority' ) as $name ) { + if ( isset( $item[ $name ] ) ) { + $url->addChild( $name, esc_xml( (string) $item[ $name ] ) ); + } + } + foreach ( (array) ( $item['alternates'] ?? array() ) as $language => $href ) { + $link = $url->addChild( 'xhtml:link', null, self::XHTML ); + $link->addAttribute( 'rel', 'alternate' ); + $link->addAttribute( 'hreflang', (string) $language ); + $link->addAttribute( 'href', esc_url( $href ) ); + } + } + return $urlset->asXML(); + } +} diff --git a/wp-content/plugins/smilia-core/includes/class-sitemap.php b/wp-content/plugins/smilia-core/includes/class-sitemap.php new file mode 100644 index 0000000..77f93f5 --- /dev/null +++ b/wp-content/plugins/smilia-core/includes/class-sitemap.php @@ -0,0 +1,79 @@ + 'page', + 'post_name__in' => Seo::SERVICE_PAGES, + 'post_status' => 'publish', + 'fields' => 'ids', + 'posts_per_page' => -1, + 'lang' => '', + ) + ); + if ( $hidden ) { + $args['post__not_in'] = array_merge( (array) ( $args['post__not_in'] ?? array() ), $hidden ); + } + return $args; + } + + public function entry( array $entry, WP_Post $post ): array { + if ( ! function_exists( 'pll_get_post_translations' ) || ! function_exists( 'pll_get_post_language' ) ) { + return $entry; + } + $links = array(); + foreach ( (array) pll_get_post_translations( $post->ID ) as $id ) { + if ( 'publish' !== get_post_status( (int) $id ) ) { + continue; + } + $links[ (string) pll_get_post_language( (int) $id, 'slug' ) ] = (string) get_permalink( (int) $id ); + } + if ( count( $links ) < 2 ) { + return $entry; + } + if ( function_exists( 'pll_languages_list' ) ) { + $order = array_flip( (array) pll_languages_list( array( 'fields' => 'slug' ) ) ); + uksort( $links, static fn( string $a, string $b ): int => ( $order[ $a ] ?? PHP_INT_MAX ) <=> ( $order[ $b ] ?? PHP_INT_MAX ) ); + } + $default = function_exists( 'pll_default_language' ) ? (string) pll_default_language( 'slug' ) : ''; + if ( isset( $links[ $default ] ) ) { + $links['x-default'] = $links[ $default ]; + } + $entry['alternates'] = $links; + return $entry; + } + + public function renderer( WP_Sitemaps $sitemaps ): void { + $sitemaps->renderer = new Sitemap_Renderer(); + } +} diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-08e4776ffc12c376a54cb7476c45fcda.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-08e4776ffc12c376a54cb7476c45fcda.json new file mode 100644 index 0000000..6bcf771 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-08e4776ffc12c376a54cb7476c45fcda.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/prepare\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Heading"],"\u041a\u043d\u043e\u043f\u043a\u0430":["Button"],"\u0422\u0435\u043a\u0441\u0442":["Text"],"\u041f\u0443\u043d\u043a\u0442 \u0441\u043f\u0438\u0441\u043a\u0430":["List item"],"\u0423\u0431\u0440\u0430\u0442\u044c \u043f\u0443\u043d\u043a\u0442":["Remove item"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0437\u0430\u043f\u0438\u0441\u043a\u0438":["Note heading"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0443\u043d\u043a\u0442":["Add item"],"\u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435":["Invitation"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-155090dcc70d53c812676304673fe8c4.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-155090dcc70d53c812676304673fe8c4.json new file mode 100644 index 0000000..174aea9 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-155090dcc70d53c812676304673fe8c4.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/reviews-board\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Heading"],"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0442\u0437\u044b\u0432\u044b":["Edit reviews"],"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u043d \u0434\u043e\u0441\u043a\u0438":["Replace board background"],"\u041f\u043e\u0434\u043f\u0438\u0441\u044c":["Caption"],"\u0422\u0435\u043a\u0441\u0442 \u043f\u0435\u0440\u0435\u0434 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438":["Text before the links"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-1f770092aa882349b2696321a09e8eea.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-1f770092aa882349b2696321a09e8eea.json new file mode 100644 index 0000000..0b95800 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-1f770092aa882349b2696321a09e8eea.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/hero\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Heading"],"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Replace photo"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Add photo"],"\u0424\u043e\u0442\u043e":["Photo"],"\u041a\u043d\u043e\u043f\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u0438":["Booking button"],"\u041f\u043e\u0434\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Subheading"],"\u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0444\u043e\u0442\u043e":["Photo position"],"\u041f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0442\u043e\u0447\u043a\u0443 \u043d\u0430 \u043b\u0438\u0446\u043e: \u044d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0444\u043e\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0434\u0440\u0435. \u041b\u0443\u0447\u0448\u0435 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0444\u043e\u0442\u043e \u043e\u0442 2000 px \u043f\u043e \u0448\u0438\u0440\u0438\u043d\u0435.":["Drag the point onto the face: this part of the photo always stays in frame. A landscape photo at least 2000 px wide works best."],"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0444\u043e\u0442\u043e \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u00ab\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u0442\u043e\u00bb \u043d\u0430\u0434 \u0431\u043b\u043e\u043a\u043e\u043c.":["First add a photo with the \u201cAdd photo\u201d button above the block."],"\u0412\u0442\u043e\u0440\u0430\u044f \u043a\u043d\u043e\u043f\u043a\u0430":["Second button"],"\u0421\u0441\u044b\u043b\u043a\u0430":["Link"],"\u0410\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438\u043b\u0438 \u044f\u043a\u043e\u0440\u044c \u0432\u0438\u0434\u0430 #contacts.":["Page address or an anchor such as #contacts."]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-3f42ffe2a9355b2d78900a5dfebc01b8.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-3f42ffe2a9355b2d78900a5dfebc01b8.json new file mode 100644 index 0000000..5ada144 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-3f42ffe2a9355b2d78900a5dfebc01b8.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/doctor-page\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0412\u0440\u0430\u0447":["Dentist"],"\u0421\u0442\u0430\u0436, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u00ab\u0441\u0442\u0430\u0436 10 \u043b\u0435\u0442\u00bb":["Experience, e.g. \u201c10 years of experience\u201d"],"\u0420\u0430\u0441\u0441\u043a\u0430\u0437, \u043a\u0430\u0436\u0434\u044b\u0439 \u0430\u0431\u0437\u0430\u0446 \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438":["Bio, each paragraph on a new line"],"\u041f\u043e\u0434\u043f\u0438\u0441\u0438":["Labels"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0440\u0430\u0447\u0435\u0439":["Other dentists heading"],"\u041a\u043d\u043e\u043f\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u0438":["Booking button"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-4078dced61757e716872cd62d01adabc.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-4078dced61757e716872cd62d01adabc.json new file mode 100644 index 0000000..3fb60c6 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-4078dced61757e716872cd62d01adabc.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/faq\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430":["Section heading"],"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b":["Edit questions"],"\u0412\u043e\u043f\u0440\u043e\u0441\u044b":["Questions"],"\u0413\u0440\u0443\u043f\u043f\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432":["Question group"],"\u042f\u0440\u043b\u044b\u043a \u0433\u0440\u0443\u043f\u043f\u044b \u0438\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u00ab\u0412\u043e\u043f\u0440\u043e\u0441\u044b\u00bb, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 home.":["Group slug from the Questions section, e.g. home."],"\u041f\u043e\u0434\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Subheading"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-414b6e8cfcca8fcca4f473c2e14c9583.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-414b6e8cfcca8fcca4f473c2e14c9583.json new file mode 100644 index 0000000..50658dd --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-414b6e8cfcca8fcca4f473c2e14c9583.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/services\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0422\u0435\u043a\u0441\u0442 \u043a\u043d\u043e\u043f\u043a\u0438":["Button text"],"\u041a\u043d\u043e\u043f\u043a\u0430":["Button"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430":["Section heading"],"\u041f\u043e\u0434\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Subheading"],"\u0421\u0441\u044b\u043b\u043a\u0430":["Link"],"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u0441\u043b\u0443\u0433\u0438":["Edit services"],"\u0410\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \/prices\/.":["Page address, e.g. \/prices\/."]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-429199f2ac2416dd407cac0ad9510518.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-429199f2ac2416dd407cac0ad9510518.json new file mode 100644 index 0000000..71e1acb --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-429199f2ac2416dd407cac0ad9510518.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/prices\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430":["Procedure"],"\u0411\u0435\u0437 \u0443\u0441\u043b\u0443\u0433\u0438":["No service"],"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0443\u043f\u043f\u044b":["Group name"],"\u0426\u0435\u043d\u0430, z\u0142":["Price, z\u0142"],"\u0423\u0431\u0440\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443":["Remove row"],"\u0423\u0441\u043b\u0443\u0433\u0430":["Service"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443":["Add row"],"\u0423\u0431\u0440\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443":["Remove group"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443":["Add group"],"\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043f\u043e\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439":["Note below the table"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-462b2b7d0fb2d4e87e473b5d32f505cc.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-462b2b7d0fb2d4e87e473b5d32f505cc.json new file mode 100644 index 0000000..2aacf31 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-462b2b7d0fb2d4e87e473b5d32f505cc.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/installment\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Heading"],"\u041a\u043d\u043e\u043f\u043a\u0430":["Button"],"\u0422\u0435\u043a\u0441\u0442":["Text"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-4e381418bc65de05fbf2258ca7e616a9.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-4e381418bc65de05fbf2258ca7e616a9.json new file mode 100644 index 0000000..faafcfb --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-4e381418bc65de05fbf2258ca7e616a9.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/page-hero\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Replace photo"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b":["Page heading"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-545178928659cdf2c14b0fccb63455d2.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-545178928659cdf2c14b0fccb63455d2.json new file mode 100644 index 0000000..fd37190 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-545178928659cdf2c14b0fccb63455d2.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/plan-visit\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Heading"],"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u043d":["Replace background"],"\u0412\u0435\u0440\u043d\u0443\u0442\u044c \u0444\u043e\u043d":["Restore background"],"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441":["Edit address"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-64c3aefaa18bd32c7439dccac25529f5.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-64c3aefaa18bd32c7439dccac25529f5.json new file mode 100644 index 0000000..a237b40 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-64c3aefaa18bd32c7439dccac25529f5.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/office\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430":["Section heading"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-6f6988e843474b14845dabf93a8f9fc5.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-6f6988e843474b14845dabf93a8f9fc5.json new file mode 100644 index 0000000..a8f5b43 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-6f6988e843474b14845dabf93a8f9fc5.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/doctors\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0440\u0430\u0447\u0435\u0439":["Edit dentists"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430":["Section heading"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-75337e927a0486c0511fcacfbd1ba221.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-75337e927a0486c0511fcacfbd1ba221.json new file mode 100644 index 0000000..e1d9e02 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-75337e927a0486c0511fcacfbd1ba221.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/visit\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430":["Section heading"],"\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u0432\u0440\u0430\u0447\u043e\u043c":["Meeting the dentist"],"\u0420\u0435\u0431\u0451\u043d\u043e\u043a \u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u0431\u0438\u043d\u0435\u0442, \u0437\u0430\u0434\u0430\u0451\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u043f\u0440\u0438\u0432\u044b\u043a\u0430\u0435\u0442 \u043a \u0432\u0440\u0430\u0447\u0443 \u0431\u0435\u0437 \u0441\u043f\u0435\u0448\u043a\u0438.":["The child looks around the room, asks questions and gets used to the dentist without any rush."],"\u0411\u0435\u0440\u0435\u0436\u043d\u043e\u0435 \u043b\u0435\u0447\u0435\u043d\u0438\u0435":["Gentle treatment"],"\u041a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0438\u0434\u0451\u0442 \u0432 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e\u043c \u0434\u043b\u044f \u0440\u0435\u0431\u0451\u043d\u043a\u0430 \u0442\u0435\u043c\u043f\u0435.":["Every step is explained in advance, and treatment goes at a pace that feels calm for the child."],"\u0423\u0447\u0438\u043c\u0441\u044f \u0443\u0445\u0430\u0436\u0438\u0432\u0430\u0442\u044c":["Learning to brush"],"\u0420\u0435\u0431\u0451\u043d\u043e\u043a \u0443\u0437\u043d\u0430\u0451\u0442, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0437\u0443\u0431\u044b \u0438 \u0443\u0445\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0437\u0430 \u043f\u043e\u043b\u043e\u0441\u0442\u044c\u044e \u0440\u0442\u0430.":["The child learns how to brush properly and look after their mouth."],"\u0421\u043b\u0435\u0434\u0438\u043c \u0437\u0430 \u043f\u0440\u0438\u043a\u0443\u0441\u043e\u043c":["Watching the bite"],"\u041d\u0430 \u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0441\u043c\u0435\u043d\u0430 \u0437\u0443\u0431\u043e\u0432 \u0438 \u043f\u0440\u0438\u043a\u0443\u0441, \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.":["Checkups track tooth changes and the bite so that any changes are noticed in time."]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-7e857d922cf03c67da5bdd45f5b2691a.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-7e857d922cf03c67da5bdd45f5b2691a.json new file mode 100644 index 0000000..cf147f6 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-7e857d922cf03c67da5bdd45f5b2691a.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/office-photo\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Replace photo"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Add photo"],"\u0424\u043e\u0442\u043e":["Photo"],"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u043e\u0442\u043e":["Photo description"],"\u0414\u043b\u044f \u043d\u0435\u0437\u0440\u044f\u0447\u0438\u0445 \u0438 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u043e\u0432. \u041f\u0443\u0441\u0442\u043e: \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0437 \u043c\u0435\u0434\u0438\u0430\u0442\u0435\u043a\u0438.":["For screen readers and search engines. Empty: the description from the Media Library is used."]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-82b009a85d35bab37992f1a71c161109.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-82b009a85d35bab37992f1a71c161109.json new file mode 100644 index 0000000..5af90f5 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-82b009a85d35bab37992f1a71c161109.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/service-page\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0426\u0435\u043d\u0430":["Price"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Heading"],"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Replace photo"],"\u041a\u043d\u043e\u043f\u043a\u0430":["Button"],"\u0423\u0431\u0440\u0430\u0442\u044c":["Remove"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c":["Add"],"\u0428\u0430\u043f\u043a\u0430":["Top section"],"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435":["Description"],"\u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f":["When to book"],"\u041f\u0443\u043d\u043a\u0442\u044b, \u043a\u0430\u0436\u0434\u044b\u0439 \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438":["Items, each on a new line"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u0451\u043c\u0430 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432":["Visit and methods headings"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u0440\u0438\u0451\u043c\u0430":["Visit heading"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043c\u0435\u0442\u043e\u0434\u043e\u0432":["Methods heading"],"\u0428\u0430\u0433\u0438 \u043f\u0440\u0438\u0451\u043c\u0430":["Visit steps"],"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435":["Name"],"\u041c\u0435\u0442\u043e\u0434\u044b \u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c":["Methods and prices"],"\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442":["When it fits"],"\u041a\u0430\u043a \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442":["How it works"],"\u041f\u043e\u043b\u044c\u0437\u0430, \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438":["Benefits, each on a new line"],"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0444\u043e\u0442\u043e":["Choose photo"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-c686226e4fdc521220452182e5e14e49.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-c686226e4fdc521220452182e5e14e49.json new file mode 100644 index 0000000..d694002 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-c686226e4fdc521220452182e5e14e49.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/paper-note\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Heading"],"\u0410\u0431\u0437\u0430\u0446":["Paragraph"],"\u0423\u0431\u0440\u0430\u0442\u044c \u0430\u0431\u0437\u0430\u0446":["Remove paragraph"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0431\u0437\u0430\u0446":["Add paragraph"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-c7828997f359bb200dbc1446ab591040.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-c7828997f359bb200dbc1446ab591040.json new file mode 100644 index 0000000..448213e --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-c7828997f359bb200dbc1446ab591040.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/clinic-info\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b":["Edit contacts"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Heading"],"\u0422\u0435\u043a\u0441\u0442 \u043a\u043d\u043e\u043f\u043a\u0438":["Button text"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-cb255f4b509ea87cfe85ea0dedc289e7.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-cb255f4b509ea87cfe85ea0dedc289e7.json new file mode 100644 index 0000000..d61096a --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-cb255f4b509ea87cfe85ea0dedc289e7.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/visit-step\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443":["Replace image"],"\u0412\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0438\u0441\u0443\u043d\u043e\u043a":["Restore illustration"],"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0433\u0430":["Step name"],"\u0422\u0435\u043a\u0441\u0442 \u0448\u0430\u0433\u0430":["Step text"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-d1e8d277ffe9cd31106f5ebeeb05855c.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-d1e8d277ffe9cd31106f5ebeeb05855c.json new file mode 100644 index 0000000..2a7602d --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-d1e8d277ffe9cd31106f5ebeeb05855c.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/reviews\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0410\u0434\u0440\u0435\u0441":["Address"],"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Replace photo"],"\u0424\u043e\u0442\u043e":["Photo"],"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u043e\u0442\u043e":["Photo description"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430":["Section heading"],"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0442\u0437\u044b\u0432\u044b":["Edit reviews"],"\u0427\u0442\u043e \u043d\u0430 \u0444\u043e\u0442\u043e: \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u043e\u0432 \u0438 \u043d\u0435\u0437\u0440\u044f\u0447\u0438\u0445 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0435\u0439.":["What is in the photo: for search engines and visitors using screen readers."],"\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0432\u0441\u0435 \u043e\u0442\u0437\u044b\u0432\u044b":["Link to all reviews"],"\u0422\u0435\u043a\u0441\u0442 \u0441\u0441\u044b\u043b\u043a\u0438":["Link text"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US-dbe25ea1d5158b4b5b70390cb258a778.json b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-dbe25ea1d5158b4b5b70390cb258a778.json new file mode 100644 index 0000000..9bc60cb --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US-dbe25ea1d5158b4b5b70390cb258a778.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/contacts-hero\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"en_US","plural-forms":"nplurals=2; plural=(n != 1);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Heading"],"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Replace photo"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Add photo"],"\u0424\u043e\u0442\u043e":["Photo"],"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u043e\u0442\u043e":["Photo description"],"\u0414\u043b\u044f \u043d\u0435\u0437\u0440\u044f\u0447\u0438\u0445 \u0438 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u043e\u0432. \u041f\u0443\u0441\u0442\u043e: \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0437 \u043c\u0435\u0434\u0438\u0430\u0442\u0435\u043a\u0438.":["For screen readers and search engines. Empty: the description from the Media Library is used."],"\u041f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438, %":["Horizontal, %"],"\u041f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438, %":["Vertical, %"],"\u041c\u0430\u0441\u0448\u0442\u0430\u0431, %":["Zoom, %"],"\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435":["Introduction"],"\u041a\u043d\u043e\u043f\u043a\u0430":["Button"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US.mo b/wp-content/plugins/smilia-core/languages/smilia-core-en_US.mo new file mode 100644 index 0000000..73fae20 Binary files /dev/null and b/wp-content/plugins/smilia-core/languages/smilia-core-en_US.mo differ diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-en_US.po b/wp-content/plugins/smilia-core/languages/smilia-core-en_US.po new file mode 100644 index 0000000..c0b31f3 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-en_US.po @@ -0,0 +1,897 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: Smilia\n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Domain: smilia-core\n" + +#: build/blocks/reviews/index.js:1 +#: build/blocks/clinic-info/contacts.php:17 includes/class-settings.php:19 +msgid "Адрес" +msgstr "Address" + +#: build/blocks/clinic-info/contacts.php:23 includes/class-booking.php:245 +msgid "Телефон" +msgstr "Phone" + +#: build/blocks/plan-visit/map.php:7 +msgid "Карта: %s" +msgstr "Map: %s" + +#: includes/class-booking.php:27 +msgid "Первый визит, знакомство" +msgstr "First visit, getting acquainted" + +#: includes/class-booking.php:28 +msgid "Осмотр и гигиена" +msgstr "Check-up and hygiene" + +#: includes/class-booking.php:29 +msgid "Болит или сколот зуб" +msgstr "Toothache or chipped tooth" + +#: includes/class-booking.php:30 +msgid "Лечение кариеса" +msgstr "Cavity treatment" + +#: includes/class-booking.php:31 +msgid "Прикус, пластинка, брекеты" +msgstr "Bite, plate, braces" + +#: includes/class-booking.php:32 +msgid "Другое" +msgstr "Other" + +#: includes/class-booking.php:78 +msgid "Заявку можно отправить только с сайта клиники." +msgstr "Requests can only be sent from the clinic website." + +#: includes/class-booking.php:82 includes/class-booking.php:87 +msgid "Страница устарела. Обновите её и отправьте заявку ещё раз." +msgstr "The page is out of date. Refresh it and send the request again." + +#: includes/class-booking.php:101 +msgid "Проверьте имя." +msgstr "Please check the name." + +#: includes/class-booking.php:105 +msgid "Проверьте номер телефона." +msgstr "Please check the phone number." + +#: includes/class-booking.php:108 +msgid "Проверьте возраст ребёнка." +msgstr "Please check the child’s age." + +#: includes/class-booking.php:111 +msgid "Выберите, что беспокоит." +msgstr "Choose the reason for the visit." + +#: includes/class-booking.php:114 +msgid "Нужно ваше согласие на обработку персональных данных." +msgstr "Consent to the processing of personal data is required." + +#: includes/class-booking.php:137 +msgid "Не получилось отправить заявку. Позвоните нам, пожалуйста." +msgstr "The request could not be sent. Please give us a call." + +#: includes/class-booking.php:247 includes/class-booking.php:262 +msgid "Что беспокоит" +msgstr "Reason for visit" + +#: includes/class-markup.php:39 includes/class-markup.php:48 +msgid "Изменить" +msgstr "Edit" + +#: includes/class-markup.php:47 +msgid "Изменить: %s" +msgstr "Edit: %s" + +#: includes/class-settings.php:23 +msgid "Запись на детский приём" +msgstr "Book a child’s appointment" + +#: includes/class-settings.php:24 +msgid "Администратор перезвонит и поможет подобрать удобное время." +msgstr "The front desk will call back and help find a convenient time." + +#: includes/class-settings.php:25 +msgid "Отправить заявку" +msgstr "Send request" + +#: includes/class-settings.php:26 +msgid "Заявка отправлена" +msgstr "Request sent" + +#: includes/class-settings.php:27 +msgid "Спасибо! Администратор перезвонит в рабочее время." +msgstr "Thank you! The front desk will call back during opening hours." + +#: includes/class-prices.php:45 +#, php-format +msgid "от %s zł" +msgstr "from %s zł" + +#: build/blocks/prices/index.js:1 +#: src/blocks/prices/render.php:1 +msgid "Процедура" +msgstr "Procedure" + +#: build/blocks/service-page/index.js:1 +#: src/blocks/prices/render.php:1 +msgid "Цена" +msgstr "Price" + +#: src/blocks/clinic-info/clock.php:11 +msgid "Открыто" +msgstr "Open" + +#: src/blocks/clinic-info/clock.php:11 +msgid "Закрыто" +msgstr "Closed" + +#: src/blocks/clinic-info/clock.php:11 +msgid "Сегодня выходной" +msgstr "Closed today" + +#: src/blocks/clinic-info/clock.php:11 +msgid "до %s" +msgstr "until %s" + +#: src/blocks/clinic-info/clock.php:11 +msgid "откроется в %s" +msgstr "opens at %s" + +#: src/blocks/clinic-info/clock.php:11 +msgid "откроется завтра в %s" +msgstr "opens tomorrow at %s" + +#: src/blocks/clinic-info/clock.php:11 +msgid "откроется %1$s в %2$s" +msgstr "opens %1$s at %2$s" + +#: src/blocks/clinic-info/clock.php:11 +msgid "в понедельник" +msgstr "on Monday" + +#: src/blocks/clinic-info/clock.php:11 +msgid "во вторник" +msgstr "on Tuesday" + +#: src/blocks/clinic-info/clock.php:11 +msgid "в среду" +msgstr "on Wednesday" + +#: src/blocks/clinic-info/clock.php:11 +msgid "в четверг" +msgstr "on Thursday" + +#: src/blocks/clinic-info/clock.php:11 +msgid "в пятницу" +msgstr "on Friday" + +#: src/blocks/clinic-info/clock.php:11 +msgid "в субботу" +msgstr "on Saturday" + +#: src/blocks/clinic-info/clock.php:11 +msgid "в воскресенье" +msgstr "on Sunday" + +#: src/blocks/clinic-info/clock.php:11 +msgid "закроется через %d минуту" +msgstr "closes in %d minute" + +#: src/blocks/clinic-info/clock.php:11 +msgid "закроется через %d минуты" +msgstr "closes in %d minutes" + +#: src/blocks/clinic-info/clock.php:11 +msgid "закроется через %d минут" +msgstr "closes in %d minutes" + +msgid "Email" +msgstr "Email" + +#: src/blocks/plan-visit/map.php:21 +msgid "Для показа карты нужно согласие на передачу IP-адреса в Google." +msgstr "Showing the map requires consent to send the IP address to Google." + +#: src/blocks/plan-visit/map.php:21 +msgid "Принять и показать карту" +msgstr "Accept and show map" + +#: src/blocks/plan-visit/map.php:21 +msgid "Открыть в Google Картах" +msgstr "Open in Google Maps" + +#: src/blocks/plan-visit/map.php:27 +#, php-format +msgid "Подробнее в политике конфиденциальности." +msgstr "More in the privacy policy." + +msgid "Для показа карты нужно согласие." +msgstr "Showing the map requires consent." + +msgid "Принять" +msgstr "Accept" + +msgid "Открыть карту в новой вкладке" +msgstr "Open the map in a new tab" + +msgid "Оценка: 5 из 5" +msgstr "Rating: 5 out of 5" + +msgid "Страницы отзывов" +msgstr "Review pages" + +msgid "Назад" +msgstr "Previous" + +msgid "Вперёд" +msgstr "Next" + +msgid "Предыдущие отзывы" +msgstr "Previous reviews" + +msgid "Следующие отзывы" +msgstr "Next reviews" + +msgid "Не выбрано" +msgstr "Not selected" + +#: includes/class-demo-access.php +msgid "Изменения не сохраняются." +msgstr "Changes are not saved." + +#: includes/class-demo-access.php +msgid "Демо-доступ" +msgstr "Demo access" + +#: includes/class-demo-access.php +msgid "Демо-просмотр" +msgstr "Demo viewer" + +#: includes/class-meta-fields.php +msgid "Образование (каждое с новой строки)" +msgstr "Education (one per line)" + +#: includes/class-meta-fields.php +msgid "Специализации и квалификации (каждая с новой строки)" +msgstr "Specializations and qualifications (one per line)" + +#: includes/class-meta-fields.php +msgid "Чем занимается (темы, каждая с новой строки)" +msgstr "Areas of work (topics, one per line)" + +#: includes/class-meta-fields.php +msgid "" +"Эти поля попадают в микроразметку врача для поисковиков. Пишите только то, " +"что указано в тексте страницы врача." +msgstr "" +"These fields go into the dentist structured data for search engines. Write " +"only what the dentist page text says." + +#: includes/class-meta-fields.php +msgid "Врач (в разметке Physician)" +msgstr "Dentist (marked up as Physician)" + +#: includes/class-meta-fields.php +msgid "Специалист без врачебной степени (в разметке Person)" +msgstr "Specialist without a medical degree (marked up as Person)" + +#: includes/class-meta-fields.php +msgid "Кто это (для микроразметки)" +msgstr "Who this is (for structured data)" + +#: smilia-core.php +msgid "Smilia Core" +msgstr "Smilia Core" + +#: smilia-core.php +msgid "Услуги, врачи, отзывы, вопросы, настройки клиники и запись на приём." +msgstr "Services, dentists, reviews, FAQ, clinic settings and appointment booking." + +#: build/blocks/clinic-info/index.js:1 +msgid "Изменить контакты" +msgstr "Edit contacts" + +#: build/blocks/clinic-info/index.js:1 +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/hero/index.js:1 +#: build/blocks/installment/index.js:1 +#: build/blocks/paper-note/index.js:1 +#: build/blocks/plan-visit/index.js:1 +#: build/blocks/prepare/index.js:1 +#: build/blocks/reviews-board/index.js:1 +#: build/blocks/service-page/index.js:1 +msgid "Заголовок" +msgstr "Heading" + +#: build/blocks/clinic-info/index.js:1 +#: build/blocks/services/index.js:1 +msgid "Текст кнопки" +msgstr "Button text" + +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/hero/index.js:1 +#: build/blocks/office-photo/index.js:1 +#: build/blocks/page-hero/index.js:1 +#: build/blocks/reviews/index.js:1 +#: build/blocks/service-page/index.js:1 +msgid "Заменить фото" +msgstr "Replace photo" + +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/hero/index.js:1 +#: build/blocks/office-photo/index.js:1 +msgid "Добавить фото" +msgstr "Add photo" + +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/hero/index.js:1 +#: build/blocks/office-photo/index.js:1 +#: build/blocks/reviews/index.js:1 +msgid "Фото" +msgstr "Photo" + +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/office-photo/index.js:1 +#: build/blocks/reviews/index.js:1 +msgid "Описание фото" +msgstr "Photo description" + +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/office-photo/index.js:1 +msgid "Для незрячих и поисковиков. Пусто: описание из медиатеки." +msgstr "For screen readers and search engines. Empty: the description from the Media Library is used." + +#: build/blocks/contacts-hero/index.js:1 +msgid "По горизонтали, %" +msgstr "Horizontal, %" + +#: build/blocks/contacts-hero/index.js:1 +msgid "По вертикали, %" +msgstr "Vertical, %" + +#: build/blocks/contacts-hero/index.js:1 +msgid "Масштаб, %" +msgstr "Zoom, %" + +#: build/blocks/contacts-hero/index.js:1 +msgid "Вступление" +msgstr "Introduction" + +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/installment/index.js:1 +#: build/blocks/prepare/index.js:1 +#: build/blocks/service-page/index.js:1 +#: build/blocks/services/index.js:1 +msgid "Кнопка" +msgstr "Button" + +#: build/blocks/doctor-page/index.js:1 +msgid "Врач" +msgstr "Dentist" + +#: build/blocks/doctor-page/index.js:1 +msgid "Стаж, например «стаж 10 лет»" +msgstr "Experience, e.g. “10 years of experience”" + +#: build/blocks/doctor-page/index.js:1 +msgid "Рассказ, каждый абзац с новой строки" +msgstr "Bio, each paragraph on a new line" + +#: build/blocks/doctor-page/index.js:1 +msgid "Подписи" +msgstr "Labels" + +#: build/blocks/doctor-page/index.js:1 +msgid "Заголовок других врачей" +msgstr "Other dentists heading" + +#: build/blocks/doctor-page/index.js:1 +#: build/blocks/hero/index.js:1 +msgid "Кнопка записи" +msgstr "Booking button" + +#: build/blocks/doctors/index.js:1 +msgid "Изменить врачей" +msgstr "Edit dentists" + +#: build/blocks/doctors/index.js:1 +#: build/blocks/faq/index.js:1 +#: build/blocks/office/index.js:1 +#: build/blocks/reviews/index.js:1 +#: build/blocks/services/index.js:1 +#: build/blocks/visit/index.js:1 +msgid "Заголовок раздела" +msgstr "Section heading" + +#: build/blocks/faq/index.js:1 +msgid "Изменить вопросы" +msgstr "Edit questions" + +#: build/blocks/faq/index.js:1 +msgid "Вопросы" +msgstr "Questions" + +#: build/blocks/faq/index.js:1 +msgid "Группа вопросов" +msgstr "Question group" + +#: build/blocks/faq/index.js:1 +msgid "Ярлык группы из раздела «Вопросы», например home." +msgstr "Group slug from the Questions section, e.g. home." + +#: build/blocks/faq/index.js:1 +#: build/blocks/hero/index.js:1 +#: build/blocks/services/index.js:1 +msgid "Подзаголовок" +msgstr "Subheading" + +#: build/blocks/hero/index.js:1 +msgid "Положение фото" +msgstr "Photo position" + +#: build/blocks/hero/index.js:1 +msgid "Перетащите точку на лицо: эта часть фото всегда останется в кадре. Лучше горизонтальное фото от 2000 px по ширине." +msgstr "Drag the point onto the face: this part of the photo always stays in frame. A landscape photo at least 2000 px wide works best." + +#: build/blocks/hero/index.js:1 +msgid "Сначала добавьте фото кнопкой «Добавить фото» над блоком." +msgstr "First add a photo with the “Add photo” button above the block." + +#: build/blocks/hero/index.js:1 +msgid "Вторая кнопка" +msgstr "Second button" + +#: build/blocks/hero/index.js:1 +#: build/blocks/services/index.js:1 +msgid "Ссылка" +msgstr "Link" + +#: build/blocks/hero/index.js:1 +msgid "Адрес страницы или якорь вида #contacts." +msgstr "Page address or an anchor such as #contacts." + +#: build/blocks/installment/index.js:1 +#: build/blocks/prepare/index.js:1 +msgid "Текст" +msgstr "Text" + +#: build/blocks/page-hero/index.js:1 +msgid "Заголовок страницы" +msgstr "Page heading" + +#: build/blocks/paper-note/index.js:1 +msgid "Абзац" +msgstr "Paragraph" + +#: build/blocks/paper-note/index.js:1 +msgid "Убрать абзац" +msgstr "Remove paragraph" + +#: build/blocks/paper-note/index.js:1 +msgid "Добавить абзац" +msgstr "Add paragraph" + +#: build/blocks/plan-visit/index.js:1 +msgid "Заменить фон" +msgstr "Replace background" + +#: build/blocks/plan-visit/index.js:1 +msgid "Вернуть фон" +msgstr "Restore background" + +#: build/blocks/plan-visit/index.js:1 +msgid "Изменить адрес" +msgstr "Edit address" + +#: build/blocks/prepare/index.js:1 +msgid "Пункт списка" +msgstr "List item" + +#: build/blocks/prepare/index.js:1 +msgid "Убрать пункт" +msgstr "Remove item" + +#: build/blocks/prepare/index.js:1 +msgid "Заголовок записки" +msgstr "Note heading" + +#: build/blocks/prepare/index.js:1 +msgid "Добавить пункт" +msgstr "Add item" + +#: build/blocks/prepare/index.js:1 +msgid "Приглашение" +msgstr "Invitation" + +#: build/blocks/prices/index.js:1 +msgid "Без услуги" +msgstr "No service" + +#: build/blocks/prices/index.js:1 +msgid "Название группы" +msgstr "Group name" + +#: build/blocks/prices/index.js:1 +msgid "Цена, zł" +msgstr "Price, zł" + +#: build/blocks/prices/index.js:1 +msgid "Убрать строку" +msgstr "Remove row" + +#: build/blocks/prices/index.js:1 +msgid "Услуга" +msgstr "Service" + +#: build/blocks/prices/index.js:1 +msgid "Добавить строку" +msgstr "Add row" + +#: build/blocks/prices/index.js:1 +msgid "Убрать группу" +msgstr "Remove group" + +#: build/blocks/prices/index.js:1 +msgid "Добавить группу" +msgstr "Add group" + +#: build/blocks/prices/index.js:1 +msgid "Примечание под таблицей" +msgstr "Note below the table" + +#: build/blocks/reviews-board/index.js:1 +#: build/blocks/reviews/index.js:1 +msgid "Изменить отзывы" +msgstr "Edit reviews" + +#: build/blocks/reviews-board/index.js:1 +msgid "Заменить фон доски" +msgstr "Replace board background" + +#: build/blocks/reviews-board/index.js:1 +msgid "Подпись" +msgstr "Caption" + +#: build/blocks/reviews-board/index.js:1 +msgid "Текст перед ссылками" +msgstr "Text before the links" + +#: build/blocks/reviews/index.js:1 +msgid "Что на фото: для поисковиков и незрячих посетителей." +msgstr "What is in the photo: for search engines and visitors using screen readers." + +#: build/blocks/reviews/index.js:1 +msgid "Ссылка на все отзывы" +msgstr "Link to all reviews" + +#: build/blocks/reviews/index.js:1 +msgid "Текст ссылки" +msgstr "Link text" + +#: build/blocks/service-page/index.js:1 +msgid "Убрать" +msgstr "Remove" + +#: build/blocks/service-page/index.js:1 +msgid "Добавить" +msgstr "Add" + +#: build/blocks/service-page/index.js:1 +msgid "Шапка" +msgstr "Top section" + +#: build/blocks/service-page/index.js:1 +msgid "Описание" +msgstr "Description" + +#: build/blocks/service-page/index.js:1 +msgid "Когда записаться" +msgstr "When to book" + +#: build/blocks/service-page/index.js:1 +msgid "Пункты, каждый с новой строки" +msgstr "Items, each on a new line" + +#: build/blocks/service-page/index.js:1 +msgid "Заголовки приёма и методов" +msgstr "Visit and methods headings" + +#: build/blocks/service-page/index.js:1 +msgid "Заголовок приёма" +msgstr "Visit heading" + +#: build/blocks/service-page/index.js:1 +msgid "Заголовок методов" +msgstr "Methods heading" + +#: build/blocks/service-page/index.js:1 +msgid "Шаги приёма" +msgstr "Visit steps" + +#: build/blocks/service-page/index.js:1 +msgid "Название" +msgstr "Name" + +#: build/blocks/service-page/index.js:1 +msgid "Методы и стоимость" +msgstr "Methods and prices" + +#: build/blocks/service-page/index.js:1 +msgid "Когда подходит" +msgstr "When it fits" + +#: build/blocks/service-page/index.js:1 +msgid "Как проходит" +msgstr "How it works" + +#: build/blocks/service-page/index.js:1 +msgid "Польза, каждый пункт с новой строки" +msgstr "Benefits, each on a new line" + +#: build/blocks/service-page/index.js:1 +msgid "Выбрать фото" +msgstr "Choose photo" + +#: build/blocks/services/index.js:1 +msgid "Изменить услуги" +msgstr "Edit services" + +#: build/blocks/services/index.js:1 +msgid "Адрес страницы, например /prices/." +msgstr "Page address, e.g. /prices/." + +#: build/blocks/visit-step/index.js:1 +msgid "Заменить картинку" +msgstr "Replace image" + +#: build/blocks/visit-step/index.js:1 +msgid "Вернуть рисунок" +msgstr "Restore illustration" + +#: build/blocks/visit-step/index.js:1 +msgid "Название шага" +msgstr "Step name" + +#: build/blocks/visit-step/index.js:1 +msgid "Текст шага" +msgstr "Step text" + +#: build/blocks/visit/index.js:1 +msgid "Знакомство с врачом" +msgstr "Meeting the dentist" + +#: build/blocks/visit/index.js:1 +msgid "Ребёнок осматривает кабинет, задаёт вопросы и привыкает к врачу без спешки." +msgstr "The child looks around the room, asks questions and gets used to the dentist without any rush." + +#: build/blocks/visit/index.js:1 +msgid "Бережное лечение" +msgstr "Gentle treatment" + +#: build/blocks/visit/index.js:1 +msgid "Каждое действие объясняется заранее, лечение идёт в спокойном для ребёнка темпе." +msgstr "Every step is explained in advance, and treatment goes at a pace that feels calm for the child." + +#: build/blocks/visit/index.js:1 +msgid "Учимся ухаживать" +msgstr "Learning to brush" + +#: build/blocks/visit/index.js:1 +msgid "Ребёнок узнаёт, как правильно чистить зубы и ухаживать за полостью рта." +msgstr "The child learns how to brush properly and look after their mouth." + +#: build/blocks/visit/index.js:1 +msgid "Следим за прикусом" +msgstr "Watching the bite" + +#: build/blocks/visit/index.js:1 +msgid "На осмотре проверяются смена зубов и прикус, чтобы вовремя заметить изменения." +msgstr "Checkups track tooth changes and the bite so that any changes are noticed in time." + +#: build/blocks/clinic-info/block.json +msgctxt "block title" +msgid "Контакты и часы работы" +msgstr "Contacts and opening hours" + +#: build/blocks/clinic-info/block.json +msgctxt "block description" +msgid "Контакты и часы работы из настроек «Клиника» и кнопка записи." +msgstr "Contacts and opening hours from the Clinic settings, plus a booking button." + +#: build/blocks/contacts-hero/block.json +msgctxt "block title" +msgid "Верх страницы контактов" +msgstr "Contacts page top" + +#: build/blocks/contacts-hero/block.json +msgctxt "block description" +msgid "Заголовок, вступление, кнопки и круглое фото." +msgstr "Heading, introduction, buttons and a round photo." + +#: build/blocks/doctor-page/block.json +msgctxt "block title" +msgid "Страница врача" +msgstr "Dentist page" + +#: build/blocks/doctor-page/block.json +msgctxt "block description" +msgid "Фото, имя, должность, стаж и рассказ о враче из записи «Врачи», затем другие врачи и кнопка записи." +msgstr "Photo, name, position, experience and bio from the Dentists entry, then other dentists and a booking button." + +#: build/blocks/doctors/block.json +msgctxt "block title" +msgid "Наши врачи" +msgstr "Our dentists" + +#: build/blocks/doctors/block.json +msgctxt "block description" +msgid "Заголовок и карточки врачей из раздела «Врачи»." +msgstr "Heading and dentist cards from the Dentists section." + +#: build/blocks/faq/block.json +msgctxt "block title" +msgid "Частые вопросы" +msgstr "FAQ" + +#: build/blocks/faq/block.json +msgctxt "block description" +msgid "Заголовок, подзаголовок и вопросы из раздела «Вопросы»." +msgstr "Heading, subheading and questions from the Questions section." + +#: build/blocks/hero/block.json +msgctxt "block title" +msgid "Баннер" +msgstr "Banner" + +#: build/blocks/hero/block.json +msgctxt "block description" +msgid "Первый экран: фото, заголовок и две кнопки." +msgstr "First screen: photo, heading and two buttons." + +#: build/blocks/installment/block.json +msgctxt "block title" +msgid "Рассрочка" +msgstr "Instalments" + +#: build/blocks/installment/block.json +msgctxt "block description" +msgid "Условия рассрочки и кнопка записи." +msgstr "Instalment terms and a booking button." + +#: build/blocks/office-photo/block.json +msgctxt "block title" +msgid "Фото клиники" +msgstr "Clinic photo" + +#: build/blocks/office-photo/block.json +msgctxt "block description" +msgid "Одно фото раздела «Внутри клиники»." +msgstr "One photo of the Inside the clinic section." + +#: build/blocks/office/block.json +msgctxt "block title" +msgid "Внутри клиники" +msgstr "Inside the clinic" + +#: build/blocks/office/block.json +msgctxt "block description" +msgid "Заголовок и три фото клиники." +msgstr "Heading and three clinic photos." + +#: build/blocks/page-hero/block.json +msgctxt "block title" +msgid "Баннер страницы" +msgstr "Page banner" + +#: build/blocks/page-hero/block.json +msgctxt "block description" +msgid "Фото и заголовок первой страницы внутренних разделов." +msgstr "Photo and heading at the top of inner pages." + +#: build/blocks/paper-note/block.json +msgctxt "block title" +msgid "Бумажная плашка" +msgstr "Paper note" + +#: build/blocks/paper-note/block.json +msgctxt "block description" +msgid "Заголовок и абзацы на листе жёлтой бумаги." +msgstr "Heading and paragraphs on a sheet of yellow paper." + +#: build/blocks/plan-visit/block.json +msgctxt "block title" +msgid "Запланируйте визит" +msgstr "Plan your visit" + +#: build/blocks/plan-visit/block.json +msgctxt "block description" +msgid "Заголовок и карта Google по адресу из настроек «Клиника»." +msgstr "Heading and a Google map of the address from the Clinic settings." + +#: build/blocks/prepare/block.json +msgctxt "block title" +msgid "Подготовка к визиту" +msgstr "Visit preparation" + +#: build/blocks/prepare/block.json +msgctxt "block description" +msgid "Записка со списком, совет родителям и кнопка записи." +msgstr "Note with a list, advice for parents and a booking button." + +#: build/blocks/prices/block.json +msgctxt "block title" +msgid "Таблица цен" +msgstr "Price table" + +#: build/blocks/prices/block.json +msgctxt "block description" +msgid "Группы процедур с ценами, группа может быть привязана к услуге." +msgstr "Procedure groups with prices; a group can be linked to a service." + +#: build/blocks/reviews-board/block.json +msgctxt "block title" +msgid "Доска отзывов" +msgstr "Review board" + +#: build/blocks/reviews-board/block.json +msgctxt "block description" +msgid "Заголовок, отзывы из раздела «Отзывы» по страницам и ссылки на площадки." +msgstr "Heading, reviews from the Reviews section in pages, and links to review platforms." + +#: build/blocks/reviews/block.json +msgctxt "block title" +msgid "Отзывы" +msgstr "Reviews" + +#: build/blocks/reviews/block.json +msgctxt "block description" +msgid "Заголовок, три отзыва из раздела «Отзывы», ссылка и фото." +msgstr "Heading, three reviews from the Reviews section, a link and a photo." + +#: build/blocks/service-page/block.json +msgctxt "block title" +msgid "Страница услуги" +msgstr "Service page" + +#: build/blocks/service-page/block.json +msgctxt "block description" +msgid "Шапка услуги, когда записаться, как проходит приём и методы со стоимостью." +msgstr "Service top section, when to book, how the visit works and methods with prices." + +#: build/blocks/services/block.json +msgctxt "block title" +msgid "Услуги" +msgstr "Services" + +#: build/blocks/services/block.json +msgctxt "block description" +msgid "Заголовок, подзаголовок, плитки из раздела «Услуги» и кнопка." +msgstr "Heading, subheading, tiles from the Services section and a button." + +#: build/blocks/visit-step/block.json +msgctxt "block title" +msgid "Шаг приёма" +msgstr "Visit step" + +#: build/blocks/visit-step/block.json +msgctxt "block description" +msgid "Картинка, название и текст одного шага." +msgstr "Image, name and text of one step." + +#: build/blocks/visit/block.json +msgctxt "block title" +msgid "Как проходит приём" +msgstr "How the visit works" + +#: build/blocks/visit/block.json +msgctxt "block description" +msgid "Заголовок и шаги детского приёма с картинками." +msgstr "Heading and steps of a children’s visit with images." diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-08e4776ffc12c376a54cb7476c45fcda.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-08e4776ffc12c376a54cb7476c45fcda.json new file mode 100644 index 0000000..fa9580d --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-08e4776ffc12c376a54cb7476c45fcda.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/prepare\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Nag\u0142\u00f3wek"],"\u041a\u043d\u043e\u043f\u043a\u0430":["Przycisk"],"\u0422\u0435\u043a\u0441\u0442":["Tekst"],"\u041f\u0443\u043d\u043a\u0442 \u0441\u043f\u0438\u0441\u043a\u0430":["Element listy"],"\u0423\u0431\u0440\u0430\u0442\u044c \u043f\u0443\u043d\u043a\u0442":["Usu\u0144 element"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0437\u0430\u043f\u0438\u0441\u043a\u0438":["Nag\u0142\u00f3wek notatki"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043f\u0443\u043d\u043a\u0442":["Dodaj element"],"\u041f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435":["Zaproszenie"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-155090dcc70d53c812676304673fe8c4.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-155090dcc70d53c812676304673fe8c4.json new file mode 100644 index 0000000..4d776fd --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-155090dcc70d53c812676304673fe8c4.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/reviews-board\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Nag\u0142\u00f3wek"],"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0442\u0437\u044b\u0432\u044b":["Edytuj opinie"],"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u043d \u0434\u043e\u0441\u043a\u0438":["Zmie\u0144 t\u0142o tablicy"],"\u041f\u043e\u0434\u043f\u0438\u0441\u044c":["Podpis"],"\u0422\u0435\u043a\u0441\u0442 \u043f\u0435\u0440\u0435\u0434 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438":["Tekst przed linkami"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-1f770092aa882349b2696321a09e8eea.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-1f770092aa882349b2696321a09e8eea.json new file mode 100644 index 0000000..bae2a6c --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-1f770092aa882349b2696321a09e8eea.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/hero\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Nag\u0142\u00f3wek"],"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Zmie\u0144 zdj\u0119cie"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Dodaj zdj\u0119cie"],"\u0424\u043e\u0442\u043e":["Zdj\u0119cie"],"\u041a\u043d\u043e\u043f\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u0438":["Przycisk zapisu"],"\u041f\u043e\u0434\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Podtytu\u0142"],"\u041f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0444\u043e\u0442\u043e":["Po\u0142o\u017cenie zdj\u0119cia"],"\u041f\u0435\u0440\u0435\u0442\u0430\u0449\u0438\u0442\u0435 \u0442\u043e\u0447\u043a\u0443 \u043d\u0430 \u043b\u0438\u0446\u043e: \u044d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0444\u043e\u0442\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0432 \u043a\u0430\u0434\u0440\u0435. \u041b\u0443\u0447\u0448\u0435 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0444\u043e\u0442\u043e \u043e\u0442 2000 px \u043f\u043e \u0448\u0438\u0440\u0438\u043d\u0435.":["Przeci\u0105gnij punkt na twarz: ta cz\u0119\u015b\u0107 zdj\u0119cia zawsze zostanie w kadrze. Najlepiej poziome zdj\u0119cie o szeroko\u015bci od 2000 px."],"\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0444\u043e\u0442\u043e \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u00ab\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u0442\u043e\u00bb \u043d\u0430\u0434 \u0431\u043b\u043e\u043a\u043e\u043c.":["Najpierw dodaj zdj\u0119cie przyciskiem \u201eDodaj zdj\u0119cie\u201d nad blokiem."],"\u0412\u0442\u043e\u0440\u0430\u044f \u043a\u043d\u043e\u043f\u043a\u0430":["Drugi przycisk"],"\u0421\u0441\u044b\u043b\u043a\u0430":["Link"],"\u0410\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438\u043b\u0438 \u044f\u043a\u043e\u0440\u044c \u0432\u0438\u0434\u0430 #contacts.":["Adres strony lub kotwica, np. #contacts."]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-3f42ffe2a9355b2d78900a5dfebc01b8.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-3f42ffe2a9355b2d78900a5dfebc01b8.json new file mode 100644 index 0000000..ff1a52e --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-3f42ffe2a9355b2d78900a5dfebc01b8.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/doctor-page\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0412\u0440\u0430\u0447":["Lekarz"],"\u0421\u0442\u0430\u0436, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u00ab\u0441\u0442\u0430\u0436 10 \u043b\u0435\u0442\u00bb":["Sta\u017c, np. \u201e10 lat do\u015bwiadczenia\u201d"],"\u0420\u0430\u0441\u0441\u043a\u0430\u0437, \u043a\u0430\u0436\u0434\u044b\u0439 \u0430\u0431\u0437\u0430\u0446 \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438":["Opis, ka\u017cdy akapit w nowym wierszu"],"\u041f\u043e\u0434\u043f\u0438\u0441\u0438":["Podpisy"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0440\u0430\u0447\u0435\u0439":["Nag\u0142\u00f3wek pozosta\u0142ych lekarzy"],"\u041a\u043d\u043e\u043f\u043a\u0430 \u0437\u0430\u043f\u0438\u0441\u0438":["Przycisk zapisu"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-4078dced61757e716872cd62d01adabc.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-4078dced61757e716872cd62d01adabc.json new file mode 100644 index 0000000..ed60a92 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-4078dced61757e716872cd62d01adabc.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/faq\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430":["Nag\u0142\u00f3wek sekcji"],"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u043e\u043f\u0440\u043e\u0441\u044b":["Edytuj pytania"],"\u0412\u043e\u043f\u0440\u043e\u0441\u044b":["Pytania"],"\u0413\u0440\u0443\u043f\u043f\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432":["Grupa pyta\u0144"],"\u042f\u0440\u043b\u044b\u043a \u0433\u0440\u0443\u043f\u043f\u044b \u0438\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 \u00ab\u0412\u043e\u043f\u0440\u043e\u0441\u044b\u00bb, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 home.":["Identyfikator grupy z sekcji \u201ePytania\u201d, np. home."],"\u041f\u043e\u0434\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Podtytu\u0142"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-414b6e8cfcca8fcca4f473c2e14c9583.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-414b6e8cfcca8fcca4f473c2e14c9583.json new file mode 100644 index 0000000..3faf269 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-414b6e8cfcca8fcca4f473c2e14c9583.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/services\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0422\u0435\u043a\u0441\u0442 \u043a\u043d\u043e\u043f\u043a\u0438":["Tekst przycisku"],"\u041a\u043d\u043e\u043f\u043a\u0430":["Przycisk"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430":["Nag\u0142\u00f3wek sekcji"],"\u041f\u043e\u0434\u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Podtytu\u0142"],"\u0421\u0441\u044b\u043b\u043a\u0430":["Link"],"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u0441\u043b\u0443\u0433\u0438":["Edytuj us\u0142ugi"],"\u0410\u0434\u0440\u0435\u0441 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \/prices\/.":["Adres strony, np. \/prices\/."]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-429199f2ac2416dd407cac0ad9510518.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-429199f2ac2416dd407cac0ad9510518.json new file mode 100644 index 0000000..9d9b8ee --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-429199f2ac2416dd407cac0ad9510518.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/prices\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u041f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430":["Procedura"],"\u0411\u0435\u0437 \u0443\u0441\u043b\u0443\u0433\u0438":["Bez us\u0142ugi"],"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0433\u0440\u0443\u043f\u043f\u044b":["Nazwa grupy"],"\u0426\u0435\u043d\u0430, z\u0142":["Cena, z\u0142"],"\u0423\u0431\u0440\u0430\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443":["Usu\u0144 wiersz"],"\u0423\u0441\u043b\u0443\u0433\u0430":["Us\u0142uga"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443":["Dodaj wiersz"],"\u0423\u0431\u0440\u0430\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443":["Usu\u0144 grup\u0119"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0433\u0440\u0443\u043f\u043f\u0443":["Dodaj grup\u0119"],"\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043f\u043e\u0434 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439":["Uwaga pod tabel\u0105"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-462b2b7d0fb2d4e87e473b5d32f505cc.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-462b2b7d0fb2d4e87e473b5d32f505cc.json new file mode 100644 index 0000000..27f3983 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-462b2b7d0fb2d4e87e473b5d32f505cc.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/installment\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Nag\u0142\u00f3wek"],"\u041a\u043d\u043e\u043f\u043a\u0430":["Przycisk"],"\u0422\u0435\u043a\u0441\u0442":["Tekst"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-4e381418bc65de05fbf2258ca7e616a9.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-4e381418bc65de05fbf2258ca7e616a9.json new file mode 100644 index 0000000..f089864 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-4e381418bc65de05fbf2258ca7e616a9.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/page-hero\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Zmie\u0144 zdj\u0119cie"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b":["Nag\u0142\u00f3wek strony"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-545178928659cdf2c14b0fccb63455d2.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-545178928659cdf2c14b0fccb63455d2.json new file mode 100644 index 0000000..38f7424 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-545178928659cdf2c14b0fccb63455d2.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/plan-visit\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Nag\u0142\u00f3wek"],"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u043d":["Zmie\u0144 t\u0142o"],"\u0412\u0435\u0440\u043d\u0443\u0442\u044c \u0444\u043e\u043d":["Przywr\u00f3\u0107 t\u0142o"],"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u0434\u0440\u0435\u0441":["Edytuj adres"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-64c3aefaa18bd32c7439dccac25529f5.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-64c3aefaa18bd32c7439dccac25529f5.json new file mode 100644 index 0000000..5516132 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-64c3aefaa18bd32c7439dccac25529f5.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/office\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430":["Nag\u0142\u00f3wek sekcji"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-6f6988e843474b14845dabf93a8f9fc5.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-6f6988e843474b14845dabf93a8f9fc5.json new file mode 100644 index 0000000..e797011 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-6f6988e843474b14845dabf93a8f9fc5.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/doctors\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0440\u0430\u0447\u0435\u0439":["Edytuj lekarzy"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430":["Nag\u0142\u00f3wek sekcji"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-75337e927a0486c0511fcacfbd1ba221.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-75337e927a0486c0511fcacfbd1ba221.json new file mode 100644 index 0000000..daec347 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-75337e927a0486c0511fcacfbd1ba221.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/visit\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430":["Nag\u0142\u00f3wek sekcji"],"\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u0432\u0440\u0430\u0447\u043e\u043c":["Poznanie lekarza"],"\u0420\u0435\u0431\u0451\u043d\u043e\u043a \u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u043a\u0430\u0431\u0438\u043d\u0435\u0442, \u0437\u0430\u0434\u0430\u0451\u0442 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0438 \u043f\u0440\u0438\u0432\u044b\u043a\u0430\u0435\u0442 \u043a \u0432\u0440\u0430\u0447\u0443 \u0431\u0435\u0437 \u0441\u043f\u0435\u0448\u043a\u0438.":["Dziecko rozgl\u0105da si\u0119 po gabinecie, zadaje pytania i bez po\u015bpiechu oswaja si\u0119 z lekarzem."],"\u0411\u0435\u0440\u0435\u0436\u043d\u043e\u0435 \u043b\u0435\u0447\u0435\u043d\u0438\u0435":["Delikatne leczenie"],"\u041a\u0430\u0436\u0434\u043e\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u0440\u0430\u043d\u0435\u0435, \u043b\u0435\u0447\u0435\u043d\u0438\u0435 \u0438\u0434\u0451\u0442 \u0432 \u0441\u043f\u043e\u043a\u043e\u0439\u043d\u043e\u043c \u0434\u043b\u044f \u0440\u0435\u0431\u0451\u043d\u043a\u0430 \u0442\u0435\u043c\u043f\u0435.":["Ka\u017cdy krok jest wyja\u015bniany z wyprzedzeniem, a leczenie przebiega w spokojnym dla dziecka tempie."],"\u0423\u0447\u0438\u043c\u0441\u044f \u0443\u0445\u0430\u0436\u0438\u0432\u0430\u0442\u044c":["Uczymy si\u0119 dba\u0107 o z\u0119by"],"\u0420\u0435\u0431\u0451\u043d\u043e\u043a \u0443\u0437\u043d\u0430\u0451\u0442, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0437\u0443\u0431\u044b \u0438 \u0443\u0445\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0437\u0430 \u043f\u043e\u043b\u043e\u0441\u0442\u044c\u044e \u0440\u0442\u0430.":["Dziecko uczy si\u0119, jak prawid\u0142owo my\u0107 z\u0119by i dba\u0107 o jam\u0119 ustn\u0105."],"\u0421\u043b\u0435\u0434\u0438\u043c \u0437\u0430 \u043f\u0440\u0438\u043a\u0443\u0441\u043e\u043c":["Kontrolujemy zgryz"],"\u041d\u0430 \u043e\u0441\u043c\u043e\u0442\u0440\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044e\u0442\u0441\u044f \u0441\u043c\u0435\u043d\u0430 \u0437\u0443\u0431\u043e\u0432 \u0438 \u043f\u0440\u0438\u043a\u0443\u0441, \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.":["Na wizycie kontrolnej sprawdzana jest wymiana z\u0119b\u00f3w i zgryz, aby w por\u0119 zauwa\u017cy\u0107 zmiany."]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-7e857d922cf03c67da5bdd45f5b2691a.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-7e857d922cf03c67da5bdd45f5b2691a.json new file mode 100644 index 0000000..63a6ae0 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-7e857d922cf03c67da5bdd45f5b2691a.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/office-photo\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Zmie\u0144 zdj\u0119cie"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Dodaj zdj\u0119cie"],"\u0424\u043e\u0442\u043e":["Zdj\u0119cie"],"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u043e\u0442\u043e":["Opis zdj\u0119cia"],"\u0414\u043b\u044f \u043d\u0435\u0437\u0440\u044f\u0447\u0438\u0445 \u0438 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u043e\u0432. \u041f\u0443\u0441\u0442\u043e: \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0437 \u043c\u0435\u0434\u0438\u0430\u0442\u0435\u043a\u0438.":["Dla os\u00f3b niewidomych i wyszukiwarek. Puste: u\u017cywany jest opis z biblioteki medi\u00f3w."]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-82b009a85d35bab37992f1a71c161109.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-82b009a85d35bab37992f1a71c161109.json new file mode 100644 index 0000000..2274010 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-82b009a85d35bab37992f1a71c161109.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/service-page\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0426\u0435\u043d\u0430":["Cena"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Nag\u0142\u00f3wek"],"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Zmie\u0144 zdj\u0119cie"],"\u041a\u043d\u043e\u043f\u043a\u0430":["Przycisk"],"\u0423\u0431\u0440\u0430\u0442\u044c":["Usu\u0144"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c":["Dodaj"],"\u0428\u0430\u043f\u043a\u0430":["Sekcja g\u00f3rna"],"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435":["Opis"],"\u041a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f":["Kiedy si\u0119 zapisa\u0107"],"\u041f\u0443\u043d\u043a\u0442\u044b, \u043a\u0430\u0436\u0434\u044b\u0439 \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438":["Punkty, ka\u017cdy w nowym wierszu"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u0451\u043c\u0430 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432":["Nag\u0142\u00f3wki wizyty i metod"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043f\u0440\u0438\u0451\u043c\u0430":["Nag\u0142\u00f3wek wizyty"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u043c\u0435\u0442\u043e\u0434\u043e\u0432":["Nag\u0142\u00f3wek metod"],"\u0428\u0430\u0433\u0438 \u043f\u0440\u0438\u0451\u043c\u0430":["Etapy wizyty"],"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435":["Nazwa"],"\u041c\u0435\u0442\u043e\u0434\u044b \u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c":["Metody i ceny"],"\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442":["Kiedy jest odpowiednie"],"\u041a\u0430\u043a \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442":["Jak przebiega"],"\u041f\u043e\u043b\u044c\u0437\u0430, \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0443\u043d\u043a\u0442 \u0441 \u043d\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438":["Korzy\u015bci, ka\u017cda w nowym wierszu"],"\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0444\u043e\u0442\u043e":["Wybierz zdj\u0119cie"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-c686226e4fdc521220452182e5e14e49.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-c686226e4fdc521220452182e5e14e49.json new file mode 100644 index 0000000..0d75a50 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-c686226e4fdc521220452182e5e14e49.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/paper-note\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Nag\u0142\u00f3wek"],"\u0410\u0431\u0437\u0430\u0446":["Akapit"],"\u0423\u0431\u0440\u0430\u0442\u044c \u0430\u0431\u0437\u0430\u0446":["Usu\u0144 akapit"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0431\u0437\u0430\u0446":["Dodaj akapit"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-c7828997f359bb200dbc1446ab591040.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-c7828997f359bb200dbc1446ab591040.json new file mode 100644 index 0000000..d6c0d2a --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-c7828997f359bb200dbc1446ab591040.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/clinic-info\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0430\u043a\u0442\u044b":["Edytuj kontakty"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Nag\u0142\u00f3wek"],"\u0422\u0435\u043a\u0441\u0442 \u043a\u043d\u043e\u043f\u043a\u0438":["Tekst przycisku"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-cb255f4b509ea87cfe85ea0dedc289e7.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-cb255f4b509ea87cfe85ea0dedc289e7.json new file mode 100644 index 0000000..3433474 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-cb255f4b509ea87cfe85ea0dedc289e7.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/visit-step\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0443":["Zmie\u0144 obraz"],"\u0412\u0435\u0440\u043d\u0443\u0442\u044c \u0440\u0438\u0441\u0443\u043d\u043e\u043a":["Przywr\u00f3\u0107 ilustracj\u0119"],"\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0433\u0430":["Nazwa etapu"],"\u0422\u0435\u043a\u0441\u0442 \u0448\u0430\u0433\u0430":["Tekst etapu"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-d1e8d277ffe9cd31106f5ebeeb05855c.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-d1e8d277ffe9cd31106f5ebeeb05855c.json new file mode 100644 index 0000000..a09d310 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-d1e8d277ffe9cd31106f5ebeeb05855c.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/reviews\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0410\u0434\u0440\u0435\u0441":["Adres"],"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Zmie\u0144 zdj\u0119cie"],"\u0424\u043e\u0442\u043e":["Zdj\u0119cie"],"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u043e\u0442\u043e":["Opis zdj\u0119cia"],"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0430":["Nag\u0142\u00f3wek sekcji"],"\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0442\u0437\u044b\u0432\u044b":["Edytuj opinie"],"\u0427\u0442\u043e \u043d\u0430 \u0444\u043e\u0442\u043e: \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u043e\u0432 \u0438 \u043d\u0435\u0437\u0440\u044f\u0447\u0438\u0445 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435\u043b\u0435\u0439.":["Co jest na zdj\u0119ciu: dla wyszukiwarek i os\u00f3b niewidomych."],"\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0432\u0441\u0435 \u043e\u0442\u0437\u044b\u0432\u044b":["Link do wszystkich opinii"],"\u0422\u0435\u043a\u0441\u0442 \u0441\u0441\u044b\u043b\u043a\u0438":["Tekst linku"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-dbe25ea1d5158b4b5b70390cb258a778.json b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-dbe25ea1d5158b4b5b70390cb258a778.json new file mode 100644 index 0000000..79b087e --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL-dbe25ea1d5158b4b5b70390cb258a778.json @@ -0,0 +1 @@ +{"translation-revision-date":"2026-10-09T22:28:21+00:00","generator":"WP-CLI\/2.12.0","source":"build\/blocks\/contacts-hero\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"pl_PL","plural-forms":"nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);"},"\u0417\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a":["Nag\u0142\u00f3wek"],"\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Zmie\u0144 zdj\u0119cie"],"\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u0442\u043e":["Dodaj zdj\u0119cie"],"\u0424\u043e\u0442\u043e":["Zdj\u0119cie"],"\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u043e\u0442\u043e":["Opis zdj\u0119cia"],"\u0414\u043b\u044f \u043d\u0435\u0437\u0440\u044f\u0447\u0438\u0445 \u0438 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u0438\u043a\u043e\u0432. \u041f\u0443\u0441\u0442\u043e: \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u0437 \u043c\u0435\u0434\u0438\u0430\u0442\u0435\u043a\u0438.":["Dla os\u00f3b niewidomych i wyszukiwarek. Puste: u\u017cywany jest opis z biblioteki medi\u00f3w."],"\u041f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438, %":["W poziomie, %"],"\u041f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438, %":["W pionie, %"],"\u041c\u0430\u0441\u0448\u0442\u0430\u0431, %":["Powi\u0119kszenie, %"],"\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435":["Wst\u0119p"],"\u041a\u043d\u043e\u043f\u043a\u0430":["Przycisk"]}}} \ No newline at end of file diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL.mo b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL.mo new file mode 100644 index 0000000..840d2a3 Binary files /dev/null and b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL.mo differ diff --git a/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL.po b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL.po new file mode 100644 index 0000000..745c421 --- /dev/null +++ b/wp-content/plugins/smilia-core/languages/smilia-core-pl_PL.po @@ -0,0 +1,899 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: Smilia\n" +"Language: pl_PL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" +"X-Domain: smilia-core\n" + +#: build/blocks/reviews/index.js:1 +#: build/blocks/clinic-info/contacts.php:17 includes/class-settings.php:19 +msgid "Адрес" +msgstr "Adres" + +#: build/blocks/clinic-info/contacts.php:23 includes/class-booking.php:245 +msgid "Телефон" +msgstr "Telefon" + +#: build/blocks/plan-visit/map.php:7 +msgid "Карта: %s" +msgstr "Mapa: %s" + +#: includes/class-booking.php:27 +msgid "Первый визит, знакомство" +msgstr "Pierwsza wizyta, poznanie" + +#: includes/class-booking.php:28 +msgid "Осмотр и гигиена" +msgstr "Przegląd i higiena" + +#: includes/class-booking.php:29 +msgid "Болит или сколот зуб" +msgstr "Ból lub ukruszony ząb" + +#: includes/class-booking.php:30 +msgid "Лечение кариеса" +msgstr "Leczenie próchnicy" + +#: includes/class-booking.php:31 +msgid "Прикус, пластинка, брекеты" +msgstr "Zgryz, płytka, aparat stały" + +#: includes/class-booking.php:32 +msgid "Другое" +msgstr "Inne" + +#: includes/class-booking.php:78 +msgid "Заявку можно отправить только с сайта клиники." +msgstr "Zgłoszenie można wysłać tylko ze strony kliniki." + +#: includes/class-booking.php:82 includes/class-booking.php:87 +msgid "Страница устарела. Обновите её и отправьте заявку ещё раз." +msgstr "Strona jest nieaktualna. Odśwież ją i wyślij zgłoszenie ponownie." + +#: includes/class-booking.php:101 +msgid "Проверьте имя." +msgstr "Sprawdź imię." + +#: includes/class-booking.php:105 +msgid "Проверьте номер телефона." +msgstr "Sprawdź numer telefonu." + +#: includes/class-booking.php:108 +msgid "Проверьте возраст ребёнка." +msgstr "Sprawdź wiek dziecka." + +#: includes/class-booking.php:111 +msgid "Выберите, что беспокоит." +msgstr "Wybierz powód wizyty." + +#: includes/class-booking.php:114 +msgid "Нужно ваше согласие на обработку персональных данных." +msgstr "Potrzebna jest zgoda na przetwarzanie danych osobowych." + +#: includes/class-booking.php:137 +msgid "Не получилось отправить заявку. Позвоните нам, пожалуйста." +msgstr "Nie udało się wysłać zgłoszenia. Prosimy o kontakt telefoniczny." + +#: includes/class-booking.php:247 includes/class-booking.php:262 +msgid "Что беспокоит" +msgstr "Powód wizyty" + +#: includes/class-markup.php:39 includes/class-markup.php:48 +msgid "Изменить" +msgstr "Edytuj" + +#: includes/class-markup.php:47 +msgid "Изменить: %s" +msgstr "Edytuj: %s" + +#: includes/class-settings.php:23 +msgid "Запись на детский приём" +msgstr "Zapis na wizytę dziecka" + +#: includes/class-settings.php:24 +msgid "Администратор перезвонит и поможет подобрать удобное время." +msgstr "Recepcja oddzwoni i pomoże wybrać dogodny termin." + +#: includes/class-settings.php:25 +msgid "Отправить заявку" +msgstr "Wyślij zgłoszenie" + +#: includes/class-settings.php:26 +msgid "Заявка отправлена" +msgstr "Zgłoszenie wysłane" + +#: includes/class-settings.php:27 +msgid "Спасибо! Администратор перезвонит в рабочее время." +msgstr "Dziękujemy! Recepcja oddzwoni w godzinach pracy." + +#: includes/class-prices.php:45 +#, php-format +msgid "от %s zł" +msgstr "od %s zł" + +#: build/blocks/prices/index.js:1 +#: src/blocks/prices/render.php:1 +msgid "Процедура" +msgstr "Procedura" + +#: build/blocks/service-page/index.js:1 +#: src/blocks/prices/render.php:1 +msgid "Цена" +msgstr "Cena" + +#: src/blocks/clinic-info/clock.php:11 +msgid "Открыто" +msgstr "Otwarte" + +#: src/blocks/clinic-info/clock.php:11 +msgid "Закрыто" +msgstr "Zamknięte" + +#: src/blocks/clinic-info/clock.php:11 +msgid "Сегодня выходной" +msgstr "Dziś nieczynne" + +#: src/blocks/clinic-info/clock.php:11 +msgid "до %s" +msgstr "do %s" + +#: src/blocks/clinic-info/clock.php:11 +msgid "откроется в %s" +msgstr "otwarcie o %s" + +#: src/blocks/clinic-info/clock.php:11 +msgid "откроется завтра в %s" +msgstr "otwarcie jutro o %s" + +#: src/blocks/clinic-info/clock.php:11 +msgid "откроется %1$s в %2$s" +msgstr "otwarcie %1$s o %2$s" + +#: src/blocks/clinic-info/clock.php:11 +msgid "в понедельник" +msgstr "w poniedziałek" + +#: src/blocks/clinic-info/clock.php:11 +msgid "во вторник" +msgstr "we wtorek" + +#: src/blocks/clinic-info/clock.php:11 +msgid "в среду" +msgstr "w środę" + +#: src/blocks/clinic-info/clock.php:11 +msgid "в четверг" +msgstr "w czwartek" + +#: src/blocks/clinic-info/clock.php:11 +msgid "в пятницу" +msgstr "w piątek" + +#: src/blocks/clinic-info/clock.php:11 +msgid "в субботу" +msgstr "w sobotę" + +#: src/blocks/clinic-info/clock.php:11 +msgid "в воскресенье" +msgstr "w niedzielę" + +#: src/blocks/clinic-info/clock.php:11 +msgid "закроется через %d минуту" +msgstr "zamknięcie za %d minutę" + +#: src/blocks/clinic-info/clock.php:11 +msgid "закроется через %d минуты" +msgstr "zamknięcie za %d minuty" + +#: src/blocks/clinic-info/clock.php:11 +msgid "закроется через %d минут" +msgstr "zamknięcie za %d minut" + +msgid "Email" +msgstr "E-mail" + +#: src/blocks/plan-visit/map.php:21 +msgid "Для показа карты нужно согласие на передачу IP-адреса в Google." +msgstr "" +"Do wyświetlenia mapy potrzebna jest zgoda na przekazanie adresu IP do " +"Google." + +#: src/blocks/plan-visit/map.php:21 +msgid "Принять и показать карту" +msgstr "Zaakceptuj i pokaż mapę" + +#: src/blocks/plan-visit/map.php:21 +msgid "Открыть в Google Картах" +msgstr "Otwórz w Mapach Google" + +#: src/blocks/plan-visit/map.php:27 +#, php-format +msgid "Подробнее в политике конфиденциальности." +msgstr "Więcej w polityce prywatności." + +msgid "Для показа карты нужно согласие." +msgstr "Do wyświetlenia mapy potrzebna jest zgoda." + +msgid "Принять" +msgstr "Zaakceptuj" + +msgid "Открыть карту в новой вкладке" +msgstr "Otwórz mapę w nowej karcie" + +msgid "Оценка: 5 из 5" +msgstr "Ocena: 5 na 5" + +msgid "Страницы отзывов" +msgstr "Strony opinii" + +msgid "Назад" +msgstr "Wstecz" + +msgid "Вперёд" +msgstr "Dalej" + +msgid "Предыдущие отзывы" +msgstr "Poprzednie opinie" + +msgid "Следующие отзывы" +msgstr "Następne opinie" + +msgid "Не выбрано" +msgstr "Nie wybrano" + +#: includes/class-demo-access.php +msgid "Изменения не сохраняются." +msgstr "Zmiany nie są zapisywane." + +#: includes/class-demo-access.php +msgid "Демо-доступ" +msgstr "Dostęp demonstracyjny" + +#: includes/class-demo-access.php +msgid "Демо-просмотр" +msgstr "Podgląd demo" + +#: includes/class-meta-fields.php +msgid "Образование (каждое с новой строки)" +msgstr "Wykształcenie (każde w nowej linii)" + +#: includes/class-meta-fields.php +msgid "Специализации и квалификации (каждая с новой строки)" +msgstr "Specjalizacje i kwalifikacje (każda w nowej linii)" + +#: includes/class-meta-fields.php +msgid "Чем занимается (темы, каждая с новой строки)" +msgstr "Czym się zajmuje (tematy, każdy w nowej linii)" + +#: includes/class-meta-fields.php +msgid "" +"Эти поля попадают в микроразметку врача для поисковиков. Пишите только то, " +"что указано в тексте страницы врача." +msgstr "" +"Te pola trafiają do danych strukturalnych lekarza dla wyszukiwarek. Wpisuj " +"tylko to, co jest w tekście strony lekarza." + +#: includes/class-meta-fields.php +msgid "Врач (в разметке Physician)" +msgstr "Lekarz (w danych jako Physician)" + +#: includes/class-meta-fields.php +msgid "Специалист без врачебной степени (в разметке Person)" +msgstr "Specjalista bez tytułu lekarza (w danych jako Person)" + +#: includes/class-meta-fields.php +msgid "Кто это (для микроразметки)" +msgstr "Kim jest (dla danych strukturalnych)" + +#: smilia-core.php +msgid "Smilia Core" +msgstr "Smilia Core" + +#: smilia-core.php +msgid "Услуги, врачи, отзывы, вопросы, настройки клиники и запись на приём." +msgstr "Usługi, lekarze, opinie, pytania, ustawienia kliniki i zapisy na wizytę." + +#: build/blocks/clinic-info/index.js:1 +msgid "Изменить контакты" +msgstr "Edytuj kontakty" + +#: build/blocks/clinic-info/index.js:1 +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/hero/index.js:1 +#: build/blocks/installment/index.js:1 +#: build/blocks/paper-note/index.js:1 +#: build/blocks/plan-visit/index.js:1 +#: build/blocks/prepare/index.js:1 +#: build/blocks/reviews-board/index.js:1 +#: build/blocks/service-page/index.js:1 +msgid "Заголовок" +msgstr "Nagłówek" + +#: build/blocks/clinic-info/index.js:1 +#: build/blocks/services/index.js:1 +msgid "Текст кнопки" +msgstr "Tekst przycisku" + +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/hero/index.js:1 +#: build/blocks/office-photo/index.js:1 +#: build/blocks/page-hero/index.js:1 +#: build/blocks/reviews/index.js:1 +#: build/blocks/service-page/index.js:1 +msgid "Заменить фото" +msgstr "Zmień zdjęcie" + +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/hero/index.js:1 +#: build/blocks/office-photo/index.js:1 +msgid "Добавить фото" +msgstr "Dodaj zdjęcie" + +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/hero/index.js:1 +#: build/blocks/office-photo/index.js:1 +#: build/blocks/reviews/index.js:1 +msgid "Фото" +msgstr "Zdjęcie" + +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/office-photo/index.js:1 +#: build/blocks/reviews/index.js:1 +msgid "Описание фото" +msgstr "Opis zdjęcia" + +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/office-photo/index.js:1 +msgid "Для незрячих и поисковиков. Пусто: описание из медиатеки." +msgstr "Dla osób niewidomych i wyszukiwarek. Puste: używany jest opis z biblioteki mediów." + +#: build/blocks/contacts-hero/index.js:1 +msgid "По горизонтали, %" +msgstr "W poziomie, %" + +#: build/blocks/contacts-hero/index.js:1 +msgid "По вертикали, %" +msgstr "W pionie, %" + +#: build/blocks/contacts-hero/index.js:1 +msgid "Масштаб, %" +msgstr "Powiększenie, %" + +#: build/blocks/contacts-hero/index.js:1 +msgid "Вступление" +msgstr "Wstęp" + +#: build/blocks/contacts-hero/index.js:1 +#: build/blocks/installment/index.js:1 +#: build/blocks/prepare/index.js:1 +#: build/blocks/service-page/index.js:1 +#: build/blocks/services/index.js:1 +msgid "Кнопка" +msgstr "Przycisk" + +#: build/blocks/doctor-page/index.js:1 +msgid "Врач" +msgstr "Lekarz" + +#: build/blocks/doctor-page/index.js:1 +msgid "Стаж, например «стаж 10 лет»" +msgstr "Staż, np. „10 lat doświadczenia”" + +#: build/blocks/doctor-page/index.js:1 +msgid "Рассказ, каждый абзац с новой строки" +msgstr "Opis, każdy akapit w nowym wierszu" + +#: build/blocks/doctor-page/index.js:1 +msgid "Подписи" +msgstr "Podpisy" + +#: build/blocks/doctor-page/index.js:1 +msgid "Заголовок других врачей" +msgstr "Nagłówek pozostałych lekarzy" + +#: build/blocks/doctor-page/index.js:1 +#: build/blocks/hero/index.js:1 +msgid "Кнопка записи" +msgstr "Przycisk zapisu" + +#: build/blocks/doctors/index.js:1 +msgid "Изменить врачей" +msgstr "Edytuj lekarzy" + +#: build/blocks/doctors/index.js:1 +#: build/blocks/faq/index.js:1 +#: build/blocks/office/index.js:1 +#: build/blocks/reviews/index.js:1 +#: build/blocks/services/index.js:1 +#: build/blocks/visit/index.js:1 +msgid "Заголовок раздела" +msgstr "Nagłówek sekcji" + +#: build/blocks/faq/index.js:1 +msgid "Изменить вопросы" +msgstr "Edytuj pytania" + +#: build/blocks/faq/index.js:1 +msgid "Вопросы" +msgstr "Pytania" + +#: build/blocks/faq/index.js:1 +msgid "Группа вопросов" +msgstr "Grupa pytań" + +#: build/blocks/faq/index.js:1 +msgid "Ярлык группы из раздела «Вопросы», например home." +msgstr "Identyfikator grupy z sekcji „Pytania”, np. home." + +#: build/blocks/faq/index.js:1 +#: build/blocks/hero/index.js:1 +#: build/blocks/services/index.js:1 +msgid "Подзаголовок" +msgstr "Podtytuł" + +#: build/blocks/hero/index.js:1 +msgid "Положение фото" +msgstr "Położenie zdjęcia" + +#: build/blocks/hero/index.js:1 +msgid "Перетащите точку на лицо: эта часть фото всегда останется в кадре. Лучше горизонтальное фото от 2000 px по ширине." +msgstr "Przeciągnij punkt na twarz: ta część zdjęcia zawsze zostanie w kadrze. Najlepiej poziome zdjęcie o szerokości od 2000 px." + +#: build/blocks/hero/index.js:1 +msgid "Сначала добавьте фото кнопкой «Добавить фото» над блоком." +msgstr "Najpierw dodaj zdjęcie przyciskiem „Dodaj zdjęcie” nad blokiem." + +#: build/blocks/hero/index.js:1 +msgid "Вторая кнопка" +msgstr "Drugi przycisk" + +#: build/blocks/hero/index.js:1 +#: build/blocks/services/index.js:1 +msgid "Ссылка" +msgstr "Link" + +#: build/blocks/hero/index.js:1 +msgid "Адрес страницы или якорь вида #contacts." +msgstr "Adres strony lub kotwica, np. #contacts." + +#: build/blocks/installment/index.js:1 +#: build/blocks/prepare/index.js:1 +msgid "Текст" +msgstr "Tekst" + +#: build/blocks/page-hero/index.js:1 +msgid "Заголовок страницы" +msgstr "Nagłówek strony" + +#: build/blocks/paper-note/index.js:1 +msgid "Абзац" +msgstr "Akapit" + +#: build/blocks/paper-note/index.js:1 +msgid "Убрать абзац" +msgstr "Usuń akapit" + +#: build/blocks/paper-note/index.js:1 +msgid "Добавить абзац" +msgstr "Dodaj akapit" + +#: build/blocks/plan-visit/index.js:1 +msgid "Заменить фон" +msgstr "Zmień tło" + +#: build/blocks/plan-visit/index.js:1 +msgid "Вернуть фон" +msgstr "Przywróć tło" + +#: build/blocks/plan-visit/index.js:1 +msgid "Изменить адрес" +msgstr "Edytuj adres" + +#: build/blocks/prepare/index.js:1 +msgid "Пункт списка" +msgstr "Element listy" + +#: build/blocks/prepare/index.js:1 +msgid "Убрать пункт" +msgstr "Usuń element" + +#: build/blocks/prepare/index.js:1 +msgid "Заголовок записки" +msgstr "Nagłówek notatki" + +#: build/blocks/prepare/index.js:1 +msgid "Добавить пункт" +msgstr "Dodaj element" + +#: build/blocks/prepare/index.js:1 +msgid "Приглашение" +msgstr "Zaproszenie" + +#: build/blocks/prices/index.js:1 +msgid "Без услуги" +msgstr "Bez usługi" + +#: build/blocks/prices/index.js:1 +msgid "Название группы" +msgstr "Nazwa grupy" + +#: build/blocks/prices/index.js:1 +msgid "Цена, zł" +msgstr "Cena, zł" + +#: build/blocks/prices/index.js:1 +msgid "Убрать строку" +msgstr "Usuń wiersz" + +#: build/blocks/prices/index.js:1 +msgid "Услуга" +msgstr "Usługa" + +#: build/blocks/prices/index.js:1 +msgid "Добавить строку" +msgstr "Dodaj wiersz" + +#: build/blocks/prices/index.js:1 +msgid "Убрать группу" +msgstr "Usuń grupę" + +#: build/blocks/prices/index.js:1 +msgid "Добавить группу" +msgstr "Dodaj grupę" + +#: build/blocks/prices/index.js:1 +msgid "Примечание под таблицей" +msgstr "Uwaga pod tabelą" + +#: build/blocks/reviews-board/index.js:1 +#: build/blocks/reviews/index.js:1 +msgid "Изменить отзывы" +msgstr "Edytuj opinie" + +#: build/blocks/reviews-board/index.js:1 +msgid "Заменить фон доски" +msgstr "Zmień tło tablicy" + +#: build/blocks/reviews-board/index.js:1 +msgid "Подпись" +msgstr "Podpis" + +#: build/blocks/reviews-board/index.js:1 +msgid "Текст перед ссылками" +msgstr "Tekst przed linkami" + +#: build/blocks/reviews/index.js:1 +msgid "Что на фото: для поисковиков и незрячих посетителей." +msgstr "Co jest na zdjęciu: dla wyszukiwarek i osób niewidomych." + +#: build/blocks/reviews/index.js:1 +msgid "Ссылка на все отзывы" +msgstr "Link do wszystkich opinii" + +#: build/blocks/reviews/index.js:1 +msgid "Текст ссылки" +msgstr "Tekst linku" + +#: build/blocks/service-page/index.js:1 +msgid "Убрать" +msgstr "Usuń" + +#: build/blocks/service-page/index.js:1 +msgid "Добавить" +msgstr "Dodaj" + +#: build/blocks/service-page/index.js:1 +msgid "Шапка" +msgstr "Sekcja górna" + +#: build/blocks/service-page/index.js:1 +msgid "Описание" +msgstr "Opis" + +#: build/blocks/service-page/index.js:1 +msgid "Когда записаться" +msgstr "Kiedy się zapisać" + +#: build/blocks/service-page/index.js:1 +msgid "Пункты, каждый с новой строки" +msgstr "Punkty, każdy w nowym wierszu" + +#: build/blocks/service-page/index.js:1 +msgid "Заголовки приёма и методов" +msgstr "Nagłówki wizyty i metod" + +#: build/blocks/service-page/index.js:1 +msgid "Заголовок приёма" +msgstr "Nagłówek wizyty" + +#: build/blocks/service-page/index.js:1 +msgid "Заголовок методов" +msgstr "Nagłówek metod" + +#: build/blocks/service-page/index.js:1 +msgid "Шаги приёма" +msgstr "Etapy wizyty" + +#: build/blocks/service-page/index.js:1 +msgid "Название" +msgstr "Nazwa" + +#: build/blocks/service-page/index.js:1 +msgid "Методы и стоимость" +msgstr "Metody i ceny" + +#: build/blocks/service-page/index.js:1 +msgid "Когда подходит" +msgstr "Kiedy jest odpowiednie" + +#: build/blocks/service-page/index.js:1 +msgid "Как проходит" +msgstr "Jak przebiega" + +#: build/blocks/service-page/index.js:1 +msgid "Польза, каждый пункт с новой строки" +msgstr "Korzyści, każda w nowym wierszu" + +#: build/blocks/service-page/index.js:1 +msgid "Выбрать фото" +msgstr "Wybierz zdjęcie" + +#: build/blocks/services/index.js:1 +msgid "Изменить услуги" +msgstr "Edytuj usługi" + +#: build/blocks/services/index.js:1 +msgid "Адрес страницы, например /prices/." +msgstr "Adres strony, np. /prices/." + +#: build/blocks/visit-step/index.js:1 +msgid "Заменить картинку" +msgstr "Zmień obraz" + +#: build/blocks/visit-step/index.js:1 +msgid "Вернуть рисунок" +msgstr "Przywróć ilustrację" + +#: build/blocks/visit-step/index.js:1 +msgid "Название шага" +msgstr "Nazwa etapu" + +#: build/blocks/visit-step/index.js:1 +msgid "Текст шага" +msgstr "Tekst etapu" + +#: build/blocks/visit/index.js:1 +msgid "Знакомство с врачом" +msgstr "Poznanie lekarza" + +#: build/blocks/visit/index.js:1 +msgid "Ребёнок осматривает кабинет, задаёт вопросы и привыкает к врачу без спешки." +msgstr "Dziecko rozgląda się po gabinecie, zadaje pytania i bez pośpiechu oswaja się z lekarzem." + +#: build/blocks/visit/index.js:1 +msgid "Бережное лечение" +msgstr "Delikatne leczenie" + +#: build/blocks/visit/index.js:1 +msgid "Каждое действие объясняется заранее, лечение идёт в спокойном для ребёнка темпе." +msgstr "Każdy krok jest wyjaśniany z wyprzedzeniem, a leczenie przebiega w spokojnym dla dziecka tempie." + +#: build/blocks/visit/index.js:1 +msgid "Учимся ухаживать" +msgstr "Uczymy się dbać o zęby" + +#: build/blocks/visit/index.js:1 +msgid "Ребёнок узнаёт, как правильно чистить зубы и ухаживать за полостью рта." +msgstr "Dziecko uczy się, jak prawidłowo myć zęby i dbać o jamę ustną." + +#: build/blocks/visit/index.js:1 +msgid "Следим за прикусом" +msgstr "Kontrolujemy zgryz" + +#: build/blocks/visit/index.js:1 +msgid "На осмотре проверяются смена зубов и прикус, чтобы вовремя заметить изменения." +msgstr "Na wizycie kontrolnej sprawdzana jest wymiana zębów i zgryz, aby w porę zauważyć zmiany." + +#: build/blocks/clinic-info/block.json +msgctxt "block title" +msgid "Контакты и часы работы" +msgstr "Kontakt i godziny otwarcia" + +#: build/blocks/clinic-info/block.json +msgctxt "block description" +msgid "Контакты и часы работы из настроек «Клиника» и кнопка записи." +msgstr "Kontakt i godziny otwarcia z ustawień „Klinika” oraz przycisk zapisu." + +#: build/blocks/contacts-hero/block.json +msgctxt "block title" +msgid "Верх страницы контактов" +msgstr "Górna część strony kontaktu" + +#: build/blocks/contacts-hero/block.json +msgctxt "block description" +msgid "Заголовок, вступление, кнопки и круглое фото." +msgstr "Nagłówek, wstęp, przyciski i okrągłe zdjęcie." + +#: build/blocks/doctor-page/block.json +msgctxt "block title" +msgid "Страница врача" +msgstr "Strona lekarza" + +#: build/blocks/doctor-page/block.json +msgctxt "block description" +msgid "Фото, имя, должность, стаж и рассказ о враче из записи «Врачи», затем другие врачи и кнопка записи." +msgstr "Zdjęcie, imię, stanowisko, staż i opis lekarza z wpisu „Lekarze”, dalej pozostali lekarze i przycisk zapisu." + +#: build/blocks/doctors/block.json +msgctxt "block title" +msgid "Наши врачи" +msgstr "Nasi lekarze" + +#: build/blocks/doctors/block.json +msgctxt "block description" +msgid "Заголовок и карточки врачей из раздела «Врачи»." +msgstr "Nagłówek i karty lekarzy z sekcji „Lekarze”." + +#: build/blocks/faq/block.json +msgctxt "block title" +msgid "Частые вопросы" +msgstr "Częste pytania" + +#: build/blocks/faq/block.json +msgctxt "block description" +msgid "Заголовок, подзаголовок и вопросы из раздела «Вопросы»." +msgstr "Nagłówek, podtytuł i pytania z sekcji „Pytania”." + +#: build/blocks/hero/block.json +msgctxt "block title" +msgid "Баннер" +msgstr "Baner" + +#: build/blocks/hero/block.json +msgctxt "block description" +msgid "Первый экран: фото, заголовок и две кнопки." +msgstr "Pierwszy ekran: zdjęcie, nagłówek i dwa przyciski." + +#: build/blocks/installment/block.json +msgctxt "block title" +msgid "Рассрочка" +msgstr "Raty" + +#: build/blocks/installment/block.json +msgctxt "block description" +msgid "Условия рассрочки и кнопка записи." +msgstr "Warunki rat i przycisk zapisu." + +#: build/blocks/office-photo/block.json +msgctxt "block title" +msgid "Фото клиники" +msgstr "Zdjęcie kliniki" + +#: build/blocks/office-photo/block.json +msgctxt "block description" +msgid "Одно фото раздела «Внутри клиники»." +msgstr "Jedno zdjęcie sekcji „Wewnątrz kliniki”." + +#: build/blocks/office/block.json +msgctxt "block title" +msgid "Внутри клиники" +msgstr "Wewnątrz kliniki" + +#: build/blocks/office/block.json +msgctxt "block description" +msgid "Заголовок и три фото клиники." +msgstr "Nagłówek i trzy zdjęcia kliniki." + +#: build/blocks/page-hero/block.json +msgctxt "block title" +msgid "Баннер страницы" +msgstr "Baner strony" + +#: build/blocks/page-hero/block.json +msgctxt "block description" +msgid "Фото и заголовок первой страницы внутренних разделов." +msgstr "Zdjęcie i nagłówek na górze podstron." + +#: build/blocks/paper-note/block.json +msgctxt "block title" +msgid "Бумажная плашка" +msgstr "Karteczka" + +#: build/blocks/paper-note/block.json +msgctxt "block description" +msgid "Заголовок и абзацы на листе жёлтой бумаги." +msgstr "Nagłówek i akapity na kartce żółtego papieru." + +#: build/blocks/plan-visit/block.json +msgctxt "block title" +msgid "Запланируйте визит" +msgstr "Zaplanuj wizytę" + +#: build/blocks/plan-visit/block.json +msgctxt "block description" +msgid "Заголовок и карта Google по адресу из настроек «Клиника»." +msgstr "Nagłówek i mapa Google z adresem z ustawień „Klinika”." + +#: build/blocks/prepare/block.json +msgctxt "block title" +msgid "Подготовка к визиту" +msgstr "Przygotowanie do wizyty" + +#: build/blocks/prepare/block.json +msgctxt "block description" +msgid "Записка со списком, совет родителям и кнопка записи." +msgstr "Notatka z listą, porada dla rodziców i przycisk zapisu." + +#: build/blocks/prices/block.json +msgctxt "block title" +msgid "Таблица цен" +msgstr "Tabela cen" + +#: build/blocks/prices/block.json +msgctxt "block description" +msgid "Группы процедур с ценами, группа может быть привязана к услуге." +msgstr "Grupy zabiegów z cenami; grupę można powiązać z usługą." + +#: build/blocks/reviews-board/block.json +msgctxt "block title" +msgid "Доска отзывов" +msgstr "Tablica opinii" + +#: build/blocks/reviews-board/block.json +msgctxt "block description" +msgid "Заголовок, отзывы из раздела «Отзывы» по страницам и ссылки на площадки." +msgstr "Nagłówek, opinie z sekcji „Opinie” na kolejnych stronach i linki do serwisów." + +#: build/blocks/reviews/block.json +msgctxt "block title" +msgid "Отзывы" +msgstr "Opinie" + +#: build/blocks/reviews/block.json +msgctxt "block description" +msgid "Заголовок, три отзыва из раздела «Отзывы», ссылка и фото." +msgstr "Nagłówek, trzy opinie z sekcji „Opinie”, link i zdjęcie." + +#: build/blocks/service-page/block.json +msgctxt "block title" +msgid "Страница услуги" +msgstr "Strona usługi" + +#: build/blocks/service-page/block.json +msgctxt "block description" +msgid "Шапка услуги, когда записаться, как проходит приём и методы со стоимостью." +msgstr "Górna sekcja usługi, kiedy się zapisać, jak przebiega wizyta oraz metody z cenami." + +#: build/blocks/services/block.json +msgctxt "block title" +msgid "Услуги" +msgstr "Usługi" + +#: build/blocks/services/block.json +msgctxt "block description" +msgid "Заголовок, подзаголовок, плитки из раздела «Услуги» и кнопка." +msgstr "Nagłówek, podtytuł, kafelki z sekcji „Usługi” i przycisk." + +#: build/blocks/visit-step/block.json +msgctxt "block title" +msgid "Шаг приёма" +msgstr "Etap wizyty" + +#: build/blocks/visit-step/block.json +msgctxt "block description" +msgid "Картинка, название и текст одного шага." +msgstr "Obraz, nazwa i tekst jednego etapu." + +#: build/blocks/visit/block.json +msgctxt "block title" +msgid "Как проходит приём" +msgstr "Jak przebiega wizyta" + +#: build/blocks/visit/block.json +msgctxt "block description" +msgid "Заголовок и шаги детского приёма с картинками." +msgstr "Nagłówek i etapy wizyty dziecka z obrazkami." diff --git a/wp-content/plugins/smilia-core/package.json b/wp-content/plugins/smilia-core/package.json new file mode 100644 index 0000000..2208000 --- /dev/null +++ b/wp-content/plugins/smilia-core/package.json @@ -0,0 +1,14 @@ +{ + "name": "smilia-core", + "private": true, + "scripts": { + "build": "wp-scripts build --webpack-src-dir=src/blocks --output-path=build/blocks --webpack-copy-php --blocks-manifest", + "start": "wp-scripts start --webpack-src-dir=src/blocks --output-path=build/blocks --webpack-copy-php --blocks-manifest" + }, + "devDependencies": { + "@wordpress/scripts": "^36.0.0" + }, + "dependencies": { + "altcha": "3.2.4" + } +} diff --git a/wp-content/plugins/smilia-core/smilia-core.php b/wp-content/plugins/smilia-core/smilia-core.php new file mode 100644 index 0000000..88d8a5a --- /dev/null +++ b/wp-content/plugins/smilia-core/smilia-core.php @@ -0,0 +1,38 @@ +register(); + +register_activation_hook( __FILE__, array( Plugin::class, 'activate' ) ); +register_deactivation_hook( __FILE__, array( Plugin::class, 'deactivate' ) ); diff --git a/wp-content/plugins/smilia-core/src/blocks/clinic-info/block.json b/wp-content/plugins/smilia-core/src/blocks/clinic-info/block.json new file mode 100644 index 0000000..983c5a7 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/clinic-info/block.json @@ -0,0 +1,51 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/clinic-info", + "title": "Контакты и часы работы", + "category": "smilia", + "icon": "phone", + "description": "Контакты и часы работы из настроек «Клиника» и кнопка записи.", + "textdomain": "smilia-core", + "attributes": { + "contactsTitle": { + "type": "string", + "role": "content", + "default": "Контакты" + }, + "hoursTitle": { + "type": "string", + "role": "content", + "default": "Часы работы" + }, + "buttonText": { + "type": "string", + "role": "content", + "default": "Записаться онлайн" + }, + "clock": { + "type": "boolean", + "default": false + }, + "part": { + "type": "string", + "enum": [ + "all", + "contacts", + "hours" + ], + "default": "all" + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "viewScript": "file:./view.js", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/clinic-info/clock.php b/wp-content/plugins/smilia-core/src/blocks/clinic-info/clock.php new file mode 100644 index 0000000..3d4eb79 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/clinic-info/clock.php @@ -0,0 +1,51 @@ + __( 'Открыто', 'smilia-core' ), + 'closed' => __( 'Закрыто', 'smilia-core' ), + 'dayoff' => __( 'Сегодня выходной', 'smilia-core' ), + 'until' => __( 'до %s', 'smilia-core' ), + 'today' => __( 'откроется в %s', 'smilia-core' ), + 'tomorrow' => __( 'откроется завтра в %s', 'smilia-core' ), + 'on' => __( 'откроется %1$s в %2$s', 'smilia-core' ), + 'weekdays' => array( + __( 'в понедельник', 'smilia-core' ), + __( 'во вторник', 'smilia-core' ), + __( 'в среду', 'smilia-core' ), + __( 'в четверг', 'smilia-core' ), + __( 'в пятницу', 'smilia-core' ), + __( 'в субботу', 'smilia-core' ), + __( 'в воскресенье', 'smilia-core' ), + ), + 'minutes' => array( + 'one' => __( 'закроется через %d минуту', 'smilia-core' ), + 'few' => __( 'закроется через %d минуты', 'smilia-core' ), + 'many' => __( 'закроется через %d минут', 'smilia-core' ), + 'other' => __( 'закроется через %d минуты', 'smilia-core' ), + ), +); +?> +
+ + +
diff --git a/wp-content/plugins/smilia-core/src/blocks/clinic-info/contacts.php b/wp-content/plugins/smilia-core/src/blocks/clinic-info/contacts.php new file mode 100644 index 0000000..9b4fb2e --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/clinic-info/contacts.php @@ -0,0 +1,50 @@ + +
+
+ +
+
+
+
+ + +
+
+
+
+ + +
+
WhatsApp
+
+
+ + +
+
+
+
+ +
+ +
    + +
  • + + +
  • + +
+ +
diff --git a/wp-content/plugins/smilia-core/src/blocks/clinic-info/edit.js b/wp-content/plugins/smilia-core/src/blocks/clinic-info/edit.js new file mode 100644 index 0000000..11914be --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/clinic-info/edit.js @@ -0,0 +1,72 @@ +import { __ } from '@wordpress/i18n'; +import { useBlockProps } from '@wordpress/block-editor'; +import PlainText from '../../shared/plain-text'; +import ServerPreview from '../../shared/server-preview'; +import ManageButton from '../../shared/manage-button'; + +export default function Edit( { attributes, setAttributes } ) { + const fields = { attributes, setAttributes }; + + return ( + <> + +
+ +
+
+
+ + <ServerPreview + block="smilia/clinic-info" + part="contacts" + /> + </div> + <div className="clinic-info__column"> + <PlainText + { ...fields } + attribute="hoursTitle" + tagName="h2" + className="clinic-info__title" + placeholder={ __( 'Заголовок', 'smilia-core' ) } + /> + <ServerPreview + block="smilia/clinic-info" + part="hours" + /> + </div> + </div> + <div className="clinic-info__cta"> + <PlainText + { ...fields } + attribute="buttonText" + tagName="span" + className="button button--primary button--lg" + placeholder={ __( 'Текст кнопки', 'smilia-core' ) } + /> + </div> + </div> + </section> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/clinic-info/hours.php b/wp-content/plugins/smilia-core/src/blocks/clinic-info/hours.php new file mode 100644 index 0000000..ce64c81 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/clinic-info/hours.php @@ -0,0 +1,11 @@ +<?php + +defined( 'ABSPATH' ) || exit; + +?> +<dl class="hours"> + <?php foreach ( $smilia_hours as $smilia_row ) : ?> + <dt class="hours__day"><?php echo esc_html( $smilia_row['day'] ); ?></dt> + <dd class="hours__time"><?php echo esc_html( $smilia_row['time'] ); ?></dd> + <?php endforeach; ?> +</dl> diff --git a/wp-content/plugins/smilia-core/src/blocks/clinic-info/index.js b/wp-content/plugins/smilia-core/src/blocks/clinic-info/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/clinic-info/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/clinic-info/render.php b/wp-content/plugins/smilia-core/src/blocks/clinic-info/render.php new file mode 100644 index 0000000..de146d6 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/clinic-info/render.php @@ -0,0 +1,42 @@ +<?php + +use Smilia\Core\Markup; +use Smilia\Core\Settings; + +defined( 'ABSPATH' ) || exit; + +$smilia_hours = Settings::hours(); +if ( 'contacts' === $attributes['part'] ) { + require __DIR__ . '/contacts.php'; + return; +} +if ( 'hours' === $attributes['part'] ) { + require __DIR__ . '/hours.php'; + return; +} +?> +<section class="section section--soft clinic-info"> + <svg class="clinic-info__wave" viewBox="0 0 300 42" preserveAspectRatio="none" aria-hidden="true" focusable="false"><path d="M0,42 C50,14 100,10 150,24 C200,38 250,35 300,18 L300,42 Z"/></svg> + <div class="container"> + <div class="clinic-info__grid"> + <div class="clinic-info__column"> + <h2 class="clinic-info__title"><?php echo Markup::text( $attributes['contactsTitle'] ); ?></h2> + <?php require __DIR__ . '/contacts.php'; ?> + </div> + <?php if ( $smilia_hours ) : ?> + <div class="clinic-info__column"> + <h2 class="clinic-info__title"><?php echo Markup::text( $attributes['hoursTitle'] ); ?></h2> + <?php require __DIR__ . '/hours.php'; ?> + </div> + <?php endif; ?> + </div> + <?php if ( ! empty( $attributes['clock'] ) && $smilia_hours && 7 === count( Settings::schedule() ) ) : ?> + <div class="clinic-info__clock"> + <?php require __DIR__ . '/clock.php'; ?> + </div> + <?php endif; ?> + <div class="clinic-info__cta"> + <button type="button" class="button button--primary button--lg" data-booking-open><?php echo Markup::text( $attributes['buttonText'] ); ?></button> + </div> + </div> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/clinic-info/style.css b/wp-content/plugins/smilia-core/src/blocks/clinic-info/style.css new file mode 100644 index 0000000..6e6dca2 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/clinic-info/style.css @@ -0,0 +1,266 @@ +.clinic-info { + position: relative; + padding-block: var(--space-24) var(--space-16); +} + +.clinic-info__wave { + position: absolute; + top: calc(var(--space-16) * -1 + 2px); + left: 0; + width: 100%; + height: var(--space-16); + fill: var(--color-bg-soft); +} + +.clinic-info__grid { + --clinic-info-columns: 2; + display: grid; + grid-template-columns: repeat(var(--clinic-info-columns), minmax(0, 1fr)); + gap: var(--space-12) var(--space-16); + max-width: 62.5rem; + margin-inline: auto; +} + +.clinic-info__column { + display: flex; + flex-direction: column; + align-items: center; + gap: var(--space-5); + text-align: center; +} + +.clinic-info__title { + color: var(--color-text-heading); + font-size: var(--fs-h3); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-tight); +} + +.clinic-info__contacts { + display: flex; + flex-direction: column; + align-items: center; + gap: var(--space-5); +} + +.clinic-info__list { + display: flex; + flex-direction: column; + gap: var(--space-5); +} + +.clinic-info__row { + display: flex; + flex-direction: column; + gap: var(--space-1); +} + +.clinic-info__label { + color: var(--color-accent-strong); + font-weight: var(--font-weight-extrabold); +} + +.clinic-info__value { + color: var(--color-text-body); +} + +.clinic-info__link { + position: relative; + white-space: nowrap; + transition: color var(--duration-fast) ease; +} + +@media (pointer: coarse) { + .clinic-info__link::before { + content: ""; + position: absolute; + inset: calc(var(--space-3) * -1) calc(var(--space-2) * -1); + } +} + +.clinic-info__link--underline { + border-bottom: 1px solid var(--color-line); +} + +.socials { + display: flex; + justify-content: center; + gap: var(--space-3); +} + +.socials__link { + display: flex; + align-items: center; + justify-content: center; + width: 2.75rem; + height: 2.75rem; + background: var(--color-accent-soft); + border-radius: 50%; + color: var(--color-accent-strong); + transition: background-color var(--duration-fast) ease, transform 0.08s ease; +} + +.socials__icon { + width: 1.25rem; + height: 1.25rem; + fill: currentColor; +} + +.hours { + display: grid; + grid-template-columns: auto auto; + gap: var(--space-3) var(--space-8); + text-align: left; +} + +.hours__day { + color: var(--color-accent-strong); +} + +.hours__time { + color: var(--color-text-body); + font-weight: var(--font-weight-bold); + white-space: nowrap; +} + +.clinic-info__clock { + display: flex; + justify-content: center; + margin-top: var(--space-12); +} + +.clinic-info__cta { + display: flex; + justify-content: center; + margin-top: var(--space-12); +} + +.socials__link:active { + transform: scale(0.97); +} + +@media (hover: hover) { + .socials__link:hover { + background: var(--color-accent-light); + color: var(--color-accent-strong); + } +} + +@media (max-width: 760px) { + .clinic-info { + padding-block: var(--space-16) var(--space-12); + } + + .clinic-info__grid { + --clinic-info-columns: 1; + } +} + +.clinic-clock { + display: flex; + flex-direction: column; + align-items: center; + gap: var(--space-4); + margin-bottom: var(--space-2); +} + +.clinic-clock__face { + width: 10rem; + height: 10rem; +} + +.clinic-clock__dial { + fill: var(--color-surface); + stroke: var(--color-accent-light); + stroke-width: 8; +} + +.clinic-clock__tick { + stroke: var(--color-line); + stroke-width: 2; + stroke-linecap: round; +} + +.clinic-clock__tick--hour { + stroke: var(--color-accent); + stroke-width: 3; +} + +.clinic-clock__number { + fill: var(--color-accent-strong); + font-family: var(--font-sans); + font-size: 15px; + font-weight: var(--font-weight-extrabold); + text-anchor: middle; +} + +.clinic-clock__hand { + stroke-linecap: round; + transform-box: view-box; + transform-origin: 50% 50%; +} + +.clinic-clock__hand--hour { + stroke: var(--color-accent-strong); + stroke-width: 6; +} + +.clinic-clock__hand--minute { + stroke: var(--color-accent-strong); + stroke-width: 4; +} + +.clinic-clock__hand--second { + stroke: var(--color-danger); + stroke-width: 2; + transition: transform 0.15s ease-out; +} + +.clinic-clock__pin { + fill: var(--color-accent-strong); +} + +.clinic-clock__status { + min-height: 5rem; + text-align: center; + color: var(--color-text-muted); + font-size: var(--fs-small); + font-weight: var(--font-weight-bold); +} + +.clinic-clock__lines { + display: flex; + flex-direction: column; + align-items: center; + line-height: var(--leading-snug); +} + +.clinic-clock__state { + color: var(--color-status-closed); + font-size: var(--text-2xl); + font-weight: var(--font-weight-black); +} + +.clinic-clock__state::after { + content: ""; + display: block; + width: 2.25rem; + height: 0.1875rem; + margin: var(--space-1) auto var(--space-2); + background: currentColor; + border-radius: var(--radius-full); +} + +.clinic-clock__status--open .clinic-clock__state { + color: var(--color-status-open); +} + +.clinic-clock__next { + font-size: var(--text-base); +} + +@media (prefers-reduced-motion: reduce) { + .clinic-clock__hand--second { + transition: none; + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/clinic-info/view.js b/wp-content/plugins/smilia-core/src/blocks/clinic-info/view.js new file mode 100644 index 0000000..7ea2b68 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/clinic-info/view.js @@ -0,0 +1,128 @@ +( () => { + const clocks = document.querySelectorAll( '[data-clinic-clock]' ); + if ( ! clocks.length ) { + return; + } + + const weekdays = [ 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun' ]; + const reduce = window.matchMedia( '(prefers-reduced-motion: reduce)' ).matches; + const pad = ( value ) => String( value ).padStart( 2, '0' ); + const time = ( minutes ) => `${ Math.floor( minutes / 60 ) }:${ pad( minutes % 60 ) }`; + let skew = 0; + + if ( window.fetch ) { + const start = Date.now(); + window + .fetch( window.location.href, { method: 'HEAD', cache: 'no-store' } ) + .then( ( response ) => { + const header = response.headers.get( 'Date' ); + if ( ! header ) { + return; + } + const drift = Date.parse( header ) + 500 - ( start + Date.now() ) / 2; + if ( Math.abs( drift ) > 5000 ) { + skew = drift; + } + } ) + .catch( () => {} ); + } + + clocks.forEach( ( clock ) => { + const schedule = JSON.parse( clock.dataset.schedule ); + const messages = JSON.parse( clock.dataset.messages ); + const hands = {}; + clock.querySelectorAll( '[data-clock-hand]' ).forEach( ( hand ) => { + hands[ hand.dataset.clockHand ] = hand; + } ); + const status = clock.querySelector( '[data-clock-status]' ); + const stateText = clock.querySelector( '[data-clock-state]' ); + const nextText = clock.querySelector( '[data-clock-next]' ); + const options = { + weekday: 'short', + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + hourCycle: 'h23', + }; + let format; + try { + format = new Intl.DateTimeFormat( 'en-US', { ...options, timeZone: clock.dataset.timezone } ); + } catch ( error ) { + format = new Intl.DateTimeFormat( 'en-US', options ); + } + let lastSecond = null; + let turns = 0; + + const now = () => { + const parts = {}; + format.formatToParts( new Date( Date.now() + skew ) ).forEach( ( part ) => { + parts[ part.type ] = part.value; + } ); + return { + day: weekdays.indexOf( parts.weekday ), + hour: Number( parts.hour ), + minute: Number( parts.minute ), + second: Number( parts.second ), + }; + }; + + const plural = new Intl.PluralRules( document.documentElement.lang || 'ru' ); + const minutes = ( count ) => + ( messages.minutes[ plural.select( count ) ] || messages.minutes.other ).replace( '%d', count ); + + const describe = ( moment ) => { + const current = moment.hour * 60 + moment.minute; + const today = schedule[ moment.day ]; + const works = today && null !== today.open; + if ( works && current >= today.open && current < today.close ) { + const left = today.close - current; + return { + open: true, + state: messages.open, + next: left <= 60 ? minutes( left ) : messages.until.replace( '%s', time( today.close ) ), + }; + } + if ( works && current < today.open ) { + return { open: false, state: messages.closed, next: messages.today.replace( '%s', time( today.open ) ) }; + } + const state = works ? messages.closed : messages.dayoff; + for ( let shift = 1; shift <= 7; shift++ ) { + const index = ( moment.day + shift ) % 7; + const next = schedule[ index ]; + if ( next && null !== next.open ) { + const label = 1 === shift && works + ? messages.tomorrow.replace( '%s', time( next.open ) ) + : messages.on.replace( '%1$s', messages.weekdays[ index ] ).replace( '%2$s', time( next.open ) ); + return { open: false, state, next: label }; + } + } + return { open: false, state, next: '' }; + }; + + const update = () => { + const moment = now(); + if ( null !== lastSecond && moment.second < lastSecond ) { + turns++; + } + lastSecond = moment.second; + hands.second.style.transform = `rotate(${ ( turns * 60 + moment.second ) * 6 }deg)`; + hands.minute.style.transform = `rotate(${ ( moment.minute + moment.second / 60 ) * 6 }deg)`; + hands.hour.style.transform = `rotate(${ ( ( moment.hour % 12 ) + moment.minute / 60 ) * 30 }deg)`; + const state = describe( moment ); + if ( stateText.textContent !== state.state ) { + stateText.textContent = state.state; + } + if ( nextText.textContent !== state.next ) { + nextText.textContent = state.next; + } + status.classList.toggle( 'clinic-clock__status--open', state.open ); + status.hidden = false; + }; + + if ( reduce ) { + hands.second.style.display = 'none'; + } + update(); + window.setInterval( update, reduce ? 5000 : 1000 ); + } ); +} )(); diff --git a/wp-content/plugins/smilia-core/src/blocks/contacts-hero/block.json b/wp-content/plugins/smilia-core/src/blocks/contacts-hero/block.json new file mode 100644 index 0000000..4fb78d5 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/contacts-hero/block.json @@ -0,0 +1,62 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/contacts-hero", + "title": "Верх страницы контактов", + "category": "smilia", + "icon": "id-alt", + "description": "Заголовок, вступление, кнопки и круглое фото.", + "textdomain": "smilia-core", + "attributes": { + "title": { + "type": "string", + "role": "content", + "default": "Контакты" + }, + "lead": { + "type": "string", + "role": "content", + "default": "Вступление" + }, + "button": { + "type": "string", + "role": "content", + "default": "Записаться онлайн" + }, + "imageId": { + "type": "number", + "role": "content", + "default": 0 + }, + "alt": { + "type": "string", + "role": "content", + "default": "" + }, + "focusX": { + "type": "number", + "role": "content", + "default": 50 + }, + "focusY": { + "type": "number", + "role": "content", + "default": 50 + }, + "zoom": { + "type": "number", + "role": "content", + "default": 100 + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/contacts-hero/edit.js b/wp-content/plugins/smilia-core/src/blocks/contacts-hero/edit.js new file mode 100644 index 0000000..a6e483b --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/contacts-hero/edit.js @@ -0,0 +1,121 @@ +import { __ } from '@wordpress/i18n'; +import { + BlockControls, + InspectorControls, + MediaReplaceFlow, + useBlockProps, +} from '@wordpress/block-editor'; +import { PanelBody, RangeControl, TextControl } from '@wordpress/components'; +import PlainText from '../../shared/plain-text'; +import { useImageUrl } from '../../shared/images'; + +export default function Edit( { attributes, setAttributes } ) { + const { imageId, alt, focusX, focusY, zoom } = attributes; + const fields = { attributes, setAttributes }; + const imageUrl = useImageUrl( imageId, 'smilia-800' ); + + return ( + <> + <BlockControls group="other"> + <MediaReplaceFlow + mediaId={ imageId } + mediaURL={ imageUrl } + allowedTypes={ [ 'image' ] } + accept="image/*" + name={ + imageId + ? __( 'Заменить фото', 'smilia-core' ) + : __( 'Добавить фото', 'smilia-core' ) + } + onSelect={ ( media ) => + setAttributes( { imageId: media.id } ) + } + /> + </BlockControls> + <InspectorControls> + <PanelBody title={ __( 'Фото', 'smilia-core' ) }> + <TextControl + label={ __( 'Описание фото', 'smilia-core' ) } + help={ __( + 'Для незрячих и поисковиков. Пусто: описание из медиатеки.', + 'smilia-core' + ) } + value={ alt } + onChange={ ( value ) => setAttributes( { alt: value } ) } + __next40pxDefaultSize + __nextHasNoMarginBottom + /> + <RangeControl + label={ __( 'По горизонтали, %', 'smilia-core' ) } + value={ focusX } + onChange={ ( value ) => setAttributes( { focusX: value ?? 50 } ) } + min={ 0 } + max={ 100 } + __next40pxDefaultSize + __nextHasNoMarginBottom + /> + <RangeControl + label={ __( 'По вертикали, %', 'smilia-core' ) } + value={ focusY } + onChange={ ( value ) => setAttributes( { focusY: value ?? 50 } ) } + min={ 0 } + max={ 100 } + __next40pxDefaultSize + __nextHasNoMarginBottom + /> + <RangeControl + label={ __( 'Масштаб, %', 'smilia-core' ) } + value={ zoom } + onChange={ ( value ) => setAttributes( { zoom: value ?? 100 } ) } + min={ 100 } + max={ 200 } + __next40pxDefaultSize + __nextHasNoMarginBottom + /> + </PanelBody> + </InspectorControls> + <section { ...useBlockProps( { className: 'contacts-hero container container--wide' } ) }> + <div className="contacts-hero__grid"> + <div className="contacts-hero__text"> + <PlainText + { ...fields } + attribute="title" + tagName="h1" + className="contacts-hero__title" + placeholder={ __( 'Заголовок', 'smilia-core' ) } + /> + <PlainText + { ...fields } + attribute="lead" + tagName="p" + className="contacts-hero__lead" + placeholder={ __( 'Вступление', 'smilia-core' ) } + /> + <div className="contacts-hero__actions"> + <PlainText + { ...fields } + attribute="button" + tagName="span" + className="button button--primary button--lg" + placeholder={ __( 'Кнопка', 'smilia-core' ) } + /> + </div> + </div> + <div + className="contacts-hero__photo" + style={ { + '--contacts-hero-focus': `${ focusX }% ${ focusY }%`, + '--contacts-hero-zoom': zoom / 100, + } } + > + { imageUrl && ( + <span className="contacts-hero__frame"> + <img className="contacts-hero__image" src={ imageUrl } alt={ alt } /> + </span> + ) } + </div> + </div> + </section> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/contacts-hero/index.js b/wp-content/plugins/smilia-core/src/blocks/contacts-hero/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/contacts-hero/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/contacts-hero/render.php b/wp-content/plugins/smilia-core/src/blocks/contacts-hero/render.php new file mode 100644 index 0000000..785b871 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/contacts-hero/render.php @@ -0,0 +1,50 @@ +<?php + +use Smilia\Core\Markup; +use Smilia\Core\Settings; + +defined( 'ABSPATH' ) || exit; + +$smilia_phone = Settings::get( 'phone_main' ); +$smilia_focus = sprintf( + '--contacts-hero-focus: %1$s%% %2$s%%; --contacts-hero-zoom: %3$s', + max( 0, min( 100, (float) $attributes['focusX'] ) ), + max( 0, min( 100, (float) $attributes['focusY'] ) ), + max( 1, min( 2, (float) $attributes['zoom'] / 100 ) ) +); +?> +<section class="contacts-hero container container--wide"> + <div class="contacts-hero__grid"> + <div class="contacts-hero__text"> + <h1 class="contacts-hero__title"><?php echo esc_html( wp_strip_all_tags( $attributes['title'] ) ); ?></h1> + <p class="contacts-hero__lead"><?php echo esc_html( wp_strip_all_tags( $attributes['lead'] ) ); ?></p> + <div class="contacts-hero__actions"> + <button type="button" class="button button--primary button--lg" data-booking-open><?php echo esc_html( wp_strip_all_tags( $attributes['button'] ) ); ?></button> + <?php if ( $smilia_phone ) : ?> + <a class="button button--outline button--lg" href="<?php echo esc_url( Settings::tel( $smilia_phone ) ); ?>"><?php echo esc_html( $smilia_phone ); ?></a> + <?php endif; ?> + </div> + </div> + <?php if ( (int) $attributes['imageId'] > 0 ) : ?> + <div class="contacts-hero__photo" style="<?php echo esc_attr( $smilia_focus ); ?>"> + <span class="contacts-hero__frame"> + <?php + Markup::image( + (int) $attributes['imageId'], + 'smilia-800', + '(min-width: 1500px) 724px, (min-width: 981px) 47vw, 100vw', + array_filter( + array( + 'class' => 'contacts-hero__image', + 'alt' => trim( (string) $attributes['alt'] ), + 'loading' => 'eager', + 'fetchpriority' => 'high', + ) + ) + ); + ?> + </span> + </div> + <?php endif; ?> + </div> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/contacts-hero/style.css b/wp-content/plugins/smilia-core/src/blocks/contacts-hero/style.css new file mode 100644 index 0000000..b553b04 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/contacts-hero/style.css @@ -0,0 +1,87 @@ +.contacts-hero { + --contacts-hero-height: 26rem; + padding-block: var(--space-4) var(--space-12); +} + +.contacts-hero__grid { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); + align-items: center; + gap: var(--space-12); +} + +.contacts-hero__text { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: var(--space-5); +} + +.contacts-hero__title { + color: var(--color-accent-strong); + font-size: clamp(var(--text-5xl), 5.3vw, var(--text-7xl)); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-tight); +} + +.contacts-hero__lead { + max-width: 32rem; + color: var(--color-text-body); + font-size: var(--text-xl); + line-height: var(--leading-relaxed); + text-wrap: pretty; +} + +.contacts-hero__actions { + display: flex; + flex-wrap: wrap; + gap: var(--space-4); + margin-top: var(--space-2); +} + +.contacts-hero__photo { + display: flex; +} + +.contacts-hero__frame { + display: block; + flex: 1; + height: var(--contacts-hero-height); + overflow: hidden; + border-radius: var(--radius-3xl); +} + +.contacts-hero__image { + width: 100%; + height: 100%; + object-fit: cover; + object-position: var(--contacts-hero-focus, 50% 50%); + transform: scale(var(--contacts-hero-zoom, 1)); + transform-origin: var(--contacts-hero-focus, 50% 50%); +} + +@media (max-width: 980px) { + .contacts-hero__grid { + grid-template-columns: minmax(0, 1fr); + gap: var(--space-8); + } + + .contacts-hero__frame { + height: 18rem; + } +} + +@media (max-width: 560px) { + .contacts-hero__actions { + flex-direction: column; + align-self: stretch; + } + + .contacts-hero__actions .button { + width: 100%; + } + + .contacts-hero__frame { + height: 14rem; + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/doctor-page/block.json b/wp-content/plugins/smilia-core/src/blocks/doctor-page/block.json new file mode 100644 index 0000000..de2ea0d --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/doctor-page/block.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/doctor-page", + "title": "Страница врача", + "category": "smilia", + "icon": "id", + "description": "Фото, имя, должность, стаж и рассказ о враче из записи «Врачи», затем другие врачи и кнопка записи.", + "textdomain": "smilia-core", + "attributes": { + "experience": { "type": "string", "role": "content", "default": "" }, + "bio": { "type": "string", "role": "content", "default": "" }, + "othersTitle": { "type": "string", "role": "content", "default": "Другие врачи" }, + "button": { "type": "string", "role": "content", "default": "Записаться на приём" } + }, + "usesContext": [ "postId" ], + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/doctor-page/edit.js b/wp-content/plugins/smilia-core/src/blocks/doctor-page/edit.js new file mode 100644 index 0000000..87633b8 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/doctor-page/edit.js @@ -0,0 +1,48 @@ +import { __ } from '@wordpress/i18n'; +import { InspectorControls, useBlockProps } from '@wordpress/block-editor'; +import { + Disabled, + PanelBody, + TextControl, + TextareaControl, +} from '@wordpress/components'; +import ServerSideRender from '@wordpress/server-side-render'; + +export default function Edit( { attributes, setAttributes } ) { + const blockProps = useBlockProps(); + const field = ( key, label, Control = TextControl ) => ( + <Control + __nextHasNoMarginBottom + label={ label } + value={ attributes[ key ] } + onChange={ ( value ) => setAttributes( { [ key ]: value } ) } + /> + ); + + return ( + <> + <InspectorControls> + <PanelBody title={ __( 'Врач', 'smilia-core' ) }> + { field( 'experience', __( 'Стаж, например «стаж 10 лет»', 'smilia-core' ) ) } + { field( + 'bio', + __( 'Рассказ, каждый абзац с новой строки', 'smilia-core' ), + TextareaControl + ) } + </PanelBody> + <PanelBody title={ __( 'Подписи', 'smilia-core' ) } initialOpen={ false }> + { field( 'othersTitle', __( 'Заголовок других врачей', 'smilia-core' ) ) } + { field( 'button', __( 'Кнопка записи', 'smilia-core' ) ) } + </PanelBody> + </InspectorControls> + <div { ...blockProps }> + <Disabled> + <ServerSideRender + block="smilia/doctor-page" + attributes={ attributes } + /> + </Disabled> + </div> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/doctor-page/index.js b/wp-content/plugins/smilia-core/src/blocks/doctor-page/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/doctor-page/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/doctor-page/render.php b/wp-content/plugins/smilia-core/src/blocks/doctor-page/render.php new file mode 100644 index 0000000..d2abe7e --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/doctor-page/render.php @@ -0,0 +1,93 @@ +<?php + +use Smilia\Core\Markup; +use Smilia\Core\Meta_Fields; + +defined( 'ABSPATH' ) || exit; + +$smilia_post_id = (int) ( $block->context['postId'] ?? get_the_ID() ); +$smilia_name = get_the_title( $smilia_post_id ); +$smilia_position = (string) get_post_meta( $smilia_post_id, Meta_Fields::POSITION, true ); +$smilia_tone = sanitize_key( (string) get_post_meta( $smilia_post_id, Meta_Fields::TONE, true ) ) ?: 'teal'; +$smilia_subtitle = implode( ', ', array_filter( array( trim( $smilia_position ), trim( (string) $attributes['experience'] ) ) ) ); +$smilia_photo_id = (int) get_post_thumbnail_id( $smilia_post_id ); +$smilia_paragraphs = array_values( array_filter( array_map( 'trim', (array) preg_split( '/\R/u', wp_strip_all_tags( (string) $attributes['bio'] ) ) ) ) ); +$smilia_others = render_block( + array( + 'blockName' => 'smilia/doctors', + 'attrs' => array( + 'part' => 'list', + 'exclude' => $smilia_post_id, + ), + 'innerBlocks' => array(), + 'innerHTML' => '', + 'innerContent' => array(), + ) +); +$smilia_crumbs = render_block( + array( + 'blockName' => 'core/breadcrumbs', + 'attrs' => array( 'separator' => '›', 'className' => 'wp-block-breadcrumbs--flush doctor-page__crumbs' ), + 'innerBlocks' => array(), + 'innerHTML' => '', + 'innerContent' => array(), + ) +); +$smilia_map = render_block( + array( + 'blockName' => 'smilia/plan-visit', + 'attrs' => array( 'title' => '' ), + 'innerBlocks' => array(), + 'innerHTML' => '', + 'innerContent' => array(), + ) +); +?> +<div class="doctor-page doctor-page--<?php echo esc_attr( $smilia_tone ); ?>"> + <section class="doctor-page__hero"> + <div class="container"> + <?php echo wp_kses_post( $smilia_crumbs ); ?> + <div class="doctor-page__grid"> + <?php if ( $smilia_photo_id > 0 ) : ?> + <div class="doctor-page__frame"> + <?php + Markup::image( + $smilia_photo_id, + 'smilia-800', + '(min-width: 62rem) 26rem, 90vw', + array( + 'class' => 'doctor-page__photo', + 'loading' => 'eager', + 'fetchpriority' => 'high', + 'alt' => $smilia_name, + ) + ); + ?> + </div> + <?php endif; ?> + <div class="doctor-page__text"> + <h1 class="doctor-page__name"><?php echo esc_html( $smilia_name ); ?></h1> + <p class="doctor-page__position"><?php echo esc_html( $smilia_subtitle ); ?></p> + <div class="doctor-page__bio"> + <?php foreach ( $smilia_paragraphs as $smilia_paragraph ) : ?> + <p class="doctor-page__paragraph"><?php echo esc_html( $smilia_paragraph ); ?></p> + <?php endforeach; ?> + </div> + </div> + </div> + </div> + </section> + <?php if ( '' !== trim( $smilia_others ) ) : ?> + <section class="section doctor-page__others" aria-labelledby="doctor-page-others"> + <div class="container"> + <h2 class="section__title section__head" id="doctor-page-others"><?php echo Markup::text( $attributes['othersTitle'] ); ?></h2> + <?php echo $smilia_others; ?> + </div> + </section> + <?php endif; ?> + <?php echo $smilia_map; ?> + <section class="doctor-page__cta"> + <svg class="doctor-page__wave" viewBox="0 0 300 42" preserveAspectRatio="none" aria-hidden="true" focusable="false"><path d="M0,42 C50,14 100,10 150,24 C200,38 250,35 300,18 L300,42 Z"/></svg> + <button type="button" class="button button--primary button--lg" data-booking-open><?php echo Markup::text( $attributes['button'] ); ?></button> + </section> +</div> diff --git a/wp-content/plugins/smilia-core/src/blocks/doctor-page/style.css b/wp-content/plugins/smilia-core/src/blocks/doctor-page/style.css new file mode 100644 index 0000000..819fd95 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/doctor-page/style.css @@ -0,0 +1,139 @@ +.doctor-page { + --doctor-page-frame-radius: 3.25rem; + --doctor-page-frame: var(--color-teal-200); + --doctor-page-photo-bg: var(--color-teal-100); +} + +.doctor-page--pink { + --doctor-page-frame: var(--color-pink-200); + --doctor-page-photo-bg: var(--color-pink-100); +} + +.doctor-page--yellow { + --doctor-page-frame: var(--color-yellow-200); + --doctor-page-photo-bg: var(--color-yellow-100); +} + +.doctor-page--lavender { + --doctor-page-frame: var(--color-lavender-200); + --doctor-page-photo-bg: var(--color-lavender-100); +} + +.doctor-page--peach { + --doctor-page-frame: var(--color-peach-200); + --doctor-page-photo-bg: var(--color-peach-100); +} + +.doctor-page__hero { + padding-block: var(--space-6) var(--space-24); + background: var(--color-bg-soft); +} + +.doctor-page__crumbs { + margin-bottom: var(--space-8); +} + +.doctor-page__grid { + display: grid; + grid-template-columns: minmax(0, 26.25rem) minmax(0, 1fr); + gap: clamp(var(--space-8), 5vw, var(--space-16)); + align-items: start; +} + +.doctor-page__frame { + padding: 0.875rem; + border-radius: var(--doctor-page-frame-radius); + background: var(--doctor-page-frame); +} + +.doctor-page__photo { + display: block; + width: 100%; + aspect-ratio: 4 / 5; + border-radius: var(--radius-3xl); + background: var(--doctor-page-photo-bg); + object-fit: cover; + object-position: center top; +} + +.doctor-page__text { + display: flex; + flex-direction: column; + gap: var(--space-6); + padding-top: var(--space-3); +} + +.doctor-page__name { + color: var(--color-accent-strong); + font-size: clamp(var(--text-4xl), 4vw, var(--text-5xl)); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-tight); + text-wrap: balance; +} + +.doctor-page__position { + margin-top: var(--space-2); + color: var(--color-accent-hover); + font-size: var(--text-lg); + font-weight: var(--font-weight-bold); +} + +.doctor-page__bio { + display: flex; + flex-direction: column; + gap: var(--space-4); +} + +.doctor-page__paragraph { + color: var(--color-text-body); + font-size: var(--text-lg); + line-height: var(--leading-relaxed); + text-wrap: pretty; +} + +.doctor-page__cta { + position: relative; + display: flex; + justify-content: center; + padding-block: var(--space-12) var(--space-16); + background: var(--color-bg-soft); +} + +@media (max-width: 980px) { + .doctor-page__grid { + grid-template-columns: minmax(0, 1fr); + } + + .doctor-page__frame { + width: min(100%, 26.25rem); + margin-inline: auto; + } + + .doctor-page__hero { + padding-bottom: var(--space-16); + } +} + +@media (max-width: 560px) { + .doctor-page__frame { + border-radius: var(--radius-3xl); + } + + .doctor-page__photo { + border-radius: var(--radius-2xl); + } + + .doctor-page__cta .button { + width: calc(100% - var(--gutter) * 2); + } +} + +.doctor-page__wave { + position: absolute; + top: -3.625rem; + left: 0; + width: 100%; + height: 3.75rem; + fill: var(--color-bg-soft); + pointer-events: none; +} diff --git a/wp-content/plugins/smilia-core/src/blocks/doctors/block.json b/wp-content/plugins/smilia-core/src/blocks/doctors/block.json new file mode 100644 index 0000000..be7608d --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/doctors/block.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/doctors", + "title": "Наши врачи", + "category": "smilia", + "icon": "groups", + "description": "Заголовок и карточки врачей из раздела «Врачи».", + "textdomain": "smilia-core", + "attributes": { + "exclude": { + "type": "number", + "default": 0 + }, + "title": { + "type": "string", + "role": "content", + "default": "Наши врачи" + }, + "part": { + "type": "string", + "enum": [ + "all", + "list" + ], + "default": "all" + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/doctors/edit.js b/wp-content/plugins/smilia-core/src/blocks/doctors/edit.js new file mode 100644 index 0000000..20628ca --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/doctors/edit.js @@ -0,0 +1,32 @@ +import { __ } from '@wordpress/i18n'; +import { useBlockProps } from '@wordpress/block-editor'; +import PlainText from '../../shared/plain-text'; +import ServerPreview from '../../shared/server-preview'; +import ManageButton from '../../shared/manage-button'; + +export default function Edit( { attributes, setAttributes } ) { + const fields = { attributes, setAttributes }; + + return ( + <> + <ManageButton + postType="smilia_doctor" + label={ __( 'Изменить врачей', 'smilia-core' ) } + /> + <section + { ...useBlockProps( { className: 'section section--soft doctors' } ) } + > + <div className="container"> + <PlainText + { ...fields } + attribute="title" + tagName="h2" + className="section__title section__head" + placeholder={ __( 'Заголовок раздела', 'smilia-core' ) } + /> + <ServerPreview block="smilia/doctors" part="list" editable /> + </div> + </section> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/doctors/index.js b/wp-content/plugins/smilia-core/src/blocks/doctors/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/doctors/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/doctors/list.php b/wp-content/plugins/smilia-core/src/blocks/doctors/list.php new file mode 100644 index 0000000..8a946f4 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/doctors/list.php @@ -0,0 +1,34 @@ +<?php + +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +?> +<ul class="doctors__grid<?php echo (int) $attributes['exclude'] > 0 ? ' doctors__grid--compact' : ''; ?>"> + <?php foreach ( $smilia_doctors as $smilia_doctor ) : ?> + <li class="doctors__item" data-reveal<?php echo Markup::edit_link( (int) $smilia_doctor['id'], $attributes ); ?>> + <?php Markup::edit_button( (int) $smilia_doctor['id'], $attributes ); ?> + <a class="doctor-card doctor-card--<?php echo esc_attr( $smilia_doctor['tone'] ? $smilia_doctor['tone'] : 'teal' ); ?>" href="<?php echo esc_url( $smilia_doctor['url'] ); ?>"> + <span class="doctor-card__photo"> + <?php + Markup::image( + (int) $smilia_doctor['image_id'], + 'smilia-480', + '(min-width: 1200px) 210px, (min-width: 981px) 20vw, (min-width: 761px) 31vw, (min-width: 561px) 46vw, 74vw', + array( + 'class' => 'doctor-card__image', + 'alt' => '', + ) + ); + ?> + <svg class="doctor-card__wave" viewBox="0 0 300 26" preserveAspectRatio="none" aria-hidden="true" focusable="false"><path d="M0,20 C50,4 100,2 150,12 C200,22 250,20 300,8 L300,26 L0,26 Z"/></svg> + </span> + <span class="doctor-card__body"> + <span class="doctor-card__name"><?php echo esc_html( $smilia_doctor['name'] ); ?></span> + <span class="doctor-card__position"><?php echo esc_html( $smilia_doctor['position'] ); ?></span> + </span> + </a> + </li> + <?php endforeach; ?> +</ul> diff --git a/wp-content/plugins/smilia-core/src/blocks/doctors/render.php b/wp-content/plugins/smilia-core/src/blocks/doctors/render.php new file mode 100644 index 0000000..de5710a --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/doctors/render.php @@ -0,0 +1,28 @@ +<?php + +use Smilia\Core\Content; +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +$smilia_exclude = (int) $attributes['exclude']; +$smilia_doctors = array_values( + array_filter( + Content::doctors(), + static fn( array $doctor ): bool => (int) $doctor['id'] !== $smilia_exclude + ) +); +if ( ! $smilia_doctors ) { + return; +} +if ( 'list' === $attributes['part'] ) { + require __DIR__ . '/list.php'; + return; +} +?> +<section class="section section--soft doctors" id="doctors"> + <div class="container"> + <h2 class="section__title section__head"><?php echo Markup::text( $attributes['title'] ); ?></h2> + <?php require __DIR__ . '/list.php'; ?> + </div> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/doctors/style.css b/wp-content/plugins/smilia-core/src/blocks/doctors/style.css new file mode 100644 index 0000000..6e573b7 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/doctors/style.css @@ -0,0 +1,156 @@ +.doctors__grid { + --doctors-columns: 5; + --doctors-gap: var(--space-6); + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: var(--doctors-gap); +} + +.doctors__item { + flex: 0 0 calc((100% - var(--doctors-gap) * (var(--doctors-columns) - 1)) / var(--doctors-columns)); +} + +.doctor-card { + --doctor-card-bg: var(--color-teal-100); + --doctor-card-border: var(--color-teal-200); + display: flex; + flex-direction: column; + height: 100%; + overflow: hidden; + background: var(--doctor-card-bg); + border: 1px solid var(--doctor-card-border); + border-radius: var(--radius-2xl); + box-shadow: var(--shadow-md); + transition: transform var(--duration-base) ease, box-shadow var(--duration-base) ease; +} + +.doctor-card--pink { + --doctor-card-bg: var(--color-pink-100); + --doctor-card-border: var(--color-pink-200); +} + +.doctor-card--yellow { + --doctor-card-bg: var(--color-yellow-100); + --doctor-card-border: var(--color-yellow-200); +} + +.doctor-card--lavender { + --doctor-card-bg: var(--color-lavender-100); + --doctor-card-border: var(--color-lavender-200); +} + +.doctor-card--peach { + --doctor-card-bg: var(--color-peach-100); + --doctor-card-border: var(--color-peach-200); +} + +.doctor-card__photo { + position: relative; + display: block; +} + +.doctor-card__image { + width: 100%; + aspect-ratio: 4 / 5; + object-fit: cover; + object-position: center top; +} + +.doctor-card__wave { + position: absolute; + right: -3px; + bottom: -1px; + left: -3px; + width: calc(100% + 6px); + max-width: none; + height: auto; + fill: var(--doctor-card-bg); +} + +.doctor-card__body { + display: flex; + flex-direction: column; + gap: var(--space-1); + padding: var(--space-3) var(--space-4) var(--space-6); + text-align: center; +} + +.doctor-card__name { + color: var(--color-accent-strong); + font-size: var(--fs-card-title); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-snug); +} + +.doctor-card__position { + color: var(--color-accent-hover); + font-size: var(--fs-small); + font-weight: var(--font-weight-bold); + line-height: 1.4; +} + +@media (hover: hover) { + .doctor-card:hover { + color: inherit; + box-shadow: var(--shadow-lg); + transform: translateY(-6px); + } +} + +@media (max-width: 980px) { + .doctors__grid { + --doctors-columns: 3; + } +} + +@media (max-width: 760px) { + .doctors__grid { + --doctors-columns: 2; + --doctors-gap: var(--space-4); + } +} + +@media (max-width: 560px) { + .doctors__grid { + --doctors-gap: var(--space-4); + --doctors-card-width: min(74vw, 20rem); + flex-wrap: nowrap; + justify-content: flex-start; + margin: calc(var(--space-2) - var(--space-6)) calc(var(--gutter) * -1) calc(var(--space-6) - var(--space-10)); + padding: var(--space-6) calc((100% + 2 * var(--gutter) - var(--doctors-card-width)) / 2) var(--space-10); + overflow-x: auto; + scroll-snap-type: x mandatory; + scrollbar-width: none; + } + + .doctors__grid::-webkit-scrollbar { + display: none; + } + + .doctors__item { + flex: 0 0 var(--doctors-card-width); + scroll-snap-align: center; + } + + .doctor-card__image { + aspect-ratio: 1; + object-position: center 15%; + } +} + +@media (min-width: 981px) { + .doctors__grid--compact { + --doctors-columns: 4; + max-width: 60rem; + margin-inline: auto; + } +} + +@media (min-width: 561px) and (max-width: 980px) { + .doctors__grid--compact { + --doctors-columns: 2; + max-width: 36rem; + margin-inline: auto; + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/faq/block.json b/wp-content/plugins/smilia-core/src/blocks/faq/block.json new file mode 100644 index 0000000..c5cebb2 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/faq/block.json @@ -0,0 +1,44 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/faq", + "title": "Частые вопросы", + "category": "smilia", + "icon": "editor-help", + "description": "Заголовок, подзаголовок и вопросы из раздела «Вопросы».", + "textdomain": "smilia-core", + "attributes": { + "title": { + "type": "string", + "role": "content", + "default": "Частые вопросы родителей" + }, + "lead": { + "type": "string", + "role": "content", + "default": "О первом приёме, лечении и подготовке ребёнка." + }, + "group": { + "type": "string", + "default": "home" + }, + "part": { + "type": "string", + "enum": [ + "all", + "list" + ], + "default": "all" + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/faq/edit.js b/wp-content/plugins/smilia-core/src/blocks/faq/edit.js new file mode 100644 index 0000000..98c78fa --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/faq/edit.js @@ -0,0 +1,79 @@ +import { __ } from '@wordpress/i18n'; +import { InspectorControls, useBlockProps } from '@wordpress/block-editor'; +import { PanelBody, TextControl } from '@wordpress/components'; +import PlainText from '../../shared/plain-text'; +import ServerPreview from '../../shared/server-preview'; +import ManageButton from '../../shared/manage-button'; +import { assetUrl } from '../../shared/images'; + +const CLOUDS = [ 1, 2, 3, 4, 5, 6 ]; + +export default function Edit( { attributes, setAttributes } ) { + const fields = { attributes, setAttributes }; + + return ( + <> + <ManageButton + postType="smilia_faq" + label={ __( 'Изменить вопросы', 'smilia-core' ) } + /> + <InspectorControls> + <PanelBody title={ __( 'Вопросы', 'smilia-core' ) }> + <TextControl + __next40pxDefaultSize + __nextHasNoMarginBottom + label={ __( 'Группа вопросов', 'smilia-core' ) } + help={ __( + 'Ярлык группы из раздела «Вопросы», например home.', + 'smilia-core' + ) } + value={ attributes.group } + onChange={ ( value ) => + setAttributes( { group: value } ) + } + /> + </PanelBody> + </InspectorControls> + <section + { ...useBlockProps( { + className: 'section faq', + style: { + '--faq-paper': `url(${ assetUrl( + 'faq/paper-tile.webp' + ) })`, + }, + } ) } + > + <div className="faq__clouds" aria-hidden="true"> + { CLOUDS.map( ( number ) => ( + <img + key={ number } + className={ `faq__cloud faq__cloud--${ number }` } + src={ assetUrl( `faq/cloud-${ number }.svg` ) } + alt="" + /> + ) ) } + </div> + <div className="container faq__inner"> + <div className="section__head faq__head"> + <PlainText + { ...fields } + attribute="title" + tagName="h2" + className="section__title" + placeholder={ __( 'Заголовок раздела', 'smilia-core' ) } + /> + <PlainText + { ...fields } + attribute="lead" + tagName="p" + className="section__lead" + placeholder={ __( 'Подзаголовок', 'smilia-core' ) } + /> + </div> + <ServerPreview block="smilia/faq" part="list" editable /> + </div> + </section> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/faq/index.js b/wp-content/plugins/smilia-core/src/blocks/faq/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/faq/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/faq/list.php b/wp-content/plugins/smilia-core/src/blocks/faq/list.php new file mode 100644 index 0000000..037aa8f --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/faq/list.php @@ -0,0 +1,15 @@ +<?php + +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +?> +<div class="faq__list"> + <?php foreach ( $smilia_items as $smilia_index => $smilia_item ) : ?> + <details class="faq-item"<?php echo 0 === $smilia_index ? ' open' : ''; ?><?php echo Markup::edit_link( (int) $smilia_item['id'], $attributes ); ?>> + <summary class="faq-item__question"><?php echo esc_html( $smilia_item['question'] ); ?><?php Markup::edit_button( (int) $smilia_item['id'], $attributes ); ?></summary> + <div class="faq-item__answer"><?php echo wp_kses_post( $smilia_item['answer'] ); ?></div> + </details> + <?php endforeach; ?> +</div> diff --git a/wp-content/plugins/smilia-core/src/blocks/faq/render.php b/wp-content/plugins/smilia-core/src/blocks/faq/render.php new file mode 100644 index 0000000..e452ef7 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/faq/render.php @@ -0,0 +1,34 @@ +<?php + +use Smilia\Core\Content; +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +$smilia_group = sanitize_key( $attributes['group'] ); +$smilia_items = Content::faq( $smilia_group ); +if ( ! $smilia_items ) { + return; +} +if ( 'list' === $attributes['part'] ) { + require __DIR__ . '/list.php'; + return; +} +?> +<section class="section faq" id="faq" style="<?php echo esc_attr( '--faq-paper: url(' . Markup::asset( 'faq/paper-tile.webp' ) . ')' ); ?>"> + <div class="faq__clouds" aria-hidden="true"> + <?php for ( $smilia_i = 1; $smilia_i <= 6; $smilia_i++ ) : ?> + <?php Markup::asset_svg( 'faq/cloud-' . $smilia_i . '.svg', 'faq__cloud faq__cloud--' . $smilia_i ); ?> + <?php endfor; ?> + <?php foreach ( array_slice( array( 4, 2, 6, 1 ), 0, min( 4, max( 0, count( $smilia_items ) - 5 ) ) ) as $smilia_i => $smilia_cloud ) : ?> + <?php Markup::asset_svg( 'faq/cloud-' . $smilia_cloud . '.svg', 'faq__cloud faq__cloud--' . ( 7 + $smilia_i ) ); ?> + <?php endforeach; ?> + </div> + <div class="container faq__inner"> + <div class="section__head faq__head"> + <h2 class="section__title"><?php echo Markup::text( $attributes['title'] ); ?></h2> + <p class="section__lead"><?php echo Markup::text( $attributes['lead'] ); ?></p> + </div> + <?php require __DIR__ . '/list.php'; ?> + </div> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/faq/style.css b/wp-content/plugins/smilia-core/src/blocks/faq/style.css new file mode 100644 index 0000000..9707f3e --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/faq/style.css @@ -0,0 +1,207 @@ +.faq { + --faq-item-shadow: 0 0.125rem 0.625rem color-mix(in srgb, var(--color-shadow) 4%, transparent); + --faq-item-open-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 14%, transparent), 0 0.375rem 1.375rem color-mix(in srgb, var(--color-accent) 18%, transparent); + position: relative; + overflow: hidden; + background: var(--color-bg-paper) var(--faq-paper) left top / 32rem 32rem repeat; +} + +.faq__inner { + position: relative; + z-index: 2; +} + +.faq__head { + margin-bottom: var(--space-head); +} + +.faq__list { + display: flex; + flex-direction: column; + gap: var(--space-4); + max-width: 56rem; + margin-inline: auto; +} + +.faq-item { + background: var(--color-surface); + border: 1px solid var(--color-line); + border-radius: var(--radius-lg); + box-shadow: var(--faq-item-shadow); + transition: border-color var(--duration-base) ease, box-shadow var(--duration-base) ease; +} + +.faq-item[open] { + border-color: var(--color-accent); + box-shadow: var(--faq-item-open-shadow); +} + +@supports (selector(::details-content)) { + .faq-item { + interpolate-size: allow-keywords; + } + + .faq-item::details-content { + block-size: 0; + overflow: clip; + transition: block-size var(--duration-base) var(--ease-out), content-visibility var(--duration-base) allow-discrete; + } + + .faq-item[open]::details-content { + block-size: auto; + } +} + +@media (prefers-reduced-motion: reduce) { + .faq-item::details-content { + transition: none; + } +} + +.faq-item__question { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--space-5); + padding: var(--space-6) var(--space-8); + color: var(--color-text-strong); + font-size: var(--text-lg); + font-weight: var(--font-weight-extrabold); + line-height: 1.4; + list-style: none; + cursor: pointer; + user-select: none; + transition: color var(--duration-fast) ease; +} + +.faq-item__question::-webkit-details-marker { + display: none; +} + +.faq-item__question::after { + content: "+"; + flex: none; + width: 1.5rem; + color: var(--color-accent-hover); + font-size: var(--text-2xl); + font-weight: var(--font-weight-bold); + line-height: 1; + text-align: center; +} + +.faq-item[open] .faq-item__question { + color: var(--color-accent-hover); +} + +.faq-item[open] .faq-item__question::after { + content: "\2212"; +} + +.faq-item__answer { + padding: var(--space-4) var(--space-8) var(--space-6); + border-top: 1px solid var(--color-line-soft); + color: var(--color-text-muted); + line-height: var(--leading-loose); + text-wrap: pretty; +} + +.faq-item__answer a { + color: var(--color-accent-strong); + font-weight: var(--font-weight-bold); +} + +.faq__cloud { + position: absolute; + z-index: 1; + width: clamp(5rem, 8vw, 8rem); + height: auto; + pointer-events: none; +} + +.faq__cloud--1 { + top: 8.25rem; + right: 3.8%; + transform: rotate(5deg); +} + +.faq__cloud--2 { + top: 29.5rem; + right: 3.4%; + transform: rotate(3deg); +} + +.faq__cloud--3 { + top: 2.75rem; + left: 4.2%; + transform: rotate(-5deg); +} + +.faq__cloud--4 { + top: 28.5rem; + left: 4.6%; + transform: rotate(-3deg); +} + +.faq__cloud--5 { + top: 17.5rem; + left: 3.2%; + transform: rotate(4deg); +} + +.faq__cloud--6 { + top: 21rem; + right: 5.2%; + transform: rotate(-5deg); +} + +.faq__cloud--7 { + top: 46rem; + right: 3.8%; + transform: rotate(4deg); +} + +.faq__cloud--8 { + top: 45rem; + left: 3.4%; + transform: rotate(-4deg); +} + +.faq__cloud--9 { + top: 60rem; + right: 4.6%; + transform: rotate(-3deg); +} + +.faq__cloud--10 { + top: 62rem; + left: 4.2%; + transform: rotate(5deg); +} + +.faq-item__question:active { + color: var(--color-accent-hover); +} + +@media (max-width: 1200px) { + .faq__cloud { + display: none; + } +} + +@media (max-width: 560px) { + .faq-item__question { + gap: var(--space-3); + padding: var(--space-4) var(--space-5); + font-size: var(--text-base); + } + + .faq-item__answer { + padding: var(--space-3) var(--space-5) var(--space-5); + } +} + +@media (hover: hover) { + .faq-item__question:hover { + color: var(--color-accent-hover); + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/hero/block.json b/wp-content/plugins/smilia-core/src/blocks/hero/block.json new file mode 100644 index 0000000..8c0b08e --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/hero/block.json @@ -0,0 +1,59 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/hero", + "title": "Баннер", + "category": "smilia", + "icon": "format-image", + "description": "Первый экран: фото, заголовок и две кнопки.", + "textdomain": "smilia-core", + "attributes": { + "title": { + "type": "string", + "role": "content", + "default": "Детская стоматология в Лодзи" + }, + "subtitle": { + "type": "string", + "role": "content", + "default": "с заботой о маленьких пациентах" + }, + "imageId": { + "type": "number", + "role": "content", + "default": 0 + }, + "focalPoint": { + "type": "object", + "default": { + "x": 0.5, + "y": 0.5 + } + }, + "buttonPrimary": { + "type": "string", + "role": "content", + "default": "Записаться на прием" + }, + "buttonSecond": { + "type": "string", + "role": "content", + "default": "Контакты" + }, + "buttonLink": { + "type": "string", + "default": "#contacts" + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "editorStyle": "file:./index.css", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/hero/edit.js b/wp-content/plugins/smilia-core/src/blocks/hero/edit.js new file mode 100644 index 0000000..5eb3ec9 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/hero/edit.js @@ -0,0 +1,160 @@ +import { __ } from '@wordpress/i18n'; +import { + BlockControls, + InspectorControls, + MediaReplaceFlow, + RichText, + useBlockProps, +} from '@wordpress/block-editor'; +import { + FocalPointPicker, + PanelBody, + TextControl, +} from '@wordpress/components'; +import { useSelect } from '@wordpress/data'; +import { store as coreStore } from '@wordpress/core-data'; +import Wave from '../../shared/wave'; + +function PlainText( props ) { + return ( + <RichText + { ...props } + allowedFormats={ [] } + disableLineBreaks + withoutInteractiveFormatting + /> + ); +} + +export default function Edit( { attributes, setAttributes } ) { + const { imageId, focalPoint, buttonLink } = attributes; + + const image = useSelect( + ( select ) => + imageId + ? select( coreStore ).getEntityRecord( + 'postType', + 'attachment', + imageId + ) + : null, + [ imageId ] + ); + const imageUrl = + image?.media_details?.sizes?.[ 'smilia-1920' ]?.source_url ?? + image?.source_url; + + const blockProps = useBlockProps( { + className: 'hero', + style: { + '--hero-focus': `${ focalPoint.x * 100 }% ${ focalPoint.y * 100 }%`, + }, + } ); + + const bind = ( key ) => ( { + value: attributes[ key ], + onChange: ( value ) => setAttributes( { [ key ]: value } ), + } ); + + return ( + <> + <BlockControls group="other"> + <MediaReplaceFlow + mediaId={ imageId } + mediaURL={ imageUrl } + allowedTypes={ [ 'image' ] } + accept="image/*" + name={ + imageId + ? __( 'Заменить фото', 'smilia-core' ) + : __( 'Добавить фото', 'smilia-core' ) + } + onSelect={ ( media ) => + setAttributes( { imageId: media.id } ) + } + /> + </BlockControls> + <InspectorControls> + <PanelBody title={ __( 'Фото', 'smilia-core' ) }> + { imageUrl ? ( + <FocalPointPicker + __nextHasNoMarginBottom + label={ __( 'Положение фото', 'smilia-core' ) } + help={ __( + 'Перетащите точку на лицо: эта часть фото всегда останется в кадре. Лучше горизонтальное фото от 2000 px по ширине.', + 'smilia-core' + ) } + url={ imageUrl } + value={ focalPoint } + onChange={ ( value ) => + setAttributes( { focalPoint: value } ) + } + /> + ) : ( + <p> + { __( + 'Сначала добавьте фото кнопкой «Добавить фото» над блоком.', + 'smilia-core' + ) } + </p> + ) } + </PanelBody> + <PanelBody title={ __( 'Вторая кнопка', 'smilia-core' ) }> + <TextControl + __next40pxDefaultSize + __nextHasNoMarginBottom + label={ __( 'Ссылка', 'smilia-core' ) } + help={ __( + 'Адрес страницы или якорь вида #contacts.', + 'smilia-core' + ) } + value={ buttonLink } + onChange={ ( value ) => + setAttributes( { buttonLink: value } ) + } + /> + </PanelBody> + </InspectorControls> + <section { ...blockProps }> + { imageUrl && ( + <img + className="hero__image" + src={ imageUrl } + alt="" + /> + ) } + <div className="hero__content"> + <h1 className="hero__title"> + <PlainText + tagName="span" + className="hero__title-main" + placeholder={ __( 'Заголовок', 'smilia-core' ) } + { ...bind( 'title' ) } + /> + <PlainText + tagName="span" + className="hero__title-sub" + placeholder={ __( 'Подзаголовок', 'smilia-core' ) } + { ...bind( 'subtitle' ) } + /> + </h1> + <div className="hero__actions"> + <PlainText + tagName="span" + className="hero__button hero__button--pulse" + placeholder={ __( 'Кнопка записи', 'smilia-core' ) } + { ...bind( 'buttonPrimary' ) } + /> + <PlainText + tagName="span" + className="hero__button" + placeholder={ __( 'Вторая кнопка', 'smilia-core' ) } + { ...bind( 'buttonSecond' ) } + /> + </div> + </div> + <Wave /> + </section> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/hero/editor.css b/wp-content/plugins/smilia-core/src/blocks/hero/editor.css new file mode 100644 index 0000000..5d05f02 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/hero/editor.css @@ -0,0 +1,4 @@ +.editor-styles-wrapper .hero { + height: auto; + min-height: min(calc(100vh - 100px), 46.5vw); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/hero/index.js b/wp-content/plugins/smilia-core/src/blocks/hero/index.js new file mode 100644 index 0000000..db656b7 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/hero/index.js @@ -0,0 +1,9 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; +import './editor.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/hero/render.php b/wp-content/plugins/smilia-core/src/blocks/hero/render.php new file mode 100644 index 0000000..d32b5a6 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/hero/render.php @@ -0,0 +1,40 @@ +<?php + +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +$smilia_point = array_map( + static fn( $value ): float => round( min( 1, max( 0, (float) $value ) ) * 100, 2 ), + array( + $attributes['focalPoint']['x'] ?? 0.5, + $attributes['focalPoint']['y'] ?? 0.5, + ) +); +?> +<section class="hero" style="<?php echo esc_attr( sprintf( '--hero-focus: %s%% %s%%', $smilia_point[0], $smilia_point[1] ) ); ?>"> + <?php + Markup::image( + (int) $attributes['imageId'], + 'smilia-1920', + '100vw', + array( + 'class' => 'hero__image', + 'alt' => '', + 'loading' => 'eager', + 'fetchpriority' => 'high', + ) + ); + ?> + <div class="hero__content"> + <h1 class="hero__title"> + <span class="hero__title-main"><?php echo esc_html( wp_strip_all_tags( $attributes['title'] ) ); ?></span> + <span class="hero__title-sub"><?php echo esc_html( wp_strip_all_tags( $attributes['subtitle'] ) ); ?></span> + </h1> + <div class="hero__actions"> + <button type="button" class="hero__button hero__button--pulse" data-booking-open><?php echo esc_html( wp_strip_all_tags( $attributes['buttonPrimary'] ) ); ?></button> + <a class="hero__button" href="<?php echo Markup::link( $attributes['buttonLink'] ); ?>"><?php echo esc_html( wp_strip_all_tags( $attributes['buttonSecond'] ) ); ?></a> + </div> + </div> + <?php Markup::wave(); ?> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/hero/style.css b/wp-content/plugins/smilia-core/src/blocks/hero/style.css new file mode 100644 index 0000000..6f8e1e1 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/hero/style.css @@ -0,0 +1,210 @@ +.hero { + --hero-height: min(calc(100vh - 100px), 46.5vw); + --hero-overlay: color-mix(in srgb, var(--color-night-deep) 62%, transparent); + --hero-content-padding: var(--space-40) var(--space-6); + --hero-title-leading: 1.18; + --hero-title-color: var(--color-highlight); + --hero-title-size: clamp(2.5rem, 5vw, 4.25rem); + --hero-subtitle-color: var(--color-highlight-cool); + --hero-subtitle-size: clamp(2rem, 4.2vw, 3.5rem); + --hero-actions-gap: var(--space-6); + --hero-actions-offset: 6.875rem; + --hero-button-padding: 0.9375rem 2.375rem; + --hero-button-tracking: 2px; + --hero-button-shadow: 0 0.625rem 1.625rem color-mix(in srgb, var(--color-accent) 28%, transparent); + --hero-button-transition: 0.25s; + --hero-pulse-duration: 1.8s; + --hero-ring-width: 4px; + --hero-ring-delay: 0.5s; + --wave-height: 8.125rem; + --wave-back: var(--color-pink-200); + --wave-middle: var(--color-accent-light); + --wave-front: var(--color-bg); + position: relative; + display: flex; + align-items: center; + justify-content: center; + height: var(--hero-height); + overflow: hidden; +} + +.hero::before { + content: ""; + position: absolute; + inset: 0; + z-index: 1; + background: var(--hero-overlay); +} + +.hero__image { + position: absolute; + inset: 0; + width: 100%; + height: 100%; + object-fit: cover; + object-position: var(--hero-focus, 50% 50%); +} + +.hero__content { + position: relative; + z-index: 2; + padding: var(--hero-content-padding); + text-align: center; +} + +.hero__title { + font-family: var(--font-sans); + font-weight: var(--font-weight-extrabold); + line-height: var(--hero-title-leading); +} + +.hero__title-main { + display: block; + color: var(--hero-title-color); + font-size: var(--hero-title-size); +} + +.hero__title-sub { + display: block; + color: var(--hero-subtitle-color); + font-size: var(--hero-subtitle-size); +} + +.hero__actions { + display: flex; + flex-direction: column; + align-items: center; + gap: var(--hero-actions-gap); + margin-top: var(--hero-actions-offset); +} + +.hero__button { + position: relative; + padding: var(--hero-button-padding); + background: var(--color-accent); + border: 0; + border-radius: var(--radius-full); + color: var(--color-white); + font-family: var(--font-sans); + font-size: var(--text-sm); + font-weight: var(--font-weight-bold); + letter-spacing: var(--hero-button-tracking); + line-height: normal; + text-transform: uppercase; + transition: background-color var(--hero-button-transition) ease; +} + +.hero__button--pulse { + display: inline-block; + isolation: isolate; + overflow: visible; + box-shadow: var(--hero-button-shadow); + animation: hero-pulse var(--hero-pulse-duration) linear infinite; +} + +.hero__button--pulse::before, +.hero__button--pulse::after { + content: ""; + position: absolute; + inset: 0; + z-index: -1; + border: var(--hero-ring-width) solid var(--color-accent); + border-radius: var(--radius-full); + opacity: 0; + pointer-events: none; + animation: hero-ring var(--hero-pulse-duration) linear infinite; +} + +.hero__button--pulse::after { + animation-delay: var(--hero-ring-delay); +} + +@keyframes hero-pulse { + 0% { + transform: scale(1); + } + + 50% { + transform: scale(1.05, 1.015); + } + + 100% { + transform: scale(1); + } +} + +@keyframes hero-ring { + 0% { + opacity: 1; + transform: scale(1); + } + + 100% { + opacity: 0; + transform: scale(1.16, 1); + } +} + +.hero__button:active { + background: var(--color-accent-hover); +} + +@media (hover: hover) { + .hero__button:hover { + background: var(--color-accent-hover); + color: var(--color-white); + } + + .hero__button--pulse:hover::before, + .hero__button--pulse:hover::after { + border-color: var(--color-accent-hover); + } +} + +@media (max-width: 1200px) { + .hero { + --hero-height: auto; + --hero-content-padding: var(--space-24) var(--gutter) var(--space-32); + --hero-actions-offset: var(--space-12); + --wave-height: var(--space-16); + min-height: 32rem; + } +} + +@media (max-width: 560px) { + .hero { + --hero-title-size: clamp(var(--text-2xl), calc((100vw - 2 * var(--gutter)) / 11.4), var(--text-4xl)); + --hero-overlay: linear-gradient( + to top, + color-mix(in srgb, var(--color-night-deep) 92%, transparent) 0%, + color-mix(in srgb, var(--color-night-deep) 72%, transparent) 38%, + transparent 70% + ); + --hero-content-padding: var(--space-8) var(--gutter) var(--space-16); + --hero-actions-offset: var(--space-8); + --wave-height: var(--space-12); + align-items: flex-end; + min-height: 35rem; + } + + .hero__image { + inset: auto 0 0; + height: 44rem; + object-position: 100% 50%; + } + + .hero__title-sub { + position: absolute; + width: 1px; + height: 1px; + overflow: hidden; + clip-path: inset(50%); + white-space: nowrap; + } +} + +@media (max-width: 400px) { + .hero { + --hero-button-padding: var(--space-4) var(--space-6); + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/installment/block.json b/wp-content/plugins/smilia-core/src/blocks/installment/block.json new file mode 100644 index 0000000..1304c86 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/installment/block.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/installment", + "title": "Рассрочка", + "category": "smilia", + "icon": "calendar-alt", + "description": "Условия рассрочки и кнопка записи.", + "textdomain": "smilia-core", + "attributes": { + "title": { + "type": "string", + "role": "content", + "default": "Лечение с оплатой частями" + }, + "text": { + "type": "string", + "role": "content", + "default": "Текст" + }, + "button": { + "type": "string", + "role": "content", + "default": "Узнать условия" + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/installment/edit.js b/wp-content/plugins/smilia-core/src/blocks/installment/edit.js new file mode 100644 index 0000000..8eccb53 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/installment/edit.js @@ -0,0 +1,46 @@ +import { __ } from '@wordpress/i18n'; +import { useBlockProps } from '@wordpress/block-editor'; +import PlainText from '../../shared/plain-text'; +import { assetUrl } from '../../shared/images'; + +export default function Edit( { attributes, setAttributes } ) { + const fields = { attributes, setAttributes }; + + return ( + <section { ...useBlockProps( { className: 'installment' } ) }> + <img + className="installment__decor installment__decor--calendar" + src={ assetUrl( 'prices/calendar.svg' ) } + alt="" + /> + <img + className="installment__decor installment__decor--card" + src={ assetUrl( 'prices/tooth-card.svg' ) } + alt="" + /> + <div className="installment__content"> + <PlainText + { ...fields } + attribute="title" + tagName="h2" + className="installment__title" + placeholder={ __( 'Заголовок', 'smilia-core' ) } + /> + <PlainText + { ...fields } + attribute="text" + tagName="p" + className="installment__text" + placeholder={ __( 'Текст', 'smilia-core' ) } + /> + <PlainText + { ...fields } + attribute="button" + tagName="span" + className="button button--primary installment__button" + placeholder={ __( 'Кнопка', 'smilia-core' ) } + /> + </div> + </section> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/installment/index.js b/wp-content/plugins/smilia-core/src/blocks/installment/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/installment/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/installment/render.php b/wp-content/plugins/smilia-core/src/blocks/installment/render.php new file mode 100644 index 0000000..82be33e --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/installment/render.php @@ -0,0 +1,16 @@ +<?php + +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +?> +<section class="installment"> + <?php Markup::asset_svg( 'prices/calendar.svg', 'installment__decor installment__decor--calendar' ); ?> + <?php Markup::asset_svg( 'prices/tooth-card.svg', 'installment__decor installment__decor--card' ); ?> + <div class="installment__content" data-reveal> + <h2 class="installment__title"><?php echo esc_html( wp_strip_all_tags( $attributes['title'] ) ); ?></h2> + <p class="installment__text"><?php echo esc_html( wp_strip_all_tags( $attributes['text'] ) ); ?></p> + <button type="button" class="button button--primary installment__button" data-booking-open><?php echo esc_html( wp_strip_all_tags( $attributes['button'] ) ); ?></button> + </div> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/installment/style.css b/wp-content/plugins/smilia-core/src/blocks/installment/style.css new file mode 100644 index 0000000..07e44dc --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/installment/style.css @@ -0,0 +1,76 @@ +.installment { + --installment-content-width: 48rem; + --installment-calendar-width: clamp(6rem, 9vw, 9rem); + --installment-card-width: clamp(7rem, 10.5vw, 10rem); + position: relative; + overflow: hidden; + padding: var(--space-section) clamp(7rem, 14vw, 14rem); + background: var(--color-bg-paper); + text-align: center; +} + +.installment__decor { + position: absolute; + height: auto; + pointer-events: none; +} + +.installment__decor--calendar { + top: var(--space-10); + left: 5%; + width: var(--installment-calendar-width); + rotate: -6deg; +} + +.installment__decor--card { + right: 4%; + bottom: var(--space-8); + width: var(--installment-card-width); + rotate: 4deg; +} + +.installment__content { + position: relative; + display: flex; + flex-direction: column; + align-items: center; + gap: var(--space-5); + max-width: var(--installment-content-width); + margin-inline: auto; +} + +.installment__title { + color: var(--color-accent-strong); + font-size: var(--fs-h2); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-tight); +} + +.installment__text { + color: var(--color-text-body); + font-size: var(--fs-lead); + line-height: var(--leading-relaxed); + text-wrap: pretty; +} + +.installment__button { + margin-top: var(--space-2); +} + +@media (max-width: 760px) { + .installment { + --installment-calendar-width: 4.5rem; + --installment-card-width: 5.5rem; + padding: var(--space-24) var(--gutter); + } + + .installment__decor--calendar { + top: var(--space-4); + left: var(--space-4); + } + + .installment__decor--card { + right: var(--space-4); + bottom: var(--space-4); + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/office-photo/block.json b/wp-content/plugins/smilia-core/src/blocks/office-photo/block.json new file mode 100644 index 0000000..424487a --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/office-photo/block.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/office-photo", + "title": "Фото клиники", + "category": "smilia", + "parent": [ + "smilia/office" + ], + "icon": "format-image", + "description": "Одно фото раздела «Внутри клиники».", + "textdomain": "smilia-core", + "attributes": { + "imageId": { + "type": "number", + "role": "content", + "default": 0 + }, + "alt": { + "type": "string", + "role": "content", + "default": "" + } + }, + "supports": { + "html": false, + "reusable": false, + "inserter": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/office-photo/edit.js b/wp-content/plugins/smilia-core/src/blocks/office-photo/edit.js new file mode 100644 index 0000000..f7c4d84 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/office-photo/edit.js @@ -0,0 +1,55 @@ +import { __ } from '@wordpress/i18n'; +import { + BlockControls, + InspectorControls, + MediaReplaceFlow, + useBlockProps, +} from '@wordpress/block-editor'; +import { PanelBody, TextControl } from '@wordpress/components'; +import { useImageUrl } from '../../shared/images'; + +export default function Edit( { attributes, setAttributes } ) { + const { imageId, alt } = attributes; + const imageUrl = useImageUrl( imageId, 'smilia-800' ); + + return ( + <> + <BlockControls group="other"> + <MediaReplaceFlow + mediaId={ imageId } + mediaURL={ imageUrl } + allowedTypes={ [ 'image' ] } + accept="image/*" + name={ + imageId + ? __( 'Заменить фото', 'smilia-core' ) + : __( 'Добавить фото', 'smilia-core' ) + } + onSelect={ ( media ) => + setAttributes( { imageId: media.id } ) + } + /> + </BlockControls> + <InspectorControls> + <PanelBody title={ __( 'Фото', 'smilia-core' ) }> + <TextControl + label={ __( 'Описание фото', 'smilia-core' ) } + help={ __( + 'Для незрячих и поисковиков. Пусто: описание из медиатеки.', + 'smilia-core' + ) } + value={ alt } + onChange={ ( value ) => setAttributes( { alt: value } ) } + __next40pxDefaultSize + __nextHasNoMarginBottom + /> + </PanelBody> + </InspectorControls> + <li { ...useBlockProps( { className: 'office__item' } ) }> + { imageUrl && ( + <img className="office__photo" src={ imageUrl } alt={ alt } /> + ) } + </li> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/office-photo/index.js b/wp-content/plugins/smilia-core/src/blocks/office-photo/index.js new file mode 100644 index 0000000..0df75c1 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/office-photo/index.js @@ -0,0 +1,7 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/office-photo/render.php b/wp-content/plugins/smilia-core/src/blocks/office-photo/render.php new file mode 100644 index 0000000..a9fa92a --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/office-photo/render.php @@ -0,0 +1,25 @@ +<?php + +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +if ( $attributes['imageId'] <= 0 ) { + return; +} +?> +<li class="office__item" data-reveal> + <?php + Markup::image( + (int) $attributes['imageId'], + 'smilia-800', + '(min-width: 1200px) 360px, 30vw', + array_filter( + array( + 'class' => 'office__photo', + 'alt' => trim( (string) $attributes['alt'] ), + ) + ) + ); + ?> +</li> diff --git a/wp-content/plugins/smilia-core/src/blocks/office/block.json b/wp-content/plugins/smilia-core/src/blocks/office/block.json new file mode 100644 index 0000000..6b634d7 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/office/block.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/office", + "title": "Внутри клиники", + "category": "smilia", + "icon": "format-gallery", + "description": "Заголовок и три фото клиники.", + "textdomain": "smilia-core", + "attributes": { + "title": { + "type": "string", + "role": "content", + "default": "Внутри клиники" + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/office/edit.js b/wp-content/plugins/smilia-core/src/blocks/office/edit.js new file mode 100644 index 0000000..aca6186 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/office/edit.js @@ -0,0 +1,38 @@ +import { __ } from '@wordpress/i18n'; +import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor'; +import PlainText from '../../shared/plain-text'; + +const PHOTO = 'smilia/office-photo'; +const TEMPLATE = [ [ PHOTO ], [ PHOTO ], [ PHOTO ] ]; + +export default function Edit( { attributes, setAttributes } ) { + const photosProps = useInnerBlocksProps( + { className: 'office__grid' }, + { + allowedBlocks: [ PHOTO ], + template: TEMPLATE, + templateLock: 'all', + renderAppender: false, + } + ); + + return ( + <section + { ...useBlockProps( { + className: 'section section--soft office', + } ) } + > + <div className="container"> + <PlainText + attributes={ attributes } + setAttributes={ setAttributes } + attribute="title" + tagName="h2" + className="section__title office__title" + placeholder={ __( 'Заголовок раздела', 'smilia-core' ) } + /> + <ul { ...photosProps } /> + </div> + </section> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/office/index.js b/wp-content/plugins/smilia-core/src/blocks/office/index.js new file mode 100644 index 0000000..694e3fa --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/office/index.js @@ -0,0 +1,10 @@ +import { registerBlockType } from '@wordpress/blocks'; +import { InnerBlocks } from '@wordpress/block-editor'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, + save: () => <InnerBlocks.Content />, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/office/render.php b/wp-content/plugins/smilia-core/src/blocks/office/render.php new file mode 100644 index 0000000..d4ada21 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/office/render.php @@ -0,0 +1,18 @@ +<?php + +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +if ( '' === trim( $content ) ) { + return; +} +?> +<section class="section section--soft office" id="office"> + <div class="container"> + <h2 class="section__title office__title"><?php echo Markup::text( $attributes['title'] ); ?></h2> + <ul class="office__grid"> + <?php echo $content; ?> + </ul> + </div> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/office/style.css b/wp-content/plugins/smilia-core/src/blocks/office/style.css new file mode 100644 index 0000000..7a17b75 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/office/style.css @@ -0,0 +1,56 @@ +.office { + --office-photo-shadow: 0 0.75rem 1.75rem color-mix(in srgb, var(--color-shadow) 12%, transparent); + padding-block: var(--space-16); +} + +.office__title { + margin-bottom: var(--space-head); +} + +.office__grid { + --office-columns: 3; + display: grid; + grid-template-columns: repeat(var(--office-columns), 1fr); + gap: var(--space-6); + align-items: start; +} + +.office__item:nth-child(odd) { + margin-top: var(--space-6); +} + +.office__photo { + width: 100%; + aspect-ratio: 3 / 4; + object-fit: cover; + border-radius: var(--radius-2xl); + box-shadow: var(--office-photo-shadow); +} + +@media (max-width: 760px) { + .office { + padding-block: var(--space-12); + } + + .office__grid { + gap: var(--space-4); + } + + .office__item:nth-child(odd) { + margin-top: var(--space-4); + } +} + +@media (max-width: 560px) { + .office__grid { + --office-columns: 1; + } + + .office__item:nth-child(odd) { + margin-top: 0; + } + + .office__photo { + aspect-ratio: 4 / 3; + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/page-hero/block.json b/wp-content/plugins/smilia-core/src/blocks/page-hero/block.json new file mode 100644 index 0000000..aa5cf09 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/page-hero/block.json @@ -0,0 +1,32 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/page-hero", + "title": "Баннер страницы", + "category": "smilia", + "icon": "format-image", + "description": "Фото и заголовок первой страницы внутренних разделов.", + "textdomain": "smilia-core", + "attributes": { + "title": { + "type": "string", + "role": "content", + "default": "Заголовок страницы" + }, + "imageId": { + "type": "number", + "role": "content", + "default": 0 + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/page-hero/edit.js b/wp-content/plugins/smilia-core/src/blocks/page-hero/edit.js new file mode 100644 index 0000000..0036130 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/page-hero/edit.js @@ -0,0 +1,45 @@ +import { __ } from '@wordpress/i18n'; +import { + BlockControls, + MediaReplaceFlow, + useBlockProps, +} from '@wordpress/block-editor'; +import PlainText from '../../shared/plain-text'; +import Wave from '../../shared/wave'; +import { useImageUrl } from '../../shared/images'; + +export default function Edit( { attributes, setAttributes } ) { + const { imageId } = attributes; + const imageUrl = useImageUrl( imageId, 'smilia-1920' ); + + return ( + <> + <BlockControls group="other"> + <MediaReplaceFlow + mediaId={ imageId } + mediaURL={ imageUrl } + allowedTypes={ [ 'image' ] } + accept="image/*" + name={ __( 'Заменить фото', 'smilia-core' ) } + onSelect={ ( media ) => + setAttributes( { imageId: media.id } ) + } + /> + </BlockControls> + <section { ...useBlockProps( { className: 'page-hero' } ) }> + { imageUrl && ( + <img className="page-hero__image" src={ imageUrl } alt="" /> + ) } + <PlainText + attributes={ attributes } + setAttributes={ setAttributes } + attribute="title" + tagName="h1" + className="page-hero__title" + placeholder={ __( 'Заголовок страницы', 'smilia-core' ) } + /> + <Wave /> + </section> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/page-hero/index.js b/wp-content/plugins/smilia-core/src/blocks/page-hero/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/page-hero/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/page-hero/render.php b/wp-content/plugins/smilia-core/src/blocks/page-hero/render.php new file mode 100644 index 0000000..f382774 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/page-hero/render.php @@ -0,0 +1,24 @@ +<?php + +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +?> +<section class="page-hero"> + <?php + Markup::image( + (int) $attributes['imageId'], + 'smilia-1920', + '100vw', + array( + 'class' => 'page-hero__image', + 'alt' => '', + 'loading' => 'eager', + 'fetchpriority' => 'high', + ) + ); + ?> + <h1 class="page-hero__title"><?php echo esc_html( wp_strip_all_tags( $attributes['title'] ) ); ?></h1> + <?php Markup::wave(); ?> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/page-hero/style.css b/wp-content/plugins/smilia-core/src/blocks/page-hero/style.css new file mode 100644 index 0000000..5502080 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/page-hero/style.css @@ -0,0 +1,63 @@ +.page-hero { + --page-hero-height: clamp(23.75rem, 42vw, 35rem); + --page-hero-overlay: color-mix(in srgb, var(--color-night-deep) 55%, transparent); + --page-hero-focus: 50% 55%; + --page-hero-title-size: clamp(2.75rem, 6vw, 5rem); + --wave-height: 8.25rem; + --wave-back: var(--color-pink-200); + --wave-middle: var(--color-accent-light); + --wave-front: var(--color-bg); + position: relative; + display: flex; + align-items: center; + justify-content: center; + height: var(--page-hero-height); + overflow: hidden; +} + +.page-hero::before { + content: ""; + position: absolute; + inset: 0; + z-index: 1; + background: var(--page-hero-overlay); +} + +.page-hero__image { + position: absolute; + inset: 0; + width: 100%; + height: 100%; + object-fit: cover; + object-position: var(--page-hero-focus); +} + +.page-hero__title { + position: relative; + z-index: 2; + margin-bottom: var(--space-10); + padding-inline: var(--gutter); + color: var(--color-highlight); + font-size: var(--page-hero-title-size); + font-weight: var(--font-weight-extrabold); + line-height: 1.1; + text-align: center; + text-wrap: balance; +} + +@media (max-width: 980px) { + .page-hero { + --wave-height: var(--space-16); + } +} + +@media (max-width: 560px) { + .page-hero { + --page-hero-height: 22.5rem; + --wave-height: var(--space-12); + } + + .page-hero__title { + margin-bottom: var(--space-6); + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/paper-note/block.json b/wp-content/plugins/smilia-core/src/blocks/paper-note/block.json new file mode 100644 index 0000000..fc61b53 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/paper-note/block.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/paper-note", + "title": "Бумажная плашка", + "category": "smilia", + "icon": "media-text", + "description": "Заголовок и абзацы на листе жёлтой бумаги.", + "textdomain": "smilia-core", + "attributes": { + "title": { + "type": "string", + "role": "content", + "default": "Первый визит в Smilia" + }, + "paragraphs": { + "type": "array", + "role": "content", + "items": { + "type": "string" + }, + "default": [ + "Текст плашки" + ] + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/paper-note/edit.js b/wp-content/plugins/smilia-core/src/blocks/paper-note/edit.js new file mode 100644 index 0000000..025ae5e --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/paper-note/edit.js @@ -0,0 +1,81 @@ +import { __ } from '@wordpress/i18n'; +import { useBlockProps } from '@wordpress/block-editor'; +import { Button } from '@wordpress/components'; +import PlainText from '../../shared/plain-text'; +import { assetUrl } from '../../shared/images'; +import { removeIcon } from '../../shared/icons'; + +function Paragraph( { value, onChange, onRemove } ) { + return ( + <div className="paper-note__row"> + <PlainText + attributes={ { value } } + setAttributes={ ( next ) => onChange( next.value ) } + attribute="value" + tagName="p" + className="paper-note__text" + placeholder={ __( 'Абзац', 'smilia-core' ) } + /> + <Button + icon={ removeIcon } + label={ __( 'Убрать абзац', 'smilia-core' ) } + onClick={ onRemove } + /> + </div> + ); +} + +export default function Edit( { attributes, setAttributes } ) { + const paragraphs = attributes.paragraphs; + const update = ( next ) => setAttributes( { paragraphs: next } ); + + return ( + <section + { ...useBlockProps( { + className: 'paper-note container', + style: { + '--paper-note-image': `url(${ assetUrl( 'new-patients/paper.webp' ) })`, + }, + } ) } + > + <div className="paper-note__sheet"> + <div className="paper-note__content"> + <PlainText + attributes={ attributes } + setAttributes={ setAttributes } + attribute="title" + tagName="h2" + className="paper-note__title" + placeholder={ __( 'Заголовок', 'smilia-core' ) } + /> + <div className="paper-note__body"> + { paragraphs.map( ( paragraph, index ) => ( + <Paragraph + key={ index } + value={ paragraph } + onChange={ ( value ) => + update( + paragraphs.map( ( current, i ) => + i === index ? value : current + ) + ) + } + onRemove={ () => + update( + paragraphs.filter( ( current, i ) => i !== index ) + ) + } + /> + ) ) } + </div> + <Button + variant="secondary" + onClick={ () => update( [ ...paragraphs, '' ] ) } + > + { __( 'Добавить абзац', 'smilia-core' ) } + </Button> + </div> + </div> + </section> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/paper-note/index.js b/wp-content/plugins/smilia-core/src/blocks/paper-note/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/paper-note/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/paper-note/render.php b/wp-content/plugins/smilia-core/src/blocks/paper-note/render.php new file mode 100644 index 0000000..39fb36b --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/paper-note/render.php @@ -0,0 +1,20 @@ +<?php + +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +$smilia_paragraphs = array_filter( array_map( 'wp_strip_all_tags', (array) $attributes['paragraphs'] ) ); +?> +<section class="paper-note container" style="<?php echo esc_attr( '--paper-note-image: url(' . Markup::asset( 'new-patients/paper.webp' ) . ')' ); ?>"> + <div class="paper-note__sheet" data-reveal> + <div class="paper-note__content"> + <h2 class="paper-note__title"><?php echo esc_html( wp_strip_all_tags( $attributes['title'] ) ); ?></h2> + <div class="paper-note__body"> + <?php foreach ( $smilia_paragraphs as $smilia_paragraph ) : ?> + <p class="paper-note__text"><?php echo esc_html( $smilia_paragraph ); ?></p> + <?php endforeach; ?> + </div> + </div> + </div> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/paper-note/style.css b/wp-content/plugins/smilia-core/src/blocks/paper-note/style.css new file mode 100644 index 0000000..4f1aef8 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/paper-note/style.css @@ -0,0 +1,74 @@ +.paper-note { + --paper-note-ratio: 3258 / 1086; + --paper-note-width: 70rem; + --paper-note-radius: 2.75rem; + --paper-note-content-width: 45rem; + --paper-note-title-size: clamp(1.75rem, 3.2vw, 2.5rem); + --paper-note-padding: var(--space-8) 17%; + --paper-note-fit: contain; + margin-top: var(--space-8); +} + +.paper-note__sheet { + display: flex; + align-items: center; + justify-content: center; + max-width: var(--paper-note-width); + margin-inline: auto; + padding: var(--paper-note-padding); + aspect-ratio: var(--paper-note-ratio); + background: var(--color-paper) var(--paper-note-image) center / var(--paper-note-fit) no-repeat; + border-radius: var(--paper-note-radius); +} + +.paper-note__content { + display: flex; + flex-direction: column; + align-items: center; + gap: var(--space-6); + max-width: var(--paper-note-content-width); + text-align: center; +} + +.paper-note__title { + color: var(--color-accent-strong); + font-size: var(--paper-note-title-size); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-tight); + text-wrap: balance; +} + +.paper-note__body { + display: flex; + flex-direction: column; + gap: var(--space-4); +} + +.paper-note__row { + display: flex; + align-items: flex-start; + justify-content: center; + gap: var(--space-2); +} + +.paper-note__text { + color: var(--color-text-strong); + font-size: var(--text-lg); + line-height: var(--leading-loose); + text-wrap: balance; +} + +@media (max-width: 980px) { + .paper-note { + --paper-note-padding: var(--space-8) 12%; + } +} + +@media (max-width: 760px) { + .paper-note { + --paper-note-ratio: auto; + --paper-note-padding: var(--space-10) var(--space-6); + --paper-note-radius: var(--radius-2xl); + --paper-note-fit: cover; + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/plan-visit/block.json b/wp-content/plugins/smilia-core/src/blocks/plan-visit/block.json new file mode 100644 index 0000000..7d9b6fd --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/plan-visit/block.json @@ -0,0 +1,41 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/plan-visit", + "title": "Запланируйте визит", + "category": "smilia", + "icon": "location", + "description": "Заголовок и карта Google по адресу из настроек «Клиника».", + "textdomain": "smilia-core", + "attributes": { + "title": { + "type": "string", + "role": "content", + "default": "Запланируйте визит в Smilia" + }, + "part": { + "type": "string", + "enum": [ + "all", + "map" + ], + "default": "all" + }, + "bgImageId": { + "type": "number", + "role": "content", + "default": 0 + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "viewScript": "file:./view.js", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/plan-visit/edit.js b/wp-content/plugins/smilia-core/src/blocks/plan-visit/edit.js new file mode 100644 index 0000000..1d1e528 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/plan-visit/edit.js @@ -0,0 +1,78 @@ +import { __ } from '@wordpress/i18n'; +import { + BlockControls, + MediaReplaceFlow, + useBlockProps, +} from '@wordpress/block-editor'; +import { ToolbarButton } from '@wordpress/components'; +import { useSelect } from '@wordpress/data'; +import { store as coreStore } from '@wordpress/core-data'; +import PlainText from '../../shared/plain-text'; +import ServerPreview from '../../shared/server-preview'; +import ManageButton from '../../shared/manage-button'; +import { assetUrl } from '../../shared/images'; + +export default function Edit( { attributes, setAttributes } ) { + const fields = { attributes, setAttributes }; + const { bgImageId } = attributes; + + const background = useSelect( + ( select ) => + bgImageId + ? select( coreStore ).getEntityRecord( + 'postType', + 'attachment', + bgImageId + ) + : null, + [ bgImageId ] + ); + + const style = { '--plan-visit-map': `url(${ assetUrl( 'plan-visit/map-v5-paper.webp' ) })` }; + if ( background?.media_details?.width ) { + style[ '--plan-visit-map' ] = `url(${ background.source_url })`; + style[ '--plan-visit-bg-ratio' ] = `${ background.media_details.width } / ${ background.media_details.height }`; + } + + return ( + <> + <BlockControls group="other"> + <MediaReplaceFlow + mediaId={ bgImageId } + mediaURL={ background?.source_url } + allowedTypes={ [ 'image' ] } + accept="image/*" + name={ __( 'Заменить фон', 'smilia-core' ) } + onSelect={ ( media ) => + setAttributes( { bgImageId: media.id } ) + } + /> + { bgImageId > 0 && ( + <ToolbarButton + onClick={ () => setAttributes( { bgImageId: 0 } ) } + > + { __( 'Вернуть фон', 'smilia-core' ) } + </ToolbarButton> + ) } + </BlockControls> + <ManageButton + path="options-general.php?page=smilia-clinic" + label={ __( 'Изменить адрес', 'smilia-core' ) } + /> + <section { ...useBlockProps( { className: 'plan-visit', style } ) }> + <div className="plan-visit__inner"> + <PlainText + { ...fields } + attribute="title" + tagName="h2" + className="plan-visit__badge" + placeholder={ __( 'Заголовок', 'smilia-core' ) } + /> + <div className="plan-visit__frame"> + <ServerPreview block="smilia/plan-visit" part="map" /> + </div> + </div> + </section> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/plan-visit/index.js b/wp-content/plugins/smilia-core/src/blocks/plan-visit/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/plan-visit/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/plan-visit/map.php b/wp-content/plugins/smilia-core/src/blocks/plan-visit/map.php new file mode 100644 index 0000000..653d21a --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/plan-visit/map.php @@ -0,0 +1,22 @@ +<?php + +defined( 'ABSPATH' ) || exit; + +$smilia_map_title = sprintf( __( 'Карта: %s', 'smilia-core' ), $smilia_address ); +$smilia_map_open = add_query_arg( + array( + 'api' => 1, + 'query' => rawurlencode( $smilia_address ), + ), + 'https://www.google.com/maps/search/' +); +?> +<div class="plan-visit__map" data-map> + <iframe class="plan-visit__embed" data-map-src="<?php echo esc_url( $smilia_embed ); ?>" title="<?php echo esc_attr( $smilia_map_title ); ?>" referrerpolicy="no-referrer-when-downgrade" hidden></iframe> + <div class="plan-visit__loading" data-map-loading aria-hidden="true" hidden><span class="plan-visit__spinner"></span></div> + <div class="plan-visit__consent" data-map-consent> + <p class="plan-visit__consent-text"><?php esc_html_e( 'Для показа карты нужно согласие.', 'smilia-core' ); ?></p> + <button type="button" class="button button--primary" data-map-accept><?php esc_html_e( 'Принять', 'smilia-core' ); ?></button> + <a class="plan-visit__consent-link" href="<?php echo esc_url( $smilia_map_open ); ?>" target="_blank" rel="noopener"><?php esc_html_e( 'Открыть карту в новой вкладке', 'smilia-core' ); ?></a> + </div> +</div> diff --git a/wp-content/plugins/smilia-core/src/blocks/plan-visit/render.php b/wp-content/plugins/smilia-core/src/blocks/plan-visit/render.php new file mode 100644 index 0000000..3bc8b6f --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/plan-visit/render.php @@ -0,0 +1,41 @@ +<?php + +use Smilia\Core\Markup; +use Smilia\Core\Settings; + +defined( 'ABSPATH' ) || exit; + +$smilia_address = Settings::get( 'address' ); +if ( ! $smilia_address ) { + return; +} +$smilia_embed = add_query_arg( + array( + 'q' => rawurlencode( $smilia_address ), + 'hl' => function_exists( 'pll_current_language' ) && pll_current_language() ? pll_current_language() : 'en', + 'z' => 16, + 'output' => 'embed', + ), + 'https://www.google.com/maps' +); +if ( 'map' === $attributes['part'] ) { + require __DIR__ . '/map.php'; + return; +} +$smilia_style = '--plan-visit-map: url(' . Markup::asset( 'plan-visit/map-v5-paper.webp' ) . ')'; +$smilia_bg = (int) $attributes['bgImageId']; +$smilia_meta = $smilia_bg > 0 ? wp_get_attachment_metadata( $smilia_bg ) : false; +if ( is_array( $smilia_meta ) && ! empty( $smilia_meta['width'] ) && ! empty( $smilia_meta['height'] ) ) { + $smilia_style = sprintf( '--plan-visit-map: url(%s); --plan-visit-bg-ratio: %d / %d', wp_get_original_image_url( $smilia_bg ), $smilia_meta['width'], $smilia_meta['height'] ); +} +?> +<section class="plan-visit" id="contacts" style="<?php echo esc_attr( $smilia_style ); ?>"> + <div class="plan-visit__inner"> + <?php if ( '' !== trim( wp_strip_all_tags( $attributes['title'] ) ) ) : ?> + <h2 class="plan-visit__badge"><?php echo Markup::text( $attributes['title'] ); ?></h2> + <?php endif; ?> + <div class="plan-visit__frame"> + <?php require __DIR__ . '/map.php'; ?> + </div> + </div> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/plan-visit/style.css b/wp-content/plugins/smilia-core/src/blocks/plan-visit/style.css new file mode 100644 index 0000000..1111daf --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/plan-visit/style.css @@ -0,0 +1,199 @@ +.plan-visit { + --plan-visit-bg-width: 112%; + --plan-visit-bg-shift: 0%; + --plan-visit-bg-ratio: 2191 / 1048; + --plan-visit-gap: 1.625rem; + --plan-visit-map-height: 22.5rem; + --plan-visit-badge-shadow: 0 0.75rem 1.625rem color-mix(in srgb, var(--color-accent-deep) 22%, transparent); + --plan-visit-frame-shadow: 0 1.125rem 2.375rem color-mix(in srgb, var(--color-accent-deep) 28%, transparent); + position: relative; + display: flex; + align-items: center; + justify-content: center; + aspect-ratio: var(--plan-visit-bg-ratio); + padding: var(--space-16) var(--gutter); + overflow: hidden; + background: var(--color-accent-light); + text-align: center; +} + +.plan-visit::before { + content: ""; + position: absolute; + top: 0; + left: var(--plan-visit-bg-shift); + width: var(--plan-visit-bg-width); + aspect-ratio: var(--plan-visit-bg-ratio); + background: var(--plan-visit-map) center / 100% 100% no-repeat; + pointer-events: none; +} + +.plan-visit__inner { + position: relative; + z-index: 1; + display: flex; + flex-direction: column; + align-items: center; + width: 100%; + max-width: 51.25rem; +} + +.plan-visit__badge { + display: inline-block; + margin-bottom: var(--plan-visit-gap); + padding: var(--space-3) var(--space-8); + background: var(--color-surface); + border-radius: var(--radius-full); + box-shadow: var(--plan-visit-badge-shadow); + color: var(--color-accent-deep); + font-size: var(--fs-h3); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-tight); +} + +.plan-visit__frame { + width: 100%; + margin-bottom: var(--plan-visit-gap); + padding: 0.4375rem; + background: var(--color-accent-strong); + border-radius: 2.25rem; + box-shadow: var(--plan-visit-frame-shadow); +} + +.plan-visit__map { + position: relative; + min-height: var(--plan-visit-map-height); + overflow: hidden; + background: var(--color-surface); + border-radius: 1.875rem; +} + +.plan-visit__embed { + display: block; + width: 100%; + height: var(--plan-visit-map-height); + border: 0; +} + +.plan-visit__embed[hidden] { + display: none; +} + +.plan-visit__consent { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: var(--space-3); + min-height: var(--plan-visit-map-height); + padding: var(--space-8) var(--space-6); + color: var(--color-text); +} + +.plan-visit__consent[hidden] { + display: none; +} + +.plan-visit__consent-text { + max-width: 28rem; + font-size: var(--fs-lead); + font-weight: var(--font-weight-bold); + text-wrap: balance; +} + +.plan-visit__consent-link { + color: var(--color-accent-strong); + text-decoration: underline; + text-underline-offset: 0.2em; +} + +.plan-visit__consent-link { + display: inline-block; + padding-block: var(--space-3); + font-size: var(--fs-small); + font-weight: var(--font-weight-bold); +} + + +@media (max-width: 980px) { + .plan-visit { + aspect-ratio: auto; + padding-block: var(--space-16); + } + + .plan-visit::before { + inset: 0; + width: auto; + aspect-ratio: auto; + background-size: cover; + } +} + +@media (max-width: 560px) { + .plan-visit { + padding: var(--space-12) 0 0; + background: var(--color-bg); + } + + .plan-visit::before { + display: none; + } + + .plan-visit__badge { + margin-bottom: var(--space-head); + padding: 0 var(--gutter); + background: none; + box-shadow: none; + font-size: var(--fs-h2); + } + + .plan-visit__frame { + margin-bottom: 0; + padding: 0; + border-radius: 0; + box-shadow: none; + } + + .plan-visit__map { + border-radius: 0; + } + + .plan-visit { + --plan-visit-map-height: 22rem; + } +} + +.plan-visit__loading { + position: absolute; + inset: 0; + z-index: 1; + display: flex; + align-items: center; + justify-content: center; + background: var(--color-surface); +} + +.plan-visit__loading[hidden] { + display: none; +} + +.plan-visit__spinner { + width: 3rem; + height: 3rem; + border: 0.3125rem solid var(--color-accent-soft); + border-top-color: var(--color-accent); + border-radius: var(--radius-full); + animation: plan-visit-spin 0.9s linear infinite; +} + +@keyframes plan-visit-spin { + to { + transform: rotate(360deg); + } +} + +@media (prefers-reduced-motion: reduce) { + .plan-visit__spinner { + animation-duration: 3s; + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/plan-visit/view.js b/wp-content/plugins/smilia-core/src/blocks/plan-visit/view.js new file mode 100644 index 0000000..bd42a42 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/plan-visit/view.js @@ -0,0 +1,85 @@ +( () => { + const maps = document.querySelectorAll( '[data-map]' ); + if ( ! maps.length ) { + return; + } + + const key = 'smilia-consent'; + + const granted = () => { + try { + return 'granted' === window.localStorage.getItem( key ); + } catch ( error ) { + return false; + } + }; + + maps.forEach( ( map ) => { + const frame = map.querySelector( '.plan-visit__embed' ); + const gate = map.querySelector( '[data-map-consent]' ); + const accept = map.querySelector( '[data-map-accept]' ); + const loading = map.querySelector( '[data-map-loading]' ); + const url = frame.dataset.mapSrc; + let observer = null; + + const show = () => { + loading.hidden = false; + frame.addEventListener( + 'load', + () => { + loading.hidden = true; + }, + { once: true } + ); + frame.src = url; + frame.hidden = false; + gate.hidden = true; + }; + + const hide = () => { + if ( observer ) { + observer.disconnect(); + observer = null; + } + frame.removeAttribute( 'src' ); + loading.hidden = true; + frame.hidden = true; + gate.hidden = false; + }; + + const watch = () => { + gate.hidden = true; + if ( ! ( 'IntersectionObserver' in window ) ) { + show(); + return; + } + observer = new IntersectionObserver( + ( entries ) => { + if ( entries.some( ( entry ) => entry.isIntersecting ) ) { + show(); + observer.disconnect(); + observer = null; + } + }, + { rootMargin: '200px 0px' } + ); + observer.observe( map ); + }; + + accept.addEventListener( 'click', () => { + document.dispatchEvent( new CustomEvent( 'smilia:consent-request' ) ); + } ); + + document.addEventListener( 'smilia:consent', ( event ) => { + if ( 'granted' === event.detail.state ) { + show(); + } else { + hide(); + } + } ); + + if ( granted() ) { + watch(); + } + } ); +} )(); diff --git a/wp-content/plugins/smilia-core/src/blocks/prepare/block.json b/wp-content/plugins/smilia-core/src/blocks/prepare/block.json new file mode 100644 index 0000000..f419d37 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/prepare/block.json @@ -0,0 +1,57 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/prepare", + "title": "Подготовка к визиту", + "category": "smilia", + "icon": "list-view", + "description": "Записка со списком, совет родителям и кнопка записи.", + "textdomain": "smilia-core", + "attributes": { + "listTitle": { + "type": "string", + "role": "content", + "default": "Что взять с собой" + }, + "items": { + "type": "array", + "role": "content", + "items": { + "type": "string" + }, + "default": [ + "Первый пункт" + ] + }, + "title": { + "type": "string", + "role": "content", + "default": "Как подготовить ребёнка" + }, + "text": { + "type": "string", + "role": "content", + "default": "Текст" + }, + "closing": { + "type": "string", + "role": "content", + "default": "Знакомство без спешки" + }, + "button": { + "type": "string", + "role": "content", + "default": "Записаться на первый визит" + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/prepare/edit.js b/wp-content/plugins/smilia-core/src/blocks/prepare/edit.js new file mode 100644 index 0000000..dbfa876 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/prepare/edit.js @@ -0,0 +1,127 @@ +import { __ } from '@wordpress/i18n'; +import { useBlockProps } from '@wordpress/block-editor'; +import { Button } from '@wordpress/components'; +import PlainText from '../../shared/plain-text'; +import { assetUrl } from '../../shared/images'; +import { removeIcon } from '../../shared/icons'; + +function Item( { value, onChange, onRemove } ) { + return ( + <li className="prepare__item"> + <PlainText + attributes={ { value } } + setAttributes={ ( next ) => onChange( next.value ) } + attribute="value" + tagName="span" + className="prepare__item-text" + placeholder={ __( 'Пункт списка', 'smilia-core' ) } + /> + <Button + icon={ removeIcon } + label={ __( 'Убрать пункт', 'smilia-core' ) } + onClick={ onRemove } + /> + </li> + ); +} + +export default function Edit( { attributes, setAttributes } ) { + const fields = { attributes, setAttributes }; + const { items } = attributes; + const update = ( next ) => setAttributes( { items: next } ); + + return ( + <section + { ...useBlockProps( { + className: 'prepare', + style: { + '--prepare-clip-back': `url(${ assetUrl( 'new-patients/clip-back.svg' ) })`, + '--prepare-clip-front': `url(${ assetUrl( 'new-patients/clip-front.svg' ) })`, + }, + } ) } + > + <svg + className="prepare__wave" + viewBox="0 0 1440 60" + preserveAspectRatio="none" + aria-hidden="true" + focusable="false" + > + <path d="M0,0 L1440,0 L1440,20 C1200,56 960,58 720,34 C480,10 240,12 0,40 Z" /> + </svg> + <div className="container"> + <div className="prepare__grid"> + <div className="prepare__note"> + <span className="prepare__clip prepare__clip--back" /> + <span className="prepare__clip prepare__clip--front" /> + <PlainText + { ...fields } + attribute="listTitle" + tagName="h2" + className="prepare__note-title" + placeholder={ __( 'Заголовок записки', 'smilia-core' ) } + /> + <ul className="prepare__list"> + { items.map( ( item, index ) => ( + <Item + key={ index } + value={ item } + onChange={ ( value ) => + update( + items.map( ( current, i ) => + i === index ? value : current + ) + ) + } + onRemove={ () => + update( + items.filter( ( current, i ) => i !== index ) + ) + } + /> + ) ) } + </ul> + <Button + variant="secondary" + onClick={ () => update( [ ...items, '' ] ) } + > + { __( 'Добавить пункт', 'smilia-core' ) } + </Button> + </div> + <div className="prepare__advice"> + <PlainText + { ...fields } + attribute="title" + tagName="h2" + className="prepare__title" + placeholder={ __( 'Заголовок', 'smilia-core' ) } + /> + <PlainText + { ...fields } + attribute="text" + tagName="p" + className="prepare__text" + placeholder={ __( 'Текст', 'smilia-core' ) } + /> + </div> + </div> + <div className="prepare__closing"> + <PlainText + { ...fields } + attribute="closing" + tagName="p" + className="prepare__closing-text" + placeholder={ __( 'Приглашение', 'smilia-core' ) } + /> + <PlainText + { ...fields } + attribute="button" + tagName="span" + className="button button--primary button--lg" + placeholder={ __( 'Кнопка', 'smilia-core' ) } + /> + </div> + </div> + </section> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/prepare/index.js b/wp-content/plugins/smilia-core/src/blocks/prepare/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/prepare/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/prepare/render.php b/wp-content/plugins/smilia-core/src/blocks/prepare/render.php new file mode 100644 index 0000000..43ec47c --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/prepare/render.php @@ -0,0 +1,38 @@ +<?php + +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +$smilia_items = array_filter( array_map( 'wp_strip_all_tags', (array) $attributes['items'] ) ); +$smilia_style = sprintf( + '--prepare-clip-back: url(%1$s); --prepare-clip-front: url(%2$s)', + Markup::asset( 'new-patients/clip-back.svg' ), + Markup::asset( 'new-patients/clip-front.svg' ) +); +?> +<section class="prepare" style="<?php echo esc_attr( $smilia_style ); ?>"> + <svg class="prepare__wave" viewBox="0 0 1440 60" preserveAspectRatio="none" aria-hidden="true" focusable="false"><path d="M0,0 L1440,0 L1440,20 C1200,56 960,58 720,34 C480,10 240,12 0,40 Z"/></svg> + <div class="container"> + <div class="prepare__grid"> + <div class="prepare__note" data-reveal> + <span class="prepare__clip prepare__clip--back" aria-hidden="true"></span> + <span class="prepare__clip prepare__clip--front" aria-hidden="true"></span> + <h2 class="prepare__note-title"><?php echo esc_html( wp_strip_all_tags( $attributes['listTitle'] ) ); ?></h2> + <ul class="prepare__list"> + <?php foreach ( $smilia_items as $smilia_item ) : ?> + <li class="prepare__item"><?php echo esc_html( $smilia_item ); ?></li> + <?php endforeach; ?> + </ul> + </div> + <div class="prepare__advice" data-reveal> + <h2 class="prepare__title"><?php echo esc_html( wp_strip_all_tags( $attributes['title'] ) ); ?></h2> + <p class="prepare__text"><?php echo esc_html( wp_strip_all_tags( $attributes['text'] ) ); ?></p> + </div> + </div> + <div class="prepare__closing" data-reveal> + <p class="prepare__closing-text"><?php echo esc_html( wp_strip_all_tags( $attributes['closing'] ) ); ?></p> + <button type="button" class="button button--primary button--lg" data-booking-open><?php echo esc_html( wp_strip_all_tags( $attributes['button'] ) ); ?></button> + </div> + </div> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/prepare/style.css b/wp-content/plugins/smilia-core/src/blocks/prepare/style.css new file mode 100644 index 0000000..3b49377 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/prepare/style.css @@ -0,0 +1,168 @@ +.prepare { + --prepare-clip-width: 2.125rem; + --prepare-clip-height: 5.875rem; + --prepare-wave-height: var(--space-16); + --prepare-tilt: -2deg; + --prepare-box-size: 1.25rem; + --prepare-box-border: 2.5px; + --prepare-box-radius: 0.375rem; + --prepare-closing-size: clamp(1.375rem, 2.4vw, 1.75rem); + --prepare-columns: 2; + --prepare-gap: var(--space-16); + --prepare-note-shadow: 0 1rem 2.125rem color-mix(in srgb, var(--color-shadow) 12%, transparent); + position: relative; + margin-top: var(--space-16); + padding: var(--space-32) 0 var(--space-24); + background: var(--color-accent-soft); +} + +.prepare__wave { + position: absolute; + top: -1px; + left: 0; + display: block; + width: 100%; + height: var(--prepare-wave-height); + fill: var(--color-bg); +} + +.prepare__grid { + display: grid; + grid-template-columns: repeat(var(--prepare-columns), minmax(0, 1fr)); + gap: var(--prepare-gap); + align-items: center; +} + +.prepare__note { + position: relative; + display: flex; + flex-direction: column; + align-items: flex-start; + gap: var(--space-5); + padding: var(--space-10) var(--space-8) var(--space-8); + background: var(--color-surface); + border-radius: var(--radius-xl); + box-shadow: var(--prepare-note-shadow); + transform: rotate(var(--prepare-tilt)); +} + +.prepare__clip { + position: absolute; + top: calc(var(--space-6) * -1 - 2px); + right: var(--space-10); + width: var(--prepare-clip-width); + pointer-events: none; +} + +.prepare__clip--back { + height: var(--space-6); + overflow: hidden; + background: var(--prepare-clip-back) top / var(--prepare-clip-width) var(--prepare-clip-height) no-repeat; +} + +.prepare__clip--front { + height: var(--prepare-clip-height); + background: var(--prepare-clip-front) top / var(--prepare-clip-width) var(--prepare-clip-height) no-repeat; + filter: drop-shadow(1px 2px 1.5px color-mix(in srgb, var(--color-shadow) 25%, transparent)); +} + +.prepare__note-title { + color: var(--color-accent-strong); + font-size: var(--text-2xl); + font-weight: var(--font-weight-extrabold); +} + +.prepare__list { + display: flex; + flex-direction: column; + gap: var(--space-4); +} + +.prepare__item { + display: flex; + align-items: flex-start; + gap: var(--space-4); + color: var(--color-text-strong); + font-size: var(--text-lg); + font-weight: var(--font-weight-semibold); + line-height: var(--leading-relaxed); +} + +.prepare__item::before { + content: ""; + flex: none; + width: var(--prepare-box-size); + height: var(--prepare-box-size); + margin-top: 0.1875rem; + border: var(--prepare-box-border) solid var(--color-accent); + border-radius: var(--prepare-box-radius); +} + +.prepare__advice { + display: flex; + flex-direction: column; + gap: var(--space-5); +} + +.prepare__title { + color: var(--color-accent-strong); + font-size: var(--text-3xl); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-tight); +} + +.prepare__text { + color: var(--color-text-strong); + font-size: var(--text-lg); + line-height: var(--leading-loose); + text-wrap: pretty; +} + +.prepare__closing { + display: flex; + flex-direction: column; + align-items: center; + gap: var(--space-5); + margin-top: var(--space-16); + text-align: center; +} + +.prepare__closing-text { + color: var(--color-accent-strong); + font-size: var(--prepare-closing-size); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-tight); + text-wrap: balance; +} + +@media (max-width: 980px) { + .prepare { + --prepare-columns: 1; + --prepare-gap: var(--space-12); + padding-top: var(--space-24); + } +} + +@media (max-width: 560px) { + .prepare { + --prepare-wave-height: var(--space-12); + padding-top: var(--space-24); + padding-bottom: var(--space-16); + } + + .prepare__note { + padding: var(--space-8) var(--space-6) var(--space-6); + } + + .prepare__note-title { + padding-right: var(--space-10); + } + + .prepare__clip { + right: var(--space-6); + } + + .prepare__closing { + margin-top: var(--space-12); + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/prices/block.json b/wp-content/plugins/smilia-core/src/blocks/prices/block.json new file mode 100644 index 0000000..9668a46 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/prices/block.json @@ -0,0 +1,68 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/prices", + "title": "Таблица цен", + "category": "smilia", + "icon": "money-alt", + "description": "Группы процедур с ценами, группа может быть привязана к услуге.", + "textdomain": "smilia-core", + "attributes": { + "groups": { + "type": "array", + "role": "content", + "items": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "service": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "price": { + "type": "string" + } + } + } + } + } + }, + "default": [ + { + "title": "Группа", + "service": "", + "items": [ + { + "name": "Процедура", + "price": "100" + } + ] + } + ] + }, + "note": { + "type": "string", + "role": "content", + "default": "* Точную стоимость врач называет после осмотра." + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/prices/edit.js b/wp-content/plugins/smilia-core/src/blocks/prices/edit.js new file mode 100644 index 0000000..8cc8b2f --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/prices/edit.js @@ -0,0 +1,162 @@ +import { __ } from '@wordpress/i18n'; +import { useBlockProps } from '@wordpress/block-editor'; +import { Button, SelectControl } from '@wordpress/components'; +import { useSelect } from '@wordpress/data'; +import { useMemo } from '@wordpress/element'; +import { decodeEntities } from '@wordpress/html-entities'; +import { store as coreStore } from '@wordpress/core-data'; +import PlainText from '../../shared/plain-text'; +import { removeIcon } from '../../shared/icons'; + +const emptyItem = { name: '', price: '' }; + +function useServiceOptions( selected ) { + const services = useSelect( + ( select ) => + select( coreStore ).getEntityRecords( 'postType', 'smilia_service', { + per_page: -1, + orderby: 'menu_order', + order: 'asc', + _fields: 'id,slug,title', + } ), + [] + ); + return useMemo( () => { + const seen = new Set(); + const options = [ { label: __( 'Без услуги', 'smilia-core' ), value: '' } ]; + ( services || [] ).forEach( ( service ) => { + if ( seen.has( service.slug ) ) { + return; + } + seen.add( service.slug ); + options.push( { label: decodeEntities( service.title.rendered ), value: service.slug } ); + } ); + selected.forEach( ( slug ) => { + if ( slug && ! seen.has( slug ) ) { + seen.add( slug ); + options.push( { label: slug, value: slug } ); + } + } ); + return options; + }, [ services, selected.join( '|' ) ] ); +} + +function Field( { value, onChange, ...props } ) { + return ( + <PlainText + attributes={ { value } } + setAttributes={ ( next ) => onChange( next.value ) } + attribute="value" + { ...props } + /> + ); +} + +export default function Edit( { attributes, setAttributes } ) { + const { groups } = attributes; + const serviceOptions = useServiceOptions( groups.map( ( group ) => group.service ) ); + const update = ( next ) => setAttributes( { groups: next } ); + const updateGroup = ( index, patch ) => + update( groups.map( ( group, i ) => ( i === index ? { ...group, ...patch } : group ) ) ); + const updateItem = ( groupIndex, itemIndex, patch ) => + updateGroup( groupIndex, { + items: groups[ groupIndex ].items.map( ( item, i ) => + i === itemIndex ? { ...item, ...patch } : item + ), + } ); + + return ( + <section { ...useBlockProps( { className: 'prices container' } ) }> + <div className="prices__list"> + { groups.map( ( group, groupIndex ) => ( + <div className="prices__card" key={ groupIndex }> + <table className="prices__table"> + <caption className="prices__group-title"> + <Field + tagName="div" + className="prices__group-label" + value={ group.title } + onChange={ ( title ) => updateGroup( groupIndex, { title } ) } + placeholder={ __( 'Название группы', 'smilia-core' ) } + /> + </caption> + <tbody> + { group.items.map( ( item, itemIndex ) => ( + <tr className="prices__row" key={ itemIndex }> + <Field + tagName="th" + className="prices__name" + value={ item.name } + onChange={ ( name ) => updateItem( groupIndex, itemIndex, { name } ) } + placeholder={ __( 'Процедура', 'smilia-core' ) } + /> + <td className="prices__price"> + <Field + tagName="span" + value={ item.price } + onChange={ ( price ) => updateItem( groupIndex, itemIndex, { price } ) } + placeholder={ __( 'Цена, zł', 'smilia-core' ) } + /> + <Button + icon={ removeIcon } + label={ __( 'Убрать строку', 'smilia-core' ) } + onClick={ () => + updateGroup( groupIndex, { + items: group.items.filter( ( current, i ) => i !== itemIndex ), + } ) + } + /> + </td> + </tr> + ) ) } + <tr className="prices__tools"> + <td colSpan={ 2 }> + <SelectControl + __next40pxDefaultSize + __nextHasNoMarginBottom + label={ __( 'Услуга', 'smilia-core' ) } + value={ group.service } + options={ serviceOptions } + onChange={ ( service ) => updateGroup( groupIndex, { service } ) } + /> + <Button + variant="secondary" + onClick={ () => + updateGroup( groupIndex, { items: [ ...group.items, { ...emptyItem } ] } ) + } + > + { __( 'Добавить строку', 'smilia-core' ) } + </Button> + <Button + variant="tertiary" + isDestructive + onClick={ () => update( groups.filter( ( current, i ) => i !== groupIndex ) ) } + > + { __( 'Убрать группу', 'smilia-core' ) } + </Button> + </td> + </tr> + </tbody> + </table> + </div> + ) ) } + </div> + <Button + variant="secondary" + onClick={ () => + update( [ ...groups, { title: '', service: '', items: [ { ...emptyItem } ] } ] ) + } + > + { __( 'Добавить группу', 'smilia-core' ) } + </Button> + <PlainText + attributes={ attributes } + setAttributes={ setAttributes } + attribute="note" + tagName="p" + className="prices__note" + placeholder={ __( 'Примечание под таблицей', 'smilia-core' ) } + /> + </section> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/prices/index.js b/wp-content/plugins/smilia-core/src/blocks/prices/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/prices/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/prices/render.php b/wp-content/plugins/smilia-core/src/blocks/prices/render.php new file mode 100644 index 0000000..9182b6c --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/prices/render.php @@ -0,0 +1,44 @@ +<?php + +use Smilia\Core\Prices; + +defined( 'ABSPATH' ) || exit; + +$smilia_groups = Prices::groups( (array) $attributes['groups'] ); +if ( ! $smilia_groups ) { + return; +} +$smilia_note = wp_strip_all_tags( $attributes['note'] ); +?> +<section class="prices container"> + <div class="prices__card" data-reveal> + <?php foreach ( $smilia_groups as $smilia_group ) : ?> + <table class="prices__table"> + <caption class="prices__group-title"> + <?php if ( $smilia_group['url'] ) : ?> + <a class="prices__group-label prices__group-link" href="<?php echo esc_url( $smilia_group['url'] ); ?>"><?php echo esc_html( $smilia_group['title'] ); ?></a> + <?php else : ?> + <span class="prices__group-label"><?php echo esc_html( $smilia_group['title'] ); ?></span> + <?php endif; ?> + </caption> + <thead class="prices__head"> + <tr> + <th scope="col"><?php esc_html_e( 'Процедура', 'smilia-core' ); ?></th> + <th scope="col"><?php esc_html_e( 'Цена', 'smilia-core' ); ?></th> + </tr> + </thead> + <tbody> + <?php foreach ( $smilia_group['items'] as $smilia_item ) : ?> + <tr class="prices__row"> + <th class="prices__name" scope="row"><?php echo esc_html( $smilia_item['name'] ); ?></th> + <td class="prices__price"><?php echo esc_html( $smilia_item['price'] ); ?></td> + </tr> + <?php endforeach; ?> + </tbody> + </table> + <?php endforeach; ?> + </div> + <?php if ( '' !== $smilia_note ) : ?> + <p class="prices__note"><?php echo esc_html( $smilia_note ); ?></p> + <?php endif; ?> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/prices/style.css b/wp-content/plugins/smilia-core/src/blocks/prices/style.css new file mode 100644 index 0000000..2bab796 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/prices/style.css @@ -0,0 +1,123 @@ +.prices { + --prices-width: var(--container); + --prices-cell-padding: var(--space-3) var(--space-6); + --prices-head-padding: var(--space-4) var(--space-6); + padding-block: var(--space-6) var(--space-16); +} + +.prices__card { + max-width: var(--prices-width); + margin-inline: auto; + overflow: hidden; + background: var(--color-surface); + border-radius: var(--radius-2xl); + box-shadow: var(--shadow-md); +} + +.prices__table { + width: 100%; + border-collapse: collapse; +} + +.prices__group-title { + caption-side: top; + padding: 0; + background: var(--color-accent); + color: var(--color-white); + font-size: var(--text-lg); + font-weight: var(--font-weight-extrabold); + text-align: left; +} + +.prices__group-label { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--space-3); + min-height: 3.5rem; + padding: var(--prices-head-padding); +} + +.prices__group-link { + color: inherit; +} + +.prices__group-link::after { + content: ""; + flex: none; + width: 0.5em; + height: 0.5em; + border-top: 2px solid currentColor; + border-right: 2px solid currentColor; + rotate: 45deg; + transition: translate var(--duration-fast) ease; +} + +.prices__head { + position: absolute; + width: 1px; + height: 1px; + overflow: hidden; + clip-path: inset(50%); + white-space: nowrap; +} + +.prices__row:nth-child(odd) { + background: var(--color-bg-soft); +} + +.prices__name { + padding: var(--prices-cell-padding); + color: var(--color-text-strong); + font-size: var(--text-lg); + font-weight: var(--font-weight-semibold); + text-align: left; +} + +.prices__price { + width: 25%; + min-width: 8rem; + padding: var(--prices-cell-padding); + color: var(--color-accent-strong); + font-weight: var(--font-weight-extrabold); + font-variant-numeric: tabular-nums; + text-align: left; + white-space: nowrap; +} + +.prices__note { + max-width: var(--prices-width); + margin: var(--space-6) auto 0; + color: var(--color-accent-strong); + font-size: var(--text-lg); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-normal); + text-align: center; +} + +@media (hover: hover) { + .prices__group-link:hover { + color: var(--color-white); + } + + .prices__group-link:hover::after { + translate: 0.25em 0; + } +} + +@media (max-width: 560px) { + .prices { + --prices-cell-padding: var(--space-3) var(--space-4); + --prices-head-padding: var(--space-4); + padding-bottom: var(--space-12); + } + + .prices__price { + width: auto; + min-width: 0; + } + + .prices__name { + font-size: var(--text-base); + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/reviews-board/block.json b/wp-content/plugins/smilia-core/src/blocks/reviews-board/block.json new file mode 100644 index 0000000..b9b2008 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/reviews-board/block.json @@ -0,0 +1,58 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/reviews-board", + "title": "Доска отзывов", + "category": "smilia", + "icon": "format-quote", + "description": "Заголовок, отзывы из раздела «Отзывы» по страницам и ссылки на площадки.", + "textdomain": "smilia-core", + "attributes": { + "title": { + "type": "string", + "role": "content", + "default": "Отзывы" + }, + "lead": { + "type": "string", + "role": "content", + "default": "" + }, + "ctaText": { + "type": "string", + "role": "content", + "default": "" + }, + "googleText": { + "type": "string", + "role": "content", + "default": "Оставить отзыв в Google" + }, + "booksyText": { + "type": "string", + "role": "content", + "default": "Оставить отзыв в Booksy" + }, + "znanyText": { + "type": "string", + "role": "content", + "default": "Оставить отзыв в ZnanyLekarz" + }, + "imageId": { + "type": "number", + "role": "content", + "default": 0 + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "viewScript": "file:./view.js", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/reviews-board/edit.js b/wp-content/plugins/smilia-core/src/blocks/reviews-board/edit.js new file mode 100644 index 0000000..71a876f --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/reviews-board/edit.js @@ -0,0 +1,108 @@ +import { __ } from '@wordpress/i18n'; +import { + BlockControls, + MediaReplaceFlow, + useBlockProps, +} from '@wordpress/block-editor'; +import PlainText from '../../shared/plain-text'; +import ManageButton from '../../shared/manage-button'; +import { assetUrl, useImageUrl } from '../../shared/images'; + +export default function Edit( { attributes, setAttributes } ) { + const fields = { attributes, setAttributes }; + const imageUrl = useImageUrl( attributes.imageId, 'smilia-800' ); + + return ( + <> + <ManageButton + postType="smilia_review" + label={ __( 'Изменить отзывы', 'smilia-core' ) } + /> + <BlockControls group="other"> + <MediaReplaceFlow + mediaId={ attributes.imageId } + mediaURL={ imageUrl } + allowedTypes={ [ 'image' ] } + accept="image/*" + name={ __( 'Заменить фон доски', 'smilia-core' ) } + onSelect={ ( media ) => + setAttributes( { imageId: media.id } ) + } + /> + </BlockControls> + <section + { ...useBlockProps( { className: 'reviews-board' } ) } + style={ + imageUrl + ? { '--reviews-board-bg': `url("${ imageUrl }")` } + : undefined + } + > + <img + className="reviews-board__decor reviews-board__decor--left" + src={ assetUrl( 'reviews/chalk-left.svg' ) } + alt="" + /> + <img + className="reviews-board__decor reviews-board__decor--right" + src={ assetUrl( 'reviews/chalk-right.svg' ) } + alt="" + /> + <div className="reviews-board__head"> + <PlainText + { ...fields } + attribute="title" + tagName="h1" + className="reviews-board__title" + placeholder={ __( 'Заголовок', 'smilia-core' ) } + /> + <PlainText + { ...fields } + attribute="lead" + tagName="p" + className="reviews-board__lead" + placeholder={ __( 'Подпись', 'smilia-core' ) } + /> + </div> + <div className="reviews-board__cta"> + <PlainText + { ...fields } + attribute="ctaText" + tagName="p" + className="reviews-board__cta-text" + placeholder={ __( + 'Текст перед ссылками', + 'smilia-core' + ) } + /> + <ul className="reviews-board__links"> + <li className="reviews-board__item"> + <PlainText + { ...fields } + attribute="googleText" + tagName="span" + className="reviews-board__link" + /> + </li> + <li className="reviews-board__item"> + <PlainText + { ...fields } + attribute="booksyText" + tagName="span" + className="reviews-board__link" + /> + </li> + <li className="reviews-board__item"> + <PlainText + { ...fields } + attribute="znanyText" + tagName="span" + className="reviews-board__link" + /> + </li> + </ul> + </div> + </section> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/reviews-board/index.js b/wp-content/plugins/smilia-core/src/blocks/reviews-board/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/reviews-board/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/reviews-board/render.php b/wp-content/plugins/smilia-core/src/blocks/reviews-board/render.php new file mode 100644 index 0000000..0849817 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/reviews-board/render.php @@ -0,0 +1,84 @@ +<?php + +use Smilia\Core\Content; +use Smilia\Core\Markup; +use Smilia\Core\Settings; + +defined( 'ABSPATH' ) || exit; + +$smilia_reviews = Content::reviews( 100 ); +$smilia_sources = array( + 'google' => array( 'reviews/google-g.svg', 'Google' ), + 'booksy' => array( 'reviews/booksy.svg', 'Booksy' ), + 'znanylekarz' => array( 'reviews/znanylekarz-mark.svg', 'ZnanyLekarz' ), +); +$smilia_links = array( + 'google' => array( Settings::get( 'review_google' ), $attributes['googleText'] ), + 'booksy' => array( Settings::get( 'review_booksy' ), $attributes['booksyText'] ), + 'znanylekarz' => array( Settings::get( 'review_znanylekarz' ), $attributes['znanyText'] ), +); +$smilia_bg = (int) $attributes['imageId'] > 0 ? wp_get_attachment_image_url( (int) $attributes['imageId'], 'full' ) : ''; +$smilia_style = $smilia_bg ? sprintf( '--reviews-board-bg: url("%s")', esc_url( $smilia_bg ) ) : ''; +$smilia_crumbs = render_block( + array( + 'blockName' => 'core/breadcrumbs', + 'attrs' => array( 'separator' => '›' ), + 'innerBlocks' => array(), + 'innerHTML' => '', + 'innerContent' => array(), + ) +); +?> +<section class="reviews-board" data-reviews-board<?php echo $smilia_style ? ' style="' . esc_attr( $smilia_style ) . '"' : ''; ?>> + <img class="reviews-board__decor reviews-board__decor--left" src="<?php echo esc_url( Markup::asset( 'reviews/chalk-left.svg' ) ); ?>" alt="" width="220" height="1130" loading="lazy" decoding="async" fetchpriority="low"> + <img class="reviews-board__decor reviews-board__decor--right" src="<?php echo esc_url( Markup::asset( 'reviews/chalk-right.svg' ) ); ?>" alt="" width="220" height="1130" loading="lazy" decoding="async" fetchpriority="low"> + <div class="reviews-board__head container"> + <?php echo wp_kses_post( $smilia_crumbs ); ?> + <h1 class="reviews-board__title"><?php echo Markup::text( $attributes['title'] ); ?></h1> + <p class="reviews-board__lead"><?php echo Markup::text( $attributes['lead'] ); ?></p> + </div> + <?php if ( $smilia_reviews ) : ?> + <div class="reviews-board__body container"> + <div class="reviews-board__viewport"> + <ul class="reviews-board__track" data-reviews-track> + <?php foreach ( $smilia_reviews as $smilia_review ) : ?> + <li class="reviews-board__review"<?php echo Markup::edit_link( (int) $smilia_review['id'], $attributes ); ?>> + <p class="reviews-board__who"> + <span class="reviews-board__name"><?php echo esc_html( $smilia_review['author'] ); ?></span> + <?php if ( isset( $smilia_sources[ $smilia_review['source'] ] ) ) : ?> + <span class="reviews-board__source"> + <?php Markup::asset_svg( $smilia_sources[ $smilia_review['source'] ][0], 'reviews-board__logo reviews-board__logo--' . $smilia_review['source'], $smilia_sources[ $smilia_review['source'] ][1] ); ?> + </span> + <?php endif; ?> + </p> + <span class="reviews-board__stars" role="img" aria-label="<?php esc_attr_e( 'Оценка: 5 из 5', 'smilia-core' ); ?>"></span> + <blockquote class="reviews-board__text"><p><?php echo esc_html( $smilia_review['text'] ); ?></p></blockquote> + </li> + <?php endforeach; ?> + </ul> + </div> + <div class="reviews-board__pager" role="group" aria-label="<?php esc_attr_e( 'Страницы отзывов', 'smilia-core' ); ?>" data-reviews-pager hidden> + <button type="button" class="reviews-board__arrow" aria-label="<?php esc_attr_e( 'Предыдущие отзывы', 'smilia-core' ); ?>" data-reviews-prev>‹</button> + <span class="reviews-board__count" aria-live="polite" data-reviews-count></span> + <button type="button" class="reviews-board__arrow" aria-label="<?php esc_attr_e( 'Следующие отзывы', 'smilia-core' ); ?>" data-reviews-next>›</button> + </div> + </div> + <?php endif; ?> + <div class="reviews-board__cta container"> + <p class="reviews-board__cta-text"><?php echo Markup::text( $attributes['ctaText'] ); ?></p> + <ul class="reviews-board__links"> + <?php foreach ( $smilia_links as $smilia_key => $smilia_link ) : ?> + <?php if ( '' !== $smilia_link[0] ) : ?> + <li class="reviews-board__item"> + <a class="reviews-board__link" href="<?php echo esc_url( $smilia_link[0] ); ?>" target="_blank" rel="noopener"> + <span class="reviews-board__chip reviews-board__chip--<?php echo esc_attr( $smilia_key ); ?>"> + <?php Markup::asset_svg( $smilia_sources[ $smilia_key ][0], 'reviews-board__chip-logo', '' ); ?> + </span> + <?php echo Markup::text( $smilia_link[1] ); ?> + </a> + </li> + <?php endif; ?> + <?php endforeach; ?> + </ul> + </div> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/reviews-board/style.css b/wp-content/plugins/smilia-core/src/blocks/reviews-board/style.css new file mode 100644 index 0000000..35dc50f --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/reviews-board/style.css @@ -0,0 +1,352 @@ +.reviews-board { + --reviews-board-per: 3; + --reviews-board-page: 0; + --reviews-board-gap: 3.5rem; + --reviews-board-ink: #f4f4ef; + --reviews-board-line: color-mix(in srgb, var(--reviews-board-ink) 85%, transparent); + --reviews-board-chip: #ecebe4; + --reviews-board-decor: 13.75rem; + padding-bottom: var(--space-24); + position: relative; + overflow: hidden; + background: #2b2d2c var(--reviews-board-bg, none) center / cover no-repeat; + color: var(--reviews-board-ink); + font-family: var(--font-hand); + text-align: center; + text-shadow: 0 0 1px color-mix(in srgb, var(--reviews-board-ink) 45%, transparent); +} + +.reviews-board__decor { + position: absolute; + top: 0; + z-index: 0; + width: var(--reviews-board-decor); + height: 100%; + object-fit: contain; + pointer-events: none; +} + +.reviews-board__decor--left { + left: 0; + object-position: left top; +} + +.reviews-board__decor--right { + right: 0; + object-position: right top; +} + +.reviews-board__head, +.reviews-board__body, +.reviews-board__cta { + position: relative; + z-index: 1; +} + +.reviews-board__head { + display: flex; + flex-direction: column; + align-items: center; + gap: var(--space-4); + padding-block: var(--space-6) var(--space-8); +} + +.reviews-board .wp-block-breadcrumbs { + max-width: none; + padding: 0; + color: color-mix(in srgb, var(--reviews-board-ink) 82%, transparent); + font-family: var(--font-hand); + font-size: var(--text-xl); + font-weight: var(--font-weight-normal); + text-shadow: none; +} + +.reviews-board .wp-block-breadcrumbs li { + font-weight: var(--font-weight-normal); +} + +.reviews-board .wp-block-breadcrumbs a { + color: inherit; +} + +.reviews-board .wp-block-breadcrumbs ol { + align-items: center; + justify-content: center; + column-gap: var(--space-3); +} + +.reviews-board .wp-block-breadcrumbs span[aria-current] { + color: var(--color-accent-light); +} + +.reviews-board__title { + font-size: clamp(var(--text-6xl), 9vw, var(--text-8xl)); + font-weight: var(--font-weight-normal); + line-height: var(--leading-tight); +} + +.reviews-board__lead { + text-wrap: balance; + color: var(--color-on-dark-muted); + font-size: clamp(var(--text-xl), 3vw, var(--text-3xl)); + line-height: var(--leading-snug); +} + +.reviews-board__body { + padding-block: var(--space-6) var(--space-16); +} + +.reviews-board__viewport { + touch-action: pan-y; + margin-inline: calc(var(--space-3) * -1); + padding: var(--space-3); + overflow: hidden; +} + +.reviews-board__track { + display: flex; + flex-wrap: wrap; + align-items: flex-start; + gap: var(--reviews-board-gap); +} + +.reviews-board--ready .reviews-board__track { + flex-wrap: nowrap; + transform: translateX(calc(var(--reviews-board-page) * (-100% - var(--reviews-board-gap)))); + transition: transform 0.5s ease; +} + +.reviews-board__review { + display: flex; + flex: none; + flex-direction: column; + align-items: flex-start; + gap: var(--space-4); + width: calc((100% - (var(--reviews-board-per) - 1) * var(--reviews-board-gap)) / var(--reviews-board-per)); + text-align: left; +} + +.reviews-board__review:nth-child(3n + 1) { + --reviews-board-chalk: var(--color-accent-light); + rotate: -0.8deg; +} + +.reviews-board__review:nth-child(3n + 2) { + --reviews-board-chalk: var(--color-pink-200); + rotate: 0.6deg; +} + +.reviews-board__review:nth-child(3n) { + --reviews-board-chalk: var(--color-yellow-200); + rotate: -0.4deg; +} + +.reviews-board__who { + display: flex; + align-items: center; + gap: var(--space-3); +} + +.reviews-board__name { + color: var(--reviews-board-chalk); + font-size: var(--text-3xl); + line-height: var(--leading-tight); +} + +.reviews-board__source { + display: flex; + flex: none; + align-items: center; + justify-content: center; + min-width: 1.75rem; + height: 1.75rem; + padding-inline: var(--space-1); + background: var(--reviews-board-chip); + border-radius: var(--radius-full); +} + +.reviews-board__logo { + display: block; + width: auto; + height: 0.875rem; +} + +.reviews-board__logo--booksy { + height: 0.75rem; + margin-inline: var(--space-2); +} + +.reviews-board__stars { + display: block; + width: 5.625em; + height: 1em; + margin-top: calc(var(--space-1) * -1); + background: var(--reviews-board-chalk); + font-size: var(--text-2xl); + -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24'%3E%3Cpath d='M13.5 1.5l3 6.8 7.3.6-5.5 4.8 1.7 7.2-6.5-3.9-6.5 3.9 1.7-7.2L3.2 8.9l7.3-.6z'/%3E%3C/svg%3E") left center / 1.125em 1em repeat-x; + mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27 24'%3E%3Cpath d='M13.5 1.5l3 6.8 7.3.6-5.5 4.8 1.7 7.2-6.5-3.9-6.5 3.9 1.7-7.2L3.2 8.9l7.3-.6z'/%3E%3C/svg%3E") left center / 1.125em 1em repeat-x; +} + +.reviews-board__text { + font-size: var(--text-2xl); + line-height: var(--leading-relaxed); + text-wrap: pretty; +} + +.reviews-board__pager { + display: flex; + align-items: center; + justify-content: center; + gap: var(--space-5); + margin-top: var(--space-16); +} + +.reviews-board__pager[hidden] { + display: none; +} + +.reviews-board__arrow { + width: 3.5rem; + height: 3.5rem; + background: transparent; + border: 2px solid var(--reviews-board-line); + border-radius: var(--radius-full); + color: var(--reviews-board-ink); + font: inherit; + font-size: var(--text-3xl); + line-height: 1; + cursor: pointer; +} + +.reviews-board__arrow[aria-disabled="true"] { + opacity: 0.4; + cursor: default; +} + +.reviews-board__arrow:active:not([aria-disabled="true"]) { + transform: scale(0.97); +} + +.reviews-board__count { + min-width: 4.5rem; + font-size: var(--text-3xl); + line-height: 1; +} + +.reviews-board__cta { + display: flex; + flex-direction: column; + align-items: center; + gap: var(--space-7); +} + +.reviews-board__cta::before { + content: ""; + width: 7.5rem; + border-top: 2px dashed color-mix(in srgb, var(--reviews-board-ink) 45%, transparent); +} + +.reviews-board__cta-text { + max-width: 40rem; + font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); + line-height: var(--leading-snug); + text-wrap: pretty; +} + +.reviews-board__links { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: var(--space-4); +} + +.reviews-board__link { + display: inline-flex; + align-items: center; + gap: var(--space-3); + min-height: 3.5rem; + padding: var(--space-3) var(--space-6) var(--space-3) var(--space-3); + border: 2px solid var(--reviews-board-line); + border-radius: var(--radius-full); + color: var(--reviews-board-ink); + font-size: var(--text-2xl); + line-height: 1; +} + +.reviews-board__chip { + display: flex; + flex: none; + align-items: center; + justify-content: center; + width: 2rem; + height: 2rem; + background: var(--reviews-board-chip); + border-radius: var(--radius-full); +} + +.reviews-board__chip--booksy { + width: 4.75rem; +} + +.reviews-board__chip-logo { + display: block; + width: 1rem; + height: auto; +} + +.reviews-board__chip--booksy .reviews-board__chip-logo { + width: 3.375rem; +} + +.reviews-board__chip--znanylekarz .reviews-board__chip-logo { + width: 1.125rem; +} + +@media (hover: hover) { + .reviews-board__arrow:hover:not([aria-disabled="true"]), + .reviews-board__link:hover { + background: color-mix(in srgb, var(--reviews-board-ink) 10%, transparent); + } +} + +@media (max-width: 1199px) { + .reviews-board__decor { + display: none; + } +} + +@media (max-width: 980px) { + .reviews-board { + --reviews-board-per: 2; + --reviews-board-gap: var(--space-10); + } +} + +@media (max-width: 560px) { + .reviews-board { + --reviews-board-per: 1; + --reviews-board-gap: var(--space-8); + padding-bottom: var(--space-16); + } + + .reviews-board__links { + flex-direction: column; + align-items: stretch; + width: 100%; + } + + .reviews-board__item { + display: flex; + } + + .reviews-board__link { + flex: 1; + font-size: var(--text-xl); + } +} + +@media (prefers-reduced-motion: reduce) { + .reviews-board--ready .reviews-board__track { + transition: none; + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/reviews-board/view.js b/wp-content/plugins/smilia-core/src/blocks/reviews-board/view.js new file mode 100644 index 0000000..a872f11 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/reviews-board/view.js @@ -0,0 +1,108 @@ +( () => { + const boards = document.querySelectorAll( '[data-reviews-board]' ); + + boards.forEach( ( board ) => { + const body = board.querySelector( '.reviews-board__body' ); + const viewport = board.querySelector( '.reviews-board__viewport' ); + const track = board.querySelector( '[data-reviews-track]' ); + const pager = board.querySelector( '[data-reviews-pager]' ); + const prev = board.querySelector( '[data-reviews-prev]' ); + const next = board.querySelector( '[data-reviews-next]' ); + const count = board.querySelector( '[data-reviews-count]' ); + if ( ! track || ! pager ) { + return; + } + + const cards = Array.from( track.children ); + let page = 0; + let per = 0; + let frame = 0; + let startX = null; + let startY = null; + + const perPage = () => + parseInt( + window + .getComputedStyle( board ) + .getPropertyValue( '--reviews-board-per' ), + 10 + ) || 3; + + const render = () => { + const current = perPage(); + if ( per && per !== current ) { + page = Math.floor( ( page * per ) / current ); + } + per = current; + const total = Math.max( 1, Math.ceil( cards.length / per ) ); + page = Math.min( page, total - 1 ); + board.style.setProperty( '--reviews-board-page', page ); + count.textContent = `${ page + 1 } / ${ total }`; + prev.setAttribute( 'aria-disabled', String( 0 === page ) ); + next.setAttribute( 'aria-disabled', String( page === total - 1 ) ); + pager.hidden = total < 2; + cards.forEach( ( card, index ) => { + card.inert = index < page * per || index >= ( page + 1 ) * per; + } ); + }; + + const go = ( step ) => { + page = Math.max( 0, page + step ); + render(); + }; + + const press = ( button, step ) => { + button.addEventListener( 'click', () => { + if ( 'true' !== button.getAttribute( 'aria-disabled' ) ) { + go( step ); + } + } ); + }; + + press( prev, -1 ); + press( next, 1 ); + + viewport.addEventListener( 'pointerdown', ( event ) => { + if ( 'mouse' === event.pointerType || ! event.isPrimary ) { + return; + } + startX = event.clientX; + startY = event.clientY; + } ); + viewport.addEventListener( 'pointerup', ( event ) => { + if ( null === startX ) { + return; + } + const dx = event.clientX - startX; + const dy = event.clientY - startY; + startX = null; + if ( Math.abs( dx ) > 50 && Math.abs( dx ) > Math.abs( dy ) * 1.5 ) { + go( dx < 0 ? 1 : -1 ); + } + } ); + viewport.addEventListener( 'pointercancel', () => { + startX = null; + } ); + + body.addEventListener( 'keydown', ( event ) => { + if ( event.altKey || event.ctrlKey || event.metaKey || event.shiftKey ) { + return; + } + if ( 'ArrowLeft' === event.key ) { + event.preventDefault(); + go( -1 ); + } else if ( 'ArrowRight' === event.key ) { + event.preventDefault(); + go( 1 ); + } + } ); + + window.addEventListener( 'resize', () => { + window.cancelAnimationFrame( frame ); + frame = window.requestAnimationFrame( render ); + } ); + + board.classList.add( 'reviews-board--ready' ); + render(); + } ); +} )(); diff --git a/wp-content/plugins/smilia-core/src/blocks/reviews/block.json b/wp-content/plugins/smilia-core/src/blocks/reviews/block.json new file mode 100644 index 0000000..8047303 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/reviews/block.json @@ -0,0 +1,54 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/reviews", + "title": "Отзывы", + "category": "smilia", + "icon": "format-quote", + "description": "Заголовок, три отзыва из раздела «Отзывы», ссылка и фото.", + "textdomain": "smilia-core", + "attributes": { + "title": { + "type": "string", + "role": "content", + "default": "Родители о Smilia" + }, + "moreText": { + "type": "string", + "role": "content", + "default": "Все отзывы" + }, + "moreLink": { + "type": "string", + "default": "/reviews/" + }, + "imageId": { + "type": "number", + "role": "content", + "default": 0 + }, + "imageAlt": { + "type": "string", + "role": "content", + "default": "Мама с дочкой" + }, + "part": { + "type": "string", + "enum": [ + "all", + "list" + ], + "default": "all" + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/reviews/edit.js b/wp-content/plugins/smilia-core/src/blocks/reviews/edit.js new file mode 100644 index 0000000..3fc8ce4 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/reviews/edit.js @@ -0,0 +1,98 @@ +import { __ } from '@wordpress/i18n'; +import { + BlockControls, + InspectorControls, + MediaReplaceFlow, + useBlockProps, +} from '@wordpress/block-editor'; +import { PanelBody, TextControl } from '@wordpress/components'; +import PlainText from '../../shared/plain-text'; +import ServerPreview from '../../shared/server-preview'; +import ManageButton from '../../shared/manage-button'; +import { useImageUrl } from '../../shared/images'; + +export default function Edit( { attributes, setAttributes } ) { + const fields = { attributes, setAttributes }; + const imageUrl = useImageUrl( attributes.imageId, 'smilia-800' ); + + return ( + <> + <ManageButton + postType="smilia_review" + label={ __( 'Изменить отзывы', 'smilia-core' ) } + /> + <BlockControls group="other"> + <MediaReplaceFlow + mediaId={ attributes.imageId } + mediaURL={ imageUrl } + allowedTypes={ [ 'image' ] } + accept="image/*" + name={ __( 'Заменить фото', 'smilia-core' ) } + onSelect={ ( media ) => + setAttributes( { imageId: media.id } ) + } + /> + </BlockControls> + <InspectorControls> + <PanelBody title={ __( 'Фото', 'smilia-core' ) }> + <TextControl + __next40pxDefaultSize + __nextHasNoMarginBottom + label={ __( 'Описание фото', 'smilia-core' ) } + help={ __( + 'Что на фото: для поисковиков и незрячих посетителей.', + 'smilia-core' + ) } + value={ attributes.imageAlt } + onChange={ ( value ) => + setAttributes( { imageAlt: value } ) + } + /> + </PanelBody> + <PanelBody title={ __( 'Ссылка на все отзывы', 'smilia-core' ) }> + <TextControl + __next40pxDefaultSize + __nextHasNoMarginBottom + label={ __( 'Адрес', 'smilia-core' ) } + value={ attributes.moreLink } + onChange={ ( value ) => + setAttributes( { moreLink: value } ) + } + /> + </PanelBody> + </InspectorControls> + <section + { ...useBlockProps( { + className: 'section section--soft reviews', + } ) } + > + <div className="container reviews__layout"> + <div className="reviews__main"> + <PlainText + { ...fields } + attribute="title" + tagName="h2" + className="section__title reviews__title" + placeholder={ __( 'Заголовок раздела', 'smilia-core' ) } + /> + <ServerPreview block="smilia/reviews" part="list" editable /> + <PlainText + { ...fields } + attribute="moreText" + tagName="span" + className="link-underline reviews__more" + placeholder={ __( 'Текст ссылки', 'smilia-core' ) } + /> + </div> + { imageUrl && ( + <img + className="reviews__photo" + src={ imageUrl } + alt={ attributes.imageAlt } + /> + ) } + </div> + </section> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/reviews/index.js b/wp-content/plugins/smilia-core/src/blocks/reviews/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/reviews/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/reviews/list.php b/wp-content/plugins/smilia-core/src/blocks/reviews/list.php new file mode 100644 index 0000000..e8c3aaa --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/reviews/list.php @@ -0,0 +1,39 @@ +<?php + +use Smilia\Core\Markup; +use Smilia\Core\Settings; + +defined( 'ABSPATH' ) || exit; + +$smilia_sources = array( + 'google' => array( 'reviews/google-g.svg', 'Google' ), + 'booksy' => array( 'reviews/booksy.svg', 'Booksy' ), + 'znanylekarz' => array( 'reviews/znanylekarz-mark.svg', 'ZnanyLekarz' ), +); +?> +<ul class="reviews__list"> + <?php foreach ( $smilia_reviews as $smilia_review ) : ?> + <li class="review" data-reveal<?php echo Markup::edit_link( (int) $smilia_review['id'], $attributes ); ?>> + <?php Markup::edit_button( (int) $smilia_review['id'], $attributes ); ?> + <?php if ( $smilia_review['topic'] ) : ?> + <span class="review__topic"><?php echo esc_html( $smilia_review['topic'] ); ?></span> + <?php endif; ?> + <blockquote class="review__text"><p><?php echo esc_html( $smilia_review['text'] ); ?></p></blockquote> + <?php + $smilia_known = isset( $smilia_sources[ $smilia_review['source'] ] ); + $smilia_url = $smilia_known ? Settings::get( 'review_' . $smilia_review['source'] ) : ''; + ob_start(); + ?> + <span class="review__author"><?php echo esc_html( $smilia_review['author'] ); ?></span> + <?php if ( $smilia_known ) : ?> + <?php Markup::asset_svg( $smilia_sources[ $smilia_review['source'] ][0], 'review__source review__source--' . $smilia_review['source'], $smilia_sources[ $smilia_review['source'] ][1] ); ?> + <?php endif; ?> + <?php $smilia_meta = (string) ob_get_clean(); ?> + <?php if ( $smilia_url ) : ?> + <a class="review__meta review__meta--link" href="<?php echo esc_url( $smilia_url ); ?>" target="_blank" rel="noopener"><?php echo $smilia_meta; ?></a> + <?php else : ?> + <span class="review__meta"><?php echo $smilia_meta; ?></span> + <?php endif; ?> + </li> + <?php endforeach; ?> +</ul> diff --git a/wp-content/plugins/smilia-core/src/blocks/reviews/render.php b/wp-content/plugins/smilia-core/src/blocks/reviews/render.php new file mode 100644 index 0000000..2719c76 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/reviews/render.php @@ -0,0 +1,36 @@ +<?php + +use Smilia\Core\Content; +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +$smilia_reviews = Content::reviews( 3 ); +if ( ! $smilia_reviews ) { + return; +} +if ( 'list' === $attributes['part'] ) { + require __DIR__ . '/list.php'; + return; +} +?> +<section class="section section--soft reviews" id="reviews"> + <div class="container reviews__layout"> + <div class="reviews__main"> + <h2 class="section__title reviews__title"><?php echo Markup::text( $attributes['title'] ); ?></h2> + <?php require __DIR__ . '/list.php'; ?> + <a class="link-underline reviews__more" href="<?php echo Markup::link( $attributes['moreLink'] ); ?>"><?php echo Markup::text( $attributes['moreText'] ); ?></a> + </div> + <?php + Markup::image( + (int) $attributes['imageId'], + 'smilia-800', + '340px', + array( + 'class' => 'reviews__photo', + 'alt' => wp_strip_all_tags( $attributes['imageAlt'] ), + ) + ); + ?> + </div> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/reviews/style.css b/wp-content/plugins/smilia-core/src/blocks/reviews/style.css new file mode 100644 index 0000000..a950131 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/reviews/style.css @@ -0,0 +1,138 @@ +.reviews__layout { + display: grid; + grid-template-columns: 1fr 21.25rem; + gap: var(--space-12); + align-items: start; +} + +.reviews__title { + margin-bottom: var(--space-head); + text-align: left; +} + +.reviews__list { + display: flex; + flex-direction: column; + gap: var(--space-8); + max-width: 51rem; +} + +.review { + --review-line: var(--color-accent-light); + display: flex; + flex-direction: column; + gap: var(--space-2); + padding-left: var(--space-6); + border-left: 4px solid var(--review-line); +} + +.review:nth-child(3n + 2) { + --review-line: var(--color-pink-300); +} + +.review:nth-child(3n) { + --review-line: var(--color-yellow-300); +} + +.review__topic { + color: var(--color-accent-hover); + font-size: var(--fs-caption); + font-weight: var(--font-weight-extrabold); + letter-spacing: var(--tracking-wide); + text-transform: uppercase; +} + +.review__text { + color: var(--color-text-strong); + font-size: var(--text-lg); + line-height: 1.58; + text-wrap: pretty; +} + +.review__meta { + display: flex; + align-items: center; + gap: var(--space-2); +} + +.review__meta--link { + width: fit-content; +} + +@media (pointer: coarse) { + .review__meta--link { + padding-block: var(--space-3); + } +} + +@media (hover: hover) { + .review__meta--link:hover .review__author { + text-decoration: underline; + text-underline-offset: 0.2em; + } +} + +.review__author { + color: var(--color-accent-strong); + font-weight: var(--font-weight-extrabold); +} + +.review__source { + width: auto; + height: 0.9375rem; +} + +.review__source--booksy { + opacity: 0.75; +} + +.reviews__more { + display: inline-block; + margin-top: var(--space-8); +} + +.reviews__photo { + width: 100%; + height: 32.5rem; + margin-top: var(--space-24); + object-fit: cover; + object-position: 22% top; + border-radius: 2.75rem; +} + +@media (max-width: 980px) { + .reviews__layout { + grid-template-columns: 1fr; + gap: 0; + } + + .reviews__main { + display: contents; + } + + .reviews__title { + order: 1; + } + + .reviews__list { + order: 3; + } + + .reviews__more { + order: 4; + } + + .reviews__photo { + order: 2; + height: auto; + aspect-ratio: 3 / 2; + margin: 0 0 var(--space-head); + border-radius: var(--radius-2xl); + } +} + +@media (max-width: 560px) { + .review__text { + font-size: var(--text-base); + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/service-page/block.json b/wp-content/plugins/smilia-core/src/blocks/service-page/block.json new file mode 100644 index 0000000..f2a6814 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/service-page/block.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/service-page", + "title": "Страница услуги", + "category": "smilia", + "icon": "heart", + "description": "Шапка услуги, когда записаться, как проходит приём и методы со стоимостью.", + "textdomain": "smilia-core", + "attributes": { + "intro": { "type": "string", "role": "content", "default": "" }, + "button": { "type": "string", "role": "content", "default": "Записаться на приём" }, + "imageId": { "type": "number", "role": "content", "default": 0 }, + "illustration": { "type": "string", "role": "content", "default": "tooth-cleaning" }, + "signsTitle": { "type": "string", "role": "content", "default": "" }, + "signs": { "type": "array", "role": "content", "items": { "type": "string" }, "default": [] }, + "stepsTitle": { "type": "string", "role": "content", "default": "Как проходит приём" }, + "steps": { "type": "array", "role": "content", "items": { "type": "object" }, "default": [] }, + "methodsTitle": { "type": "string", "role": "content", "default": "" }, + "methods": { "type": "array", "role": "content", "items": { "type": "object" }, "default": [] } + }, + "usesContext": [ "postId" ], + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/service-page/edit.js b/wp-content/plugins/smilia-core/src/blocks/service-page/edit.js new file mode 100644 index 0000000..b2be7ec --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/service-page/edit.js @@ -0,0 +1,171 @@ +import { __ } from '@wordpress/i18n'; +import { + BlockControls, + InspectorControls, + MediaReplaceFlow, + MediaUpload, + MediaUploadCheck, + useBlockProps, +} from '@wordpress/block-editor'; +import { + Button, + Disabled, + PanelBody, + TextControl, + TextareaControl, +} from '@wordpress/components'; +import ServerSideRender from '@wordpress/server-side-render'; +import { useImageUrl } from '../../shared/images'; + +function Rows( { label, rows, fields, onChange, blank } ) { + const change = ( index, key, value ) => + onChange( + rows.map( ( row, i ) => + i === index ? { ...row, [ key ]: value } : row + ) + ); + + return ( + <PanelBody title={ label } initialOpen={ false }> + { rows.map( ( row, index ) => ( + <div key={ index }> + { fields.map( ( [ key, name, area ] ) => { + if ( 'imageId' === key ) { + return ( + <MediaUploadCheck key={ key }> + <MediaUpload + allowedTypes={ [ 'image' ] } + value={ row.imageId } + onSelect={ ( media ) => + change( index, 'imageId', media.id ) + } + render={ ( { open } ) => ( + <Button variant="secondary" onClick={ open }> + { name } + </Button> + ) } + /> + </MediaUploadCheck> + ); + } + const Control = area ? TextareaControl : TextControl; + return ( + <Control + __nextHasNoMarginBottom + key={ key } + label={ name } + value={ row[ key ] || '' } + onChange={ ( value ) => change( index, key, value ) } + /> + ); + } ) } + <Button + isDestructive + variant="link" + onClick={ () => + onChange( rows.filter( ( item, i ) => i !== index ) ) + } + > + { __( 'Убрать', 'smilia-core' ) } + </Button> + </div> + ) ) } + <Button + variant="secondary" + onClick={ () => onChange( [ ...rows, blank ] ) } + > + { __( 'Добавить', 'smilia-core' ) } + </Button> + </PanelBody> + ); +} + +export default function Edit( { attributes, setAttributes } ) { + const blockProps = useBlockProps(); + const imageUrl = useImageUrl( attributes.imageId, 'smilia-800' ); + const text = ( key, name, area ) => { + const Control = area ? TextareaControl : TextControl; + return ( + <Control + __nextHasNoMarginBottom + label={ name } + value={ attributes[ key ] } + onChange={ ( value ) => setAttributes( { [ key ]: value } ) } + /> + ); + }; + + return ( + <> + <BlockControls group="other"> + <MediaReplaceFlow + mediaId={ attributes.imageId } + mediaURL={ imageUrl } + allowedTypes={ [ 'image' ] } + accept="image/*" + name={ __( 'Заменить фото', 'smilia-core' ) } + onSelect={ ( media ) => setAttributes( { imageId: media.id } ) } + /> + </BlockControls> + <InspectorControls> + <PanelBody title={ __( 'Шапка', 'smilia-core' ) }> + { text( 'intro', __( 'Описание', 'smilia-core' ), true ) } + { text( 'button', __( 'Кнопка', 'smilia-core' ) ) } + </PanelBody> + <PanelBody + title={ __( 'Когда записаться', 'smilia-core' ) } + initialOpen={ false } + > + { text( 'signsTitle', __( 'Заголовок', 'smilia-core' ) ) } + <TextareaControl + __nextHasNoMarginBottom + label={ __( 'Пункты, каждый с новой строки', 'smilia-core' ) } + value={ attributes.signs.join( '\n' ) } + onChange={ ( value ) => + setAttributes( { signs: value.split( '\n' ) } ) + } + /> + </PanelBody> + <PanelBody + title={ __( 'Заголовки приёма и методов', 'smilia-core' ) } + initialOpen={ false } + > + { text( 'stepsTitle', __( 'Заголовок приёма', 'smilia-core' ) ) } + { text( 'methodsTitle', __( 'Заголовок методов', 'smilia-core' ) ) } + </PanelBody> + <Rows + label={ __( 'Шаги приёма', 'smilia-core' ) } + rows={ attributes.steps } + fields={ [ + [ 'title', __( 'Название', 'smilia-core' ) ], + [ 'text', __( 'Описание', 'smilia-core' ), true ], + ] } + blank={ { title: '', text: '' } } + onChange={ ( steps ) => setAttributes( { steps } ) } + /> + <Rows + label={ __( 'Методы и стоимость', 'smilia-core' ) } + rows={ attributes.methods } + fields={ [ + [ 'title', __( 'Название', 'smilia-core' ) ], + [ 'when', __( 'Когда подходит', 'smilia-core' ) ], + [ 'text', __( 'Как проходит', 'smilia-core' ), true ], + [ 'benefits', __( 'Польза, каждый пункт с новой строки', 'smilia-core' ), true ], + [ 'price', __( 'Цена', 'smilia-core' ) ], + [ 'imageId', __( 'Выбрать фото', 'smilia-core' ) ], + ] } + blank={ { title: '', when: '', text: '', benefits: '', price: '', imageId: 0 } } + onChange={ ( methods ) => setAttributes( { methods } ) } + /> + </InspectorControls> + <div { ...blockProps }> + <Disabled> + <ServerSideRender + block="smilia/service-page" + attributes={ attributes } + /> + </Disabled> + </div> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/service-page/index.js b/wp-content/plugins/smilia-core/src/blocks/service-page/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/service-page/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/service-page/render.php b/wp-content/plugins/smilia-core/src/blocks/service-page/render.php new file mode 100644 index 0000000..bb39709 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/service-page/render.php @@ -0,0 +1,130 @@ +<?php + +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +$smilia_lines = static fn( string $value ): array => array_values( array_filter( array_map( 'trim', (array) preg_split( '/\R/u', wp_strip_all_tags( $value ) ) ) ) ); +$smilia_text = static fn( array $row, string $key ): string => esc_html( wp_strip_all_tags( (string) ( $row[ $key ] ?? '' ) ) ); + +$smilia_signs = $smilia_lines( implode( "\n", array_map( 'strval', (array) $attributes['signs'] ) ) ); +$smilia_steps = array_values( array_filter( (array) $attributes['steps'], 'is_array' ) ); +$smilia_methods = array_values( array_filter( (array) $attributes['methods'], 'is_array' ) ); +$smilia_post_id = (int) ( $block->context['postId'] ?? get_the_ID() ); +$smilia_art = sanitize_key( (string) $attributes['illustration'] ); +$smilia_has_art = '' !== $smilia_art && is_readable( SMILIA_CORE_DIR . '/assets/img/service/' . $smilia_art . '.svg' ); +$smilia_crumbs = render_block( + array( + 'blockName' => 'core/breadcrumbs', + 'attrs' => array( 'separator' => '›', 'className' => 'wp-block-breadcrumbs--flush service-page__crumbs' ), + 'innerBlocks' => array(), + 'innerHTML' => '', + 'innerContent' => array(), + ) +); +?> +<div class="service-page"> + <section class="service-page__section service-page__hero container"> + <?php echo wp_kses_post( $smilia_crumbs ); ?> + <h1 class="service-page__title"><?php echo esc_html( get_the_title( $smilia_post_id ) ); ?></h1> + <div class="service-page__hero-grid"> + <div class="service-page__hero-text"> + <p class="service-page__intro"><?php echo Markup::text( $attributes['intro'] ); ?></p> + <button type="button" class="button button--primary button--lg service-page__cta" data-booking-open><?php echo Markup::text( $attributes['button'] ); ?></button> + </div> + <?php if ( (int) $attributes['imageId'] > 0 ) : ?> + <div class="service-page__frame"> + <?php + Markup::image( + (int) $attributes['imageId'], + 'smilia-800', + '(min-width: 62rem) 32rem, 90vw', + array( + 'class' => 'service-page__photo', + 'loading' => 'eager', + 'fetchpriority' => 'high', + ) + ); + ?> + </div> + <?php endif; ?> + </div> + </section> + <?php if ( $smilia_signs ) : ?> + <section class="service-page__section service-page__signs container"> + <div class="service-page__signs-box<?php echo $smilia_has_art ? '' : ' service-page__signs-box--plain'; ?>" data-reveal> + <div class="service-page__signs-body"> + <h2 class="service-page__heading service-page__heading--compact"><?php echo Markup::text( $attributes['signsTitle'] ); ?></h2> + <ul class="service-page__signs-list"> + <?php foreach ( $smilia_signs as $smilia_sign ) : ?> + <li class="service-page__sign"><?php echo esc_html( $smilia_sign ); ?></li> + <?php endforeach; ?> + </ul> + </div> + <?php if ( $smilia_has_art ) : ?> + <img class="service-page__tooth" src="<?php echo esc_url( Markup::asset( 'service/' . $smilia_art . '.svg' ) ); ?>" alt="" width="210" height="210" loading="lazy" decoding="async"> + <?php endif; ?> + </div> + </section> + <?php endif; ?> + <?php if ( $smilia_steps ) : ?> + <section class="service-page__section service-page__steps container"> + <h2 class="service-page__heading"><?php echo Markup::text( $attributes['stepsTitle'] ); ?></h2> + <ol class="service-page__steps-list"> + <?php foreach ( $smilia_steps as $smilia_step ) : ?> + <li class="service-page__step" data-reveal> + <h3 class="service-page__step-title"><?php echo $smilia_text( $smilia_step, 'title' ); ?></h3> + <p class="service-page__step-text"><?php echo $smilia_text( $smilia_step, 'text' ); ?></p> + </li> + <?php endforeach; ?> + </ol> + </section> + <?php endif; ?> + <?php if ( $smilia_methods ) : ?> + <section class="service-page__section service-page__methods"> + <h2 class="service-page__heading service-page__heading--wide container"><?php echo Markup::text( $attributes['methodsTitle'] ); ?></h2> + <ul class="service-page__methods-list container"> + <?php foreach ( $smilia_methods as $smilia_index => $smilia_method ) : ?> + <?php $smilia_benefits = $smilia_lines( (string) ( $smilia_method['benefits'] ?? '' ) ); ?> + <li class="service-page__method service-page__method--<?php echo (int) ( $smilia_index % 3 ) + 1; ?><?php echo 1 === $smilia_index % 2 ? ' service-page__method--reverse' : ''; ?>"> + <div class="service-page__method-picture"> + <?php + $smilia_image_id = (int) ( $smilia_method['imageId'] ?? 0 ); + $smilia_dims = $smilia_image_id > 0 ? wp_get_attachment_metadata( $smilia_image_id ) : array(); + $smilia_ratio = ! empty( $smilia_dims['width'] ) && ! empty( $smilia_dims['height'] ) ? (float) $smilia_dims['width'] / (float) $smilia_dims['height'] : 1.0; + Markup::image( + $smilia_image_id, + 'smilia-800', + sprintf( '(min-width: 62rem) max(50vw, %1$.1frem), max(100vw, %2$.1frem)', $smilia_ratio * 28, $smilia_ratio * 14 ), + array( + 'class' => 'service-page__method-photo', + 'alt' => '', + ) + ); + ?> + </div> + <div class="service-page__method-body"> + <h3 class="service-page__method-title"><?php echo $smilia_text( $smilia_method, 'title' ); ?></h3> + <?php if ( '' !== $smilia_text( $smilia_method, 'when' ) ) : ?> + <p class="service-page__method-when"><?php echo $smilia_text( $smilia_method, 'when' ); ?></p> + <?php endif; ?> + <?php if ( '' !== $smilia_text( $smilia_method, 'text' ) ) : ?> + <p class="service-page__method-text"><?php echo $smilia_text( $smilia_method, 'text' ); ?></p> + <?php endif; ?> + <?php if ( $smilia_benefits ) : ?> + <ul class="service-page__method-benefits"> + <?php foreach ( $smilia_benefits as $smilia_benefit ) : ?> + <li class="service-page__method-benefit"><?php echo esc_html( $smilia_benefit ); ?></li> + <?php endforeach; ?> + </ul> + <?php endif; ?> + <?php if ( '' !== $smilia_text( $smilia_method, 'price' ) ) : ?> + <p class="service-page__method-price"><?php echo $smilia_text( $smilia_method, 'price' ); ?></p> + <?php endif; ?> + </div> + </li> + <?php endforeach; ?> + </ul> + </section> + <?php endif; ?> +</div> diff --git a/wp-content/plugins/smilia-core/src/blocks/service-page/style.css b/wp-content/plugins/smilia-core/src/blocks/service-page/style.css new file mode 100644 index 0000000..1f15182 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/service-page/style.css @@ -0,0 +1,385 @@ +.service-page { + --service-page-gap: var(--space-16); + --service-page-heading: var(--color-accent-strong); + --service-page-tile: 20rem; + padding-bottom: var(--service-page-gap); +} + +.service-page__section + .service-page__section { + margin-top: var(--service-page-gap); +} + +.service-page__crumbs { + margin-bottom: var(--space-4); +} + +.service-page__hero { + padding-top: var(--space-6); +} + +.service-page__title { + max-width: 51rem; + color: var(--service-page-heading); + font-size: clamp(var(--text-4xl), 4vw, 2.75rem); + font-weight: var(--font-weight-extrabold); + line-height: 1.1; + text-wrap: pretty; +} + +.service-page__hero-grid { + display: grid; + grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); + gap: var(--space-12); + align-items: start; + margin-top: var(--space-10); +} + +.service-page__hero-text { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: var(--space-4); + padding-top: var(--space-1); +} + +.service-page__intro { + color: var(--color-text-muted); + font-size: var(--text-lg); + line-height: var(--leading-loose); + text-wrap: pretty; +} + +.service-page__cta { + margin-top: var(--space-1); +} + +.service-page__frame { + padding: 0.875rem; + border-radius: 2.5rem; + background: var(--color-highlight); +} + +.service-page__photo { + display: block; + width: 100%; + aspect-ratio: 1; + border-radius: 1.875rem; + object-fit: cover; +} + +.service-page__heading { + margin-bottom: var(--space-8); + color: var(--service-page-heading); + font-size: var(--text-3xl); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-tight); + text-wrap: pretty; +} + +.service-page__signs-box { + display: grid; + grid-template-columns: minmax(0, 1fr) 13rem; + gap: var(--space-12); + align-items: center; + padding: var(--space-12); + border-radius: 1.75rem; + background: var(--color-bg-soft); +} + +.service-page__signs-box--plain { + grid-template-columns: minmax(0, 1fr); +} + +.service-page__heading--compact { + margin-bottom: var(--space-6); +} + +.service-page__signs-list { + display: grid; + gap: var(--space-4); +} + +.service-page__sign { + display: flex; + gap: var(--space-3); + color: var(--color-text-body); + font-size: var(--text-lg); + line-height: var(--leading-relaxed); + text-wrap: pretty; +} + +.service-page__sign::before { + content: ""; + flex: none; + width: 1.125rem; + height: 1.125rem; + margin-top: 0.3em; + border-radius: var(--radius-full); + background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.4l2.6 2.6L13 6.6' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat, var(--color-accent); +} + +.service-page__tooth { + display: block; + width: 13rem; + height: auto; + justify-self: center; +} + +.service-page__steps-list { + display: grid; + grid-template-columns: repeat(4, minmax(0, 1fr)); + gap: var(--space-6); + counter-reset: step; +} + +.service-page__step { + position: relative; + display: flex; + flex-direction: column; + gap: var(--space-4); + counter-increment: step; +} + +.service-page__step::before { + content: counter(step); + display: flex; + align-items: center; + justify-content: center; + width: 3.375rem; + height: 3.375rem; + border-radius: var(--radius-full); + background: var(--color-accent); + color: var(--color-white); + font-size: var(--text-2xl); + font-weight: var(--font-weight-extrabold); +} + +.service-page__step:not(:last-child)::after { + content: ""; + position: absolute; + top: 1.625rem; + right: calc(var(--space-6) * -1); + left: 3.375rem; + height: 3px; + border-radius: var(--radius-full); + background: var(--color-line-soft); +} + +.service-page__step-title { + color: var(--color-text-body); + font-size: var(--text-lg); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-snug); +} + +.service-page__step-text { + color: var(--color-text-muted); + font-size: var(--text-base); + line-height: var(--leading-relaxed); + text-wrap: pretty; +} + +.service-page__heading--wide { + margin-bottom: var(--space-8); +} + +.service-page__methods-list { + display: grid; +} + +.service-page__method { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); +} + +.service-page__method-picture { + position: relative; + min-height: var(--service-page-tile); + overflow: hidden; +} + +.service-page__method--reverse .service-page__method-picture { + order: 1; +} + +.service-page__method-photo { + position: absolute; + inset: 0; + width: 100%; + height: 100%; + object-fit: cover; + object-position: 65% 50%; +} + +.service-page__method-body { + display: flex; + flex-direction: column; + justify-content: center; + gap: var(--space-3); + min-height: var(--service-page-tile); + padding: var(--space-10) var(--space-12); + background: var(--service-page-tile-bg); + color: var(--color-text-body); +} + +.service-page__method--1 { + --service-page-tile-bg: var(--color-teal-100); + --service-page-tile-ink: var(--color-teal-800); + --service-page-tile-price: var(--color-teal-700); +} + +.service-page__method--2 { + --service-page-tile-bg: var(--color-yellow-100); + --service-page-tile-ink: var(--color-yellow-900); + --service-page-tile-price: var(--color-yellow-900); +} + +.service-page__method--3 { + --service-page-tile-bg: var(--color-pink-100); + --service-page-tile-ink: var(--color-pink-700); + --service-page-tile-price: var(--color-pink-700); +} + +.service-page__method-title { + color: var(--service-page-tile-ink); + font-size: var(--text-2xl); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-snug); +} + +.service-page__method-text { + font-size: var(--text-lg); + line-height: var(--leading-relaxed); + text-wrap: pretty; +} + +.service-page__method-when { + color: var(--service-page-tile-price); + font-size: var(--text-base); + font-weight: var(--font-weight-bold); + line-height: var(--leading-snug); +} + +.service-page__method-benefits { + display: grid; + gap: var(--space-2); +} + +.service-page__method-benefit { + display: flex; + gap: var(--space-3); + font-size: var(--text-base); + line-height: var(--leading-normal); + text-wrap: pretty; +} + +.service-page__method-benefit::before { + content: "•"; + flex: none; + color: var(--service-page-tile-price); +} + +.service-page__method-price { + color: var(--service-page-tile-price); + font-size: var(--text-xl); + font-weight: var(--font-weight-extrabold); +} + +@media (max-width: 980px) { + .service-page { + --service-page-gap: var(--space-12); + } + + .service-page__hero-grid { + grid-template-columns: minmax(0, 1fr); + gap: var(--space-8); + } + + .service-page__signs-box { + padding: var(--space-8); + } + + .service-page__steps-list { + grid-template-columns: repeat(2, minmax(0, 1fr)); + row-gap: var(--space-8); + } + + .service-page__step:nth-child(even)::after { + display: none; + } +} + +@media (max-width: 760px) { + .service-page { + --service-page-tile: 14rem; + } + + .service-page__signs-box { + grid-template-columns: minmax(0, 1fr); + } + + .service-page__tooth { + display: none; + } + + .service-page__method { + grid-template-columns: minmax(0, 1fr); + } + + .service-page__method--reverse .service-page__method-picture { + order: 0; + } + + .service-page__method-body { + min-height: 0; + padding: var(--space-8) var(--space-6); + } +} + +@media (max-width: 560px) { + .service-page__signs-box { + padding: var(--space-6); + } + + .service-page__steps-list { + grid-template-columns: minmax(0, 1fr); + } + + .service-page__steps-list { + gap: var(--space-6); + } + + .service-page__step { + display: grid; + grid-template-columns: 3.375rem minmax(0, 1fr); + column-gap: var(--space-4); + row-gap: var(--space-2); + align-content: start; + } + + .service-page__step::before { + grid-row: 1 / span 2; + } + + .service-page__step-title { + align-self: center; + } + + .service-page__step-text { + grid-column: 2; + } + + .service-page__step:not(:last-child)::after { + display: block; + top: 3.375rem; + right: auto; + bottom: calc(var(--space-6) * -1); + left: calc(1.6875rem - 1.5px); + width: 3px; + height: auto; + } + + .service-page__cta { + width: 100%; + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/services/block.json b/wp-content/plugins/smilia-core/src/blocks/services/block.json new file mode 100644 index 0000000..62abe72 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/services/block.json @@ -0,0 +1,49 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/services", + "title": "Услуги", + "category": "smilia", + "icon": "list-view", + "description": "Заголовок, подзаголовок, плитки из раздела «Услуги» и кнопка.", + "textdomain": "smilia-core", + "attributes": { + "title": { + "type": "string", + "role": "content", + "default": "Услуги детской стоматологии" + }, + "lead": { + "type": "string", + "role": "content", + "default": "От первого знакомства с врачом до лечения и исправления прикуса." + }, + "buttonText": { + "type": "string", + "role": "content", + "default": "Все услуги и цены" + }, + "buttonLink": { + "type": "string", + "default": "/prices/" + }, + "part": { + "type": "string", + "enum": [ + "all", + "list" + ], + "default": "all" + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/services/edit.js b/wp-content/plugins/smilia-core/src/blocks/services/edit.js new file mode 100644 index 0000000..9012069 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/services/edit.js @@ -0,0 +1,63 @@ +import { __ } from '@wordpress/i18n'; +import { InspectorControls, useBlockProps } from '@wordpress/block-editor'; +import { PanelBody, TextControl } from '@wordpress/components'; +import PlainText from '../../shared/plain-text'; +import ServerPreview from '../../shared/server-preview'; +import ManageButton from '../../shared/manage-button'; + +export default function Edit( { attributes, setAttributes } ) { + const fields = { attributes, setAttributes }; + + return ( + <> + <ManageButton + postType="smilia_service" + label={ __( 'Изменить услуги', 'smilia-core' ) } + /> + <InspectorControls> + <PanelBody title={ __( 'Кнопка', 'smilia-core' ) }> + <TextControl + __next40pxDefaultSize + __nextHasNoMarginBottom + label={ __( 'Ссылка', 'smilia-core' ) } + help={ __( 'Адрес страницы, например /prices/.', 'smilia-core' ) } + value={ attributes.buttonLink } + onChange={ ( value ) => + setAttributes( { buttonLink: value } ) + } + /> + </PanelBody> + </InspectorControls> + <section { ...useBlockProps( { className: 'section services' } ) }> + <div className="container"> + <div className="section__head"> + <PlainText + { ...fields } + attribute="title" + tagName="h2" + className="section__title" + placeholder={ __( 'Заголовок раздела', 'smilia-core' ) } + /> + <PlainText + { ...fields } + attribute="lead" + tagName="p" + className="section__lead" + placeholder={ __( 'Подзаголовок', 'smilia-core' ) } + /> + </div> + <ServerPreview block="smilia/services" part="list" editable /> + <div className="services__more"> + <PlainText + { ...fields } + attribute="buttonText" + tagName="span" + className="button button--primary" + placeholder={ __( 'Текст кнопки', 'smilia-core' ) } + /> + </div> + </div> + </section> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/services/index.js b/wp-content/plugins/smilia-core/src/blocks/services/index.js new file mode 100644 index 0000000..3476639 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/services/index.js @@ -0,0 +1,8 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/services/list.php b/wp-content/plugins/smilia-core/src/blocks/services/list.php new file mode 100644 index 0000000..eed0e31 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/services/list.php @@ -0,0 +1,33 @@ +<?php + +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +?> +<ul class="services__grid"> + <?php foreach ( $smilia_services as $smilia_service ) : ?> + <li class="services__item" data-reveal<?php echo Markup::edit_link( (int) $smilia_service['id'], $attributes ); ?>> + <?php Markup::edit_button( (int) $smilia_service['id'], $attributes ); ?> + <a class="service-tile service-tile--<?php echo esc_attr( $smilia_service['tone'] ? $smilia_service['tone'] : 'teal' ); ?>" href="<?php echo esc_url( $smilia_service['url'] ); ?>"> + <span class="service-tile__ring"> + <?php + Markup::image( + (int) $smilia_service['image_id'], + 'smilia-480', + '232px', + array( + 'class' => 'service-tile__image', + 'alt' => '', + ) + ); + ?> + </span> + <span class="service-tile__name"><?php echo esc_html( $smilia_service['title'] ); ?></span> + <?php if ( $smilia_service['summary'] ) : ?> + <span class="service-tile__summary"><?php echo esc_html( $smilia_service['summary'] ); ?></span> + <?php endif; ?> + </a> + </li> + <?php endforeach; ?> +</ul> diff --git a/wp-content/plugins/smilia-core/src/blocks/services/render.php b/wp-content/plugins/smilia-core/src/blocks/services/render.php new file mode 100644 index 0000000..2bbfe73 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/services/render.php @@ -0,0 +1,28 @@ +<?php + +use Smilia\Core\Content; +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +$smilia_services = Content::services(); +if ( ! $smilia_services ) { + return; +} +if ( 'list' === $attributes['part'] ) { + require __DIR__ . '/list.php'; + return; +} +?> +<section class="section services" id="services"> + <div class="container"> + <div class="section__head"> + <h2 class="section__title"><?php echo Markup::text( $attributes['title'] ); ?></h2> + <p class="section__lead"><?php echo Markup::text( $attributes['lead'] ); ?></p> + </div> + <?php require __DIR__ . '/list.php'; ?> + <div class="services__more"> + <a class="button button--primary" href="<?php echo Markup::link( $attributes['buttonLink'] ); ?>"><?php echo Markup::text( $attributes['buttonText'] ); ?></a> + </div> + </div> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/services/style.css b/wp-content/plugins/smilia-core/src/blocks/services/style.css new file mode 100644 index 0000000..463a01f --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/services/style.css @@ -0,0 +1,119 @@ +.services__grid { + --services-columns: 3; + display: grid; + grid-template-columns: repeat(var(--services-columns), minmax(0, 1fr)); + gap: var(--space-12) var(--space-8); +} + +.service-tile { + --service-tile-ring: var(--color-accent-light); + display: flex; + flex-direction: column; + align-items: center; + gap: var(--space-3); + color: inherit; + text-align: center; +} + +.service-tile--pink { + --service-tile-ring: var(--color-pink-200); +} + +.service-tile--yellow { + --service-tile-ring: var(--color-yellow-200); +} + +.service-tile--lavender { + --service-tile-ring: var(--color-lavender-200); +} + +.service-tile--peach { + --service-tile-ring: var(--color-peach-200); +} + +.service-tile__ring { + display: block; + width: min(15.5rem, 100%); + aspect-ratio: 1; + padding: 0.5625rem; + background: var(--service-tile-ring); + border-radius: 50%; + transition: transform var(--duration-base) ease; +} + +.service-tile__image { + width: 100%; + height: 100%; + object-fit: cover; + border-radius: 50%; +} + +.service-tile__name { + margin-top: var(--space-1); + color: var(--color-accent-strong); + font-size: var(--fs-card-title); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-snug); +} + +.service-tile__summary { + color: var(--color-text-muted); + line-height: var(--leading-normal); + text-wrap: pretty; +} + +.services__more { + display: flex; + justify-content: center; + margin-top: var(--space-12); +} + +@media (hover: hover) { + .service-tile:hover { + color: inherit; + } + + .service-tile:hover .service-tile__ring { + transform: translateY(-6px); + } +} + +@media (max-width: 760px) { + .services__grid { + --services-columns: 2; + column-gap: var(--space-4); + } +} + +@media (max-width: 560px) { + .services__grid { + --services-columns: 1; + row-gap: var(--space-6); + } + + .service-tile { + display: grid; + grid-template-columns: 6.5rem minmax(0, 1fr); + grid-template-rows: auto auto; + column-gap: var(--space-4); + row-gap: var(--space-1); + text-align: left; + } + + .service-tile__ring { + grid-row: 1 / 3; + align-self: center; + width: 100%; + padding: 0.3125rem; + } + + .service-tile__name { + align-self: end; + margin-top: 0; + } + + .service-tile__summary { + align-self: start; + font-size: var(--fs-small); + } +} diff --git a/wp-content/plugins/smilia-core/src/blocks/visit-step/block.json b/wp-content/plugins/smilia-core/src/blocks/visit-step/block.json new file mode 100644 index 0000000..c7c8012 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/visit-step/block.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/visit-step", + "title": "Шаг приёма", + "category": "smilia", + "parent": [ "smilia/visit" ], + "icon": "format-image", + "description": "Картинка, название и текст одного шага.", + "textdomain": "smilia-core", + "attributes": { + "picture": { + "type": "string", + "enum": [ "kid-1", "kid-2", "kid-3", "kid-4" ], + "default": "kid-1" + }, + "imageId": { + "type": "number", + "role": "content", + "default": 0 + }, + "title": { + "type": "string", + "role": "content", + "default": "" + }, + "text": { + "type": "string", + "role": "content", + "default": "" + } + }, + "supports": { + "html": false, + "reusable": false, + "inserter": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/visit-step/edit.js b/wp-content/plugins/smilia-core/src/blocks/visit-step/edit.js new file mode 100644 index 0000000..403333c --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/visit-step/edit.js @@ -0,0 +1,83 @@ +import { __ } from '@wordpress/i18n'; +import { + BlockControls, + MediaReplaceFlow, + RichText, + useBlockProps, +} from '@wordpress/block-editor'; +import { ToolbarButton } from '@wordpress/components'; +import { useSelect } from '@wordpress/data'; +import { store as coreStore } from '@wordpress/core-data'; +import { assetUrl } from '../../shared/images'; + +export default function Edit( { attributes, setAttributes } ) { + const { picture, imageId, title, text } = attributes; + + const image = useSelect( + ( select ) => + imageId + ? select( coreStore ).getEntityRecord( + 'postType', + 'attachment', + imageId + ) + : null, + [ imageId ] + ); + const imageUrl = + image?.media_details?.sizes?.medium?.source_url ?? image?.source_url; + const pictureUrl = assetUrl( `visit/${ picture }.svg` ); + + const blockProps = useBlockProps( { className: 'visit__step' } ); + + return ( + <> + <BlockControls group="other"> + <MediaReplaceFlow + mediaId={ imageId } + mediaURL={ imageUrl } + allowedTypes={ [ 'image' ] } + accept="image/*" + name={ __( 'Заменить картинку', 'smilia-core' ) } + onSelect={ ( media ) => + setAttributes( { imageId: media.id } ) + } + /> + { imageId > 0 && ( + <ToolbarButton + onClick={ () => setAttributes( { imageId: 0 } ) } + > + { __( 'Вернуть рисунок', 'smilia-core' ) } + </ToolbarButton> + ) } + </BlockControls> + <li { ...blockProps }> + <img + className="visit__image" + src={ imageId ? imageUrl : pictureUrl } + alt="" + /> + <RichText + tagName="h3" + className="visit__name" + value={ title } + onChange={ ( value ) => setAttributes( { title: value } ) } + placeholder={ __( 'Название шага', 'smilia-core' ) } + allowedFormats={ [] } + disableLineBreaks + withoutInteractiveFormatting + /> + <RichText + tagName="p" + className="visit__text" + value={ text } + onChange={ ( value ) => setAttributes( { text: value } ) } + placeholder={ __( 'Текст шага', 'smilia-core' ) } + allowedFormats={ [] } + disableLineBreaks + withoutInteractiveFormatting + /> + </li> + </> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/visit-step/index.js b/wp-content/plugins/smilia-core/src/blocks/visit-step/index.js new file mode 100644 index 0000000..0df75c1 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/visit-step/index.js @@ -0,0 +1,7 @@ +import { registerBlockType } from '@wordpress/blocks'; +import Edit from './edit'; +import metadata from './block.json'; + +registerBlockType( metadata.name, { + edit: Edit, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/visit-step/render.php b/wp-content/plugins/smilia-core/src/blocks/visit-step/render.php new file mode 100644 index 0000000..1e1104c --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/visit-step/render.php @@ -0,0 +1,30 @@ +<?php + +use Smilia\Core\Picture; + +defined( 'ABSPATH' ) || exit; + +$smilia_picture = in_array( $attributes['picture'], array( 'kid-1', 'kid-2', 'kid-3', 'kid-4' ), true ) ? $attributes['picture'] : 'kid-1'; +?> +<li class="visit__step" data-reveal> + <?php + if ( $attributes['imageId'] > 0 ) { + echo wp_get_attachment_image( + (int) $attributes['imageId'], + 'smilia-480', + false, + array( + 'class' => 'visit__image', + 'alt' => '', + 'sizes' => '(max-width: 760px) 50vw, 216px', + 'decoding' => 'async', + 'loading' => 'lazy', + ) + ); + } else { + Picture::svg( SMILIA_CORE_DIR . '/assets/img/visit/' . $smilia_picture . '.svg', plugins_url( 'assets/img/visit/' . $smilia_picture . '.svg', SMILIA_CORE_FILE ), 'visit__image' ); + } + ?> + <h3 class="visit__name"><?php echo esc_html( wp_strip_all_tags( $attributes['title'] ) ); ?></h3> + <p class="visit__text"><?php echo esc_html( wp_strip_all_tags( $attributes['text'] ) ); ?></p> +</li> diff --git a/wp-content/plugins/smilia-core/src/blocks/visit/block.json b/wp-content/plugins/smilia-core/src/blocks/visit/block.json new file mode 100644 index 0000000..7361842 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/visit/block.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://schemas.wp.org/trunk/block.json", + "apiVersion": 3, + "name": "smilia/visit", + "title": "Как проходит приём", + "category": "smilia", + "icon": "list-view", + "description": "Заголовок и шаги детского приёма с картинками.", + "textdomain": "smilia-core", + "attributes": { + "title": { + "type": "string", + "role": "content", + "default": "Как проходит детский приём<br>в нашей клинике Smilia" + } + }, + "supports": { + "html": false, + "multiple": false, + "reusable": false, + "className": false, + "customClassName": false + }, + "editorScript": "file:./index.js", + "style": "file:./style-index.css", + "render": "file:./render.php" +} diff --git a/wp-content/plugins/smilia-core/src/blocks/visit/edit.js b/wp-content/plugins/smilia-core/src/blocks/visit/edit.js new file mode 100644 index 0000000..751b5cf --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/visit/edit.js @@ -0,0 +1,85 @@ +import { __ } from '@wordpress/i18n'; +import { + RichText, + useBlockProps, + useInnerBlocksProps, +} from '@wordpress/block-editor'; + +const STEP = 'smilia/visit-step'; + +const TEMPLATE = [ + [ + STEP, + { + picture: 'kid-1', + title: __( 'Знакомство с врачом', 'smilia-core' ), + text: __( + 'Ребёнок осматривает кабинет, задаёт вопросы и привыкает к врачу без спешки.', + 'smilia-core' + ), + }, + ], + [ + STEP, + { + picture: 'kid-2', + title: __( 'Бережное лечение', 'smilia-core' ), + text: __( + 'Каждое действие объясняется заранее, лечение идёт в спокойном для ребёнка темпе.', + 'smilia-core' + ), + }, + ], + [ + STEP, + { + picture: 'kid-3', + title: __( 'Учимся ухаживать', 'smilia-core' ), + text: __( + 'Ребёнок узнаёт, как правильно чистить зубы и ухаживать за полостью рта.', + 'smilia-core' + ), + }, + ], + [ + STEP, + { + picture: 'kid-4', + title: __( 'Следим за прикусом', 'smilia-core' ), + text: __( + 'На осмотре проверяются смена зубов и прикус, чтобы вовремя заметить изменения.', + 'smilia-core' + ), + }, + ], +]; + +export default function Edit( { attributes, setAttributes } ) { + const blockProps = useBlockProps( { className: 'section visit' } ); + const stepsProps = useInnerBlocksProps( + { className: 'visit__steps' }, + { + allowedBlocks: [ STEP ], + template: TEMPLATE, + templateLock: 'all', + renderAppender: false, + } + ); + + return ( + <section { ...blockProps }> + <div className="container"> + <RichText + tagName="h2" + className="section__title section__head visit__title" + value={ attributes.title } + onChange={ ( value ) => setAttributes( { title: value } ) } + placeholder={ __( 'Заголовок раздела', 'smilia-core' ) } + allowedFormats={ [] } + withoutInteractiveFormatting + /> + <ol { ...stepsProps } /> + </div> + </section> + ); +} diff --git a/wp-content/plugins/smilia-core/src/blocks/visit/index.js b/wp-content/plugins/smilia-core/src/blocks/visit/index.js new file mode 100644 index 0000000..694e3fa --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/visit/index.js @@ -0,0 +1,10 @@ +import { registerBlockType } from '@wordpress/blocks'; +import { InnerBlocks } from '@wordpress/block-editor'; +import Edit from './edit'; +import metadata from './block.json'; +import './style.css'; + +registerBlockType( metadata.name, { + edit: Edit, + save: () => <InnerBlocks.Content />, +} ); diff --git a/wp-content/plugins/smilia-core/src/blocks/visit/render.php b/wp-content/plugins/smilia-core/src/blocks/visit/render.php new file mode 100644 index 0000000..9f99f53 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/visit/render.php @@ -0,0 +1,13 @@ +<?php + +defined( 'ABSPATH' ) || exit; + +?> +<section class="section visit" id="visit"> + <div class="container"> + <h2 class="section__title section__head visit__title"><?php echo wp_kses( $attributes['title'], array( 'br' => array() ) ); ?></h2> + <ol class="visit__steps"> + <?php echo $content; ?> + </ol> + </div> +</section> diff --git a/wp-content/plugins/smilia-core/src/blocks/visit/style.css b/wp-content/plugins/smilia-core/src/blocks/visit/style.css new file mode 100644 index 0000000..a5404cc --- /dev/null +++ b/wp-content/plugins/smilia-core/src/blocks/visit/style.css @@ -0,0 +1,55 @@ +.visit__title { + max-width: 56rem; + margin-inline: auto; +} + +.visit__steps { + --visit-columns: 4; + display: grid; + grid-template-columns: repeat(var(--visit-columns), 1fr); + gap: var(--space-12); +} + +.visit__step { + display: flex; + flex-direction: column; + align-items: center; + gap: var(--space-5); + text-align: center; +} + +.visit__image { + width: clamp(9.5rem, 15vw, 13.5rem); + height: auto; +} + +.visit__name { + color: var(--color-text-heading); + font-size: var(--fs-card-title); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-snug); +} + +.visit__text { + color: var(--color-text-muted); + line-height: var(--leading-normal); + text-wrap: pretty; +} + +@media (max-width: 980px) { + .visit__steps { + --visit-columns: 2; + row-gap: var(--space-16); + } +} + +@media (max-width: 560px) { + .visit__steps { + --visit-columns: 1; + row-gap: var(--space-12); + } + + .visit__image { + width: 13.75rem; + } +} diff --git a/wp-content/plugins/smilia-core/src/editor-fields/index.js b/wp-content/plugins/smilia-core/src/editor-fields/index.js new file mode 100644 index 0000000..857beec --- /dev/null +++ b/wp-content/plugins/smilia-core/src/editor-fields/index.js @@ -0,0 +1,43 @@ +import { registerPlugin } from '@wordpress/plugins'; +import { PluginDocumentSettingPanel } from '@wordpress/editor'; +import { useSelect } from '@wordpress/data'; +import { useEntityProp } from '@wordpress/core-data'; +import { SelectControl, TextControl, TextareaControl } from '@wordpress/components'; + +const panels = window.smiliaMetaPanels || {}; + +function Field( { field, meta, setMeta } ) { + const props = { + label: field.label, + value: meta[ field.key ] || '', + onChange: ( value ) => setMeta( { ...meta, [ field.key ]: value } ), + __nextHasNoMarginBottom: true, + }; + if ( field.control === 'select' ) { + return <SelectControl { ...props } options={ field.options } __next40pxDefaultSize />; + } + if ( field.control === 'textarea' ) { + return <TextareaControl { ...props } rows={ 3 } />; + } + return <TextControl { ...props } __next40pxDefaultSize />; +} + +function Panels() { + const postType = useSelect( ( select ) => select( 'core/editor' ).getCurrentPostType(), [] ); + const [ storedMeta, setMeta ] = useEntityProp( 'postType', postType, 'meta' ); + const list = panels[ postType ]; + if ( ! list ) { + return null; + } + const meta = storedMeta || {}; + return list.map( ( panel ) => ( + <PluginDocumentSettingPanel key={ panel.name } name={ panel.name } title={ panel.title }> + { panel.fields.map( ( field ) => ( + <Field key={ field.key } field={ field } meta={ meta } setMeta={ setMeta } /> + ) ) } + { panel.help ? <p className="components-base-control__help">{ panel.help }</p> : null } + </PluginDocumentSettingPanel> + ) ); +} + +registerPlugin( 'smilia-meta-fields', { render: Panels } ); diff --git a/wp-content/plugins/smilia-core/src/shared/icons.js b/wp-content/plugins/smilia-core/src/shared/icons.js new file mode 100644 index 0000000..906ab0d --- /dev/null +++ b/wp-content/plugins/smilia-core/src/shared/icons.js @@ -0,0 +1,5 @@ +export const removeIcon = ( + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" aria-hidden="true" focusable="false"> + <path d="M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" /> + </svg> +); diff --git a/wp-content/plugins/smilia-core/src/shared/images.js b/wp-content/plugins/smilia-core/src/shared/images.js new file mode 100644 index 0000000..5d439a7 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/shared/images.js @@ -0,0 +1,50 @@ +import { useSelect } from '@wordpress/data'; +import { store as coreStore } from '@wordpress/core-data'; + +export const assetUrl = ( path ) => + `${ window.smiliaBlocks?.images ?? '' }${ path }`; + +export function useImageUrl( id, size = 'medium' ) { + return useSelect( + ( select ) => { + if ( ! id ) { + return ''; + } + const image = select( coreStore ).getEntityRecord( + 'postType', + 'attachment', + id + ); + return ( + image?.media_details?.sizes?.[ size ]?.source_url ?? + image?.source_url ?? + '' + ); + }, + [ id, size ] + ); +} + +export function useImages( ids, size = 'medium' ) { + return useSelect( + ( select ) => { + if ( ! ids.length ) { + return []; + } + const records = + select( coreStore ).getEntityRecords( + 'postType', + 'attachment', + { include: ids, orderby: 'include', per_page: ids.length } + ) ?? []; + return records.map( ( image ) => ( { + id: image.id, + url: + image.media_details?.sizes?.[ size ]?.source_url ?? + image.source_url, + alt: image.alt_text, + } ) ); + }, + [ ids.join( ',' ), size ] + ); +} diff --git a/wp-content/plugins/smilia-core/src/shared/manage-button.js b/wp-content/plugins/smilia-core/src/shared/manage-button.js new file mode 100644 index 0000000..152dda2 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/shared/manage-button.js @@ -0,0 +1,18 @@ +import { BlockControls } from '@wordpress/block-editor'; +import { ToolbarButton } from '@wordpress/components'; + +export default function ManageButton( { postType, path, label } ) { + const target = path ?? `edit.php?post_type=${ postType }`; + + return ( + <BlockControls group="other"> + <ToolbarButton + href={ `${ window.smiliaBlocks?.admin ?? '/wp-admin/' }${ target }` } + target="_blank" + rel="noopener" + > + { label } + </ToolbarButton> + </BlockControls> + ); +} diff --git a/wp-content/plugins/smilia-core/src/shared/plain-text.js b/wp-content/plugins/smilia-core/src/shared/plain-text.js new file mode 100644 index 0000000..ea344e1 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/shared/plain-text.js @@ -0,0 +1,14 @@ +import { RichText } from '@wordpress/block-editor'; + +export default function PlainText( { attribute, attributes, setAttributes, ...props } ) { + return ( + <RichText + { ...props } + value={ attributes[ attribute ] } + onChange={ ( value ) => setAttributes( { [ attribute ]: value } ) } + allowedFormats={ [] } + disableLineBreaks + withoutInteractiveFormatting + /> + ); +} diff --git a/wp-content/plugins/smilia-core/src/shared/server-preview.js b/wp-content/plugins/smilia-core/src/shared/server-preview.js new file mode 100644 index 0000000..d7ef60d --- /dev/null +++ b/wp-content/plugins/smilia-core/src/shared/server-preview.js @@ -0,0 +1,29 @@ +import { Disabled } from '@wordpress/components'; +import ServerSideRender from '@wordpress/server-side-render'; + +const openEditor = ( event ) => { + event.preventDefault(); + const item = event.target.closest( '.edit-badge' ) + ? event.target.closest( '[data-edit-url]' ) + : null; + if ( item ) { + window.open( item.dataset.editUrl, '_blank', 'noopener' ); + } +}; + +export default function ServerPreview( { block, part, editable = false } ) { + const preview = <ServerSideRender block={ block } attributes={ { part } } />; + + if ( ! editable ) { + return <Disabled>{ preview }</Disabled>; + } + + return ( + <div + onClickCapture={ openEditor } + role="presentation" + > + { preview } + </div> + ); +} diff --git a/wp-content/plugins/smilia-core/src/shared/wave.js b/wp-content/plugins/smilia-core/src/shared/wave.js new file mode 100644 index 0000000..0c12592 --- /dev/null +++ b/wp-content/plugins/smilia-core/src/shared/wave.js @@ -0,0 +1,30 @@ +const WAVES = [ + [ + 'wave__back', + 'M0,78 C240,18 480,14 740,52 C1000,90 1220,96 1440,48 L1440,130 L0,130 Z', + ], + [ + 'wave__middle', + 'M0,96 C260,42 520,40 770,72 C1020,104 1240,108 1440,70 L1440,130 L0,130 Z', + ], + [ + 'wave__front', + 'M0,114 C280,70 560,68 800,92 C1040,116 1260,118 1440,94 L1440,130 L0,130 Z', + ], +]; + +export default function Wave() { + return ( + <svg + className="wave" + viewBox="0 0 1440 130" + preserveAspectRatio="none" + aria-hidden="true" + focusable="false" + > + { WAVES.map( ( [ className, path ] ) => ( + <path key={ className } className={ className } d={ path } /> + ) ) } + </svg> + ); +} diff --git a/wp-content/plugins/smilia-core/webpack.config.js b/wp-content/plugins/smilia-core/webpack.config.js new file mode 100644 index 0000000..4efc268 --- /dev/null +++ b/wp-content/plugins/smilia-core/webpack.config.js @@ -0,0 +1,20 @@ +const path = require( 'path' ); +const CopyPlugin = require( 'copy-webpack-plugin' ); +const defaultConfig = require( '@wordpress/scripts/config/webpack.config' ); + +module.exports = { + ...defaultConfig, + entry: async () => ( { + ...( typeof defaultConfig.entry === 'function' ? await defaultConfig.entry() : defaultConfig.entry ), + 'editor-fields/index': path.resolve( __dirname, 'src/editor-fields/index.js' ), + } ), + plugins: [ + ...defaultConfig.plugins, + new CopyPlugin( { + patterns: [ + { from: path.resolve( __dirname, 'node_modules/altcha/dist/main/altcha.min.js' ), to: 'altcha/altcha.min.js', info: { minimized: true } }, + { from: path.resolve( __dirname, 'node_modules/altcha/LICENSE.txt' ), to: 'altcha/LICENSE.txt' }, + ], + } ), + ], +}; diff --git a/wp-content/themes/smilia/404.php b/wp-content/themes/smilia/404.php new file mode 100644 index 0000000..a9a5991 --- /dev/null +++ b/wp-content/themes/smilia/404.php @@ -0,0 +1,11 @@ +<?php + +use Smilia\Theme\Components; + +defined( 'ABSPATH' ) || exit; + +Components::use( array( 'demo-bar', 'site-header', 'site-footer', 'booking', 'not-found' ) ); + +get_header(); +Components::render( 'not-found' ); +get_footer(); diff --git a/wp-content/themes/smilia/assets/css/base.css b/wp-content/themes/smilia/assets/css/base.css new file mode 100644 index 0000000..cac6c27 --- /dev/null +++ b/wp-content/themes/smilia/assets/css/base.css @@ -0,0 +1,548 @@ +*, +*::before, +*::after { + box-sizing: border-box; +} + +html { + -webkit-text-size-adjust: 100%; + -webkit-tap-highlight-color: transparent; + scroll-padding-top: 6rem; +} + +@media (prefers-reduced-motion: no-preference) { + html { + scroll-behavior: smooth; + } +} + +body { + margin: 0; + background: var(--color-bg); + color: var(--color-text); + font-family: var(--font-sans); + font-size: var(--fs-body); + font-weight: 500; + line-height: var(--leading-normal); + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +h1, +h2, +h3, +h4, +p, +ul, +ol, +figure, +blockquote, +dl, +dd { + margin: 0; +} + +ul, +ol { + padding: 0; + list-style: none; +} + +img, +svg { + display: block; + max-width: 100%; +} + +img { + height: auto; +} + +a { + color: inherit; + text-decoration: none; +} + +button, +input, +select, +textarea { + font: inherit; + color: inherit; +} + +button { + cursor: pointer; +} + +:focus-visible { + outline: 3px solid var(--color-focus); + outline-offset: 3px; +} + +.screen-reader-text { + position: absolute !important; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +} + +.skip-link:focus { + position: fixed; + top: var(--space-4); + left: var(--space-4); + z-index: 100; + width: auto; + height: auto; + padding: var(--space-3) var(--space-6); + clip: auto; + background: var(--color-surface); + border-radius: var(--radius-full); + box-shadow: var(--shadow-lg); +} + +.container { + width: 100%; + max-width: calc(var(--container) + var(--gutter) * 2); + margin-inline: auto; + padding-inline: var(--gutter); +} + +.container--wide { + max-width: calc(var(--container-wide) + var(--gutter) * 2); +} + +.section { + padding-block: var(--space-section); +} + +.section--soft { + background: var(--color-bg-soft); +} + +.section__title { + color: var(--color-text-heading); + font-size: var(--fs-h2); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-tight); + text-align: center; + text-wrap: balance; +} + +.section__title + .section__lead { + margin-top: var(--space-3); +} + +.section__lead { + max-width: 38rem; + margin-inline: auto; + color: var(--color-text-muted); + font-size: var(--fs-lead); + line-height: var(--leading-relaxed); + text-align: center; + text-wrap: pretty; +} + +.section__head { + margin-bottom: var(--space-head); +} + +.button { + display: inline-flex; + align-items: center; + justify-content: center; + gap: var(--space-2); + min-height: 3rem; + padding: var(--space-3) var(--space-8); + border: 2px solid transparent; + border-radius: var(--radius-full); + font-size: var(--fs-button); + font-weight: var(--font-weight-extrabold); + line-height: 1; + white-space: nowrap; + transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease, border-color var(--duration-fast) ease, transform 0.08s ease; +} + +.button:active { + transform: scale(0.97); +} + +.button--primary { + background: var(--color-accent); + color: var(--color-white); + box-shadow: var(--shadow-accent); +} + +.button--outline { + background: var(--color-surface); + border-color: var(--color-accent); + color: var(--color-accent); +} + +.button--lg { + min-height: 3.5rem; + padding-inline: var(--space-10); + font-size: var(--text-lg); +} + +.link-underline { + color: var(--color-accent-strong); + font-weight: var(--font-weight-extrabold); + border-bottom: 2px solid var(--color-accent-light); + transition: color var(--duration-fast) ease; +} + +:has(> .edit-badge) { + position: relative; +} + +.edit-badge { + position: absolute; + top: var(--space-2); + right: var(--space-2); + z-index: 5; + display: none; + padding: var(--space-1) var(--space-3); + background: var(--color-accent); + border: 0; + border-radius: var(--radius-full); + box-shadow: var(--shadow-sm); + color: var(--color-white); + font-family: var(--font-sans); + font-size: var(--text-sm); + font-weight: var(--font-weight-bold); + line-height: var(--leading-normal); + text-decoration: none; + cursor: pointer; +} + +.wave { + position: absolute; + bottom: -2px; + left: 0; + z-index: 3; + display: block; + width: 100%; + height: var(--wave-height, var(--space-32)); +} + +.wave__back { + fill: var(--wave-back, var(--color-pink-200)); +} + +.wave__middle { + fill: var(--wave-middle, var(--color-accent-light)); +} + +.wave__front { + fill: var(--wave-front, var(--color-bg)); +} + +.wp-block-breadcrumbs { + max-width: calc(var(--container) + var(--gutter) * 2); + margin-inline: auto; + padding: var(--space-4) var(--gutter) 0; + color: var(--color-text-muted); + font-size: var(--fs-small); + font-weight: var(--font-weight-bold); +} + +.wp-block-breadcrumbs--flush { + max-width: none; + padding: 0; +} + +.wp-block-breadcrumbs--wide { + max-width: calc(var(--container-wide) + var(--gutter) * 2); +} + +.wp-block-breadcrumbs li { + gap: var(--space-2); +} + +.wp-block-breadcrumbs a { + padding-block: var(--space-1); +} + +@media (pointer: coarse) { + .wp-block-breadcrumbs a { + padding-block: var(--space-3); + } +} + +.wp-block-breadcrumbs ol { + column-gap: var(--space-2); +} + +.wp-block-breadcrumbs ol li:not(:last-child)::after { + margin: 0; +} + +.wp-block-breadcrumbs span[aria-current] { + color: var(--color-accent-strong); +} + +.reveal--hidden { + opacity: 0; + translate: 0 1.5rem; +} + +.reveal--visible { + animation: reveal-rise var(--duration-slow) var(--ease-out) var(--reveal-delay, 0ms) both; +} + +@keyframes reveal-rise { + from { + opacity: 0; + translate: 0 1.5rem; + } + + to { + opacity: 1; + translate: 0 0; + } +} + +@media (hover: hover) { + .wp-block-breadcrumbs a:hover { + color: var(--color-accent-strong); + } + + :has(> .edit-badge):hover { + outline: 2px solid var(--color-accent); + outline-offset: 4px; + } + + :hover > .edit-badge { + display: block; + } + + .edit-badge:hover { + background: var(--color-accent-hover); + color: var(--color-white); + } +} + +@media (hover: hover) { + a:hover { + color: var(--color-accent); + } + + .button--primary:hover { + background: var(--color-accent-hover); + color: var(--color-white); + } + + .button--outline:hover { + background: color-mix(in srgb, var(--color-accent) 6%, var(--color-surface)); + color: var(--color-accent); + } + + .showcase__figma:hover { + color: var(--color-accent-strong); + } + + .link-underline:hover { + color: var(--color-accent); + } +} + +@media (prefers-reduced-motion: reduce) { + *, + *::before, + *::after { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.01ms !important; + } +} + +@media print { + .reveal--hidden { + opacity: 1; + translate: none; + } +} + +.container--text { + max-width: calc(var(--container-text) + var(--gutter) * 2); +} + +.legal { + --container-text: 52rem; + --legal-title-size: clamp(var(--text-3xl), 4vw, 2.75rem); + padding-block: var(--space-6) var(--space-16); +} + +.legal__crumbs { + margin-bottom: var(--space-4); +} + +.legal__title { + margin-bottom: var(--space-4); + color: var(--color-accent-strong); + font-size: var(--legal-title-size); + font-weight: var(--font-weight-extrabold); + line-height: 1.1; + text-wrap: balance; +} + +.legal__intro, +.legal__text, +.legal__list { + margin-top: var(--space-4); + color: var(--color-text-body); + font-size: var(--text-lg); + line-height: var(--leading-loose); + text-wrap: pretty; +} + +.legal__title + .legal__intro { + margin-top: 0; +} + +.legal__heading { + margin-top: var(--space-10); + color: var(--color-text-heading); + font-size: var(--text-2xl); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-snug); +} + +.legal__heading + .legal__text, +.legal__heading + .legal__list { + margin-top: var(--space-3); +} + +.legal__list { + padding-left: var(--space-6); + list-style: disc; +} + +.legal__item + .legal__item { + margin-top: var(--space-2); +} + +.legal__link { + color: var(--color-accent-strong); + font-weight: var(--font-weight-bold); + text-decoration: underline; + text-underline-offset: 0.2em; +} + +.showcase .wp-block-group__inner-container { + display: contents; +} + +.showcase__admin { + display: flex; + flex-wrap: wrap; + gap: var(--space-3); + margin-top: var(--space-8); +} + +.showcase__figma { + border-color: var(--color-accent-strong); + color: var(--color-accent-strong); +} + +.showcase__list { + display: grid; + gap: var(--space-3); + margin-top: var(--space-8); +} + +.showcase__item { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--space-4); + padding: var(--space-4) var(--space-6); + background: var(--color-surface); + border-radius: var(--radius-xl); + box-shadow: var(--shadow-sm); +} + +.showcase__info { + display: grid; + gap: var(--space-1); + min-width: 0; +} + +.showcase__name { + color: var(--color-text-heading); + font-size: var(--text-lg); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-snug); +} + +.showcase__kind { + color: var(--color-text-muted); + font-size: var(--text-sm); +} + +.showcase__checks { + display: flex; + flex-wrap: wrap; + gap: var(--space-1) var(--space-4); + font-size: var(--text-sm); +} + +.showcase__check { + color: var(--color-accent-strong); + font-weight: var(--font-weight-bold); + text-decoration: underline; + text-underline-offset: 0.2em; +} + +@media (pointer: coarse) { + .showcase__check { + display: inline-block; + padding-block: var(--space-3); + } +} + +@media (hover: hover) { + .showcase__check:hover { + color: var(--color-accent); + } +} + +.showcase__links { + display: flex; + flex-wrap: wrap; + justify-content: flex-end; + gap: var(--space-2); +} + +.showcase__link { + min-height: 2.75rem; + padding-inline: var(--space-5); +} + +@media (max-width: 760px) { + .showcase__item { + flex-direction: column; + align-items: stretch; + padding: var(--space-4); + } + + .showcase__links { + justify-content: flex-start; + } + + .showcase__admin-link { + width: 100%; + } +} + +@media (max-width: 400px) { + .showcase__link { + flex: 1 1 auto; + } +} diff --git a/wp-content/themes/smilia/assets/css/editor.css b/wp-content/themes/smilia/assets/css/editor.css new file mode 100644 index 0000000..bcbead2 --- /dev/null +++ b/wp-content/themes/smilia/assets/css/editor.css @@ -0,0 +1,17 @@ +.is-root-container > [data-type^="smilia/"] { + max-width: none; + margin-block: 0; +} + +[data-edit-url] a:focus { + box-shadow: none; + outline: none; +} + +.prices__tools td { + display: flex; + flex-wrap: wrap; + align-items: flex-end; + gap: var(--space-3); + padding: var(--space-3) var(--space-6) var(--space-5); +} diff --git a/wp-content/themes/smilia/assets/css/tokens.css b/wp-content/themes/smilia/assets/css/tokens.css new file mode 100644 index 0000000..79ec72d --- /dev/null +++ b/wp-content/themes/smilia/assets/css/tokens.css @@ -0,0 +1,321 @@ +@font-face { + font-family: "Nunito"; + font-style: normal; + font-weight: 500 800; + font-display: swap; + src: url("../fonts/nunito-cyrillic.woff2") format("woff2"); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} + +@font-face { + font-family: "Nunito"; + font-style: normal; + font-weight: 500 800; + font-display: swap; + src: url("../fonts/nunito-latin-ext.woff2") format("woff2"); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +@font-face { + font-family: "Nunito"; + font-style: normal; + font-weight: 500 800; + font-display: swap; + src: url("../fonts/nunito-latin.woff2") format("woff2"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +@font-face { + font-family: "Neucha"; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("../fonts/neucha-cyrillic.woff2") format("woff2"); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} + +@font-face { + font-family: "Neucha"; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("../fonts/neucha-latin.woff2") format("woff2"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +@font-face { + font-family: "Pangolin"; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("../fonts/pangolin-latin-ext.woff2") format("woff2"); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +@font-face { + font-family: "Pangolin"; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url("../fonts/pangolin-latin.woff2") format("woff2"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +@font-face { + font-family: "Comfortaa"; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url("../fonts/comfortaa-latin.woff2") format("woff2"); + unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; +} + +@font-face { + font-family: "Comfortaa"; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url("../fonts/comfortaa-latin-ext.woff2") format("woff2"); + unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; +} + +@font-face { + font-family: "Comfortaa"; + font-style: normal; + font-weight: 700; + font-display: swap; + src: url("../fonts/comfortaa-cyrillic.woff2") format("woff2"); + unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; +} + +@font-face { + font-family: "Nunito Fallback"; + font-weight: 100 549; + src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("Arimo"); + size-adjust: 102.32%; + ascent-override: 98.81%; + descent-override: 34.5%; + line-gap-override: 0%; +} + +@font-face { + font-family: "Nunito Fallback"; + font-weight: 550 649; + src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Arimo Bold"); + size-adjust: 96.43%; + ascent-override: 104.84%; + descent-override: 36.61%; + line-gap-override: 0%; +} + +@font-face { + font-family: "Nunito Fallback"; + font-weight: 650 749; + src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Arimo Bold"); + size-adjust: 98.52%; + ascent-override: 102.62%; + descent-override: 35.83%; + line-gap-override: 0%; +} + +@font-face { + font-family: "Nunito Fallback"; + font-weight: 750 900; + src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Arimo Bold"); + size-adjust: 100.76%; + ascent-override: 100.34%; + descent-override: 35.03%; + line-gap-override: 0%; +} + +@font-face { + font-family: "Comfortaa Fallback"; + font-weight: 700; + src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("Arimo Bold"); + size-adjust: 117.72%; + ascent-override: 74.84%; + descent-override: 19.88%; + line-gap-override: 0%; +} + +:root { + --color-white: #ffffff; + --color-cyan-200: #8fe4ef; + --color-teal-50: #f2fbfc; + --color-teal-100: #dff2f6; + --color-teal-200: #cde9ee; + --color-teal-300: #8fd9e2; + --color-teal-500: #00b3c7; + --color-teal-600: #009fb1; + --color-teal-700: #00778a; + --color-teal-800: #00566b; + --color-teal-950: #12414c; + --color-slate-400: #8a9ca3; + --color-slate-500: #5d7078; + --color-slate-700: #4a565c; + --color-slate-800: #3d4a51; + --color-slate-900: #222b30; + --color-slate-950: #19232a; + --color-yellow-50: #fdf3d0; + --color-yellow-100: #fbefcd; + --color-yellow-200: #f5e6a8; + --color-yellow-300: #ecd07a; + --color-yellow-900: #5f4a0f; + --color-pink-100: #fbe3ee; + --color-pink-200: #f9cfe4; + --color-pink-300: #f2a9c9; + --color-pink-700: #b03a72; + --color-green-700: #15803d; + --color-red-700: #b91c1c; + --color-lavender-100: #e7ecf2; + --color-lavender-200: #cfd7e3; + --color-peach-100: #fbe4d3; + --color-peach-200: #f0cdb0; + --color-sand-50: #fdf8ec; + + --font-sans: "Nunito", "Nunito Fallback", system-ui, -apple-system, "Segoe UI", sans-serif; + --font-logo: "Comfortaa", "Comfortaa Fallback", "Nunito", sans-serif; + --font-hand: "Neucha", "Segoe Print", "Bradley Hand", cursive; + + --text-xs: 0.75rem; + --text-sm: 0.875rem; + --text-base: 1rem; + --text-lg: 1.125rem; + --text-xl: 1.25rem; + --text-2xl: 1.5rem; + --text-3xl: 1.875rem; + --text-4xl: 2.25rem; + --text-5xl: 3rem; + --text-6xl: 3.75rem; + --text-7xl: 4.5rem; + --text-8xl: 6rem; + + --font-weight-normal: 400; + --font-weight-semibold: 600; + --font-weight-bold: 700; + --font-weight-extrabold: 800; + + --leading-tight: 1.2; + --leading-snug: 1.3; + --leading-normal: 1.5; + --leading-relaxed: 1.6; + --leading-loose: 1.7; + + --tracking-wide: 0.09em; + --tracking-wider: 0.14em; + + --space-1: 0.25rem; + --space-2: 0.5rem; + --space-3: 0.75rem; + --space-4: 1rem; + --space-5: 1.25rem; + --space-6: 1.5rem; + --space-7: 1.75rem; + --space-8: 2rem; + --space-10: 2.5rem; + --space-12: 3rem; + --space-16: 4rem; + --space-24: 6rem; + --space-32: 8rem; + --space-40: 10rem; + + --radius-sm: 0.25rem; + --radius-md: 0.5rem; + --radius-lg: 0.75rem; + --radius-xl: 1rem; + --radius-2xl: 1.5rem; + --radius-3xl: 2rem; + --radius-full: 9999px; + + --shadow-sm: 0 2px 12px color-mix(in srgb, var(--color-teal-950) 8%, transparent); + --shadow-md: 0 10px 26px color-mix(in srgb, var(--color-teal-950) 9%, transparent); + --shadow-lg: 0 20px 40px color-mix(in srgb, var(--color-teal-950) 16%, transparent); + --shadow-accent: 0 10px 24px color-mix(in srgb, var(--color-teal-500) 28%, transparent); + + --ease-out: cubic-bezier(0.22, 0.8, 0.28, 1); + --duration-fast: 0.2s; + --duration-base: 0.28s; + --duration-slow: 1s; + + --container: 70rem; + --container-wide: 87.5rem; + + --color-bg: var(--color-white); + --color-bg-soft: var(--color-teal-50); + --color-bg-paper: var(--color-sand-50); + --color-surface: var(--color-white); + --color-text: var(--color-slate-900); + --color-text-heading: var(--color-slate-700); + --color-text-body: var(--color-slate-800); + --color-text-muted: var(--color-slate-500); + --color-text-faint: var(--color-slate-400); + --color-text-strong: var(--color-teal-950); + --color-line: var(--color-teal-200); + --color-line-soft: var(--color-teal-100); + --color-accent: var(--color-teal-500); + --color-accent-hover: var(--color-teal-600); + --color-accent-strong: var(--color-teal-700); + --color-accent-soft: var(--color-teal-100); + --color-danger: var(--color-pink-700); + --color-status-open: var(--color-green-700); + --color-status-closed: var(--color-red-700); + --color-focus: var(--color-teal-700); + --color-overlay: color-mix(in srgb, var(--color-teal-950) 45%, transparent); + --color-accent-light: var(--color-teal-300); + --color-accent-deep: var(--color-teal-800); + --color-shadow: var(--color-teal-950); + --color-night: var(--color-slate-900); + --color-night-deep: var(--color-slate-950); + --color-highlight: var(--color-yellow-200); + --color-highlight-cool: var(--color-cyan-200); + --color-note: var(--color-yellow-100); + --color-paper: var(--color-yellow-50); + --color-on-dark-muted: var(--color-teal-100); + + --fs-display: var(--text-7xl); + --fs-h1: var(--text-6xl); + --fs-h2: var(--text-5xl); + --fs-h3: var(--text-3xl); + --fs-card-title: var(--text-xl); + --fs-lead: var(--text-lg); + --fs-body: var(--text-base); + --fs-small: var(--text-sm); + --fs-caption: var(--text-xs); + --fs-button: var(--text-base); + + --space-section: var(--space-24); + --space-head: var(--space-12); + --space-card: var(--space-6); + --gutter: var(--space-16); +} + +@media (max-width: 980px) { + :root { + --fs-h1: var(--text-5xl); + --fs-h2: var(--text-4xl); + --space-section: var(--space-16); + --gutter: var(--space-8); + } +} + +@media (max-width: 760px) { + :root { + --fs-h1: var(--text-4xl); + --fs-h2: var(--text-3xl); + --fs-h3: var(--text-2xl); + --fs-card-title: var(--text-lg); + --space-head: var(--space-10); + --gutter: var(--space-6); + } +} + +@media (max-width: 400px) { + :root { + --space-section: var(--space-12); + --gutter: var(--space-4); + } +} + +:root:lang(pl) { + --font-hand: "Pangolin", "Segoe Print", "Bradley Hand", cursive; +} diff --git a/wp-content/themes/smilia/assets/fonts/comfortaa-cyrillic.woff2 b/wp-content/themes/smilia/assets/fonts/comfortaa-cyrillic.woff2 new file mode 100644 index 0000000..47f98a9 Binary files /dev/null and b/wp-content/themes/smilia/assets/fonts/comfortaa-cyrillic.woff2 differ diff --git a/wp-content/themes/smilia/assets/fonts/comfortaa-latin-ext.woff2 b/wp-content/themes/smilia/assets/fonts/comfortaa-latin-ext.woff2 new file mode 100644 index 0000000..e17344d Binary files /dev/null and b/wp-content/themes/smilia/assets/fonts/comfortaa-latin-ext.woff2 differ diff --git a/wp-content/themes/smilia/assets/fonts/comfortaa-latin.woff2 b/wp-content/themes/smilia/assets/fonts/comfortaa-latin.woff2 new file mode 100644 index 0000000..9503f12 Binary files /dev/null and b/wp-content/themes/smilia/assets/fonts/comfortaa-latin.woff2 differ diff --git a/wp-content/themes/smilia/assets/fonts/neucha-cyrillic.woff2 b/wp-content/themes/smilia/assets/fonts/neucha-cyrillic.woff2 new file mode 100644 index 0000000..62e6eb2 Binary files /dev/null and b/wp-content/themes/smilia/assets/fonts/neucha-cyrillic.woff2 differ diff --git a/wp-content/themes/smilia/assets/fonts/neucha-latin.woff2 b/wp-content/themes/smilia/assets/fonts/neucha-latin.woff2 new file mode 100644 index 0000000..886c2d7 Binary files /dev/null and b/wp-content/themes/smilia/assets/fonts/neucha-latin.woff2 differ diff --git a/wp-content/themes/smilia/assets/fonts/nunito-cyrillic.woff2 b/wp-content/themes/smilia/assets/fonts/nunito-cyrillic.woff2 new file mode 100644 index 0000000..a4cfb25 Binary files /dev/null and b/wp-content/themes/smilia/assets/fonts/nunito-cyrillic.woff2 differ diff --git a/wp-content/themes/smilia/assets/fonts/nunito-latin-ext.woff2 b/wp-content/themes/smilia/assets/fonts/nunito-latin-ext.woff2 new file mode 100644 index 0000000..14a9f78 Binary files /dev/null and b/wp-content/themes/smilia/assets/fonts/nunito-latin-ext.woff2 differ diff --git a/wp-content/themes/smilia/assets/fonts/nunito-latin.woff2 b/wp-content/themes/smilia/assets/fonts/nunito-latin.woff2 new file mode 100644 index 0000000..3e909a1 Binary files /dev/null and b/wp-content/themes/smilia/assets/fonts/nunito-latin.woff2 differ diff --git a/wp-content/themes/smilia/assets/fonts/pangolin-latin-ext.woff2 b/wp-content/themes/smilia/assets/fonts/pangolin-latin-ext.woff2 new file mode 100644 index 0000000..83eb1dd Binary files /dev/null and b/wp-content/themes/smilia/assets/fonts/pangolin-latin-ext.woff2 differ diff --git a/wp-content/themes/smilia/assets/fonts/pangolin-latin.woff2 b/wp-content/themes/smilia/assets/fonts/pangolin-latin.woff2 new file mode 100644 index 0000000..4fd45b1 Binary files /dev/null and b/wp-content/themes/smilia/assets/fonts/pangolin-latin.woff2 differ diff --git a/wp-content/themes/smilia/assets/img/icons/apple-touch-icon.png b/wp-content/themes/smilia/assets/img/icons/apple-touch-icon.png new file mode 100644 index 0000000..4ba067f Binary files /dev/null and b/wp-content/themes/smilia/assets/img/icons/apple-touch-icon.png differ diff --git a/wp-content/themes/smilia/assets/img/icons/icon-maskable-192.png b/wp-content/themes/smilia/assets/img/icons/icon-maskable-192.png new file mode 100644 index 0000000..1e83a71 Binary files /dev/null and b/wp-content/themes/smilia/assets/img/icons/icon-maskable-192.png differ diff --git a/wp-content/themes/smilia/assets/img/icons/icon-maskable-512.png b/wp-content/themes/smilia/assets/img/icons/icon-maskable-512.png new file mode 100644 index 0000000..d13e1b1 Binary files /dev/null and b/wp-content/themes/smilia/assets/img/icons/icon-maskable-512.png differ diff --git a/wp-content/themes/smilia/assets/img/smilia-mark.svg b/wp-content/themes/smilia/assets/img/smilia-mark.svg new file mode 100644 index 0000000..fd6b86b --- /dev/null +++ b/wp-content/themes/smilia/assets/img/smilia-mark.svg @@ -0,0 +1,5 @@ +<svg width="512" height="512" viewBox="30 70 1180 1145" fill="none" xmlns="http://www.w3.org/2000/svg"> + <path d="M460.765 401.925C540.284 395.719 595.287 472.8 612.874 472.927C616.989 472.957 621.11 470.96 624.569 468.897C631.99 464.467 638.891 457.869 645.749 452.516C659.152 442.056 673.425 432.236 688.61 424.53C709.453 413.955 733.553 407.529 756.913 407.138C786.53 406.643 815.761 415.984 837.192 436.98C862.688 461.96 872.963 497.791 873.049 532.756C873.293 634.844 802.774 739.511 733.786 809.301C704.01 838.68 671.827 867.085 635.211 887.707C628.433 891.522 620.246 896.481 612.335 897.075C590.619 898.716 521.722 843.186 504.449 828.301C427.225 761.738 349.758 662.238 342.098 556.823C339.153 516.28 347.796 475.297 375.102 444.007C397.144 418.748 427.434 404.188 460.765 401.925Z" fill="#8DD0D8"></path> + <path d="M336.775 75.0447C389.454 71.786 449.686 84.5868 499.756 100.595C537.592 110.849 594.403 141.753 633.968 136.27C692.921 128.099 748.757 96.4594 808.75 84.7901C898.282 67.3755 989.919 68.8659 1068.82 119.73C1143.93 168.149 1182.55 250.331 1200.85 335.096C1225.6 452.952 1207.13 572.335 1167.71 684.697C1162.72 698.86 1157.43 712.906 1151.84 726.836C1149.87 731.771 1145.98 742.181 1143.25 746.387C1144.89 738.923 1145.4 728.673 1145.68 720.94C1146.61 695.223 1144.97 670.467 1134.58 646.612C1131.59 637.728 1120.35 625.837 1120.95 616.291C1121.52 607.211 1123.79 595.453 1125.16 586.279C1127.79 568.999 1129.96 551.655 1131.69 534.263C1141.12 437.133 1133.22 324.91 1080.42 239.828C1016.25 136.401 895.796 140.403 791.851 167.269C746.491 178.993 700.997 196.666 654.56 202.809C621.024 207.245 594.602 204.198 561.943 197.035C530.346 189.304 498.868 178.332 467.168 169.772C399.131 151.402 323.668 140.588 255.949 166.017C203.025 185.89 166.293 229.648 144.066 280.222C87.6913 408.484 105.213 574.703 162.097 699.509C187.362 753.888 220.34 804.342 260.01 849.309C280.773 872.755 303.19 894.687 327.089 914.93C330.63 917.955 334.34 920.943 337.816 924.017C341.213 927.029 349.125 932.136 346.164 937.194C339.977 940.69 322.366 934.842 315.271 932.571C268.788 917.667 219.606 892.226 183.846 858.592C107.834 787.087 62.8476 675.831 44.1997 575.014C38.3652 542.352 34.8418 509.319 33.6556 476.161C25.4342 273.769 112.409 83.7082 336.775 75.0447Z" fill="#039FB9"></path> + <path d="M1084.5 686.883C1102.68 687.508 1101.87 736.131 1100.98 750.024C1092.88 876.894 1012.03 997.346 921.108 1080.96C833.91 1161.15 718.527 1217.22 598.344 1210.42C476.347 1204.37 360.551 1132.96 280.129 1044.59C264.389 1027.51 214.421 970.534 215.477 947.425C215.565 945.49 216.115 943.5 217.763 942.294C218.827 941.516 220.239 941.161 221.532 941.039C235.725 939.71 273.101 967.484 286.303 975.622C340.609 1009.27 400.17 1033.58 462.511 1047.53C684.275 1098.13 913.099 998.136 1026.61 801.023C1038.46 781.086 1048.9 760.342 1057.85 738.948C1063.41 725.569 1067.99 711.48 1074.33 698.462C1076.86 693.251 1079.47 689.945 1084.5 686.883Z" fill="#FCA1B7"></path> +</svg> \ No newline at end of file diff --git a/wp-content/themes/smilia/assets/js/phone-field.js b/wp-content/themes/smilia/assets/js/phone-field.js new file mode 100644 index 0000000..41a7870 --- /dev/null +++ b/wp-content/themes/smilia/assets/js/phone-field.js @@ -0,0 +1,145 @@ +(() => { + const GROUP = 3; + + const setup = (input) => { + const code = input.dataset.phoneCode; + const length = Number(input.dataset.phoneDigits); + const prefix = `+${code} `; + + const digitsOf = (value) => value.slice(prefix.length).replace(/\D/g, ''); + + const format = (digits) => { + const groups = []; + for (let i = 0; i < digits.length; i += GROUP) { + groups.push(digits.slice(i, i + GROUP)); + } + return prefix + groups.join(' '); + }; + + const positionOf = (digitIndex) => { + if (digitIndex <= 0) { + return prefix.length; + } + return prefix.length + digitIndex + Math.floor((digitIndex - 1) / GROUP); + }; + + const indexOf = (position) => input.value.slice(prefix.length, Math.max(position, prefix.length)).replace(/\D/g, '').length; + + const render = (digits, caret = digits.length) => { + input.value = format(digits); + const position = positionOf(caret); + input.setSelectionRange(position, position); + }; + + const normalize = (raw) => { + let digits = raw.replace(/\D/g, ''); + if (digits.length > length) { + if (digits.startsWith(`00${code}`)) { + digits = digits.slice(code.length + 2); + } else if (digits.startsWith(code)) { + digits = digits.slice(code.length); + } + } + return digits; + }; + + const replace = (text, isPaste) => { + const current = digitsOf(input.value); + const start = indexOf(input.selectionStart); + const end = indexOf(input.selectionEnd); + const whole = start === 0 && end === current.length; + const room = length - current.length + (end - start); + const clean = isPaste && whole ? normalize(text) : text.replace(/\D/g, ''); + if (isPaste && clean.length > room) { + return; + } + const inserted = clean.slice(0, room); + if (!inserted) { + return; + } + render(current.slice(0, start) + inserted + current.slice(end), start + inserted.length); + }; + + const remove = (inputType) => { + const current = digitsOf(input.value); + let start = indexOf(input.selectionStart); + let end = indexOf(input.selectionEnd); + if (start === end) { + if (inputType.includes('Backward')) { + if (inputType.includes('Line')) { + start = 0; + } else if (inputType.includes('Word')) { + start = Math.max(0, Math.floor((start - 1) / GROUP) * GROUP); + } else { + start = Math.max(0, start - 1); + } + } else if (inputType.includes('Line')) { + end = current.length; + } else if (inputType.includes('Word')) { + end = Math.min(current.length, (Math.floor(end / GROUP) + 1) * GROUP); + } else { + end = Math.min(current.length, end + 1); + } + } + render(current.slice(0, start) + current.slice(end), start); + }; + + const keepCaret = () => { + window.setTimeout(() => { + if (document.activeElement !== input) { + return; + } + if (!input.value.startsWith(prefix)) { + render(normalize(input.value)); + return; + } + if (input.selectionStart === input.selectionEnd && input.selectionStart < prefix.length) { + input.setSelectionRange(prefix.length, prefix.length); + } + }, 0); + }; + + input.addEventListener('beforeinput', (event) => { + event.preventDefault(); + if (event.inputType.startsWith('delete')) { + remove(event.inputType); + } else if (event.inputType === 'insertFromPaste') { + replace(event.data ?? event.dataTransfer?.getData('text') ?? '', true); + } else if (event.inputType.startsWith('insert') && event.data) { + replace(event.data, event.inputType === 'insertReplacementText'); + } + }); + + input.addEventListener('input', () => { + render(normalize(input.value.startsWith(prefix) ? digitsOf(input.value) : input.value).slice(0, length)); + }); + + input.addEventListener('focus', () => { + if (!input.value) { + render(''); + } + keepCaret(); + }); + + input.addEventListener('blur', () => { + if (!digitsOf(input.value)) { + input.value = ''; + } + }); + + ['click', 'keyup', 'select'].forEach((type) => input.addEventListener(type, keepCaret)); + + input.smiliaPhone = { + value: () => { + const digits = digitsOf(input.value); + return digits ? `+${code}${digits}` : ''; + }, + complete: () => digitsOf(input.value).length === length, + reset: () => { + input.value = ''; + }, + }; + }; + + document.querySelectorAll('[data-phone-code]').forEach(setup); +})(); diff --git a/wp-content/themes/smilia/assets/js/reveal.js b/wp-content/themes/smilia/assets/js/reveal.js new file mode 100644 index 0000000..abe4f76 --- /dev/null +++ b/wp-content/themes/smilia/assets/js/reveal.js @@ -0,0 +1,42 @@ +( () => { + const items = document.querySelectorAll( '[data-reveal]' ); + if ( + ! items.length || + ! ( 'IntersectionObserver' in window ) || + window.matchMedia( '(prefers-reduced-motion: reduce)' ).matches + ) { + return; + } + + const observer = new IntersectionObserver( + ( entries ) => { + entries + .filter( ( entry ) => entry.isIntersecting ) + .forEach( ( entry, index ) => { + entry.target.style.setProperty( '--reveal-delay', `${ index * 120 }ms` ); + entry.target.classList.remove( 'reveal--hidden' ); + entry.target.classList.add( 'reveal--visible' ); + observer.unobserve( entry.target ); + } ); + }, + { threshold: 0.2 } + ); + + const start = () => + window.requestAnimationFrame( () => { + items.forEach( ( item ) => { + const rect = item.getBoundingClientRect(); + const shown = Math.min( rect.right, window.innerWidth ) - Math.max( rect.left, 0 ); + if ( rect.top > window.innerHeight && shown >= rect.width * 0.2 ) { + item.classList.add( 'reveal--hidden' ); + observer.observe( item ); + } + } ); + } ); + + if ( document.readyState === 'complete' ) { + start(); + } else { + window.addEventListener( 'load', start, { once: true } ); + } +} )(); diff --git a/wp-content/themes/smilia/assets/site.webmanifest b/wp-content/themes/smilia/assets/site.webmanifest new file mode 100644 index 0000000..fa05b54 --- /dev/null +++ b/wp-content/themes/smilia/assets/site.webmanifest @@ -0,0 +1,13 @@ +{ + "name": "Smilia", + "short_name": "Smilia", + "start_url": "/", + "display": "browser", + "background_color": "#ffffff", + "icons": [ + { "src": "img/icons/icon-maskable-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any" }, + { "src": "img/icons/icon-maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any" }, + { "src": "img/icons/icon-maskable-192.png", "sizes": "192x192", "type": "image/png", "purpose": "maskable" }, + { "src": "img/icons/icon-maskable-512.png", "sizes": "512x512", "type": "image/png", "purpose": "maskable" } + ] +} diff --git a/wp-content/themes/smilia/components/booking/booking.css b/wp-content/themes/smilia/components/booking/booking.css new file mode 100644 index 0000000..914faf7 --- /dev/null +++ b/wp-content/themes/smilia/components/booking/booking.css @@ -0,0 +1,349 @@ +.booking { + --booking-shadow: 0 1.875rem 4.375rem color-mix(in srgb, var(--color-shadow) 30%, transparent); + width: min(32.5rem, calc(100% - var(--space-12))); + max-height: calc(100% - var(--space-12)); + padding: var(--space-10) var(--space-10) var(--space-10); + overflow: auto; + background: var(--color-surface); + border: 0; + border-radius: var(--radius-2xl); + box-shadow: var(--booking-shadow); + color: var(--color-text); +} + +.booking::backdrop { + background: var(--color-overlay); +} + +.booking[open] { + animation: booking-in var(--duration-base) var(--ease-out); +} + +.booking__close { + position: absolute; + top: var(--space-5); + right: var(--space-5); + display: flex; + align-items: center; + justify-content: center; + width: 2.75rem; + height: 2.75rem; + padding: 0; + background: var(--color-bg-soft); + border: 0; + border-radius: 50%; + color: var(--color-accent-strong); + transition: background-color var(--duration-fast) ease, transform 0.08s ease; +} + +.booking__close-icon { + width: 1.25rem; + height: 1.25rem; + fill: none; + stroke: currentColor; + stroke-width: 2.4; + stroke-linecap: round; +} + +.booking__title { + padding-right: var(--space-12); + margin-bottom: var(--space-2); + color: var(--color-text-heading); + font-size: var(--text-2xl); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-snug); +} + +.booking__lead { + margin-bottom: var(--space-6); + color: var(--color-text-muted); + line-height: var(--leading-relaxed); + text-wrap: pretty; +} + +.booking__demo { + margin-bottom: var(--space-6); + padding: var(--space-3) var(--space-4); + background: var(--color-note); + border-radius: var(--radius-lg); + color: var(--color-text-body); + font-size: var(--fs-small); + line-height: var(--leading-normal); +} + +.booking__fields { + display: flex; + flex-direction: column; + gap: var(--space-4); +} + +.booking__row { + display: grid; + grid-template-columns: 7rem 1fr; + gap: var(--space-3); +} + +.field { + display: flex; + flex-direction: column; + gap: var(--space-2); +} + +.field__label { + color: var(--color-accent-strong); + font-size: var(--fs-small); + font-weight: var(--font-weight-bold); +} + +.field__input { + width: 100%; + min-height: 3.25rem; + padding: var(--space-3) var(--space-4); + background: var(--color-bg-soft); + border: 1.5px solid var(--color-line); + border-radius: var(--radius-lg); + color: var(--color-text-strong); + font-size: var(--fs-body); + outline: none; + appearance: none; + transition: border-color var(--duration-fast) ease, box-shadow var(--duration-fast) ease; +} + +.field__input::placeholder { + color: var(--color-text-faint); +} + +.field__input:focus { + border-color: var(--color-accent); + box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 16%, transparent); +} + +.field__input[aria-invalid="true"] { + border-color: var(--color-danger); + box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-danger) 14%, transparent); +} + +.field__select { + position: relative; + display: block; +} + +.field__select::after { + content: ""; + position: absolute; + top: 50%; + right: var(--space-4); + width: 0.5rem; + height: 0.5rem; + margin-top: -0.375rem; + border-right: 2px solid var(--color-accent-strong); + border-bottom: 2px solid var(--color-accent-strong); + transform: rotate(45deg); + pointer-events: none; +} + +.field__select .field__input { + padding-right: var(--space-10); + cursor: pointer; +} + +@supports (appearance: base-select) { + .field__select::after { + display: none; + } + + .field__select select.field__input { + appearance: base-select; + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--space-3); + padding-right: var(--space-4); + } + + select.field__input::picker-icon { + content: ""; + flex: none; + width: 0.5rem; + height: 0.5rem; + margin-top: -0.25rem; + border-right: 2px solid var(--color-accent-strong); + border-bottom: 2px solid var(--color-accent-strong); + rotate: 45deg; + transition: rotate var(--duration-fast) ease; + } + + select.field__input:open::picker-icon { + margin-top: 0.25rem; + rotate: 225deg; + } + + select.field__input::picker(select) { + appearance: base-select; + min-width: anchor-size(width); + margin-top: var(--space-2); + padding: var(--space-2); + background: var(--color-surface); + border: 1.5px solid var(--color-line); + border-radius: var(--radius-lg); + box-shadow: var(--shadow-lg); + } + + select.field__input option { + display: flex; + align-items: center; + justify-content: flex-start; + gap: var(--space-3); + padding: var(--space-3) var(--space-4); + border-radius: var(--radius-md); + color: var(--color-text-strong); + font-size: var(--fs-body); + cursor: pointer; + } + + select.field__input option:checked { + background: var(--color-accent-soft); + color: var(--color-accent-strong); + font-weight: var(--font-weight-bold); + } + + select.field__input option::checkmark { + order: 1; + margin-left: auto; + color: var(--color-accent-strong); + } + + select.field__input option:focus-visible { + background: var(--color-bg-soft); + outline: 2px solid var(--color-focus); + outline-offset: -2px; + } +} + +@media (hover: hover) { + @supports (appearance: base-select) { + select.field__input option:hover { + background: var(--color-bg-soft); + color: var(--color-accent-strong); + } + } +} + +.booking__trap { + position: absolute; + left: -9999px; + width: 1px; + height: 1px; + overflow: hidden; +} + +.consent { + display: flex; + align-items: flex-start; + gap: var(--space-3); + margin-top: var(--space-5); + color: var(--color-text-muted); + font-size: var(--fs-small); + line-height: var(--leading-normal); + cursor: pointer; +} + +.consent__box { + flex: none; + width: 1.25rem; + height: 1.25rem; + margin: 0.125rem 0 0; + background: var(--color-bg-soft); + border: 1.5px solid var(--color-line); + border-radius: var(--radius-sm); + appearance: none; + cursor: pointer; + transition: background-color var(--duration-fast) ease, border-color var(--duration-fast) ease; +} + +.consent__box:checked { + background: var(--color-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 7' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; + border-color: var(--color-accent); +} + +.consent__box[aria-invalid="true"] { + border-color: var(--color-danger); + box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-danger) 14%, transparent); +} + +.consent__line { + display: block; +} + +.consent__text a { + color: var(--color-accent-strong); + font-weight: var(--font-weight-bold); + text-decoration: underline; + text-underline-offset: 2px; +} + +.booking__message { + min-height: calc(2 * 1.5em); + margin: var(--space-2) 0; + color: var(--color-danger); + font-size: var(--fs-small); + font-weight: var(--font-weight-bold); + line-height: 1.5; +} + +.booking__submit { + width: 100%; +} + +.booking__submit[aria-busy="true"] { + cursor: progress; +} + +.booking__done { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: var(--space-2); +} + +.booking__done[hidden] { + display: none; +} + +@keyframes booking-in { + from { + opacity: 0; + transform: translateY(1rem) scale(0.98); + } + + to { + opacity: 1; + transform: translateY(0) scale(1); + } +} + +.booking__close:active { + transform: scale(0.94); +} + +@media (hover: hover) { + .booking__close:hover { + background: var(--color-accent-soft); + } + + .consent__box:hover { + border-color: var(--color-accent); + } +} + +@media (max-width: 560px) { + .booking { + width: calc(100% - var(--space-6)); + max-height: calc(100% - var(--space-6)); + padding: var(--space-8) var(--space-5) var(--space-6); + } + + .booking__row { + grid-template-columns: 1fr; + } +} diff --git a/wp-content/themes/smilia/components/booking/booking.js b/wp-content/themes/smilia/components/booking/booking.js new file mode 100644 index 0000000..fccd0e6 --- /dev/null +++ b/wp-content/themes/smilia/components/booking/booking.js @@ -0,0 +1,183 @@ +(() => { + const dialog = document.getElementById('booking'); + if (!dialog || typeof dialog.showModal !== 'function') { + return; + } + + const form = dialog.querySelector('[data-booking-form]'); + const done = dialog.querySelector('[data-booking-done]'); + const doneText = dialog.querySelector('[data-booking-done-text]'); + const message = dialog.querySelector('[data-booking-message]'); + const submit = form.querySelector('.booking__submit'); + const texts = JSON.parse(form.dataset.messages || '{}'); + const phone = form.elements.namedItem('phone'); + const guard = form.querySelector('altcha-widget'); + + const arm = () => { + if (!guard) { + return; + } + if (!document.querySelector('script[data-altcha]')) { + const script = document.createElement('script'); + script.type = 'module'; + script.src = form.dataset.altchaScript || ''; + script.setAttribute('data-altcha', ''); + document.head.appendChild(script); + return; + } + if (typeof guard.getState === 'function' && !['verified', 'verifying'].includes(guard.getState())) { + guard.verify(); + } + }; + + const ready = () => + new Promise((resolve) => { + let tick = 0; + const poll = () => { + const state = guard && typeof guard.getState === 'function' ? guard.getState() : ''; + if (state === 'verified') { + resolve(guard.value || form.elements.namedItem('altcha')?.value || ''); + return; + } + const failed = state === 'error' || state === 'expired'; + const idle = state === 'unverified' && tick >= 30; + if ((failed || idle) && tick % 30 === 0) { + guard.verify(); + } + if (++tick > 150) { + resolve(''); + return; + } + setTimeout(poll, 100); + }; + poll(); + }); + + const rearm = () => { + if (guard && typeof guard.reset === 'function') { + guard.reset(); + guard.verify(); + } + }; + + const clearErrors = () => { + message.textContent = ''; + form.querySelectorAll('[aria-invalid="true"]').forEach((field) => { + field.removeAttribute('aria-invalid'); + field.removeAttribute('aria-describedby'); + }); + }; + + const showError = (fieldName, text) => { + message.textContent = text; + const field = fieldName ? form.elements.namedItem(fieldName) : null; + if (field instanceof HTMLElement) { + field.setAttribute('aria-invalid', 'true'); + field.setAttribute('aria-describedby', message.id); + field.focus(); + } + }; + + const validate = () => { + const name = form.elements.namedItem('name').value.trim(); + if (name.length < 2) { + return 'name'; + } + if (phone.smiliaPhone ? !phone.smiliaPhone.complete() : phone.value.replace(/\D/g, '').length < 9) { + return 'phone'; + } + if (!form.elements.namedItem('consent').checked) { + return 'consent'; + } + return ''; + }; + + const open = () => { + form.hidden = false; + done.hidden = true; + clearErrors(); + form.elements.namedItem('page').value = window.location.href; + arm(); + dialog.showModal(); + }; + + document.addEventListener('click', (event) => { + if (event.target.closest('[data-booking-open]')) { + event.preventDefault(); + open(); + } + }); + + dialog.addEventListener('click', (event) => { + if (event.target === dialog || event.target.closest('[data-booking-close]')) { + dialog.close(); + } + }); + + form.addEventListener('input', (event) => { + if (event.target.getAttribute('aria-invalid') === 'true') { + event.target.removeAttribute('aria-invalid'); + message.textContent = ''; + } + }); + + form.addEventListener('submit', async (event) => { + event.preventDefault(); + clearErrors(); + + const invalid = validate(); + if (invalid) { + showError(invalid, texts[invalid]); + return; + } + + submit.disabled = true; + submit.setAttribute('aria-busy', 'true'); + + try { + const proof = await ready(); + if (!proof) { + showError('', texts.guard); + rearm(); + return; + } + const body = new FormData(form); + body.set('altcha', proof); + if (phone.smiliaPhone) { + body.set('phone', phone.smiliaPhone.value()); + } + const response = await fetch(form.action, { + method: 'POST', + credentials: 'same-origin', + headers: { + Accept: 'application/json', + 'X-WP-Nonce': form.dataset.restNonce || '', + }, + body, + }); + + rearm(); + if (response.status === 429) { + showError('', texts.limit); + return; + } + + const result = await response.json().catch(() => ({})); + if (!response.ok || !result.ok) { + showError(result.field || '', result.message || texts.network); + return; + } + + form.reset(); + phone.smiliaPhone?.reset(); + form.hidden = true; + doneText.textContent = result.message; + done.hidden = false; + } catch (error) { + showError('', texts.network); + } finally { + submit.disabled = false; + submit.removeAttribute('aria-busy'); + } + }); +})(); diff --git a/wp-content/themes/smilia/components/booking/booking.php b/wp-content/themes/smilia/components/booking/booking.php new file mode 100644 index 0000000..36de69d --- /dev/null +++ b/wp-content/themes/smilia/components/booking/booking.php @@ -0,0 +1,101 @@ +<?php + +use Smilia\Theme\Data; + +defined( 'ABSPATH' ) || exit; + +$smilia_form = Data::booking(); +if ( ! $smilia_form ) { + return; +} + +$smilia_messages = array( + 'name' => __( 'Проверьте имя.', 'smilia' ), + 'phone' => __( 'Проверьте номер телефона.', 'smilia' ), + 'consent' => __( 'Нужно ваше согласие на обработку персональных данных.', 'smilia' ), + 'network' => __( 'Не получилось отправить заявку. Проверьте интернет или позвоните нам.', 'smilia' ), + 'limit' => __( 'Слишком много заявок подряд. Попробуйте через минуту.', 'smilia' ), + 'guard' => __( 'Не удалось подтвердить отправку. Обновите страницу и отправьте заявку ещё раз.', 'smilia' ), +); +?> +<dialog class="booking" id="booking" aria-labelledby="booking-title"> + <button type="button" class="booking__close" data-booking-close aria-label="<?php esc_attr_e( 'Закрыть', 'smilia' ); ?>"> + <svg class="booking__close-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M6 6l12 12M18 6L6 18"/></svg> + </button> + + <form class="booking__form" method="post" action="<?php echo esc_url( $smilia_form['endpoint'] ); ?>" novalidate data-booking-form data-rest-nonce="<?php echo esc_attr( $smilia_form['rest'] ); ?>" data-altcha-script="<?php echo esc_url( $smilia_form['script'] ); ?>" data-messages="<?php echo esc_attr( wp_json_encode( $smilia_messages ) ); ?>"> + <h2 class="booking__title" id="booking-title"><?php echo esc_html( Data::setting( 'booking_title' ) ); ?></h2> + <p class="booking__lead"><?php echo esc_html( Data::setting( 'booking_lead' ) ); ?></p> + <p class="booking__demo"><?php esc_html_e( 'Демонстрационный сайт: заявка не будет обработана.', 'smilia' ); ?></p> + + <div class="booking__fields"> + <label class="field"> + <span class="field__label"><?php esc_html_e( 'Ваше имя', 'smilia' ); ?></span> + <input class="field__input" type="text" name="name" autocomplete="name" maxlength="80" required placeholder="<?php esc_attr_e( 'Как к вам обращаться', 'smilia' ); ?>"> + </label> + <label class="field"> + <span class="field__label"><?php esc_html_e( 'Телефон', 'smilia' ); ?></span> + <input class="field__input" type="tel" name="phone" autocomplete="tel" inputmode="tel" maxlength="24" required placeholder="<?php echo esc_attr( $smilia_form['phone']['example'] ); ?>" data-phone-code="<?php echo esc_attr( $smilia_form['phone']['code'] ); ?>" data-phone-digits="<?php echo esc_attr( (string) $smilia_form['phone']['digits'] ); ?>"> + </label> + <div class="booking__row"> + <label class="field"> + <span class="field__label"><?php esc_html_e( 'Возраст', 'smilia' ); ?></span> + <input class="field__input" type="text" name="age" maxlength="20" placeholder="<?php esc_attr_e( '5 лет', 'smilia' ); ?>"> + </label> + <label class="field"> + <span class="field__label"><?php esc_html_e( 'Что беспокоит', 'smilia' ); ?></span> + <span class="field__select"> + <select class="field__input" name="concern"> + <?php foreach ( $smilia_form['concerns'] as $smilia_value => $smilia_label ) : ?> + <option value="<?php echo esc_attr( $smilia_value ); ?>"><?php echo esc_html( $smilia_label ); ?></option> + <?php endforeach; ?> + </select> + </span> + </label> + </div> + </div> + + <div class="booking__trap" aria-hidden="true"> + <label><?php esc_html_e( 'Сайт', 'smilia' ); ?><input type="text" name="website" tabindex="-1" autocomplete="off"></label> + </div> + <altcha-widget name="altcha" challenge="<?php echo esc_url( $smilia_form['captcha'] ); ?>" auto="onload" display="invisible"></altcha-widget> + <input type="hidden" name="smilia_nonce" value="<?php echo esc_attr( $smilia_form['nonce'] ); ?>"> + <input type="hidden" name="started" value="<?php echo esc_attr( $smilia_form['started'] ); ?>"> + <input type="hidden" name="page" value=""> + + <label class="consent"> + <input class="consent__box" type="checkbox" name="consent" value="1" required> + <span class="consent__text"> + <span class="consent__line"> + <?php + printf( + wp_kses( + __( 'Нажимая «%1$s», я соглашаюсь на обработку <a href="%2$s" target="_blank">персональных данных</a> на условиях и для целей, определённых <a href="%3$s" target="_blank">Политикой конфиденциальности</a>.', 'smilia' ), + array( + 'a' => array( + 'href' => array(), + 'target' => array(), + ), + ) + ), + esc_html( Data::setting( 'booking_submit' ) ), + esc_url( $smilia_form['consent'] ), + esc_url( $smilia_form['privacy'] ) + ); + ?> + </span> + </span> + </label> + + <p class="booking__message" id="booking-message" role="alert" aria-live="assertive" data-booking-message></p> + + <button type="submit" class="button button--primary button--lg booking__submit"><?php echo esc_html( Data::setting( 'booking_submit' ) ); ?></button> + </form> + + <div class="booking__done" hidden data-booking-done> + <h2 class="booking__title"><?php echo esc_html( Data::setting( 'booking_done' ) ); ?></h2> + <p class="booking__lead" data-booking-done-text></p> + <p class="booking__demo"><?php esc_html_e( 'Демонстрационный сайт: заявка не будет обработана.', 'smilia' ); ?></p> + <button type="button" class="button button--primary" data-booking-close><?php esc_html_e( 'Хорошо', 'smilia' ); ?></button> + </div> +</dialog> diff --git a/wp-content/themes/smilia/components/consent/consent.css b/wp-content/themes/smilia/components/consent/consent.css new file mode 100644 index 0000000..eecc56e --- /dev/null +++ b/wp-content/themes/smilia/components/consent/consent.css @@ -0,0 +1,57 @@ +.cookie-bar { + position: fixed; + inset: auto var(--space-4) var(--space-4); + z-index: 70; + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: var(--space-4) var(--space-8); + max-width: 62rem; + margin-inline: auto; + padding: var(--space-5) var(--space-6); + background: var(--color-surface); + border: 1.5px solid var(--color-line); + border-radius: var(--radius-2xl); + box-shadow: var(--shadow-lg); + color: var(--color-text); + font-size: var(--fs-small); + line-height: var(--leading-normal); +} + +.cookie-bar[hidden] { + display: none; +} + +.cookie-bar__text { + flex: 1 1 24rem; + text-wrap: pretty; +} + +.cookie-bar__text a { + color: var(--color-accent-strong); + text-decoration: underline; + text-underline-offset: 0.2em; +} + +.cookie-bar__actions { + display: flex; + flex-wrap: wrap; + gap: var(--space-3); +} + +@media (max-width: 560px) { + .cookie-bar { + inset: auto var(--space-3) var(--space-3); + padding: var(--space-4); + } + + .cookie-bar__actions { + flex-wrap: nowrap; + width: 100%; + } + + .cookie-bar__actions .button { + flex: 1; + } +} diff --git a/wp-content/themes/smilia/components/consent/consent.js b/wp-content/themes/smilia/components/consent/consent.js new file mode 100644 index 0000000..a62c72b --- /dev/null +++ b/wp-content/themes/smilia/components/consent/consent.js @@ -0,0 +1,58 @@ +( () => { + const banner = document.querySelector( '[data-consent]' ); + if ( ! banner ) { + return; + } + + const key = 'smilia-consent'; + const previous = 'smilia-map-consent'; + + const read = () => { + try { + window.localStorage.removeItem( previous ); + return window.localStorage.getItem( key ) || ''; + } catch ( error ) { + return ''; + } + }; + + const write = ( value ) => { + try { + window.localStorage.removeItem( previous ); + if ( value ) { + window.localStorage.setItem( key, value ); + } else { + window.localStorage.removeItem( key ); + } + } catch ( error ) { + return; + } + }; + + const set = ( state, fromBanner ) => { + write( state ); + banner.hidden = '' !== state; + if ( '' === state ) { + banner.setAttribute( 'tabindex', '-1' ); + banner.focus( { preventScroll: true } ); + } else if ( fromBanner ) { + document.querySelector( '[data-consent-open]' )?.focus( { preventScroll: true } ); + } + document.dispatchEvent( + new CustomEvent( 'smilia:consent', { detail: { state } } ) + ); + }; + + banner.hidden = '' !== read(); + + banner + .querySelector( '[data-consent-accept]' ) + .addEventListener( 'click', () => set( 'granted', true ) ); + banner + .querySelector( '[data-consent-decline]' ) + .addEventListener( 'click', () => set( 'denied', true ) ); + document.addEventListener( 'smilia:consent-open', () => set( '' ) ); + document.addEventListener( 'smilia:consent-request', () => + set( 'granted' ) + ); +} )(); diff --git a/wp-content/themes/smilia/components/consent/consent.php b/wp-content/themes/smilia/components/consent/consent.php new file mode 100644 index 0000000..c322eb8 --- /dev/null +++ b/wp-content/themes/smilia/components/consent/consent.php @@ -0,0 +1,27 @@ +<?php + +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +?> +<div class="cookie-bar" data-consent role="region" aria-label="<?php esc_attr_e( 'Согласие на сторонние сервисы', 'smilia' ); ?>" hidden> + <p class="cookie-bar__text"> + <?php esc_html_e( 'Сайт использует cookie и сторонние сервисы.', 'smilia' ); ?> + <?php + echo wp_kses( + sprintf( __( 'Подробнее в <a href="%s" target="_blank">политике конфиденциальности</a>.', 'smilia' ), esc_url( Markup::url( '/privacy-policy/' ) ) ), + array( + 'a' => array( + 'href' => true, + 'target' => true, + ), + ) + ); + ?> + </p> + <div class="cookie-bar__actions"> + <button type="button" class="button button--primary" data-consent-accept><?php esc_html_e( 'Принять', 'smilia' ); ?></button> + <button type="button" class="button button--outline" data-consent-decline><?php esc_html_e( 'Отклонить', 'smilia' ); ?></button> + </div> +</div> diff --git a/wp-content/themes/smilia/components/demo-bar/demo-bar.css b/wp-content/themes/smilia/components/demo-bar/demo-bar.css new file mode 100644 index 0000000..8eef7a9 --- /dev/null +++ b/wp-content/themes/smilia/components/demo-bar/demo-bar.css @@ -0,0 +1,26 @@ +.demo-bar { + --demo-bar-bg: var(--color-text-strong); + --demo-bar-text: color-mix(in srgb, var(--color-white) 82%, transparent); + --demo-bar-link: var(--color-highlight); + padding: var(--space-2) var(--gutter); + background: var(--demo-bar-bg); + text-align: center; +} + +.demo-bar__text { + color: var(--demo-bar-text); + font-size: var(--fs-small); + line-height: var(--leading-normal); +} + +.demo-bar__link { + color: var(--demo-bar-link); + text-decoration: underline; + text-underline-offset: 0.2em; +} + +@media (hover: hover) { + .demo-bar__link:hover { + color: var(--color-white); + } +} diff --git a/wp-content/themes/smilia/components/demo-bar/demo-bar.php b/wp-content/themes/smilia/components/demo-bar/demo-bar.php new file mode 100644 index 0000000..2c5d7a4 --- /dev/null +++ b/wp-content/themes/smilia/components/demo-bar/demo-bar.php @@ -0,0 +1,28 @@ +<?php + +use Smilia\Core\Markup; + +defined( 'ABSPATH' ) || exit; + +?> +<div class="demo-bar"> + <p class="demo-bar__text"> + <?php + printf( + wp_kses( + __( 'Сайт представлен <a class="demo-bar__link" href="%1$s">jimagie</a> в демонстрационных целях: заявки не обрабатываются. <a class="demo-bar__link" href="%4$s">Список страниц</a>. По вопросам: <a class="demo-bar__link" href="%3$s">%2$s</a>', 'smilia' ), + array( + 'a' => array( + 'class' => array(), + 'href' => array(), + ), + ) + ), + esc_url( __( 'https://jimagie.com/ru/', 'smilia' ) ), + esc_html( 'siema@jimagie.com' ), + esc_url( 'mailto:siema@jimagie.com' ), + esc_url( Markup::url( '/smilia/' ) ) + ); + ?> + </p> +</div> diff --git a/wp-content/themes/smilia/components/not-found/not-found.css b/wp-content/themes/smilia/components/not-found/not-found.css new file mode 100644 index 0000000..afd173b --- /dev/null +++ b/wp-content/themes/smilia/components/not-found/not-found.css @@ -0,0 +1,94 @@ +.not-found { + --not-found-bg: var(--color-night); + --not-found-code-size: clamp(5rem, 12vw, 8rem); + --not-found-image-size: clamp(10rem, 18vw, 14rem); + --wave-height: var(--space-32); + --wave-back: var(--color-highlight); + --wave-middle: var(--color-accent-light); + --wave-front: var(--color-accent-strong); + position: relative; + display: flex; + align-items: center; + justify-content: center; + min-height: min(calc(100svh - 7rem), 46rem); + padding: var(--space-16) var(--gutter) calc(var(--wave-height) + var(--space-8)); + overflow: hidden; + background: var(--not-found-bg); + text-align: center; +} + +.not-found__image { + width: var(--not-found-image-size); + height: auto; + margin-bottom: var(--space-2); +} + +.not-found__content { + position: relative; + z-index: 2; + display: flex; + flex-direction: column; + align-items: center; + gap: var(--space-4); + max-width: 40rem; +} + +.not-found__code { + color: var(--color-highlight); + font-size: var(--not-found-code-size); + font-weight: var(--font-weight-extrabold); + line-height: 1; + letter-spacing: -0.02em; +} + +.not-found__title { + color: var(--color-highlight); + font-size: var(--fs-h2); + font-weight: var(--font-weight-extrabold); + line-height: var(--leading-tight); +} + +.not-found__text { + color: var(--color-highlight-cool); + font-size: var(--fs-lead); + line-height: var(--leading-relaxed); +} + +.not-found__actions { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: var(--space-4); + margin-top: var(--space-6); +} + +.not-found__book { + background: transparent; + border-color: var(--color-white); + color: var(--color-white); +} + +@media (hover: hover) { + .not-found__book:hover { + background: color-mix(in srgb, var(--color-white) 12%, transparent); + color: var(--color-white); + } +} + +@media (max-width: 760px) { + .not-found { + --wave-height: var(--space-16); + } +} + +@media (max-width: 560px) { + .not-found__actions { + flex-direction: column; + align-items: center; + } + + .not-found__action { + width: 100%; + max-width: 16rem; + } +} diff --git a/wp-content/themes/smilia/components/not-found/not-found.php b/wp-content/themes/smilia/components/not-found/not-found.php new file mode 100644 index 0000000..805792f --- /dev/null +++ b/wp-content/themes/smilia/components/not-found/not-found.php @@ -0,0 +1,21 @@ +<?php + +use Smilia\Core\Markup; +use Smilia\Theme\Data; + +defined( 'ABSPATH' ) || exit; + +?> +<section class="not-found"> + <div class="not-found__content"> + <?php Data::illustration( 'visit/kid-4.svg', 'not-found__image', 'eager' ); ?> + <p class="not-found__code">404</p> + <h1 class="not-found__title"><?php esc_html_e( 'Такой страницы нет', 'smilia' ); ?></h1> + <p class="not-found__text"><?php esc_html_e( 'Возможно, адрес изменился или в нём опечатка.', 'smilia' ); ?></p> + <div class="not-found__actions"> + <a class="button button--primary button--lg not-found__action" href="<?php echo esc_url( Data::home_url() ); ?>"><?php esc_html_e( 'На главную', 'smilia' ); ?></a> + <button type="button" class="button button--outline button--lg not-found__action not-found__book" data-booking-open><?php esc_html_e( 'Записаться', 'smilia' ); ?></button> + </div> + </div> + <?php Markup::wave(); ?> +</section> diff --git a/wp-content/themes/smilia/components/site-footer/site-footer.css b/wp-content/themes/smilia/components/site-footer/site-footer.css new file mode 100644 index 0000000..ed8d62c --- /dev/null +++ b/wp-content/themes/smilia/components/site-footer/site-footer.css @@ -0,0 +1,154 @@ +.site-footer { + padding-block: var(--space-8); + background: var(--color-accent-strong); + color: var(--color-on-dark-muted); +} + +.site-footer__inner { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: var(--space-4) var(--space-8); +} + +.logo--inverse { + color: var(--color-white); +} + +.logo--inverse .logo__mark { + width: 2.125rem; + filter: brightness(0) invert(1); +} + +.logo--inverse .logo__text { + font-size: var(--text-2xl); +} + +.footer-nav__list { + display: flex; + flex-wrap: wrap; + gap: var(--space-6); +} + +.footer-nav__link { + color: var(--color-on-dark-muted); + font-weight: var(--font-weight-bold); + transition: color var(--duration-fast) ease; +} + +.site-footer__bottom { + display: flex; + flex-wrap: wrap; + align-items: center; + justify-content: space-between; + gap: var(--space-2) var(--space-8); + margin-top: var(--space-4); + padding-top: var(--space-4); + border-top: 1px solid color-mix(in srgb, var(--color-white) 18%, transparent); +} + +.site-footer__copyright { + color: var(--color-on-dark-muted); + font-size: var(--fs-small); +} + +.site-footer__legal { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--space-2) var(--space-6); + font-size: var(--fs-small); +} + +.footer-legal__list { + display: flex; + flex-wrap: wrap; + gap: var(--space-2) var(--space-6); +} + +.footer-legal__link { + position: relative; + color: var(--color-on-dark-muted); + font-weight: var(--font-weight-bold); + text-decoration: underline; + text-underline-offset: 0.2em; + transition: color var(--duration-fast) ease; +} + +.site-footer__consent-button { + position: relative; + padding: 0; + background: none; + border: 0; + font: inherit; + cursor: pointer; + color: var(--color-on-dark-muted); + font-weight: var(--font-weight-bold); + text-decoration: underline; + text-underline-offset: 0.2em; + transition: color var(--duration-fast) ease; +} + +@media (pointer: coarse) { + .site-footer__consent-button::before { + content: ""; + position: absolute; + inset: calc(var(--space-3) * -1) calc(var(--space-2) * -1); + } +} + +@media (pointer: coarse) { + .footer-nav__link, + .footer-legal__link { + display: inline-block; + padding: var(--space-3) var(--space-2); + } + + .footer-legal__list { + gap: 0 var(--space-4); + } +} + +@media (hover: hover) { + .footer-nav__link:hover, + .footer-legal__link:hover, + .site-footer__consent-button:hover, + .logo--inverse:hover { + color: var(--color-white); + } +} + +@media (max-width: 560px) { + .site-footer__inner { + flex-direction: column; + align-items: center; + } + + .footer-nav__list { + justify-content: center; + gap: var(--space-3) var(--space-5); + } + + .site-footer__bottom { + flex-direction: column; + justify-content: center; + } + + .site-footer__copyright { + text-align: center; + } + + .site-footer__legal { + justify-content: center; + text-align: center; + } + + .footer-legal__list { + justify-content: center; + } +} + +.site-footer :focus-visible { + outline-color: var(--color-white); +} diff --git a/wp-content/themes/smilia/components/site-footer/site-footer.js b/wp-content/themes/smilia/components/site-footer/site-footer.js new file mode 100644 index 0000000..93db02a --- /dev/null +++ b/wp-content/themes/smilia/components/site-footer/site-footer.js @@ -0,0 +1,7 @@ +( () => { + document.querySelectorAll( '[data-consent-open]' ).forEach( ( button ) => { + button.addEventListener( 'click', () => { + document.dispatchEvent( new CustomEvent( 'smilia:consent-open' ) ); + } ); + } ); +} )(); diff --git a/wp-content/themes/smilia/components/site-footer/site-footer.php b/wp-content/themes/smilia/components/site-footer/site-footer.php new file mode 100644 index 0000000..8de763b --- /dev/null +++ b/wp-content/themes/smilia/components/site-footer/site-footer.php @@ -0,0 +1,62 @@ +<?php + +use Smilia\Theme\Media; +use Smilia\Theme\Nav_Walker; + +defined( 'ABSPATH' ) || exit; +?> +<footer class="site-footer"> + <div class="container site-footer__inner"> + <a class="logo logo--inverse" href="<?php echo esc_url( home_url( '/' ) ); ?>" aria-label="<?php esc_attr_e( 'Smilia, на главную', 'smilia' ); ?>"> + <?php Media::svg( 'smilia-mark.svg', 'logo__mark' ); ?> + <span class="logo__text">Smilia</span> + </a> + <nav class="footer-nav" aria-label="<?php esc_attr_e( 'Меню в подвале', 'smilia' ); ?>"> + <?php + wp_nav_menu( + array( + 'theme_location' => 'footer', + 'container' => false, + 'items_wrap' => '<ul class="footer-nav__list">%3$s</ul>', + 'walker' => new Nav_Walker( 'footer-nav' ), + 'depth' => 1, + 'fallback_cb' => false, + ) + ); + ?> + </nav> + </div> + <div class="container"> + <div class="site-footer__bottom"> + <p class="site-footer__copyright"> + <?php + echo esc_html( + sprintf( + __( '© %s Smilia, детская стоматология в Лодзи.', 'smilia' ), + wp_date( 'Y' ) + ) + ); + ?> + </p> + <div class="site-footer__legal"> + <nav class="footer-legal" aria-label="<?php esc_attr_e( 'Документы', 'smilia' ); ?>"> + <?php + wp_nav_menu( + array( + 'theme_location' => 'footer_legal', + 'container' => false, + 'items_wrap' => '<ul class="footer-legal__list">%3$s</ul>', + 'walker' => new Nav_Walker( 'footer-legal' ), + 'depth' => 1, + 'fallback_cb' => false, + ) + ); + ?> + </nav> + <p class="site-footer__consent"> + <button type="button" class="site-footer__consent-button" data-consent-open><?php esc_html_e( 'Настройки согласия', 'smilia' ); ?></button> + </p> + </div> + </div> + </div> +</footer> diff --git a/wp-content/themes/smilia/components/site-header/site-header.css b/wp-content/themes/smilia/components/site-header/site-header.css new file mode 100644 index 0000000..7fcf2a2 --- /dev/null +++ b/wp-content/themes/smilia/components/site-header/site-header.css @@ -0,0 +1,518 @@ +.site-header { + --site-header-height: 4.5rem; + --site-header-book-width: 10.75rem; + --site-header-call-width: 9.75rem; + position: sticky; + top: 0; + z-index: 50; + background: var(--color-surface); + box-shadow: var(--shadow-sm); +} + +.admin-bar .site-header { + top: var(--wp-admin--admin-bar--height, 0px); +} + +.site-header__inner { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--space-6); + min-height: var(--site-header-height); + padding-block: var(--space-3); +} + +.site-header__actions { + display: flex; + align-items: center; + gap: var(--space-4); +} + +.site-header__book { + min-width: var(--site-header-book-width); +} + +.call-menu__toggle { + min-width: var(--site-header-call-width); +} + +.site-header__burger { + display: none; + flex-direction: column; + justify-content: center; + gap: 0.375rem; + width: 2.75rem; + height: 2.75rem; + padding: 0 var(--space-2); + background: none; + border: 0; + border-radius: var(--radius-full); + cursor: pointer; + transition: transform 0.08s ease; +} + +.site-header__burger-line { + display: block; + height: 2px; + background: var(--color-accent-strong); + border-radius: var(--radius-full); + transition: transform var(--duration-fast) ease, opacity var(--duration-fast) ease; +} + +.site-header--open .site-header__burger-line:nth-child(1) { + transform: translateY(0.5rem) rotate(45deg); +} + +.site-header--open .site-header__burger-line:nth-child(2) { + opacity: 0; +} + +.site-header--open .site-header__burger-line:nth-child(3) { + transform: translateY(-0.5rem) rotate(-45deg); +} + +.logo { + position: relative; + display: inline-flex; + align-items: center; + gap: var(--space-2); + color: var(--color-accent); +} + +@media (pointer: coarse) { + .logo::before { + content: ""; + position: absolute; + inset: calc(var(--space-2) * -1) 0; + } +} + +.logo__mark { + width: 2.875rem; + height: auto; +} + +.logo__text { + font-family: var(--font-logo); + font-size: var(--text-3xl); + font-weight: var(--font-weight-bold); + letter-spacing: 0.02em; + line-height: 1; +} + +.site-nav__list { + display: flex; + align-items: center; + gap: var(--space-6); +} + +.site-nav__item { + position: relative; +} + +.site-nav__link { + display: inline-flex; + align-items: center; + gap: var(--space-2); + padding-block: var(--space-2); + font-size: var(--fs-body); + font-weight: var(--font-weight-semibold); + white-space: nowrap; + transition: color var(--duration-fast) ease; +} + +.site-nav__link--current { + color: var(--color-accent-strong); +} + +.site-nav__item--has-children > .site-nav__link::after { + content: ""; + width: 0.45em; + height: 0.45em; + margin-top: -0.2em; + border-right: 2px solid currentColor; + border-bottom: 2px solid currentColor; + opacity: 0.55; + transform: rotate(45deg); + transition: transform var(--duration-fast) ease, opacity var(--duration-fast) ease; +} + +.site-nav__item--has-children:focus-within > .site-nav__link::after { + opacity: 1; + transform: translateY(0.2em) rotate(225deg); +} + +.site-nav__dropdown { + position: absolute; + top: 100%; + left: 50%; + z-index: 60; + display: flex; + flex-direction: column; + gap: 2px; + width: 18rem; + padding: var(--space-4) var(--space-3) var(--space-3); + margin-top: var(--space-4); + background: var(--color-surface); + border-top: 4px solid var(--color-accent); + border-radius: var(--radius-2xl); + box-shadow: var(--shadow-lg); + opacity: 0; + visibility: hidden; + transform: translate(-50%, var(--space-2)); + transition: opacity var(--duration-fast) ease, transform var(--duration-fast) ease, visibility var(--duration-fast); + transition-delay: 0.15s; +} + +.site-nav__dropdown::before { + content: ""; + position: absolute; + inset: calc(var(--space-4) * -1 - 4px) 0 auto; + height: var(--space-4); +} + +.site-nav__item--has-children:focus-within > .site-nav__dropdown { + opacity: 1; + visibility: visible; + transform: translate(-50%, 0); + transition-delay: 0s; +} + +.site-nav__sublink { + display: block; + padding: var(--space-3) var(--space-4); + border-radius: var(--radius-lg); + color: var(--color-text-strong); + font-size: var(--fs-body); + font-weight: var(--font-weight-semibold); + transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease; +} + +.site-nav { + display: flex; + align-items: center; + gap: var(--space-6); +} + + +.lang-menu { + position: relative; +} + +.lang-menu__toggle { + display: inline-flex; + align-items: center; + gap: var(--space-2); + min-height: 2.75rem; + padding: 0 var(--space-2); + background: none; + border: 0; + border-radius: var(--radius-full); + color: var(--color-text-strong); + font-family: inherit; + font-size: var(--fs-body); + font-weight: var(--font-weight-bold); + cursor: pointer; + transition: color var(--duration-fast) ease, transform 0.08s ease; +} + +.lang-menu__toggle::after { + content: ""; + width: 0.45em; + height: 0.45em; + margin-top: -0.2em; + border-right: 2px solid currentColor; + border-bottom: 2px solid currentColor; + opacity: 0.55; + transform: rotate(45deg); + transition: transform var(--duration-fast) ease, opacity var(--duration-fast) ease; +} + +.lang-menu__toggle[aria-expanded="true"]::after { + opacity: 1; + transform: translateY(0.2em) rotate(225deg); +} + +.lang-menu__panel { + position: absolute; + top: calc(100% + var(--space-3)); + right: 0; + z-index: 20; + display: flex; + flex-direction: column; + gap: 2px; + min-width: 11rem; + padding: var(--space-3); + background: var(--color-surface); + border-radius: var(--radius-2xl); + box-shadow: var(--shadow-lg); +} + +.lang-menu__panel[hidden] { + display: none; +} + +.lang-menu__item { + display: block; + padding: var(--space-2) var(--space-4); + border-radius: var(--radius-lg); + color: var(--color-text-strong); + font-weight: var(--font-weight-semibold); + transition: background-color var(--duration-fast) ease, color var(--duration-fast) ease; +} + +.lang-menu__item--current { + background: var(--color-accent-soft); + color: var(--color-accent-strong); +} + + + +.site-nav__phones, +.site-nav__book { + display: none; +} + +.call-menu { + position: relative; +} + +.call-menu__panel { + position: absolute; + top: calc(100% + var(--space-3)); + right: 0; + z-index: 20; + display: flex; + flex-direction: column; + gap: var(--space-4); + min-width: 18rem; + padding: var(--space-6); + background: var(--color-surface); + border-radius: var(--radius-2xl); + box-shadow: var(--shadow-lg); +} + +.call-menu__panel[hidden] { + display: none; +} + +.call-menu__panel::before { + content: ""; + position: absolute; + top: -0.5rem; + right: 2.75rem; + width: 1rem; + height: 1rem; + background: var(--color-surface); + transform: rotate(45deg); +} + +.call-menu__item { + display: flex; + flex-direction: column; + gap: 2px; +} + +.call-menu__label { + color: var(--color-text-faint); + font-size: var(--fs-small); + font-weight: var(--font-weight-semibold); +} + +.call-menu__number { + color: var(--color-accent-strong); + font-size: var(--text-lg); + font-weight: var(--font-weight-bold); +} + +.site-header__burger:active, +.lang-menu__toggle:active { + transform: scale(0.94); +} + +.site-nav__item--has-children.site-nav__item.site-nav__item--dismissed > .site-nav__dropdown { + opacity: 0; + visibility: hidden; +} + +.site-nav__item--has-children.site-nav__item.site-nav__item--dismissed > .site-nav__link::after { + opacity: 0.55; + transform: rotate(45deg); +} + +@media (hover: hover) { + .site-nav__item--has-children:hover > .site-nav__link::after { + opacity: 1; + transform: translateY(0.2em) rotate(225deg); + } + + .site-nav__item--has-children:hover > .site-nav__dropdown { + opacity: 1; + visibility: visible; + transform: translate(-50%, 0); + transition-delay: 0s; + } + + .site-nav__sublink:hover { + background: var(--color-accent-soft); + color: var(--color-accent-strong); + } + + .call-menu__item:hover .call-menu__number { + color: var(--color-accent); + } + + .site-header__burger:hover .site-header__burger-line { + background: var(--color-accent); + } + + .lang-menu__toggle:hover { + color: var(--color-accent-strong); + } + + .lang-menu__item:hover { + background: var(--color-accent-soft); + color: var(--color-accent-strong); + } +} + +@media (max-width: 1310px), (hover: none) { + .site-header__burger { + display: flex; + } + + .site-nav { + position: absolute; + top: 100%; + right: 0; + left: 0; + display: none; + max-height: calc(100dvh - var(--site-nav-top, var(--site-header-height))); + padding: var(--space-4) var(--gutter) var(--space-8); + overflow-y: auto; + background: var(--color-surface); + border-top: 1px solid var(--color-line-soft); + box-shadow: var(--shadow-lg); + } + + .site-header--open .site-nav { + display: block; + } + + + + + .site-nav__list { + flex-direction: column; + align-items: stretch; + gap: 0; + } + + .site-nav__link { + display: flex; + padding-block: var(--space-3); + font-size: var(--text-lg); + } + + .site-nav__item--has-children > .site-nav__link::after { + display: none; + } + + .site-nav__dropdown { + position: static; + width: auto; + padding: 0 0 var(--space-2) var(--space-4); + margin-top: 0; + background: none; + border-top: 0; + border-radius: 0; + box-shadow: none; + opacity: 1; + visibility: visible; + transform: none; + } + + .site-nav__dropdown::before { + display: none; + } + + .site-nav__item--has-children:hover > .site-nav__dropdown, + .site-nav__item--has-children:focus-within > .site-nav__dropdown { + transform: none; + } + + .site-nav__sublink { + margin-left: calc(var(--space-3) * -1); + padding: var(--space-2) var(--space-3); + color: var(--color-text-muted); + } +} + +@media (max-width: 760px) { + .call-menu { + display: none; + } + + .site-nav__phones { + display: flex; + flex-direction: column; + gap: var(--space-4); + margin-top: var(--space-4); + padding-top: var(--space-6); + border-top: 1px solid var(--color-line-soft); + } + + .logo__mark { + width: 2.25rem; + } + + .logo__text { + font-size: var(--text-2xl); + } +} + +@media (max-width: 560px) { + .site-header__inner { + gap: var(--space-3); + } + + .site-header__book { + display: none; + } + + .site-nav__book { + display: flex; + width: 100%; + margin-bottom: var(--space-4); + } +} + +@media (max-width: 400px) { + .site-header__inner { + gap: var(--space-2); + } + + .logo { + gap: var(--space-1); + } + + .logo__text { + font-size: var(--text-xl); + } +} + +@media (max-width: 600px) { + .admin-bar .site-header { + top: 0; + } +} + +@media (pointer: coarse) { + .lang-menu__item { + padding-block: var(--space-3); + } + + .site-nav__sublink { + padding-block: var(--space-3); + } +} diff --git a/wp-content/themes/smilia/components/site-header/site-header.js b/wp-content/themes/smilia/components/site-header/site-header.js new file mode 100644 index 0000000..fb3e777 --- /dev/null +++ b/wp-content/themes/smilia/components/site-header/site-header.js @@ -0,0 +1,120 @@ +(() => { + const setupDropdown = (root, toggle, panel) => { + const setOpen = (open) => { + panel.hidden = !open; + toggle.setAttribute('aria-expanded', String(open)); + }; + + toggle.addEventListener('click', () => setOpen(panel.hidden)); + + document.addEventListener('click', (event) => { + if (!panel.hidden && !root.contains(event.target)) { + setOpen(false); + } + }); + + document.addEventListener('keydown', (event) => { + if (event.key === 'Escape' && !panel.hidden) { + setOpen(false); + toggle.focus(); + } + }); + }; + + document.querySelectorAll('[data-dropdown]').forEach((root) => { + const toggle = root.querySelector('[data-dropdown-toggle]'); + const panel = root.querySelector('[data-dropdown-panel]'); + if (toggle && panel) { + setupDropdown(root, toggle, panel); + } + }); +})(); + +(() => { + const header = document.querySelector('[data-site-header]'); + const burger = header?.querySelector('.site-header__burger'); + const nav = header?.querySelector('.site-nav'); + if (!burger || !nav) { + return; + } + const desktop = window.matchMedia('(min-width: 1311px) and (hover: hover)'); + + const syncTop = () => { + header.style.setProperty('--site-nav-top', `${Math.max(0, header.getBoundingClientRect().bottom)}px`); + }; + + const setOpen = (open) => { + header.classList.toggle('site-header--open', open); + burger.setAttribute('aria-expanded', String(open)); + if (open) { + syncTop(); + nav.querySelector('a, button')?.focus({ preventScroll: true }); + } + }; + + burger.addEventListener('click', () => { + setOpen(!header.classList.contains('site-header--open')); + }); + + nav.addEventListener('click', (event) => { + if (event.target.closest('a')) { + setOpen(false); + } + }); + + ['scroll', 'resize'].forEach((name) => { + window.addEventListener( + name, + () => { + if (header.classList.contains('site-header--open')) { + syncTop(); + } + }, + { passive: true } + ); + }); + + document.addEventListener('click', (event) => { + if (header.classList.contains('site-header--open') && !header.contains(event.target)) { + setOpen(false); + } + }); + + document.addEventListener('keydown', (event) => { + if (event.key === 'Escape' && header.classList.contains('site-header--open')) { + setOpen(false); + burger.focus(); + } + }); + + desktop.addEventListener('change', (event) => { + if (event.matches) { + setOpen(false); + } + }); +})(); + +(() => { + const items = document.querySelectorAll('.site-nav__item--has-children'); + + items.forEach((item) => { + const reset = () => item.classList.remove('site-nav__item--dismissed'); + item.addEventListener('mouseleave', reset); + item.addEventListener('focusout', (event) => { + if (!item.contains(event.relatedTarget)) { + reset(); + } + }); + }); + + document.addEventListener('keydown', (event) => { + if (event.key !== 'Escape') { + return; + } + const item = document.activeElement?.closest('.site-nav__item--has-children'); + if (item) { + item.classList.add('site-nav__item--dismissed'); + item.querySelector('.site-nav__link')?.focus(); + } + }); +})(); diff --git a/wp-content/themes/smilia/components/site-header/site-header.php b/wp-content/themes/smilia/components/site-header/site-header.php new file mode 100644 index 0000000..6fe89a7 --- /dev/null +++ b/wp-content/themes/smilia/components/site-header/site-header.php @@ -0,0 +1,90 @@ +<?php + +use Smilia\Theme\Data; +use Smilia\Theme\Media; +use Smilia\Theme\Nav_Walker; + +defined( 'ABSPATH' ) || exit; + +$smilia_languages = Data::languages(); +$smilia_phones = array_filter( + array( + __( 'Новый пациент', 'smilia' ) => Data::setting( 'phone_new' ), + __( 'Действующий пациент', 'smilia' ) => Data::setting( 'phone_current' ), + ) +); +?> +<header class="site-header" data-site-header> + <div class="site-header__inner container container--wide"> + <a class="logo" href="<?php echo esc_url( home_url( '/' ) ); ?>" aria-label="<?php esc_attr_e( 'Smilia, на главную', 'smilia' ); ?>"> + <?php Media::svg( 'smilia-mark.svg', 'logo__mark', '', 'eager' ); ?> + <span class="logo__text">Smilia</span> + </a> + + <nav class="site-nav" id="site-nav" aria-label="<?php esc_attr_e( 'Главное меню', 'smilia' ); ?>"> + <button type="button" class="button button--primary site-nav__book" data-booking-open><?php esc_html_e( 'Записаться', 'smilia' ); ?></button> + <?php + wp_nav_menu( + array( + 'theme_location' => 'primary', + 'container' => false, + 'items_wrap' => '<ul class="site-nav__list">%3$s</ul>', + 'walker' => new Nav_Walker( 'site-nav' ), + 'depth' => 2, + 'fallback_cb' => false, + ) + ); + ?> + <?php if ( $smilia_phones ) : ?> + <ul class="site-nav__phones"> + <?php foreach ( $smilia_phones as $smilia_label => $smilia_phone ) : ?> + <li> + <a class="call-menu__item" href="<?php echo esc_url( Data::tel( $smilia_phone ) ); ?>"> + <span class="call-menu__label"><?php echo esc_html( $smilia_label ); ?></span> + <span class="call-menu__number"><?php echo esc_html( $smilia_phone ); ?></span> + </a> + </li> + <?php endforeach; ?> + </ul> + <?php endif; ?> + </nav> + + <div class="site-header__actions"> + <?php if ( $smilia_languages ) : ?> + <div class="lang-menu" data-dropdown> + <?php foreach ( $smilia_languages as $smilia_language ) : ?> + <?php if ( $smilia_language['current_lang'] ) : ?> + <button type="button" class="lang-menu__toggle" aria-expanded="false" aria-controls="lang-menu-panel" aria-label="<?php echo esc_attr( sprintf( __( 'Язык сайта: %s', 'smilia' ), strtoupper( $smilia_language['slug'] ) ) ); ?>" data-dropdown-toggle><?php echo esc_html( strtoupper( $smilia_language['slug'] ) ); ?></button> + <?php endif; ?> + <?php endforeach; ?> + <ul class="lang-menu__panel" id="lang-menu-panel" hidden data-dropdown-panel> + <?php foreach ( $smilia_languages as $smilia_language ) : ?> + <li> + <a class="lang-menu__item<?php echo $smilia_language['current_lang'] ? ' lang-menu__item--current' : ''; ?>" href="<?php echo esc_url( $smilia_language['url'] ); ?>" hreflang="<?php echo esc_attr( $smilia_language['slug'] ); ?>" lang="<?php echo esc_attr( $smilia_language['slug'] ); ?>"<?php echo $smilia_language['current_lang'] ? ' aria-current="true"' : ''; ?>><?php echo esc_html( $smilia_language['name'] ); ?></a> + </li> + <?php endforeach; ?> + </ul> + </div> + <?php endif; ?> + <button type="button" class="button button--primary site-header__book" data-booking-open><?php esc_html_e( 'Записаться', 'smilia' ); ?></button> + <?php if ( $smilia_phones ) : ?> + <div class="call-menu" data-dropdown> + <button type="button" class="button button--outline call-menu__toggle" aria-expanded="false" aria-controls="call-menu-panel" data-dropdown-toggle><?php esc_html_e( 'Позвонить', 'smilia' ); ?></button> + <div class="call-menu__panel" id="call-menu-panel" hidden data-dropdown-panel> + <?php foreach ( $smilia_phones as $smilia_label => $smilia_phone ) : ?> + <a class="call-menu__item" href="<?php echo esc_url( Data::tel( $smilia_phone ) ); ?>"> + <span class="call-menu__label"><?php echo esc_html( $smilia_label ); ?></span> + <span class="call-menu__number"><?php echo esc_html( $smilia_phone ); ?></span> + </a> + <?php endforeach; ?> + </div> + </div> + <?php endif; ?> + <button type="button" class="site-header__burger" aria-expanded="false" aria-controls="site-nav" aria-label="<?php esc_attr_e( 'Меню', 'smilia' ); ?>"> + <span class="site-header__burger-line"></span> + <span class="site-header__burger-line"></span> + <span class="site-header__burger-line"></span> + </button> + </div> + </div> +</header> diff --git a/wp-content/themes/smilia/footer.php b/wp-content/themes/smilia/footer.php new file mode 100644 index 0000000..6f0b1a1 --- /dev/null +++ b/wp-content/themes/smilia/footer.php @@ -0,0 +1,15 @@ +<?php + +use Smilia\Theme\Components; + +defined( 'ABSPATH' ) || exit; +?> +</main> +<?php +Components::render( 'site-footer' ); +Components::render( 'booking' ); +Components::render( 'consent' ); +wp_footer(); +?> +</body> +</html> diff --git a/wp-content/themes/smilia/front-page.php b/wp-content/themes/smilia/front-page.php new file mode 100644 index 0000000..ee03c6f --- /dev/null +++ b/wp-content/themes/smilia/front-page.php @@ -0,0 +1,16 @@ +<?php + +use Smilia\Theme\Components; + +defined( 'ABSPATH' ) || exit; + +Components::use( array( 'demo-bar', 'site-header', 'site-footer', 'booking' ) ); + +get_header(); + +while ( have_posts() ) { + the_post(); + the_content(); +} + +get_footer(); diff --git a/wp-content/themes/smilia/functions.php b/wp-content/themes/smilia/functions.php new file mode 100644 index 0000000..bb70b50 --- /dev/null +++ b/wp-content/themes/smilia/functions.php @@ -0,0 +1,21 @@ +<?php + +namespace Smilia\Theme; + +defined( 'ABSPATH' ) || exit; + +spl_autoload_register( + static function ( string $class_name ): void { + $prefix = __NAMESPACE__ . '\\'; + if ( 0 !== strpos( $class_name, $prefix ) ) { + return; + } + $relative = substr( $class_name, strlen( $prefix ) ); + $file = __DIR__ . '/inc/class-' . strtolower( str_replace( '_', '-', $relative ) ) . '.php'; + if ( is_readable( $file ) ) { + require $file; + } + } +); + +Theme::instance()->register(); diff --git a/wp-content/themes/smilia/header.php b/wp-content/themes/smilia/header.php new file mode 100644 index 0000000..06ba956 --- /dev/null +++ b/wp-content/themes/smilia/header.php @@ -0,0 +1,18 @@ +<?php + +use Smilia\Theme\Components; + +defined( 'ABSPATH' ) || exit; +?><!doctype html> +<html <?php language_attributes(); ?>> +<head> +<meta charset="<?php bloginfo( 'charset' ); ?>"> +<meta name="viewport" content="width=device-width, initial-scale=1"> +<?php wp_head(); ?> +</head> +<body <?php body_class(); ?>> +<?php wp_body_open(); ?> +<a class="skip-link screen-reader-text" href="#main"><?php esc_html_e( 'Перейти к содержимому', 'smilia' ); ?></a> +<?php Components::render( 'demo-bar' ); ?> +<?php Components::render( 'site-header' ); ?> +<main id="main" class="site-main"> diff --git a/wp-content/themes/smilia/inc/class-assets.php b/wp-content/themes/smilia/inc/class-assets.php new file mode 100644 index 0000000..53cb83c --- /dev/null +++ b/wp-content/themes/smilia/inc/class-assets.php @@ -0,0 +1,71 @@ +<?php + +namespace Smilia\Theme; + +defined( 'ABSPATH' ) || exit; + +final class Assets { + + public function register(): void { + add_action( 'wp_enqueue_scripts', array( $this, 'enqueue' ), 5 ); + add_action( 'wp_enqueue_scripts', array( $this, 'dequeue_core' ), 100 ); + add_filter( 'should_load_separate_core_block_assets', '__return_true' ); + remove_action( 'wp_enqueue_scripts', 'wp_enqueue_global_styles' ); + remove_action( 'wp_footer', 'wp_enqueue_global_styles', 1 ); + add_action( 'wp_head', array( $this, 'preload_fonts' ), 1 ); + } + + public static function uri( string $path ): string { + return get_theme_file_uri( $path ); + } + + public static function version( string $path ): string { + $file = get_theme_file_path( $path ); + return is_readable( $file ) ? (string) filemtime( $file ) : wp_get_theme()->get( 'Version' ); + } + + public function enqueue(): void { + wp_enqueue_style( 'smilia-tokens', self::uri( 'assets/css/tokens.css' ), array(), self::version( 'assets/css/tokens.css' ) ); + wp_enqueue_style( 'smilia-base', self::uri( 'assets/css/base.css' ), array( 'smilia-tokens' ), self::version( 'assets/css/base.css' ) ); + wp_register_script( + 'smilia-phone-field', + self::uri( 'assets/js/phone-field.js' ), + array(), + self::version( 'assets/js/phone-field.js' ), + array( + 'in_footer' => true, + 'strategy' => 'defer', + ) + ); + wp_enqueue_script( + 'smilia-reveal', + self::uri( 'assets/js/reveal.js' ), + array(), + self::version( 'assets/js/reveal.js' ), + array( + 'in_footer' => true, + 'strategy' => 'defer', + ) + ); + Components::enqueue_used(); + } + + public function dequeue_core(): void { + wp_dequeue_style( 'wp-block-library' ); + wp_dequeue_style( 'classic-theme-styles' ); + } + + public function preload_fonts(): void { + $subsets = array( + 'ru' => array( 'cyrillic', 'latin' ), + 'pl' => array( 'latin', 'latin-ext' ), + ); + $fonts = array( 'assets/fonts/comfortaa-latin.woff2' ); + foreach ( $subsets[ substr( determine_locale(), 0, 2 ) ] ?? array( 'latin' ) as $subset ) { + $fonts[] = "assets/fonts/nunito-{$subset}.woff2"; + } + foreach ( $fonts as $font ) { + printf( '<link rel="preload" href="%s" as="font" type="font/woff2" crossorigin>' . "\n", esc_url( self::uri( $font ) ) ); + } + } +} diff --git a/wp-content/themes/smilia/inc/class-components.php b/wp-content/themes/smilia/inc/class-components.php new file mode 100644 index 0000000..6fd3e0f --- /dev/null +++ b/wp-content/themes/smilia/inc/class-components.php @@ -0,0 +1,55 @@ +<?php + +namespace Smilia\Theme; + +defined( 'ABSPATH' ) || exit; + +final class Components { + + private const SCRIPT_DEPS = array( + 'booking' => array( 'smilia-phone-field' ), + ); + + private static array $used = array(); + + public static function use( array $names ): void { + foreach ( $names as $name ) { + self::$used[ sanitize_key( $name ) ] = true; + } + } + + public static function enqueue_used(): void { + foreach ( array_keys( self::$used ) as $name ) { + self::enqueue( $name ); + } + } + + private static function enqueue( string $name ): void { + $css = "components/{$name}/{$name}.css"; + $js = "components/{$name}/{$name}.js"; + if ( is_readable( get_theme_file_path( $css ) ) ) { + wp_enqueue_style( "smilia-{$name}", Assets::uri( $css ), array( 'smilia-base' ), Assets::version( $css ) ); + } + if ( is_readable( get_theme_file_path( $js ) ) ) { + wp_enqueue_script( + "smilia-{$name}", + Assets::uri( $js ), + self::SCRIPT_DEPS[ $name ] ?? array(), + Assets::version( $js ), + array( + 'in_footer' => true, + 'strategy' => 'defer', + ) + ); + } + } + + public static function render( string $name, array $args = array() ): void { + $name = sanitize_key( $name ); + if ( ! isset( self::$used[ $name ] ) ) { + self::$used[ $name ] = true; + self::enqueue( $name ); + } + get_template_part( "components/{$name}/{$name}", null, $args ); + } +} diff --git a/wp-content/themes/smilia/inc/class-data.php b/wp-content/themes/smilia/inc/class-data.php new file mode 100644 index 0000000..e681b3c --- /dev/null +++ b/wp-content/themes/smilia/inc/class-data.php @@ -0,0 +1,51 @@ +<?php + +namespace Smilia\Theme; + +use Smilia\Core\Booking; +use Smilia\Core\Markup; +use Smilia\Core\Settings; + +defined( 'ABSPATH' ) || exit; + +final class Data { + + private static function ready(): bool { + return class_exists( Settings::class ); + } + + public static function setting( string $key ): string { + return self::ready() ? Settings::get( $key ) : ''; + } + + public static function tel( string $phone ): string { + return self::ready() ? Settings::tel( $phone ) : ''; + } + + public static function languages(): array { + if ( ! function_exists( 'pll_the_languages' ) ) { + return array(); + } + $languages = pll_the_languages( + array( + 'raw' => 1, + 'hide_if_empty' => 0, + ) + ); + return is_array( $languages ) && count( $languages ) > 1 ? array_values( $languages ) : array(); + } + + public static function illustration( string $path, string $class_name, string $loading = 'lazy' ): void { + if ( self::ready() ) { + Markup::asset_svg( $path, $class_name, '', $loading ); + } + } + + public static function home_url(): string { + return function_exists( 'pll_home_url' ) ? pll_home_url() : home_url( '/' ); + } + + public static function booking(): array { + return self::ready() ? Booking::form_data() : array(); + } +} diff --git a/wp-content/themes/smilia/inc/class-media.php b/wp-content/themes/smilia/inc/class-media.php new file mode 100644 index 0000000..a6f53f6 --- /dev/null +++ b/wp-content/themes/smilia/inc/class-media.php @@ -0,0 +1,16 @@ +<?php + +namespace Smilia\Theme; + +use Smilia\Core\Picture; + +defined( 'ABSPATH' ) || exit; + +final class Media { + + public static function svg( string $file, string $class_name = '', string $alt = '', string $loading = 'lazy' ): void { + if ( class_exists( Picture::class ) ) { + Picture::svg( get_theme_file_path( 'assets/img/' . $file ), Assets::uri( 'assets/img/' . $file ), $class_name, $alt, $loading ); + } + } +} diff --git a/wp-content/themes/smilia/inc/class-nav-walker.php b/wp-content/themes/smilia/inc/class-nav-walker.php new file mode 100644 index 0000000..8f9cde4 --- /dev/null +++ b/wp-content/themes/smilia/inc/class-nav-walker.php @@ -0,0 +1,58 @@ +<?php + +namespace Smilia\Theme; + +use Walker_Nav_Menu; + +defined( 'ABSPATH' ) || exit; + +final class Nav_Walker extends Walker_Nav_Menu { + + private string $block; + + public function __construct( string $block = 'site-nav' ) { + $this->block = $block; + } + + public function start_lvl( &$output, $depth = 0, $args = null ): void { + $output .= '<ul class="' . esc_attr( $this->block ) . '__dropdown">'; + } + + public function end_lvl( &$output, $depth = 0, $args = null ): void { + $output .= '</ul>'; + } + + public function start_el( &$output, $data_object, $depth = 0, $args = null, $current_object_id = 0 ): void { + $item = $data_object; + $classes = (array) $item->classes; + $children = in_array( 'menu-item-has-children', $classes, true ); + $anchor = false !== strpos( (string) $data_object->url, '#' ); + $exact = in_array( 'current-menu-item', $classes, true ) && ! $anchor; + $current = ( $exact || in_array( 'current-menu-ancestor', $classes, true ) ) && ! $anchor; + $element = 0 === $depth ? 'item' : 'subitem'; + $link = 0 === $depth ? 'link' : 'sublink'; + + $li_class = $this->block . '__' . $element; + if ( $children ) { + $li_class .= ' ' . $this->block . '__' . $element . '--has-children'; + } + + $a_class = $this->block . '__' . $link; + if ( $current ) { + $a_class .= ' ' . $this->block . '__' . $link . '--current'; + } + + $output .= '<li class="' . esc_attr( $li_class ) . '">'; + $output .= sprintf( + '<a class="%s" href="%s"%s>%s</a>', + esc_attr( $a_class ), + esc_url( $item->url ), + $exact ? ' aria-current="page"' : '', + esc_html( apply_filters( 'the_title', $item->title, $item->ID ) ) + ); + } + + public function end_el( &$output, $data_object, $depth = 0, $args = null ): void { + $output .= '</li>'; + } +} diff --git a/wp-content/themes/smilia/inc/class-theme.php b/wp-content/themes/smilia/inc/class-theme.php new file mode 100644 index 0000000..8f2c188 --- /dev/null +++ b/wp-content/themes/smilia/inc/class-theme.php @@ -0,0 +1,99 @@ +<?php + +namespace Smilia\Theme; + +defined( 'ABSPATH' ) || exit; + +final class Theme { + + private static ?Theme $instance = null; + + public static function instance(): Theme { + if ( null === self::$instance ) { + self::$instance = new self(); + } + return self::$instance; + } + + public function register(): void { + add_action( 'after_setup_theme', array( $this, 'setup' ) ); + add_action( 'init', array( $this, 'clean_head' ) ); + add_filter( 'image_editor_output_format', array( $this, 'webp_output' ) ); + add_filter( 'wp_editor_set_quality', array( $this, 'image_quality' ), 10, 2 ); + add_filter( 'big_image_size_threshold', array( $this, 'big_image_threshold' ) ); + add_filter( 'max_srcset_image_width', array( $this, 'max_srcset_width' ) ); + add_filter( 'wp_img_tag_add_auto_sizes', '__return_true' ); + add_filter( 'site_icon_meta_tags', array( $this, 'mobile_icons' ) ); + ( new Assets() )->register(); + } + + public function setup(): void { + load_theme_textdomain( 'smilia', get_template_directory() . '/languages' ); + add_theme_support( 'title-tag' ); + add_theme_support( 'post-thumbnails' ); + add_theme_support( 'responsive-embeds' ); + add_theme_support( 'editor-styles' ); + add_editor_style( array( 'assets/css/tokens.css', 'assets/css/base.css', 'assets/css/editor.css' ) ); + add_theme_support( 'html5', array( 'search-form', 'gallery', 'caption', 'style', 'script', 'navigation-widgets' ) ); + register_nav_menus( + array( + 'primary' => __( 'Главное меню', 'smilia' ), + 'footer' => __( 'Меню в подвале', 'smilia' ), + 'footer_legal' => __( 'Документы в подвале', 'smilia' ), + ) + ); + add_image_size( 'smilia-480', 480, 0 ); + add_image_size( 'smilia-800', 800, 0 ); + add_image_size( 'smilia-1600', 1600, 0 ); + add_image_size( 'smilia-1920', 1920, 0 ); + add_image_size( 'smilia-2560', 2560, 0 ); + } + + public function mobile_icons( array $tags ): array { + $tags = array_values( array_filter( $tags, static fn( string $tag ): bool => false === strpos( $tag, 'apple-touch-icon' ) ) ); + $tags[] = sprintf( '<link rel="apple-touch-icon" href="%s" />', esc_url( self::asset_url( 'assets/img/icons/apple-touch-icon.png' ) ) ); + $tags[] = sprintf( '<link rel="manifest" href="%s" />', esc_url( self::asset_url( 'assets/site.webmanifest' ) ) ); + return $tags; + } + + private static function asset_url( string $path ): string { + $file = get_theme_file_path( $path ); + return add_query_arg( 'ver', is_readable( $file ) ? (string) filemtime( $file ) : '1', get_theme_file_uri( $path ) ); + } + + public function clean_head(): void { + remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); + remove_action( 'wp_print_styles', 'print_emoji_styles' ); + remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); + remove_action( 'admin_print_styles', 'print_emoji_styles' ); + remove_filter( 'the_content_feed', 'wp_staticize_emoji' ); + remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); + remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' ); + remove_action( 'wp_head', 'rsd_link' ); + remove_action( 'wp_head', 'wp_generator' ); + remove_action( 'wp_head', 'wp_shortlink_wp_head' ); + remove_action( 'wp_head', 'rest_output_link_wp_head' ); + remove_action( 'wp_head', 'wp_oembed_add_discovery_links' ); + remove_action( 'wp_head', 'feed_links', 2 ); + remove_action( 'wp_head', 'feed_links_extra', 3 ); + remove_action( 'template_redirect', 'rest_output_link_header', 11 ); + remove_action( 'template_redirect', 'wp_shortlink_header', 11 ); + } + + public function big_image_threshold(): int { + return 6000; + } + + public function max_srcset_width(): int { + return 2560; + } + + public function image_quality( int $quality, string $mime_type ): int { + return 'image/webp' === $mime_type ? 90 : $quality; + } + + public function webp_output( array $formats ): array { + $formats['image/jpeg'] = 'image/webp'; + return $formats; + } +} diff --git a/wp-content/themes/smilia/index.php b/wp-content/themes/smilia/index.php new file mode 100644 index 0000000..f353347 --- /dev/null +++ b/wp-content/themes/smilia/index.php @@ -0,0 +1,27 @@ +<?php + +use Smilia\Theme\Components; + +defined( 'ABSPATH' ) || exit; + +Components::use( array( 'demo-bar', 'site-header', 'site-footer', 'booking' ) ); + +get_header(); +?> +<div class="section"> + <div class="container"> + <?php + while ( have_posts() ) : + the_post(); + ?> + <article <?php post_class(); ?>> + <h1 class="section__title"><?php the_title(); ?></h1> + <div class="entry-content"><?php the_content(); ?></div> + </article> + <?php + endwhile; + ?> + </div> +</div> +<?php +get_footer(); diff --git a/wp-content/themes/smilia/languages/en_US.mo b/wp-content/themes/smilia/languages/en_US.mo new file mode 100644 index 0000000..ec2cc6d Binary files /dev/null and b/wp-content/themes/smilia/languages/en_US.mo differ diff --git a/wp-content/themes/smilia/languages/en_US.po b/wp-content/themes/smilia/languages/en_US.po new file mode 100644 index 0000000..f37b89e --- /dev/null +++ b/wp-content/themes/smilia/languages/en_US.po @@ -0,0 +1,194 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: Smilia\n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Domain: smilia\n" + +#: components/booking/booking.php:13 +msgid "Проверьте имя." +msgstr "Please check the name." + +#: components/booking/booking.php:14 +msgid "Проверьте номер телефона." +msgstr "Please check the phone number." + +#: components/booking/booking.php:15 +msgid "Нужно ваше согласие на обработку персональных данных." +msgstr "Consent to the processing of personal data is required." + +#: components/booking/booking.php:16 +msgid "Не получилось отправить заявку. Проверьте интернет или позвоните нам." +msgstr "" +"The request could not be sent. Check the connection or give us a call." + +#: components/booking/booking.php:17 +msgid "Слишком много заявок подряд. Попробуйте через минуту." +msgstr "Too many requests in a row. Please try again in a minute." + +#: components/booking/booking.php:21 +msgid "Закрыть" +msgstr "Close" + +#: components/booking/booking.php:28 components/booking/booking.php:110 +msgid "Демонстрационный сайт: заявка не будет обработана." +msgstr "Demo site: the request will not be processed." + +#: components/booking/booking.php:32 +msgid "Ваше имя" +msgstr "Name" + +#: components/booking/booking.php:33 +msgid "Как к вам обращаться" +msgstr "How to address you" + +#: components/booking/booking.php:36 +msgid "Телефон" +msgstr "Phone" + +#: components/booking/booking.php:41 +msgid "Возраст" +msgstr "Age" + +#: components/booking/booking.php:42 +msgid "5 лет" +msgstr "5 years" + +#: components/booking/booking.php:45 +msgid "Что беспокоит" +msgstr "Reason for visit" + +#: components/booking/booking.php:58 +msgid "Сайт" +msgstr "Website" + +#: components/booking/booking.php:71 +#, php-format +msgid "" +"Нажимая «%1$s», я соглашаюсь на обработку <a href=\"%2$s\" " +"target=\"_blank\">персональных данных</a> на условиях и для целей, " +"определённых <a href=\"%3$s\" target=\"_blank\">Политикой " +"конфиденциальности</a>." +msgstr "" +"By clicking “%1$s”, I agree to the processing of my <a href=\"%2$s\" " +"target=\"_blank\">personal data</a> on the terms and for the purposes set " +"out in the <a href=\"%3$s\" target=\"_blank\">Privacy Policy</a>." + +#: components/booking/booking.php:111 +msgid "Хорошо" +msgstr "OK" + +#: components/demo-bar/demo-bar.php:11 +#, php-format +msgid "" +"Сайт представлен <a class=\"demo-bar__link\" href=\"%1$s\">jimagie</a> в " +"демонстрационных целях: заявки не обрабатываются. <a class=\"demo-" +"bar__link\" href=\"%4$s\">Список страниц</a>. По вопросам: <a class=\"demo-" +"bar__link\" href=\"%3$s\">%2$s</a>" +msgstr "" +"Site presented by <a class=\"demo-bar__link\" href=\"%1$s\">jimagie</a> for " +"demonstration purposes: requests are not processed. <a class=\"demo-" +"bar__link\" href=\"%4$s\">List of pages</a>. Questions: <a class=\"demo-" +"bar__link\" href=\"%3$s\">%2$s</a>" + +#: components/demo-bar/demo-bar.php:19 +msgid "https://jimagie.com/ru/" +msgstr "https://jimagie.com/" + +#: components/not-found/not-found.php:13 +msgid "Такой страницы нет" +msgstr "This page does not exist" + +#: components/not-found/not-found.php:14 +msgid "Возможно, адрес изменился или в нём опечатка." +msgstr "The address may have changed or contain a typo." + +#: components/not-found/not-found.php:16 +msgid "На главную" +msgstr "Back to home" + +#: components/not-found/not-found.php:17 +#: components/site-header/site-header.php:77 +msgid "Записаться" +msgstr "Book a visit" + +#: components/site-footer/site-footer.php:10 +#: components/site-header/site-header.php:19 +msgid "Smilia, на главную" +msgstr "Smilia, home page" + +#: components/site-footer/site-footer.php:14 inc/class-theme.php:40 +msgid "Меню в подвале" +msgstr "Footer menu" + +#: components/site-footer/site-footer.php:34 +msgid "© %s Smilia, детская стоматология в Лодзи." +msgstr "© %s Smilia, pediatric dentistry in Łódź." + +#: components/site-header/site-header.php:12 +msgid "Новый пациент" +msgstr "New patient" + +#: components/site-header/site-header.php:13 +msgid "Действующий пациент" +msgstr "Existing patient" + +#: components/site-header/site-header.php:24 inc/class-theme.php:39 +msgid "Главное меню" +msgstr "Main menu" + +#: components/site-header/site-header.php:65 +msgid "Язык сайта: %s" +msgstr "Site language: %s" + +#: components/site-header/site-header.php:80 +msgid "Позвонить" +msgstr "Call" + +#: components/site-header/site-header.php:91 +msgid "Меню" +msgstr "Menu" + +#: header.php:15 +msgid "Перейти к содержимому" +msgstr "Skip to content" + +#: components/site-footer/site-footer.php:1 +msgid "Отозвать согласие на карту Google" +msgstr "Withdraw consent for Google Maps" + +#: components/site-footer/site-footer.php:1 +msgid "Согласие на карту отозвано." +msgstr "Consent for the map has been withdrawn." + +msgid "Сайт использует cookie и сторонние сервисы." +msgstr "The site uses cookies and third-party services." + +msgid "Принять" +msgstr "Accept" + +msgid "Отклонить" +msgstr "Decline" + +msgid "Настройки согласия" +msgstr "Consent settings" + +msgid "Согласие на сторонние сервисы" +msgstr "Consent to third-party services" + +#: components/consent/consent.php:13 +#, php-format +msgid "Подробнее в <a href=\"%s\" target=\"_blank\">политике конфиденциальности</a>." +msgstr "Learn more in the <a href=\"%s\" target=\"_blank\">privacy policy</a>." + +#: components/site-footer/site-footer.php +msgid "Документы" +msgstr "Documents" + +#: inc/class-theme.php:42 +msgid "Документы в подвале" +msgstr "Footer documents" diff --git a/wp-content/themes/smilia/languages/pl_PL.mo b/wp-content/themes/smilia/languages/pl_PL.mo new file mode 100644 index 0000000..5710595 Binary files /dev/null and b/wp-content/themes/smilia/languages/pl_PL.mo differ diff --git a/wp-content/themes/smilia/languages/pl_PL.po b/wp-content/themes/smilia/languages/pl_PL.po new file mode 100644 index 0000000..12ead68 --- /dev/null +++ b/wp-content/themes/smilia/languages/pl_PL.po @@ -0,0 +1,197 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: Smilia\n" +"Language: pl_PL\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" +"X-Domain: smilia\n" + +#: components/booking/booking.php:13 +msgid "Проверьте имя." +msgstr "Sprawdź imię." + +#: components/booking/booking.php:14 +msgid "Проверьте номер телефона." +msgstr "Sprawdź numer telefonu." + +#: components/booking/booking.php:15 +msgid "Нужно ваше согласие на обработку персональных данных." +msgstr "Potrzebna jest zgoda na przetwarzanie danych osobowych." + +#: components/booking/booking.php:16 +msgid "Не получилось отправить заявку. Проверьте интернет или позвоните нам." +msgstr "" +"Nie udało się wysłać zgłoszenia. Sprawdź połączenie z internetem lub " +"zadzwoń." + +#: components/booking/booking.php:17 +msgid "Слишком много заявок подряд. Попробуйте через минуту." +msgstr "Zbyt wiele zgłoszeń z rzędu. Spróbuj ponownie za minutę." + +#: components/booking/booking.php:21 +msgid "Закрыть" +msgstr "Zamknij" + +#: components/booking/booking.php:28 components/booking/booking.php:110 +msgid "Демонстрационный сайт: заявка не будет обработана." +msgstr "Strona demonstracyjna: zgłoszenie nie zostanie zrealizowane." + +#: components/booking/booking.php:32 +msgid "Ваше имя" +msgstr "Imię" + +#: components/booking/booking.php:33 +msgid "Как к вам обращаться" +msgstr "Jak się zwracać" + +#: components/booking/booking.php:36 +msgid "Телефон" +msgstr "Telefon" + +#: components/booking/booking.php:41 +msgid "Возраст" +msgstr "Wiek" + +#: components/booking/booking.php:42 +msgid "5 лет" +msgstr "5 lat" + +#: components/booking/booking.php:45 +msgid "Что беспокоит" +msgstr "Powód wizyty" + +#: components/booking/booking.php:58 +msgid "Сайт" +msgstr "Strona" + +#: components/booking/booking.php:71 +#, php-format +msgid "" +"Нажимая «%1$s», я соглашаюсь на обработку <a href=\"%2$s\" " +"target=\"_blank\">персональных данных</a> на условиях и для целей, " +"определённых <a href=\"%3$s\" target=\"_blank\">Политикой " +"конфиденциальности</a>." +msgstr "" +"Klikając „%1$s”, wyrażam zgodę na przetwarzanie moich <a href=\"%2$s\" " +"target=\"_blank\">danych osobowych</a> na warunkach i w celach określonych w" +" <a href=\"%3$s\" target=\"_blank\">Polityce prywatności</a>." + +#: components/booking/booking.php:111 +msgid "Хорошо" +msgstr "OK" + +#: components/demo-bar/demo-bar.php:11 +#, php-format +msgid "" +"Сайт представлен <a class=\"demo-bar__link\" href=\"%1$s\">jimagie</a> в " +"демонстрационных целях: заявки не обрабатываются. <a class=\"demo-" +"bar__link\" href=\"%4$s\">Список страниц</a>. По вопросам: <a class=\"demo-" +"bar__link\" href=\"%3$s\">%2$s</a>" +msgstr "" +"Strona przygotowana przez <a class=\"demo-bar__link\" " +"href=\"%1$s\">jimagie</a> w celach demonstracyjnych: zgłoszenia nie są " +"realizowane. <a class=\"demo-bar__link\" href=\"%4$s\">Lista stron</a>. " +"Pytania: <a class=\"demo-bar__link\" href=\"%3$s\">%2$s</a>" + +#: components/demo-bar/demo-bar.php:19 +msgid "https://jimagie.com/ru/" +msgstr "https://jimagie.com/pl/" + +#: components/not-found/not-found.php:13 +msgid "Такой страницы нет" +msgstr "Nie ma takiej strony" + +#: components/not-found/not-found.php:14 +msgid "Возможно, адрес изменился или в нём опечатка." +msgstr "Możliwe, że adres się zmienił albo zawiera literówkę." + +#: components/not-found/not-found.php:16 +msgid "На главную" +msgstr "Na stronę główną" + +#: components/not-found/not-found.php:17 +#: components/site-header/site-header.php:77 +msgid "Записаться" +msgstr "Umów wizytę" + +#: components/site-footer/site-footer.php:10 +#: components/site-header/site-header.php:19 +msgid "Smilia, на главную" +msgstr "Smilia, strona główna" + +#: components/site-footer/site-footer.php:14 inc/class-theme.php:40 +msgid "Меню в подвале" +msgstr "Menu w stopce" + +#: components/site-footer/site-footer.php:34 +msgid "© %s Smilia, детская стоматология в Лодзи." +msgstr "© %s Smilia, stomatologia dziecięca w Łodzi." + +#: components/site-header/site-header.php:12 +msgid "Новый пациент" +msgstr "Nowy pacjent" + +#: components/site-header/site-header.php:13 +msgid "Действующий пациент" +msgstr "Obecny pacjent" + +#: components/site-header/site-header.php:24 inc/class-theme.php:39 +msgid "Главное меню" +msgstr "Menu główne" + +#: components/site-header/site-header.php:65 +msgid "Язык сайта: %s" +msgstr "Język strony: %s" + +#: components/site-header/site-header.php:80 +msgid "Позвонить" +msgstr "Zadzwoń" + +#: components/site-header/site-header.php:91 +msgid "Меню" +msgstr "Menu" + +#: header.php:15 +msgid "Перейти к содержимому" +msgstr "Przejdź do treści" + +#: components/site-footer/site-footer.php:1 +msgid "Отозвать согласие на карту Google" +msgstr "Wycofaj zgodę na mapę Google" + +#: components/site-footer/site-footer.php:1 +msgid "Согласие на карту отозвано." +msgstr "Zgoda na mapę została wycofana." + +msgid "Сайт использует cookie и сторонние сервисы." +msgstr "Strona korzysta z plików cookie i usług zewnętrznych." + +msgid "Принять" +msgstr "Zaakceptuj" + +msgid "Отклонить" +msgstr "Odrzuć" + +msgid "Настройки согласия" +msgstr "Ustawienia zgód" + +msgid "Согласие на сторонние сервисы" +msgstr "Zgoda na usługi zewnętrzne" + +#: components/consent/consent.php:13 +#, php-format +msgid "Подробнее в <a href=\"%s\" target=\"_blank\">политике конфиденциальности</a>." +msgstr "" +"Więcej informacji w <a href=\"%s\" target=\"_blank\">polityce " +"prywatności</a>." + +#: components/site-footer/site-footer.php +msgid "Документы" +msgstr "Dokumenty" + +#: inc/class-theme.php:42 +msgid "Документы в подвале" +msgstr "Dokumenty w stopce" diff --git a/wp-content/themes/smilia/page.php b/wp-content/themes/smilia/page.php new file mode 100644 index 0000000..ee03c6f --- /dev/null +++ b/wp-content/themes/smilia/page.php @@ -0,0 +1,16 @@ +<?php + +use Smilia\Theme\Components; + +defined( 'ABSPATH' ) || exit; + +Components::use( array( 'demo-bar', 'site-header', 'site-footer', 'booking' ) ); + +get_header(); + +while ( have_posts() ) { + the_post(); + the_content(); +} + +get_footer(); diff --git a/wp-content/themes/smilia/single-smilia_doctor.php b/wp-content/themes/smilia/single-smilia_doctor.php new file mode 100644 index 0000000..ee03c6f --- /dev/null +++ b/wp-content/themes/smilia/single-smilia_doctor.php @@ -0,0 +1,16 @@ +<?php + +use Smilia\Theme\Components; + +defined( 'ABSPATH' ) || exit; + +Components::use( array( 'demo-bar', 'site-header', 'site-footer', 'booking' ) ); + +get_header(); + +while ( have_posts() ) { + the_post(); + the_content(); +} + +get_footer(); diff --git a/wp-content/themes/smilia/single-smilia_service.php b/wp-content/themes/smilia/single-smilia_service.php new file mode 100644 index 0000000..ee03c6f --- /dev/null +++ b/wp-content/themes/smilia/single-smilia_service.php @@ -0,0 +1,16 @@ +<?php + +use Smilia\Theme\Components; + +defined( 'ABSPATH' ) || exit; + +Components::use( array( 'demo-bar', 'site-header', 'site-footer', 'booking' ) ); + +get_header(); + +while ( have_posts() ) { + the_post(); + the_content(); +} + +get_footer(); diff --git a/wp-content/themes/smilia/style.css b/wp-content/themes/smilia/style.css new file mode 100644 index 0000000..5d26183 --- /dev/null +++ b/wp-content/themes/smilia/style.css @@ -0,0 +1,8 @@ +/* +Theme Name: Smilia +Description: Тема сайта детской стоматологии Smilia. +Version: 0.1.0 +Requires at least: 6.5 +Requires PHP: 8.2 +Text Domain: smilia +*/