This commit is contained in:
Roman Pyrih
2025-08-29 11:05:59 +02:00
parent 468136d4d1
commit 8a6b114721
11 changed files with 452 additions and 75 deletions

View File

@@ -11,7 +11,6 @@ get_header();
?>
<main id="primary" class="site-main">
<?php if ( have_posts() ) : ?>
<header class="page-header">

View File

@@ -0,0 +1,107 @@
<?php
/**
* Page: Blog
*/
get_header();
$paged = 1;
$args = [
'post_type' => 'post',
'posts_per_page' => get_option('posts_per_page'),
'paged' => $paged,
];
$query = new WP_Query($args);
?>
<main id="primary" class="site-main blog-page">
<div class="box-1">
<div class="container">
<div class="box--wrapper">
<div class="box-bg">
<img src="/wp-content/uploads/2025/08/blog-bg.jpg" alt="">
</div>
<div class="row">
<div class="col col-1">
<?php get_template_part('inc/breadcrumb');?>
</div>
<div class="col col-2">
<div class="box-head">
<h2>Korzyści w podatku CIT wynikające z rozliczania hipotetycznych odsetek</h2>
</div>
<a class="btn_4" href="#">Czytaj więcej</a>
</div>
</div>
</div>
</div>
</div>
<div class="box-2">
<div class="container">
<div id="box-posts-list" class="posts-list">
<?php
if ($query->have_posts()) :
while ($query->have_posts()) : $query->the_post();
$image = get_the_post_thumbnail_url(get_the_ID(), 'medium');
$title = get_the_title();
$link = get_permalink();
get_template_part(
'inc/template-article-card', null, [
'image' => $image,
'title' => $title,
'link' => $link
]
);
endwhile;
wp_reset_postdata();
endif;
?>
</div>
<div class="posts-more">
<a class="btn_3" href="#" id="load-more-posts" data-page="1">
Więcej artykułów
<span class="loader"></span>
</a>
</div>
</div>
</div>
</main>
<script>
jQuery(function ($) {
$('#load-more-posts').on('click', function (e) {
e.preventDefault()
var button = $(this)
var page = button.data('page')
$.ajax({
url: '<?php echo admin_url("admin-ajax.php"); ?>',
type: 'POST',
data: {
action: 'load_more_posts',
page: page,
},
beforeSend: function () {
button.prop('disabled', true)
button.find('.loader').show()
},
complete: function () {
button.prop('disabled', false)
button.find('.loader').hide()
},
success: function (response) {
if (response) {
$('#box-posts-list').append(response)
button.data('page', page + 1)
} else {
button.text('Brak więcej artykułów').prop('disabled', true)
}
},
})
})
})
</script>
<?php
get_footer();
?>

View File

