[bug fix]header slide
This commit is contained in:
parent
6ec7dcd884
commit
707ebc4cb4
|
@ -13,4 +13,5 @@ series:
|
||||||
-
|
-
|
||||||
categories:
|
categories:
|
||||||
-
|
-
|
||||||
|
image:
|
||||||
---
|
---
|
||||||
|
|
|
@ -42,6 +42,9 @@
|
||||||
|
|
||||||
@include no-select;
|
@include no-select;
|
||||||
@include translateX(-50%);
|
@include translateX(-50%);
|
||||||
|
@include themify($themes) {
|
||||||
|
color: themed('gtt-color');
|
||||||
|
}
|
||||||
|
|
||||||
&--text {
|
&--text {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
@ -66,6 +69,9 @@
|
||||||
background: transparent;
|
background: transparent;
|
||||||
|
|
||||||
@include no-select;
|
@include no-select;
|
||||||
|
@include themify($themes) {
|
||||||
|
color: themed('gtt-color');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__icon {
|
&__icon {
|
||||||
|
|
|
@ -1,34 +1,14 @@
|
||||||
.swiper-container {
|
|
||||||
background-color: transparent;
|
|
||||||
width: 100%;
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper-slide {
|
|
||||||
background-position: center;
|
|
||||||
background-size: cover;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper-pagination-bullet {
|
|
||||||
opacity: .5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.swiper-pagination-bullet-active {
|
|
||||||
@include themify($themes) {
|
|
||||||
background: themed('navbar-title-active-color') !important;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.swipe {
|
.swipe {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.swipe-wrap {
|
.swipe-wrap {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.swipe-wrap > div {
|
.swipe-wrap > div {
|
||||||
float: left;
|
float: left;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
@ -1,9 +1,4 @@
|
||||||
.header {
|
.header {
|
||||||
@include flexbox();
|
|
||||||
@include justify-content(center);
|
|
||||||
@include align-items(center);
|
|
||||||
@include flex-direction(column);
|
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
font-family: $title-font;
|
font-family: $title-font;
|
||||||
font-weight: 900;
|
font-weight: 900;
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,7 +1,6 @@
|
||||||
{{ define "title" }}{{ .Site.Title }}{{ end }}
|
{{ define "title" }}{{ .Site.Title }}{{ end }}
|
||||||
|
|
||||||
{{ define "main" }}
|
{{ define "main" }}
|
||||||
|
|
||||||
<main class="main inner" data-sidebar-position="{{ $.Param "sidebarPosition" }}">
|
<main class="main inner" data-sidebar-position="{{ $.Param "sidebarPosition" }}">
|
||||||
<div class="list__main {{ if $.Param "enableSidebar" }}{{ if eq ($.Param "sidebarPosition") "left" }}mr{{ else }}lm{{ end }}{{ else }}lmr{{ end }}">
|
<div class="list__main {{ if $.Param "enableSidebar" }}{{ if eq ($.Param "sidebarPosition") "left" }}mr{{ else }}lm{{ end }}{{ else }}lmr{{ end }}">
|
||||||
<div class="summary__container" data-display="block">
|
<div class="summary__container" data-display="block">
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
<script defer src="{{ $swipe.RelPermalink }}"></script>
|
<script defer src="{{ $swipe.RelPermalink }}"></script>
|
||||||
|
|
||||||
{{ if $.Params.header }}
|
{{ if $.Params.header }}
|
||||||
<div id="headerSwipe" class="swipe">
|
<div id="headerSwipe" class="swipe">
|
||||||
<div class="swipe-wrap">
|
<div class="swipe-wrap">
|
||||||
{{ range $.Params.header }}
|
{{ range $.Params.header }}
|
||||||
{{ if eq .type "slide" }}
|
{{ if eq .type "slide" }}
|
||||||
{{ $height := .height }}
|
{{ $height := .height }}
|
||||||
{{ range .slide }}
|
{{ range .slide }}
|
||||||
<div class="swiper-slide site-header site-header__align-{{ .align }}" style="background-image: url('{{ .imageSrc | relURL }}'); background-size: {{ .imageSize }}; background-repeat: {{ .imageRepeat }}; background-position: {{ .imagePosition }}; height: {{ $height }}px;">
|
<div class="site-header site-header__align-{{ .align }}" style="background-image: url('{{ .imageSrc | relURL }}'); background-size: {{ .imageSize }}; background-repeat: {{ .imageRepeat }}; background-position: {{ .imagePosition }}; height: {{ $height }}px;">
|
||||||
{{ $header := . }}
|
{{ $header := . }}
|
||||||
{{ if .title }}
|
{{ if .title }}
|
||||||
{{ range .title }}
|
{{ range .title }}
|
||||||
|
@ -32,11 +32,10 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<script>
|
||||||
<script>
|
|
||||||
document.addEventListener('DOMContentLoaded', function () {
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
{{ $header := .Params.header }}
|
{{ $header := $.Params.header }}
|
||||||
var options = null;
|
var options = null;
|
||||||
var header = JSON.parse({{ $header | jsonify }});
|
var header = JSON.parse({{ $header | jsonify }});
|
||||||
var slide = header.filter(function(h) {
|
var slide = header.filter(function(h) {
|
||||||
|
@ -46,9 +45,9 @@
|
||||||
if (slide.length > 0) {
|
if (slide.length > 0) {
|
||||||
options = slide[0].options;
|
options = slide[0].options;
|
||||||
}
|
}
|
||||||
console.log(options);
|
|
||||||
var headerSwipeElem = document.getElementById('headerSwipe');
|
var headerSwipeElem = document.getElementById('headerSwipe');
|
||||||
var headerSwipe = Swipe(headerSwipeElem,
|
var headerSwipe = new Swipe(headerSwipeElem,
|
||||||
options ?
|
options ?
|
||||||
options : {
|
options : {
|
||||||
startSlide: 0,
|
startSlide: 0,
|
||||||
|
@ -62,6 +61,5 @@
|
||||||
transitionEnd: function (index, element) { }
|
transitionEnd: function (index, element) { }
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{{ end }}
|
{{ end }}
|
Loading…
Reference in New Issue