[bug fix]header slide

This commit is contained in:
zzossig 2020-02-12 17:47:55 +09:00
parent 6ec7dcd884
commit 707ebc4cb4
8 changed files with 88 additions and 109 deletions

View File

@ -13,4 +13,5 @@ series:
-
categories:
-
image:
---

View File

@ -42,6 +42,9 @@
@include no-select;
@include translateX(-50%);
@include themify($themes) {
color: themed('gtt-color');
}
&--text {
text-align: center;
@ -66,6 +69,9 @@
background: transparent;
@include no-select;
@include themify($themes) {
color: themed('gtt-color');
}
}
&__icon {

View File

@ -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 {
overflow: hidden;
visibility: hidden;
position: relative;
}
.swipe-wrap {
overflow: hidden;
position: relative;
}
.swipe-wrap > div {
float: left;
position: relative;

View File

@ -1,9 +1,4 @@
.header {
@include flexbox();
@include justify-content(center);
@include align-items(center);
@include flex-direction(column);
.title {
font-family: $title-font;
font-weight: 900;

View File

@ -1,7 +1,6 @@
{{ define "title" }}{{ .Site.Title }}{{ end }}
{{ define "main" }}
<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="summary__container" data-display="block">

View File

@ -8,7 +8,7 @@
{{ if eq .type "slide" }}
{{ $height := .height }}
{{ 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 := . }}
{{ if .title }}
{{ range .title }}
@ -33,10 +33,9 @@
{{ end }}
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
{{ $header := .Params.header }}
{{ $header := $.Params.header }}
var options = null;
var header = JSON.parse({{ $header | jsonify }});
var slide = header.filter(function(h) {
@ -46,9 +45,9 @@
if (slide.length > 0) {
options = slide[0].options;
}
console.log(options);
var headerSwipeElem = document.getElementById('headerSwipe');
var headerSwipe = Swipe(headerSwipeElem,
var headerSwipe = new Swipe(headerSwipeElem,
options ?
options : {
startSlide: 0,
@ -63,5 +62,4 @@
});
});
</script>
{{ end }}