@@ -1752,4 +1752,101 @@ body.page-id-54 main .box-4 .row-2 .c-acc .c-acc--item .c-acc--body .c-acc--body
font-size: 20px;
line-height: 1.5;
letter-spacing: -0.38px;
}
body.blog main.blog-page {
padding-top: 32px;
}
body.blog main.blog-page .box-1 {
margin-bottom: 48px;
}
body.blog main.blog-page .box-1 .box--wrapper {
position: relative;
height: 568px;
padding: 64px;
}
body.blog main.blog-page .box-1 .box-bg {
position: absolute;
inset: 0;
}
body.blog main.blog-page .box-1 .row {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
row-gap: 40px;
height: 100%;
}
body.blog main.blog-page .box-1 .row .col-1 #breadcrumbs_box .container {
padding: 0;
}
body.blog main.blog-page .box-1 .row .col-1 #breadcrumbs_box #breadcrumbs {
color: #ffffff;
}
body.blog main.blog-page .box-1 .row .col-2 .box-head {
max-width: 785px;
margin-bottom: 32px;
}
body.blog main.blog-page .box-1 .row .col-2 .box-head h2 {
color: #ffffff;
font-weight: 500;
font-size: 48px;
line-height: 1.2;
letter-spacing: -0.96px;
}
body.blog main.blog-page .box-2 {
padding-bottom: 150px;
}
body.blog main.blog-page .box-2 .posts-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 64px;
margin-bottom: 100px;
}
body.blog main.blog-page .box-2 .posts-more {
text-align: center;
}
body.blog main.blog-page .box-2 .posts-more a {
display: inline-flex;
flex-direction: row;
gap: 16px;
}
body.blog main.blog-page .box-2 .posts-more a:hover .loader::after, body.blog main.blog-page .box-2 .posts-more a:hover .loader::before {
background: #ffffff;
}
body.blog main.blog-page .box-2 .posts-more a .loader {
width: 16px;
height: 16px;
display: inline-block;
position: relative;
margin-top: -3px;
display: none;
}
body.blog main.blog-page .box-2 .posts-more a .loader::after, body.blog main.blog-page .box-2 .posts-more a .loader::before {
content: "";
box-sizing: border-box;
width: 20px;
height: 20px;
border-radius: 50%;
background: #d9ba5c;
position: absolute;
left: 0;
top: 0;
animation: animloader 1s linear infinite;
transition: all 250ms ease-in-out;
}
body.blog main.blog-page .box-2 .posts-more a .loader::after {
opacity: 0;
animation-delay: 0.5s;
}
@keyframes animloader {
0% {
transform: scale(0);
opacity: 1;
}
100% {
transform: scale(1);
opacity: 0;
}
}/*# sourceMappingURL=custom.css.map */

File diff suppressed because one or more lines are too long

View File

@@ -1352,7 +1352,7 @@ body.page-id-47 {
}
}
//* ONasze usługi
//* O nasze usługi
body.page-id-54 {
main {
padding-top: 80px;
@@ -1791,3 +1791,129 @@ body.page-id-54 {
}
}
}
//* Blog
body.blog {
main.blog-page {
padding-top: 32px;
.box-1 {
margin-bottom: 48px;
.box--wrapper {
position: relative;
height: 568px;
padding: 64px;
}
.box-bg {
position: absolute;
inset: 0;
}
.row {
position: relative;
z-index: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
row-gap: 40px;
height: 100%;
.col {
&-1 {
#breadcrumbs_box {
.container {
padding: 0;
}
#breadcrumbs {
color: $cWhite;
}
}
}
&-2 {
.box-head {
max-width: 785px;
margin-bottom: 32px;
h2 {
color: $cWhite;
font-weight: 500;
font-size: 48px;
line-height: 1.2;
letter-spacing: -0.96px;
}
}
}
}
}
}
.box-2 {
padding-bottom: 150px;
.posts-list {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 64px;
margin-bottom: 100px;
}
.posts-more {
text-align: center;
a {
display: inline-flex;
flex-direction: row;
gap: 16px;
&:hover {
.loader {
&::after,
&::before {
background: $cWhite;
}
}
}
.loader {
width: 16px;
height: 16px;
display: inline-block;
position: relative;
margin-top: -3px;
display: none;
&::after,
&::before {
content: '';
box-sizing: border-box;
width: 20px;
height: 20px;
border-radius: 50%;
background: $cGold;
position: absolute;
left: 0;
top: 0;
animation: animloader 1s linear infinite;
transition: all 250ms ease-in-out;
}
&::after {
opacity: 0;
animation-delay: 0.5s;
}
}
@keyframes animloader {
0% {
transform: scale(0);
opacity: 1;
}
100% {
transform: scale(1);
opacity: 0;
}
}
}
}
}
}
}

View File

