This commit is contained in:
2025-11-10 10:22:03 +01:00
parent 6156064593
commit 4f68f8e5d0
7 changed files with 290 additions and 87 deletions

View File

@@ -191,14 +191,51 @@ jQuery(function ($) {
})
})
jQuery(function ($) {
$('#frame-box .actions .text').on('click', function () {
$('.text-data', this).toggleClass('active')
})
})
// jQuery(function ($) {
// $('#frame-box .actions .text').on('click', function () {
// $('.text-data', this).toggleClass('active')
// })
// })
jQuery(document).ready(function($) {
$('.song.text').on('click', function() {
const songId = $(this).attr('data-song-id');
$.ajax({
url: '/wp-admin/admin-ajax.php',
type: 'POST',
data: {
action: 'get_song_text',
song_id: songId
},
beforeSend: function() {
$('#song-text-box').html('<p>Ładowanie...</p>');
},
success: function(response) {
$('#song-text-box').addClass('active');
$('#song-text-box').html(response);
},
error: function() {
$('#song-text-box').addClass('active');
$('#song-text-box').html('<div class="song-text-content"><p>Bład proszę spróbować później.</p></div>');
setTimeout(() => {
$('#song-text-box').removeClass('active');
}, 2000);
}
});
});
$(document).on('click', '#song-text-box .song-text-close .close-btn', function() {
$('#song-text-box').removeClass('active');
setTimeout(() => {
$('#song-text-box').empty();
}, 1000);
});
});
jQuery(function ($) {
Fancybox.bind('[data-fancybox]', {
// Інші параметри за потреби
})
})

View File

@@ -2328,4 +2328,103 @@ body.page-id-846 #content .page-content {
aspect-ratio: 16/9;
-o-object-fit: contain;
object-fit: contain;
}
#song-text-box {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 360px;
height: 340px;
z-index: 100;
background: #9a0100;
opacity: 0;
visibility: hidden;
transition: all 250ms ease-in;
}
#song-text-box.active {
opacity: 1;
visibility: visible;
}
#song-text-box .song-text-close {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 25px;
background: #9a0100;
}
#song-text-box .song-text-close .close-btn {
position: absolute;
top: 2px;
right: 2px;
width: 20px;
height: 20px;
cursor: pointer;
background-size: contain;
}
#song-text-box .song-text-close .close-btn::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(45deg);
height: 2px;
width: 20px;
background-color: #fff;
}
#song-text-box .song-text-close .close-btn::after {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(-45deg);
height: 2px;
width: 20px;
background-color: #fff;
}
#song-text-box .song-text-content {
padding: 5px 20px 20px 20px;
height: 315px;
overflow: auto;
margin-top: 25px;
scrollbar-width: auto;
scrollbar-color: #fff #9a0100;
}
#song-text-box .song-text-content::-webkit-scrollbar {
width: 25px;
}
#song-text-box .song-text-content::-webkit-scrollbar-track {
background: #9a0100;
border-radius: 10px;
}
#song-text-box .song-text-content::-webkit-scrollbar-thumb {
background: #fff;
border-radius: 10px;
-webkit-transition: background 0.2s ease;
transition: background 0.2s ease;
}
#song-text-box .song-text-content::-webkit-scrollbar-thumb:hover {
background: #bcbcbc;
}
#song-text-box .song-text-content h2 {
color: #fff;
font-size: 16px;
font-family: "Arial", sans-serif;
font-weight: 600;
margin-top: 0;
margin-bottom: 10px;
text-transform: initial;
}
#song-text-box .song-text-content p {
color: #fff;
font-size: 12px;
font-family: "Arial", sans-serif;
font-weight: 400;
line-height: 1.2;
margin-bottom: 10px;
}
#song-text-box .song-text-content p:last-child {
margin-bottom: 0;
}/*# sourceMappingURL=custom.css.map */

File diff suppressed because one or more lines are too long

View File

