2026-10-08 GLOBAL
This commit is contained in:
parent
bf15fa6773
commit
b233efce60
@ -2183,10 +2183,13 @@
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 3px;
|
||||
width: 100%;
|
||||
background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
|
||||
z-index: 10000;
|
||||
width: 0%;
|
||||
transition: width 0.1s linear;
|
||||
transform: scaleX(0);
|
||||
transform-origin: 0 50%;
|
||||
transition: transform 0.1s linear;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -213,21 +213,18 @@ document.querySelectorAll('.header-menu').forEach(item => {
|
||||
progressBar.className = 'pksh-scroll-progress';
|
||||
document.body.prepend(progressBar);
|
||||
|
||||
var maxScroll = 0;
|
||||
var ticking = false;
|
||||
|
||||
// геометрию читаем только вне обработчика scroll
|
||||
function measure() {
|
||||
maxScroll = document.documentElement.scrollHeight - document.documentElement.clientHeight;
|
||||
}
|
||||
|
||||
function paint() {
|
||||
ticking = false;
|
||||
var scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
||||
var progress = maxScroll > 0 ? (scrollTop / maxScroll) * 100 : 0;
|
||||
// читаем геометрию до записи (в этом же кадре записи ещё не было)
|
||||
var doc = document.documentElement;
|
||||
var maxScroll = doc.scrollHeight - doc.clientHeight;
|
||||
var scrollTop = window.pageYOffset || doc.scrollTop;
|
||||
var progress = maxScroll > 0 ? (scrollTop / maxScroll) : 0;
|
||||
if (progress < 0) { progress = 0; }
|
||||
if (progress > 100) { progress = 100; }
|
||||
progressBar.style.width = progress + '%';
|
||||
if (progress > 1) { progress = 1; }
|
||||
progressBar.style.transform = 'scaleX(' + progress + ')';
|
||||
}
|
||||
|
||||
function onScroll() {
|
||||
@ -237,18 +234,8 @@ document.querySelectorAll('.header-menu').forEach(item => {
|
||||
}
|
||||
}
|
||||
|
||||
function onResize() {
|
||||
window.requestAnimationFrame(function () { measure(); paint(); });
|
||||
}
|
||||
|
||||
window.addEventListener('scroll', onScroll, { passive: true });
|
||||
window.addEventListener('resize', onResize, { passive: true });
|
||||
if ('ResizeObserver' in window) {
|
||||
new ResizeObserver(function () { window.requestAnimationFrame(measure); }).observe(document.documentElement);
|
||||
}
|
||||
|
||||
measure();
|
||||
paint();
|
||||
window.requestAnimationFrame(paint);
|
||||
})();
|
||||
|
||||
/* ── Desktop Sticky CTA — show after hero ── */
|
||||
|
||||
@ -3261,15 +3261,7 @@ function enqueue_template_specific_styles()
|
||||
);
|
||||
}
|
||||
if (is_page_template('page-semejnye-klassy.php')) {
|
||||
|
||||
|
||||
$family_css = dekart_css_asset('page-semejnye-klassy.css');
|
||||
wp_enqueue_style(
|
||||
'family-classes-style',
|
||||
$family_css['url'],
|
||||
array(),
|
||||
$family_css['ver']
|
||||
);
|
||||
// page-semejnye-klassy.min.css инлайнится в header.php вместе с main.min.css
|
||||
wp_enqueue_script(
|
||||
'family-classes-script',
|
||||
get_template_directory_uri() . '/assets/js/semejnye-klassy.js',
|
||||
@ -4625,7 +4617,7 @@ function dekart_deferred_loader_script($blocks, int $timeout = 3000): string
|
||||
}
|
||||
|
||||
$json = wp_json_encode($blocks, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_HEX_TAG);
|
||||
return '<script>(function(){var B=' . $json . ';var done=false;function inject(){if(done){return;}done=true;B.forEach(function(html){var t=document.createElement("template");t.innerHTML=html;Array.prototype.slice.call(t.content.childNodes).forEach(function(n){var node;if(n.nodeName==="SCRIPT"){node=document.createElement("script");for(var i=0;i<n.attributes.length;i++){node.setAttribute(n.attributes[i].name,n.attributes[i].value);}node.text=n.textContent||"";}else{node=n.cloneNode(true);}(document.head||document.documentElement).appendChild(node);});});}var ev=["scroll","click","keydown","mousemove","touchstart","pointerdown"];function go(){ev.forEach(function(e){window.removeEventListener(e,go);});inject();}ev.forEach(function(e){window.addEventListener(e,go,{passive:true,once:true});});function sched(){if(window.requestIdleCallback){requestIdleCallback(inject,{timeout:' . (int) $timeout . '});}else{setTimeout(inject,' . (int) $timeout . ');}}if(document.readyState==="complete"){sched();}else{window.addEventListener("load",sched,{once:true});}})();</script>';
|
||||
return '<script>(function(){var B=' . $json . ';var done=false;function inject(){if(done){return;}done=true;try{var seen={};B.join(" ").replace(/https?:\/\/([^\/"\s]+)/g,function(m,h){h=h.toLowerCase();if(seen[h]){return m;}seen[h]=1;var l=document.createElement("link");l.rel="preconnect";l.href="https://"+h;l.crossOrigin="";(document.head||document.documentElement).appendChild(l);return m;});}catch(e){}B.forEach(function(html){var t=document.createElement("template");t.innerHTML=html;Array.prototype.slice.call(t.content.childNodes).forEach(function(n){var node;if(n.nodeName==="SCRIPT"){node=document.createElement("script");for(var i=0;i<n.attributes.length;i++){node.setAttribute(n.attributes[i].name,n.attributes[i].value);}node.text=n.textContent||"";}else{node=n.cloneNode(true);}(document.head||document.documentElement).appendChild(node);});});}var ev=["scroll","click","keydown","mousemove","touchstart","pointerdown"];function go(){ev.forEach(function(e){window.removeEventListener(e,go);});inject();}ev.forEach(function(e){window.addEventListener(e,go,{passive:true,once:true});});function sched(){if(window.requestIdleCallback){requestIdleCallback(inject,{timeout:' . (int) $timeout . '});}else{setTimeout(inject,' . (int) $timeout . ');}}if(document.readyState==="complete"){sched();}else{window.addEventListener("load",sched,{once:true});}})();</script>';
|
||||
}
|
||||
|
||||
add_action('wp_head', 'dekart_output_counters', 1);
|
||||
|
||||
@ -7,15 +7,6 @@
|
||||
<?php
|
||||
?>
|
||||
|
||||
<link rel="preconnect" href="https://cdn-ru.bitrix24.ru">
|
||||
<link rel="preconnect" href="https://alee.bitrix24.ru" crossorigin>
|
||||
<link rel="dns-prefetch" href="//api-maps.yandex.ru">
|
||||
<link rel="dns-prefetch" href="//mod.gudok.tel">
|
||||
<?php
|
||||
|
||||
// PRELOAD 1
|
||||
|
||||
?>
|
||||
<link rel="preload" as="image"
|
||||
href="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/logo-svg.svg"
|
||||
type="image/svg+xml">
|
||||
@ -70,14 +61,21 @@ if (is_front_page()) {
|
||||
?><link rel="preload" as="style" href="<?php echo esc_url($main_css_url); ?>" onload="this.onload=null;this.rel='stylesheet'">
|
||||
<noscript><link rel="stylesheet" href="<?php echo esc_url($main_css_url); ?>"></noscript>
|
||||
<?php elseif (is_page_template('page-semejnye-klassy.php')) :
|
||||
$critical_family_path = get_template_directory() . '/assets/css/critical-family.css';
|
||||
if (file_exists($critical_family_path)) {
|
||||
echo '<style id="critical-family-css">' . file_get_contents($critical_family_path) . '</style>' . "\n";
|
||||
// Полный CSS инлайном: геометрия всех блоков есть с первого рендера → нет сдвига при позднем main.css
|
||||
$css_base = get_template_directory_uri() . '/assets/css/';
|
||||
$bundle = '';
|
||||
foreach (array( 'main.min.css', 'page-semejnye-klassy.min.css' ) as $rel) {
|
||||
$path = get_template_directory() . '/assets/css/' . $rel;
|
||||
if (file_exists($path)) {
|
||||
$bundle .= (string) file_get_contents($path) . "\n";
|
||||
}
|
||||
}
|
||||
$main_css = dekart_css_asset('main.css');
|
||||
$main_css_url = $main_css['url'] . '?ver=' . $main_css['ver'];
|
||||
?><link rel="preload" as="style" href="<?php echo esc_url($main_css_url); ?>" onload="this.onload=null;this.rel='stylesheet'">
|
||||
<noscript><link rel="stylesheet" href="<?php echo esc_url($main_css_url); ?>"></noscript>
|
||||
// url() в инлайне резолвятся от документа — делаем абсолютными
|
||||
$bundle = preg_replace('#url\((?!(?:\'|")?(?:data:|https?:|//|/))#i', 'url(' . $css_base, $bundle);
|
||||
if ('' !== trim($bundle)) {
|
||||
echo '<style id="family-css-inline">' . $bundle . '</style>' . "\n";
|
||||
}
|
||||
?>
|
||||
<?php else :
|
||||
$main_css = dekart_css_asset('main.css'); ?>
|
||||
<link rel="stylesheet" href="<?php echo esc_url($main_css['url'] . '?ver=' . $main_css['ver']); ?>" media="all">
|
||||
|
||||
@ -30,6 +30,10 @@ $rating = carbon_get_post_meta($tid, 'teacher_rating');
|
||||
$avatar_id = carbon_get_post_meta($tid, 'teacher_avatar');
|
||||
$avatar_url = $avatar_id ? wp_get_attachment_url($avatar_id) : '';
|
||||
$avatar_srcset = $avatar_id ? (string) wp_get_attachment_image_srcset($avatar_id, 'medium_large') : '';
|
||||
$avatar_src = $avatar_id ? wp_get_attachment_image_src($avatar_id, 'medium_large') : null;
|
||||
$avatar_w = $avatar_src ? (int) $avatar_src[1] : 480;
|
||||
$avatar_h = $avatar_src ? (int) $avatar_src[2] : 384;
|
||||
$avatar_img = $avatar_src ? (string) $avatar_src[0] : $avatar_url;
|
||||
|
||||
$tenure = '';
|
||||
if ($start_year && absint($start_year) > 1900) {
|
||||
@ -80,10 +84,10 @@ $cat_filter = implode(' ', $dir_slugs);
|
||||
<div class="teachers-card__media">
|
||||
<?php if ($avatar_url) : ?>
|
||||
<img class="teachers-card__photo" loading="lazy" decoding="async"
|
||||
src="<?php echo esc_url($avatar_url); ?>"
|
||||
src="<?php echo esc_url($avatar_img); ?>"
|
||||
<?php if ($avatar_srcset) : ?>srcset="<?php echo esc_attr($avatar_srcset); ?>" sizes="(max-width: 640px) 92vw, 320px"<?php endif; ?>
|
||||
alt="<?php echo esc_attr($alt_photo); ?>"
|
||||
width="480" height="384">
|
||||
width="<?php echo esc_attr($avatar_w); ?>" height="<?php echo esc_attr($avatar_h); ?>">
|
||||
<?php else : ?>
|
||||
<?php
|
||||
$initials = '';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user