@@ -228,3 +228,35 @@ function brpp_enqueue_scripts() {
);
}
add_action( 'wp_enqueue_scripts', 'brpp_enqueue_scripts' );
add_action('wp_ajax_load_more_posts', 'load_more_posts_callback');
add_action('wp_ajax_nopriv_load_more_posts', 'load_more_posts_callback');
function load_more_posts_callback() {
$paged = isset($_POST['page']) ? intval($_POST['page']) + 1 : 1;
$query = new WP_Query([
'post_type' => 'post',
'posts_per_page' => get_option('posts_per_page'),
'paged' => $paged,
]);
if ($query->have_posts()) :
while ($query->have_posts()) : $query->the_post();
$image = get_the_post_thumbnail_url(get_the_ID(), 'medium');
$title = get_the_title();
$link = get_permalink();
get_template_part(
'inc/template-article-card', null, [
'image' => $image ?: '/wp-content/uploads/2025/08/default.jpg',
'title' => $title,
'link' => $link
]
);
endwhile;
endif;
wp_reset_postdata();
wp_die();
}

View File

@@ -48,7 +48,7 @@
<a href="#">BRPP Finanse</a>
</li>
<li>
<a href="#">Kontakt</a>
<a href="/kontakt">Kontakt</a>
</li>
</ul>
</div>

View File

@@ -1,20 +1,11 @@
<?php
/**
* The main template file
*
* This is the most generic template file in a WordPress theme
* and one of the two required files for a theme (the other being style.css).
* It is used to display a page when nothing more specific matches a query.
* E.g., it puts together the home page when no home.php file exists.
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/
*
* @package BRPP_prawo_podatki
*/
get_header();
if ( is_home() && get_option('page_for_posts') == 27 ) {
get_template_part('blog');
return;
}
?>
<?php get_header(); ?>
<main id="primary" class="site-main">
<div class="container">
<?php
@@ -51,7 +42,6 @@ get_header();
?>
</div>
</main><!-- #main -->
<?php
get_sidebar();
get_footer();

View File

