<?php /** * Kamil OnePage Portfolio * * @package Kamil_OnePage_Portfolio */ if ( ! defined( 'ABSPATH' ) ) { exit; } define( 'KOPP_VERSION', '1.0.0' ); define( 'KOPP_DIR', get_template_directory() ); define( 'KOPP_URI', get_template_directory_uri() ); function kopp_setup() { if ( is_dir( KOPP_DIR . '/languages' ) ) { load_theme_textdomain( 'kamil-onepage-portfolio', KOPP_DIR . '/languages' ); } add_theme_support( 'title-tag' ); add_theme_support( 'post-thumbnails' ); add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) ); add_theme_support( 'custom-logo', array( 'height' => 80, 'width' => 240, 'flex-height' => true, 'flex-width' => true ) ); register_nav_menus( array( 'primary' => __( 'Primary menu', 'kamil-onepage-portfolio' ) ) ); } add_action( 'after_setup_theme', 'kopp_setup' ); function kopp_assets() { wp_enqueue_style( 'kopp-fonts', 'https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap', array(), null ); wp_enqueue_style( 'kopp-main', KOPP_URI . '/assets/css/main.css', array(), KOPP_VERSION ); wp_enqueue_script( 'kopp-main', KOPP_URI . '/assets/js/main.js', array(), KOPP_VERSION, true ); } add_action( 'wp_enqueue_scripts', 'kopp_assets' ); function kopp_sanitize_html_text( $value ) { $allowed = array( 'br' => array(), 'span' => array( 'class' => array() ), 'em' => array(), 'strong' => array(), 'a' => array( 'href' => array(), 'class' => array(), 'target' => array(), 'rel' => array() ), 'p' => array( 'class' => array() ), ); return wp_kses( $value, $allowed ); } function kopp_customize_register( $wp_customize ) { $wp_customize->add_section( 'kopp_hero', array( 'title' => 'Portfolio Hero', 'priority' => 30 ) ); $hero_fields = array( 'kopp_hero_badge' => array( 'label' => 'Badge text', 'default' => 'Profesjonalne strony WWW', 'type' => 'text' ), 'kopp_hero_title' => array( 'label' => 'Main title (HTML: br, span)', 'default' => 'Tworz <span class="kopp-gradient-text">strony</span>,<br>które dziaBaj.', 'type' => 'textarea' ), 'kopp_hero_subtitle' => array( 'label' => 'Subtitle', 'default' => 'Szybkie, dopracowane witryny  od landingów po rozbudowane serwisy w WordPressie.', 'type' => 'textarea' ), 'kopp_hero_cta_primary' => array( 'label' => 'Primary button', 'default' => 'Realizacje', 'type' => 'text' ), 'kopp_hero_cta_secondary' => array( 'label' => 'Secondary button', 'default' => 'Kontakt', 'type' => 'text' ), ); foreach ( $hero_fields as $id => $cfg ) { $wp_customize->add_setting( $id, array( 'default' => $cfg['default'], 'sanitize_callback' => 'kopp_sanitize_html_text' ) ); $ctype = ( isset( $cfg['type'] ) && 'textarea' === $cfg['type'] ) ? 'textarea' : 'text'; $wp_customize->add_control( $id, array( 'label' => $cfg['label'], 'section' => 'kopp_hero', 'type' => $ctype ) ); } $wp_customize->add_section( 'kopp_about', array( 'title' => 'Portfolio About', 'priority' => 31 ) ); $wp_customize->add_setting( 'kopp_about_title', array( 'default' => 'O mnie', 'sanitize_callback' => 'sanitize_text_field' ) ); $wp_customize->add_control( 'kopp_about_title', array( 'label' => 'Section title', 'section' => 'kopp_about', 'type' => 'text' ) ); $wp_customize->add_setting( 'kopp_about_text', array( 'default' => 'Skupiam si na wydajno[ci, dostpno[ci i czytelnym kodzie. Pomagam firmom zaistnie w sieci z witrynami, które Baduj si bByskawicznie i wygldaj jak nale|y.', 'sanitize_callback' => 'kopp_sanitize_html_text', ) ); $wp_customize->add_control( 'kopp_about_text', array( 'label' => 'Content', 'section' => 'kopp_about', 'type' => 'textarea' ) ); $wp_customize->add_section( 'kopp_contact', array( 'title' => 'Portfolio Contact', 'priority' => 32 ) ); $wp_customize->add_setting( 'kopp_contact_email', array( 'default' => get_option( 'admin_email' ), 'sanitize_callback' => 'sanitize_email', ) ); $wp_customize->add_control( 'kopp_contact_email', array( 'label' => 'Public email', 'section' => 'kopp_contact', 'type' => 'email' ) ); $wp_customize->add_setting( 'kopp_form_shortcode', array( 'default' => '', 'sanitize_callback' => 'sanitize_textarea_field' ) ); $wp_customize->add_control( 'kopp_form_shortcode', array( 'label' => 'Form shortcode (optional)', 'description' => 'Paste e.g. [contact-form-7 id="123"] to replace the mailto helper.', 'section' => 'kopp_contact', 'type' => 'textarea', ) ); foreach ( array( 'github' => 'GitHub', 'linkedin' => 'LinkedIn', 'twitter' => 'X / Twitter' ) as $key => $lab ) { $sid = 'kopp_social_' . $key; $wp_customize->add_setting( $sid, array( 'default' => '', 'sanitize_callback' => 'esc_url_raw' ) ); $wp_customize->add_control( $sid, array( 'label' => $lab . ' URL', 'section' => 'kopp_contact', 'type' => 'url' ) ); } } add_action( 'customize_register', 'kopp_customize_register' ); /** * @param array $atts Link attributes. * @param WP_Post|object $item Menu item. * @param stdClass $args Menu args. */ function kopp_nav_link_class( $atts, $item, $args ) { if ( ! is_object( $args ) || ! isset( $args->theme_location ) || 'primary' !== $args->theme_location ) { return $atts; } $existing = isset( $atts['class'] ) ? $atts['class'] . ' ' : ''; $atts['class'] = trim( $existing . 'kopp-nav__link' ); return $atts; } add_filter( 'nav_menu_link_attributes', 'kopp_nav_link_class', 10, 3 ); function kopp_mod( $mod, $default = '' ) { $v = get_theme_mod( $mod, $default ); return ( $v !== '' && $v !== null ) ? $v : $default; } function kopp_default_menu() { $items = array( '#kopp-hero' => __( 'Start', 'kamil-onepage-portfolio' ), '#kopp-about' => __( 'O mnie', 'kamil-onepage-portfolio' ), '#kopp-services' => __( 'UsBugi', 'kamil-onepage-portfolio' ), '#kopp-work' => __( 'Portfolio', 'kamil-onepage-portfolio' ), '#kopp-contact' => __( 'Kontakt', 'kamil-onepage-portfolio' ), ); echo '<ul class="kopp-nav__list">'; foreach ( $items as $url => $label ) { echo '<li><a class="kopp-nav__link" href="' . esc_url( $url ) . '">' . esc_html( $label ) . '</a></li>'; } echo '</ul>'; } <?php /** * One-page front * * @package Kamil_OnePage_Portfolio */ get_header(); $hero_badge = kopp_mod( 'kopp_hero_badge', 'Profesjonalne strony WWW' ); $hero_title = kopp_mod( 'kopp_hero_title', 'Tworz <span class="kopp-gradient-text">strony</span>,<br>które dziaBaj.' ); $hero_sub = kopp_mod( 'kopp_hero_subtitle', 'Szybkie, dopracowane witryny  od landingów po rozbudowane serwisy w WordPressie.' ); $cta1 = kopp_mod( 'kopp_hero_cta_primary', 'Realizacje' ); $cta2 = kopp_mod( 'kopp_hero_cta_secondary', 'Kontakt' ); $about_title = kopp_mod( 'kopp_about_title', 'O mnie' ); $about_text = kopp_mod( 'kopp_about_text', 'Skupiam si na wydajno[ci, dostpno[ci i czytelnym kodzie.' ); $contact_email = kopp_mod( 'kopp_contact_email', get_option( 'admin_email' ) ); $gh = get_theme_mod( 'kopp_social_github', '' ); $li = get_theme_mod( 'kopp_social_linkedin', '' ); $tw = get_theme_mod( 'kopp_social_twitter', '' ); $form_shortcode = trim( (string) get_theme_mod( 'kopp_form_shortcode', '' ) ); $portfolio_query = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 6, 'ignore_sticky_posts' => true, 'category_name' => apply_filters( 'kopp_portfolio_category', 'portfolio' ), ) ); ?> <main id="kopp-main" class="kopp-main"> <section id="kopp-hero" class="kopp-hero"> <div class="kopp-container kopp-hero__grid"> <div class="kopp-hero__content"> <p class="kopp-hero__badge kopp-reveal" data-kopp-reveal><span class="kopp-hero__badge-dot"></span><?php echo esc_html( $hero_badge ); ?></p> <h1 class="kopp-hero__title kopp-reveal" data-kopp-reveal data-kopp-reveal-delay="80"><?php echo wp_kses_post( $hero_title ); ?></h1> <p class="kopp-hero__subtitle kopp-reveal" data-kopp-reveal data-kopp-reveal-delay="160"><?php echo esc_html( $hero_sub ); ?></p> <div class="kopp-hero__actions kopp-reveal" data-kopp-reveal data-kopp-reveal-delay="240"> <a class="kopp-btn kopp-btn--primary kopp-magnetic" href="#kopp-work"><span><?php echo esc_html( $cta1 ); ?></span></a> <a class="kopp-btn kopp-btn--ghost kopp-magnetic" href="#kopp-contact"><span><?php echo esc_html( $cta2 ); ?></span></a> </div> <ul class="kopp-hero__stats kopp-reveal" data-kopp-reveal data-kopp-reveal-delay="320" aria-label="<?php esc_attr_e( 'W skrócie', 'kamil-onepage-portfolio' ); ?>"> <li><strong data-kopp-count="50">0</strong><span><?php esc_html_e( 'Projektów', 'kamil-onepage-portfolio' ); ?></span></li> <li><strong data-kopp-count="5">0</strong><span><?php esc_html_e( 'Lat do[wiadczenia', 'kamil-onepage-portfolio' ); ?></span></li> <li><strong>100%</strong><span><?php esc_html_e( 'Zaanga|owania', 'kamil-onepage-portfolio' ); ?></span></li> </ul> </div> <div class="kopp-hero__visual kopp-reveal" data-kopp-reveal data-kopp-reveal-delay="120"> <div class="kopp-orbit" aria-hidden="true"> <div class="kopp-orbit__ring kopp-orbit__ring--1"></div> <div class="kopp-orbit__ring kopp-orbit__ring--2"></div> <div class="kopp-orbit__core"> <span class="kopp-orbit__code">&lt;/&gt;</span> </div> <div class="kopp-orbit__float kopp-orbit__float--1">HTML</div> <div class="kopp-orbit__float kopp-orbit__float--2">CSS</div> <div class="kopp-orbit__float kopp-orbit__float--3">WP</div> </div> </div> </div> <div class="kopp-hero__scroll" aria-hidden="true"> <span class="kopp-hero__scroll-line"></span> </div> </section> <section id="kopp-about" class="kopp-section kopp-about"> <div class="kopp-container"> <header class="kopp-section__head kopp-reveal" data-kopp-reveal> <p class="kopp-section__eyebrow"><?php esc_html_e( '01', 'kamil-onepage-portfolio' ); ?></p> <h2 class="kopp-section__title"><?php echo esc_html( $about_title ); ?></h2> <div class="kopp-section__line" aria-hidden="true"></div> </header> <div class="kopp-about__grid"> <div class="kopp-about__text kopp-reveal" data-kopp-reveal data-kopp-reveal-delay="100"> <div class="kopp-card kopp-card--glass"> <?php echo wp_kses_post( wpautop( $about_text ) ); ?> </div> </div> <ul class="kopp-skills" aria-label="<?php esc_attr_e( 'Umiejtno[ci', 'kamil-onepage-portfolio' ); ?>"> <?php $skills = array( 'WordPress', 'WooCommerce', 'Performance', 'UI / UX', 'SEO basics', 'ACF / Gutenberg' ); $d = 0; foreach ( $skills as $skill ) { $d += 70; printf( '<li class="kopp-skill kopp-reveal" data-kopp-reveal data-kopp-reveal-delay="%d"><span class="kopp-skill__bar"></span><span class="kopp-skill__label">%s</span></li>', (int) $d, esc_html( $skill ) ); } ?> </ul> </div> </div> </section> <section id="kopp-services" class="kopp-section kopp-services"> <div class="kopp-container"> <header class="kopp-section__head kopp-reveal" data-kopp-reveal> <p class="kopp-section__eyebrow"><?php esc_html_e( '02', 'kamil-onepage-portfolio' ); ?></p> <h2 class="kopp-section__title"><?php esc_html_e( 'UsBugi', 'kamil-onepage-portfolio' ); ?></h2> <div class="kopp-section__line" aria-hidden="true"></div> </header> <div class="kopp-services__grid"> <?php $services = array( array( 'icon' => '01', 'title' => __( 'Strony i landing page', 'kamil-onepage-portfolio' ), 'desc' => __( 'UkBad, ruch i tre[ci pod konwersj  nowocze[nie i czytelnie.', 'kamil-onepage-portfolio' ), ), array( 'icon' => '02', 'title' => __( 'WordPress od podstaw', 'kamil-onepage-portfolio' ), 'desc' => __( 'Motywy, bloki i kod, który da si rozwija bez chaosu.', 'kamil-onepage-portfolio' ), ), array( 'icon' => '03', 'title' => __( 'Szybko[ i Core Web Vitals', 'kamil-onepage-portfolio' ), 'desc' => __( 'Optymalizacja mediów, lazy load i realne dziaBania pod wynik w PageSpeed.', 'kamil-onepage-portfolio' ), ), array( 'icon' => '04', 'title' => __( 'Opieka po starcie', 'kamil-onepage-portfolio' ), 'desc' => __( 'Aktualizacje, poprawki i maBe wdro|enia po publikacji.', 'kamil-onepage-portfolio' ), ), ); $i = 0; foreach ( $services as $s ) { $i++; $delay = 80 * $i; ?> <article class="kopp-service kopp-reveal kopp-tilt" data-kopp-reveal data-kopp-reveal-delay="<?php echo (int) $delay; ?>" data-kopp-tilt> <div class="kopp-service__inner"> <span class="kopp-service__icon" aria-hidden="true"><?php echo esc_html( $s['icon'] ); ?></span> <h3 class="kopp-service__title"><?php echo esc_html( $s['title'] ); ?></h3> <p class="kopp-service__desc"><?php echo esc_html( $s['desc'] ); ?></p> <span class="kopp-service__shine" aria-hidden="true"></span> </div> </article> <?php } ?> </div> </div> </section> <section id="kopp-work" class="kopp-section kopp-work"> <div class="kopp-marquee" aria-hidden="true"> <div class="kopp-marquee__track"> <span><?php esc_html_e( 'Wybrane realizacje  ', 'kamil-onepage-portfolio' ); ?></span> <span><?php esc_html_e( 'Wybrane realizacje  ', 'kamil-onepage-portfolio' ); ?></span> <span><?php esc_html_e( 'Wybrane realizacje  ', 'kamil-onepage-portfolio' ); ?></span> <span><?php esc_html_e( 'Wybrane realizacje  ', 'kamil-onepage-portfolio' ); ?></span> </div> </div> <div class="kopp-container"> <header class="kopp-section__head kopp-reveal" data-kopp-reveal> <p class="kopp-section__eyebrow"><?php esc_html_e( '03', 'kamil-onepage-portfolio' ); ?></p> <h2 class="kopp-section__title"><?php esc_html_e( 'Realizacje', 'kamil-onepage-portfolio' ); ?></h2> <div class="kopp-section__line" aria-hidden="true"></div> </header> <div class="kopp-work__grid"> <?php if ( $portfolio_query->have_posts() ) { $n = 0; while ( $portfolio_query->have_posts() ) { $portfolio_query->the_post(); $n++; $delay = min( 400, 60 * $n ); $thumb = get_the_post_thumbnail_url( get_the_ID(), 'large' ); ?> <a href="<?php the_permalink(); ?>" class="kopp-project kopp-reveal" data-kopp-reveal data-kopp-reveal-delay="<?php echo (int) $delay; ?>"> <div class="kopp-project__media"> <?php if ( $thumb ) : ?> <img src="<?php echo esc_url( $thumb ); ?>" alt="" loading="lazy" width="800" height="600"> <?php else : ?> <div class="kopp-project__placeholder"></div> <?php endif; ?> <div class="kopp-project__overlay"> <span class="kopp-project__arrow">&rarr;</span> </div> </div> <h3 class="kopp-project__title"><?php the_title(); ?></h3> <p class="kopp-project__meta"><?php echo esc_html( get_the_date() ); ?></p> </a> <?php } wp_reset_postdata(); } else { $placeholders = array( array( 't' => 'Neon Commerce', 'm' => 'Woo + headless cart' ), array( 't' => 'Studio Atlas', 'm' => 'Brand site + motion' ), array( 't' => 'Docs App', 'm' => 'Docs portal UI' ), array( 't' => 'Fitness Pro', 'm' => 'Membership funnel' ), array( 't' => 'Architects Co', 'm' => 'Case study grid' ), array( 't' => 'Audio Lab', 'm' => 'Product storytelling' ), ); $n = 0; foreach ( $placeholders as $p ) { $n++; $delay = 60 * $n; ?> <div class="kopp-project kopp-project--static kopp-reveal" data-kopp-reveal data-kopp-reveal-delay="<?php echo (int) $delay; ?>"> <div class="kopp-project__media"> <div class="kopp-project__placeholder kopp-project__placeholder--<?php echo (int) ( ( $n % 4 ) + 1 ); ?>"></div> <div class="kopp-project__overlay"> <span class="kopp-project__tag"><?php esc_html_e( 'PrzykBad', 'kamil-onepage-portfolio' ); ?></span> </div> </div> <h3 class="kopp-project__title"><?php echo esc_html( $p['t'] ); ?></h3> <p class="kopp-project__meta"><?php echo esc_html( $p['m'] ); ?></p> </div> <?php } } ?> </div> <p class="kopp-work__hint kopp-reveal" data-kopp-reveal><?php esc_html_e( 'Wskazówka: przypisz wpisy do kategorii  portfolio , aby zastpi karty przykBadowe.', 'kamil-onepage-portfolio' ); ?></p> </div> </section> <section id="kopp-contact" class="kopp-section kopp-contact"> <div class="kopp-container"> <div class="kopp-contact__panel kopp-reveal" data-kopp-reveal> <header class="kopp-section__head kopp-section__head--inset"> <p class="kopp-section__eyebrow"><?php esc_html_e( '04', 'kamil-onepage-portfolio' ); ?></p> <h2 class="kopp-section__title"><?php esc_html_e( 'Zbudujmy co[ razem', 'kamil-onepage-portfolio' ); ?></h2> <p class="kopp-contact__lead"><?php esc_html_e( 'Napisz o celu, terminie i bud|ecie  odezw si z propozycj kolejnych kroków.', 'kamil-onepage-portfolio' ); ?></p> </header> <div class="kopp-contact__grid"> <div class="kopp-contact__info"> <?php if ( is_email( $contact_email ) ) : ?> <a class="kopp-contact__mail" href="mailto:<?php echo esc_attr( $contact_email ); ?>"><?php echo esc_html( $contact_email ); ?></a> <?php endif; ?> <ul class="kopp-contact__social"> <?php if ( $gh ) : ?> <li><a class="kopp-social" href="<?php echo esc_url( $gh ); ?>" rel="noopener noreferrer" target="_blank">GitHub</a></li> <?php endif; ?> <?php if ( $li ) : ?> <li><a class="kopp-social" href="<?php echo esc_url( $li ); ?>" rel="noopener noreferrer" target="_blank">LinkedIn</a></li> <?php endif; ?> <?php if ( $tw ) : ?> <li><a class="kopp-social" href="<?php echo esc_url( $tw ); ?>" rel="noopener noreferrer" target="_blank">X</a></li> <?php endif; ?> </ul> </div> <div class="kopp-contact__form-wrap"> <?php if ( $form_shortcode !== '' ) { echo do_shortcode( $form_shortcode ); } elseif ( is_email( $contact_email ) ) { ?> <form class="kopp-form" id="kopp-mailto-form" data-kopp-mailto="<?php echo esc_attr( $contact_email ); ?>"> <label class="kopp-form__field"> <span><?php esc_html_e( 'Temat', 'kamil-onepage-portfolio' ); ?></span> <input type="text" name="kopp_subject" required autocomplete="off" placeholder="<?php esc_attr_e( 'Strona / projekt', 'kamil-onepage-portfolio' ); ?>"> </label> <label class="kopp-form__field"> <span><?php esc_html_e( 'Wiadomo[', 'kamil-onepage-portfolio' ); ?></span> <textarea name="kopp_body" rows="5" required placeholder="<?php esc_attr_e( 'Opisz zlecenie& ', 'kamil-onepage-portfolio' ); ?>"></textarea> </label> <button type="submit" class="kopp-btn kopp-btn--primary kopp-magnetic"><span><?php esc_html_e( 'Wy[lij e-mailem', 'kamil-onepage-portfolio' ); ?></span></button> <p class="kopp-form__note"><?php esc_html_e( 'Wygld ’! Dostosuj ’! Portfolio Contact: wklej shortcode formularza (np. Contact Form 7), by zastpi ten pomocnik.', 'kamil-onepage-portfolio' ); ?></p> </form> <?php } else { echo '<p class="kopp-form__note">' . esc_html__( 'Ustaw publiczny e-mail w Dostosuj.', 'kamil-onepage-portfolio' ) . '</p>'; } ?> </div> </div> </div> </div> </section> </main> <?php get_footer();