@@ -2888,3 +2888,115 @@ body {
}
}
}
#song-text-box {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 360px;
height: 340px;
z-index: 100;
background: #9a0100;
opacity: 0;
visibility: hidden;
transition: all 250ms ease-in;
&.active {
opacity: 1;
visibility: visible;
}
.song-text-close {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 25px;
background: #9a0100;
.close-btn {
position: absolute;
top: 2px;
right: 2px;
width: 20px;
height: 20px;
cursor: pointer;
background-size: contain;
&::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(45deg);
height: 2px;
width: 20px;
background-color: #fff;
}
&::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) rotate(-45deg);
height: 2px;
width: 20px;
background-color: #fff;
}
}
}
.song-text-content {
padding: 5px 20px 20px 20px;
height: 315px;
overflow: auto;
margin-top: 25px;
scrollbar-width: auto;
scrollbar-color: #fff #9a0100;
&::-webkit-scrollbar {
width: 25px;
}
&::-webkit-scrollbar-track {
background: #9a0100;
border-radius: 10px;
}
&::-webkit-scrollbar-thumb {
background: #fff;
border-radius: 10px;
transition: background 0.2s ease;
}
&::-webkit-scrollbar-thumb:hover {
background: #bcbcbc;
}
h2 {
color: #fff;
font-size: 16px;
font-family: 'Arial', sans-serif;
font-weight: 600;
margin-top: 0;
margin-bottom: 10px;
text-transform: initial;
}
p {
color: #fff;
font-size: 12px;
font-family: 'Arial', sans-serif;
font-weight: 400;
line-height: 1.2;
margin-bottom: 10px;
&:last-child {
margin-bottom: 0;
}
}
}
}

View File

@@ -287,3 +287,19 @@ function hello_elementor_swiper_scripts() {
wp_enqueue_script('swiper_code', get_template_directory_uri() . '/plugins/swiper-11.1.4/swiper.min.js', array('jquery'), wp_get_theme()->get('Version'), true);
}
add_action('wp_enqueue_scripts', 'hello_elementor_swiper_scripts', 999);
add_action('wp_ajax_get_song_text', 'get_song_text_callback');
add_action('wp_ajax_nopriv_get_song_text', 'get_song_text_callback');
function get_song_text_callback() {
$song_id = intval($_POST['song_id']);
$song = get_field("albums_arr", 846)[$song_id]['melody_text'];
echo '<div class="song-text-close"><div class="close-btn"></div></div>';
echo '<div class="song-text-content">';
echo wp_kses_post($song);
echo '</div>';
wp_die();
}

View File

@@ -80,6 +80,9 @@
</div>
</div>
<?php include 'template-parts/frame-time-line.php'; ?>
<div id="song-text-box">
</div>
</div>
<div id="foto" style="display: none;">

View File

@@ -19,13 +19,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[0]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="0">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[0]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -75,13 +71,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[1]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="1">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[1]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -118,13 +110,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[2]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="2">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[2]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -164,13 +152,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[3]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="3">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[3]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -209,13 +193,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[4]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="4">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[4]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -255,13 +235,9 @@
<?= get_field("albums_arr")[5]['text'] ?>
<?php if(get_field("albums_arr")[5]['add_text'] == 1): ?>
<div class="song text">
<div class="song text" data-song-id="5">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[5]['melody_text'] ?>
</div>
</div>
<?php endif; ?>
@@ -317,13 +293,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[6]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="6">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[6]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -360,13 +332,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[7]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="7">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[7]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -403,13 +371,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[8]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="8">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[8]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -446,13 +410,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[9]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="9">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[9]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -489,13 +449,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[10]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="10">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[10]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -532,13 +488,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[11]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="11">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[11]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -575,13 +527,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[12]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="12">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[12]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -618,13 +566,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[13]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="13">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[13]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -661,13 +605,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[14]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="14">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[14]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>
@@ -704,13 +644,9 @@
<?php endforeach; ?>
<?php if(get_field("albums_arr")[15]['add_text'] == 1): ?>
<li class="song text">
<li class="song text" data-song-id="15">
Teksty
<img src="/wp-content/uploads/2024/04/txt.png" alt="">
<div class="text-data">
<?= get_field("albums_arr")[15]['melody_text'] ?>
</div>
</li>
<?php endif; ?>
</ul>