@@ -1,91 +1,119 @@
jQuery(function ($) {
if($('body.page-id-25').length) {
gsap.registerPlugin(ScrollTrigger);
if ($('body.page-id-25').length) {
gsap.registerPlugin(ScrollTrigger)
function initSticky() {
ScrollTrigger.getById('heroImagePin')?.kill();
ScrollTrigger.getById('heroImagePin')?.kill()
const $pin = $('.box-1 .col-2');
const $end = $('.box-2 .row');
if (!$pin.length || !$end.length) return;
const $pin = $('.box-1 .col-2')
const $end = $('.box-2 .row')
if (!$pin.length || !$end.length) return
const $row = $pin.closest('.row');
$row.css('min-height', $('img', $pin).outerHeight());
const $row = $pin.closest('.row')
$row.css('min-height', $('img', $pin).outerHeight())
ScrollTrigger.create({
id: 'heroImagePin',
trigger: $pin[0],
pin: true,
start: "top top",
end: () => {
const pinTop = $pin.offset().top;
const pinH = $pin.outerHeight();
const endBottom = $end.offset().top + $end.outerHeight();
return "+=" + Math.max(0, endBottom - pinTop - pinH);
start: 'top top',
end: () => {
const pinTop = $pin.offset().top
const pinH = $pin.outerHeight()
const endBottom = $end.offset().top + $end.outerHeight()
return '+=' + Math.max(0, endBottom - pinTop - pinH)
},
scrub: 0.5,
anticipatePin: 1,
invalidateOnRefresh: true,
pinSpacing: true,
pinReparent: true
});
pinReparent: true,
})
}
$(window).on('load', initSticky);
$(window).on('load', initSticky)
$(window).on('resize orientationchange', () => ScrollTrigger.refresh());
$(window).on('resize orientationchange', () => ScrollTrigger.refresh())
}
});
})
jQuery(function ($) {
if (!$('body').hasClass('page-id-47')) return;
if (!$('body').hasClass('page-id-47')) return
const $body = $('body');
const $body = $('body')
$body.on('click', '.tile .tile--wrapper .tile--btn', function (e) {
e.preventDefault();
$body.addClass('no-scroll');
$body.on('click', '.tile .tile--wrapper .tile--btn', function (e) {
e.preventDefault()
$body.addClass('no-scroll')
const $tile = $(this).closest('.tile');
const $sidebar = $tile.find('.tile-sidebar');
const $tile = $(this).closest('.tile')
const $sidebar = $tile.find('.tile-sidebar')
$('.tile').not($tile).removeClass('active')
.find('.tile-sidebar').fadeOut(200);
$('.tile')
.not($tile)
.removeClass('active')
.find('.tile-sidebar')
.fadeOut(200)
$sidebar.fadeToggle(200);
$tile.toggleClass('active');
});
$sidebar.fadeToggle(200)
$tile.toggleClass('active')
})
$body.on('click', '.tile .tile-sidebar .tile--btn, .tile .tile-sidebar-bg', function (e) {
e.preventDefault();
$body.removeClass('no-scroll');
$(this).closest('.tile-sidebar').fadeOut(200)
.closest('.tile').removeClass('active');
});
});
$body.on(
'click',
'.tile .tile-sidebar .tile--btn, .tile .tile-sidebar-bg',
function (e) {
e.preventDefault()
$body.removeClass('no-scroll')
$(this)
.closest('.tile-sidebar')
.fadeOut(200)
.closest('.tile')
.removeClass('active')
}
)
})
jQuery(function ($) {
$('body').on('click', '.c-tabs .c-tabs--nav li', function (e) {
e.preventDefault();
e.preventDefault()
let tabId = $(this).attr('tab_id');
let tabId = $(this).attr('tab_id')
$(this).closest('.c-tabs').find('.c-tabs--nav li').not(this).removeClass('active');
$(this).addClass('active');
$(this)
.closest('.c-tabs')
.find('.c-tabs--nav li')
.not(this)
.removeClass('active')
$(this).addClass('active')
$(this).closest('.c-tabs').find('.c-tabs--content [tab_id]').not('[tab_id=' + tabId + ']').hide();
$(this).closest('.c-tabs').find('.c-tabs--content [tab_id=' + $(this).attr('tab_id') + ']').show();
});
$('.c-tabs .c-tabs--nav li:first-child').trigger('click');
$(this)
.closest('.c-tabs')
.find('.c-tabs--content [tab_id]')
.not('[tab_id=' + tabId + ']')
.hide()
$(this)
.closest('.c-tabs')
.find('.c-tabs--content [tab_id=' + $(this).attr('tab_id') + ']')
.show()
})
$('.c-tabs .c-tabs--nav li:first-child').trigger('click')
$('body').on('click', '.c-acc .c-acc--item .c-acc--head', function (e) {
e.preventDefault();
e.preventDefault()
$(this).closest('.c-acc').find('.c-acc--item').not($(this).closest('.c-acc--item')).removeClass('active');
$(this).closest('.c-acc--item').toggleClass('active');
$(this)
.closest('.c-acc')
.find('.c-acc--item')
.not($(this).closest('.c-acc--item'))
.removeClass('active')
$(this).closest('.c-acc--item').toggleClass('active')
$(this).closest('.c-acc').find('.c-acc--item .c-acc--body').not($(this).next('.c-acc--body')).slideUp(200);
$(this).next('.c-acc--body').slideToggle(200);
});
});
$(this)
.closest('.c-acc')
.find('.c-acc--item .c-acc--body')
.not($(this).next('.c-acc--body'))
.slideUp(200)
$(this).next('.c-acc--body').slideToggle(200)
})
})

View File

@@ -16,7 +16,6 @@ get_header();
?>
<main id="primary" class="site-main">
<?php
while ( have_posts() ) :
the_post();

View File

@@ -11,7 +11,6 @@ get_header();
?>
<main id="primary" class="site-main">
<?php
while ( have_posts() ) :
the_post();