Initial commit
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
{{/* Отображает текущий сезон для отладки */}}
|
||||
{{- $currentDate := now -}}
|
||||
{{- $dayOfYear := $currentDate.YearDay -}}
|
||||
|
||||
{{- $springStart := 80 -}}
|
||||
{{- $summerStart := 172 -}}
|
||||
{{- $autumnStart := 264 -}}
|
||||
{{- $winterStart := 355 -}}
|
||||
|
||||
{{- $season := "зима" -}}
|
||||
{{- $seasonEn := "winter" -}}
|
||||
|
||||
{{- if and (ge $dayOfYear $springStart) (lt $dayOfYear $summerStart) -}}
|
||||
{{- $season = "весна" -}}
|
||||
{{- $seasonEn = "spring" -}}
|
||||
{{- else if and (ge $dayOfYear $summerStart) (lt $dayOfYear $autumnStart) -}}
|
||||
{{- $season = "лето" -}}
|
||||
{{- $seasonEn = "summer" -}}
|
||||
{{- else if and (ge $dayOfYear $autumnStart) (lt $dayOfYear $winterStart) -}}
|
||||
{{- $season = "осень" -}}
|
||||
{{- $seasonEn = "autumn" -}}
|
||||
{{- end -}}
|
||||
|
||||
<!-- Сейчас {{ $season }} ({{ $seasonEn }}) - День года: {{ $dayOfYear }} -->
|
||||
@@ -0,0 +1,43 @@
|
||||
{{/*
|
||||
Определяем текущий сезон и возвращаем соответствующий фон
|
||||
Зима: 21 декабря - 20 марта
|
||||
Весна: 21 марта - 20 июня
|
||||
Лето: 21 июня - 20 сентября
|
||||
Осень: 21 сентября - 20 декабря
|
||||
*/}}
|
||||
|
||||
{{- $currentDate := now -}}
|
||||
{{- $month := $currentDate.Month -}}
|
||||
{{- $day := $currentDate.Day -}}
|
||||
|
||||
{{/* Определяем номер дня в году для более точного определения сезона */}}
|
||||
{{- $dayOfYear := $currentDate.YearDay -}}
|
||||
|
||||
{{/* Примерные границы сезонов по дням года */}}
|
||||
{{- $springStart := 80 -}} {{/* ~21 марта */}}
|
||||
{{- $summerStart := 172 -}} {{/* ~21 июня */}}
|
||||
{{- $autumnStart := 264 -}} {{/* ~21 сентября */}}
|
||||
{{- $winterStart := 355 -}} {{/* ~21 декабря */}}
|
||||
|
||||
{{- $season := "winter" -}}
|
||||
|
||||
{{- if and (ge $dayOfYear $springStart) (lt $dayOfYear $summerStart) -}}
|
||||
{{- $season = "spring" -}}
|
||||
{{- else if and (ge $dayOfYear $summerStart) (lt $dayOfYear $autumnStart) -}}
|
||||
{{- $season = "summer" -}}
|
||||
{{- else if and (ge $dayOfYear $autumnStart) (lt $dayOfYear $winterStart) -}}
|
||||
{{- $season = "autumn" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Возвращаем путь к фоновому изображению в зависимости от сезона */}}
|
||||
{{- if eq $season "winter" -}}
|
||||
images/bg-winter.jpg
|
||||
{{- else if eq $season "spring" -}}
|
||||
images/bg-spring.jpg
|
||||
{{- else if eq $season "summer" -}}
|
||||
images/bg-summer.jpg
|
||||
{{- else if eq $season "autumn" -}}
|
||||
images/bg-autumn.jpg
|
||||
{{- else -}}
|
||||
images/DESKTOP_NEW_1.jpg
|
||||
{{- end -}}
|
||||
@@ -0,0 +1,81 @@
|
||||
<div id="back-to-top" class="back-to-top-btn" onclick="scrollToTop()">
|
||||
↑
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.back-to-top-btn {
|
||||
position: fixed;
|
||||
bottom: 30px;
|
||||
right: 30px;
|
||||
background: rgba(24, 191, 239, 0.9);
|
||||
color: #ffffff;
|
||||
border: none;
|
||||
border-radius: 50%;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
cursor: pointer;
|
||||
font-size: 1.2rem;
|
||||
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
z-index: 1000;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0 4px 12px rgba(24, 191, 239, 0.3), 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
backdrop-filter: blur(10px);
|
||||
}
|
||||
|
||||
.back-to-top-btn.show {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.back-to-top-btn:hover {
|
||||
background: rgba(24, 191, 239, 1);
|
||||
transform: translateY(-2px) scale(1.05);
|
||||
box-shadow: 0 8px 20px rgba(24, 191, 239, 0.4), 0 4px 8px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.back-to-top-btn:active {
|
||||
transform: translateY(0) scale(0.95);
|
||||
transition: all 0.1s ease;
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.back-to-top-btn {
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function scrollToTop() {
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener('scroll', function() {
|
||||
const backToTopBtn = document.getElementById('back-to-top');
|
||||
|
||||
// Вычисляем высоту страницы и положение скролла
|
||||
const documentHeight = document.documentElement.scrollHeight;
|
||||
const windowHeight = window.innerHeight;
|
||||
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
||||
|
||||
// Показываем кнопку только в последней трети страницы
|
||||
const scrollPercent = (scrollTop + windowHeight) / documentHeight;
|
||||
|
||||
if (scrollPercent > 0.66) { // Показываем когда прокрутили 66% страницы
|
||||
backToTopBtn.classList.add('show');
|
||||
} else {
|
||||
backToTopBtn.classList.remove('show');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@@ -4,7 +4,7 @@ NB this overrides Hugo's built-in "figure" shortcode but is backwards compatible
|
||||
Documentation and licence at https://github.com/liwenyip/hugo-easy-gallery/
|
||||
-->
|
||||
<!-- count how many times we've called this shortcode; load the css if it's the first time -->
|
||||
{{- if not ($.Page.Scratch.Get "figurecount") }}<link rel="stylesheet" href={{ "css/hugo-easy-gallery.css" | relURL }} />{{ end }}
|
||||
{{- if not ($.Page.Scratch.Get "figurecount") }}<link rel="stylesheet" href="{{ "css/hugo-easy-gallery.css" | relURL }}?v={{ now.Unix }}&update=2" />{{ end }}
|
||||
{{- $.Page.Scratch.Add "figurecount" 1 -}}
|
||||
<!-- use either src or link-thumb for thumbnail image -->
|
||||
{{- $thumb := .Get "src" | default (printf "%s." (.Get "thumb") | replace (.Get "link") ".") }}
|
||||
|
||||
@@ -3,7 +3,7 @@ Put this file in /layouts/shortcodes/gallery.html
|
||||
Documentation and licence at https://github.com/liwenyip/hugo-easy-gallery/
|
||||
-->
|
||||
<!-- count how many times we've called this shortcode; load the css if it's the first time -->
|
||||
{{- if not ($.Page.Scratch.Get "figurecount") }}<link rel="stylesheet" href={{ "css/hugo-easy-gallery.css" | relURL }} />{{ end }}
|
||||
{{- if not ($.Page.Scratch.Get "figurecount") }}<link rel="stylesheet" href="{{ "css/hugo-easy-gallery.css" | relURL }}?v={{ now.Unix }}&update=2" />{{ end }}
|
||||
{{- $.Page.Scratch.Add "figurecount" 1 }}
|
||||
{{ $baseURL := .Site.BaseURL }}
|
||||
<div class="gallery caption-position-{{ with .Get "caption-position" | default "bottom" }}{{.}}{{end}} caption-effect-{{ with .Get "caption-effect" | default "slide" }}{{.}}{{end}} hover-effect-{{ with .Get "hover-effect" | default "zoom" }}{{.}}{{end}} {{ if ne (.Get "hover-transition") "none" }}hover-transition{{end}}" itemscope itemtype="http://schema.org/ImageGallery">
|
||||
@@ -39,3 +39,6 @@ Documentation and licence at https://github.com/liwenyip/hugo-easy-gallery/
|
||||
{{ .Inner }}
|
||||
{{- end }}
|
||||
</div>
|
||||
|
||||
<!-- Добавляем кнопку "вернуться в начало" для галереи -->
|
||||
{{ partial "back-to-top.html" . }}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
<div class="yandex-map-container">
|
||||
<script type="text/javascript" charset="utf-8" async src="https://api-maps.yandex.ru/services/constructor/1.0/js/?um={{ .Get 0 }}&width=800&height=400&lang=ru_RU&scroll=true"></script>
|
||||
</div>
|
||||
Reference in New Issue
Block a user