24/09/03 리스트, 리스트상세 등 추가
This commit is contained in:
parent
216ddaedf2
commit
fc384d084e
0
src/main/webapp/kofair_case_seed/adm/index.html
Normal file
0
src/main/webapp/kofair_case_seed/adm/index.html
Normal file
0
src/main/webapp/kofair_case_seed/adm/scripts/ui.js
Normal file
0
src/main/webapp/kofair_case_seed/adm/scripts/ui.js
Normal file
71
src/main/webapp/kofair_case_seed/css/font.css
Normal file
71
src/main/webapp/kofair_case_seed/css/font.css
Normal file
@ -0,0 +1,71 @@
|
||||
@font-face {
|
||||
font-family: 'Noto Sans KR';
|
||||
font-style: normal;
|
||||
font-weight: 300;
|
||||
src: url('../font/NotoSansKR-Light.woff') format('woff'),
|
||||
url('../font/NotoSansKR-Light.woff2') format('woff2'),
|
||||
url('../font/NotoSansKR-Light.ttf') format('truetype');
|
||||
font-display: block
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans KR';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
src: url('../font/NotoSansKR-Regular.woff') format('woff'),
|
||||
url('../font/NotoSansKR-Regular.woff2') format('woff2'),
|
||||
url('../font/NotoSansKR-Regular.ttf') format('truetype');
|
||||
font-display: block;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans KR';
|
||||
font-style: normal;
|
||||
font-weight: 500;
|
||||
src: url('../font/NotoSansKR-Medium.woff') format('woff'),
|
||||
url('../font/NotoSansKR-Medium.woff2') format('woff2'),
|
||||
url('../font/NotoSansKR-Medium.ttf') format('truetype');
|
||||
font-display: block;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans KR';
|
||||
font-style: normal;
|
||||
font-weight: 700;
|
||||
src: url('../font/NotoSansKR-Bold.woff') format('woff'),
|
||||
url('../font/NotoSansKR-Bold.woff2') format('woff2'),
|
||||
url('../font/NotoSansKR-Bold.ttf') format('truetype');
|
||||
font-display: block;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'Noto Sans KR';
|
||||
font-style: normal;
|
||||
font-weight: 800;
|
||||
src: url('../font/NotoSansKR-ExtraBold.woff') format('woff'),
|
||||
url('../font/NotoSansKR-ExtraBold.woff2') format('woff2'),
|
||||
url('../font/NotoSansKR-ExtraBold.ttf') format('truetype');
|
||||
font-display: block;
|
||||
}
|
||||
|
||||
/* Gmarket Sans */
|
||||
@font-face {
|
||||
font-family: 'GmarketSansBold';
|
||||
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansBold.woff') format('woff');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'GmarketSansMedium';
|
||||
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansMedium.woff') format('woff');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'GmarketSansLight';
|
||||
src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2001@1.1/GmarketSansLight.woff') format('woff');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
53
src/main/webapp/kofair_case_seed/css/reset.css
Normal file
53
src/main/webapp/kofair_case_seed/css/reset.css
Normal file
@ -0,0 +1,53 @@
|
||||
/* reset 파일 정리 */
|
||||
|
||||
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {margin: 0;padding: 0;border: 0;font-size: 100%;font: inherit;vertical-align: baseline;color: inherit;font-weight: inherit;font-family: 'Noto Sans KR', sans-serif;}
|
||||
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section {display: block; font-family: 'Noto Sans KR', sans-serif; margin: 0; padding: 0; border: 0; font-size: 100%;}
|
||||
body {min-height: 100vh;line-height: 1.3;-webkit-font-smoothing: antialiased;}
|
||||
ol,ul,li {list-style: none;}
|
||||
p, h1, h2, h3, h4, h5, h6 {margin: 0; padding: 0;letter-spacing: -0.5px;}
|
||||
h1, h2, h3, h4, h5, h6, button, input, label{line-height:1.1;}
|
||||
a {color: inherit; text-decoration: none; display: block;}
|
||||
/* a:focus:active:hover{outline: 0} */
|
||||
img {display:block;max-width: 100%;font-size: 0; border: 0;}
|
||||
table {border-collapse: collapse; border-spacing: 0; table-layout: fixed;}
|
||||
select, input {vertical-align: middle; font-family: 'Noto Sans KR', sans-serif;}
|
||||
caption, .label{position: absolute;width: 1px; height: 1px; margin: 0; border: none; clip: rect(0,0,0,0); overflow: hidden;}
|
||||
/* 안드로이드 및 아이폰에서 기본적으로 적용되어있는 select, input css 제거. */
|
||||
select {background-color: #fff; appearance: none; -webkit-appearance: none; -moz-appearance: none;}
|
||||
select::-ms-expand {display: none;}
|
||||
button,html input[type="button"],input[type="reset"],input[type="submit"] {-webkit-appearance: button; cursor: pointer; *overflow: visible; font-family: 'Noto Sans KR', sans-serif;}
|
||||
button[disabled],html input[disabled] {cursor: default;}
|
||||
/* ie 하위버전 기본적으로 적용되어 있는 css 변경 */
|
||||
input[type="checkbox"],input[type="radio"] {box-sizing: border-box; padding: 0; *height: 13px; *width: 13px;}
|
||||
/* 아이폰 기본적으로 적용되어 있는 버튼 css 변경 */
|
||||
input{-webkit-appearance: button;}
|
||||
/* 사파리5, 크롬에서 기본적으로 적용되어 있는 css 변경 */
|
||||
input[type="search"] {-webkit-appearance: textfield; -moz-box-sizing: content-box; -webkit-box-sizing: content-box; box-sizing: content-box;}
|
||||
input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration {-webkit-appearance: none;}
|
||||
address, em, i {font-style: normal;}
|
||||
button {border: 0; background: none; cursor: pointer;}
|
||||
hr {margin: 0; border: none; padding: 0; display: block;}
|
||||
figure, figcaption {margin: 0; padding: 0;}
|
||||
form, fieldset {border: none; margin: 0; padding: 0; line-height: 1;}
|
||||
input[type="submit"] {-webkit-appearance: none; -moz-appearance: none; appearance: none;}
|
||||
header, footer, article, section, aside, nav, main {display: block;}
|
||||
textarea{color: #666;font-size: 20px;font-weight: 300; font-family: 'Noto Sans KR', sans-serif;}
|
||||
|
||||
input::placeholder,input[type="text"]::placeholder,input[type="password"]::placeholder,input[type="text"]:-ms-input-placeholder,input[type="password"]:-ms-input-placeholder{color: #666 !important; font-size: 16px !important;}
|
||||
input[type="text"]:focus::placeholder,input[type="password"]:focus::placeholder{color: transparent;}
|
||||
|
||||
input:disabled,input[disabled="disabled"],input:read-only,input[readonly="readonly"]{background-color: #eee !important; color: #aaa !important; font-size: 16px;}
|
||||
button:disabled,button[disabled="disabled"]{background-color: #eee !important; color: #aaa !important; border: none !important;}
|
||||
select:disabled,select[disabled="disabled"]{background-color: #eee !important; color: #aaa !important; border: none !important;}
|
||||
|
||||
*,*::before,*::after {box-sizing: border-box;}
|
||||
|
||||
:target{scroll-margin-block: 5ex;}
|
||||
|
||||
/* a:hover, a:active,a:hover:active { outline: none; }
|
||||
a:focus:not(:focus) {outline: none;}
|
||||
a:focus:not(:focus-visible){outline: none;} */
|
||||
|
||||
::-webkit-scrollbar{width:7px;height:7px;} /* 스크롤바 너비 */
|
||||
::-webkit-scrollbar-thumb{background:#adadad;border-radius:10px;} /* 스크롤바 모양 */
|
||||
::-webkit-scrollbar-track{background:transparent;} /* 뒷배경 */
|
||||
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Bold.ttf
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Bold.ttf
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Bold.woff
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Bold.woff
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Bold.woff2
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Bold.woff2
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-ExtraBold.ttf
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-ExtraBold.ttf
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-ExtraBold.woff
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-ExtraBold.woff
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-ExtraBold.woff2
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-ExtraBold.woff2
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Light.ttf
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Light.ttf
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Light.woff
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Light.woff
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Light.woff2
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Light.woff2
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Medium.ttf
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Medium.ttf
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Medium.woff
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Medium.woff
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Medium.woff2
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Medium.woff2
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Regular.ttf
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Regular.ttf
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Regular.woff
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Regular.woff
Normal file
Binary file not shown.
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Regular.woff2
Normal file
BIN
src/main/webapp/kofair_case_seed/font/NotoSansKR-Regular.woff2
Normal file
Binary file not shown.
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><title>400: Font family not found</title><link href="//fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet" type="text/css"/><style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
html,code {
|
||||
font: 15px/22px arial,sans-serif;
|
||||
}
|
||||
html {
|
||||
background: #fff;
|
||||
color: #222;
|
||||
padding: 15px;
|
||||
}
|
||||
body {
|
||||
background: 100% 5px no-repeat;
|
||||
margin-top: 0;
|
||||
max-width: none:
|
||||
min-height: 180px;
|
||||
padding: 30px 0 15px;
|
||||
}
|
||||
* > body {
|
||||
padding-right: 205px;
|
||||
}
|
||||
p {
|
||||
margin: 22px 0 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
ins {
|
||||
text-decoration: none;
|
||||
}
|
||||
ins {
|
||||
color: #777;
|
||||
}
|
||||
/* Google Fonts logo styling*/
|
||||
.projectLogo a {
|
||||
font-family: "Open Sans", arial, sans-serif;
|
||||
font-size: 32px;
|
||||
font-weight: 300;
|
||||
color: #63666a;
|
||||
line-height: 1.375;
|
||||
text-decoration: none;
|
||||
}
|
||||
.projectLogo img {
|
||||
margin: -1px 0 -4px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style></head><body><h1 id="g" class="projectLogo"><a href="//www.google.com/fonts"><img src="//www.google.com/images/logos/google_logo_41.png" alt="Google"/> Fonts</a></h1><p><b>400:</b> <ins>Missing font family</ins></p><p>The requested font families are not available.<p>Requested: Noto Sans KR (style: normal, weight: 300)<p><ins>For reference, see the <a href="https://developers.google.com/fonts/docs/getting_started">Google Fonts API documentation</a>.</ins></p></body></html>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><title>400: Font family not found</title><link href="//fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet" type="text/css"/><style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
html,code {
|
||||
font: 15px/22px arial,sans-serif;
|
||||
}
|
||||
html {
|
||||
background: #fff;
|
||||
color: #222;
|
||||
padding: 15px;
|
||||
}
|
||||
body {
|
||||
background: 100% 5px no-repeat;
|
||||
margin-top: 0;
|
||||
max-width: none:
|
||||
min-height: 180px;
|
||||
padding: 30px 0 15px;
|
||||
}
|
||||
* > body {
|
||||
padding-right: 205px;
|
||||
}
|
||||
p {
|
||||
margin: 22px 0 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
ins {
|
||||
text-decoration: none;
|
||||
}
|
||||
ins {
|
||||
color: #777;
|
||||
}
|
||||
/* Google Fonts logo styling*/
|
||||
.projectLogo a {
|
||||
font-family: "Open Sans", arial, sans-serif;
|
||||
font-size: 32px;
|
||||
font-weight: 300;
|
||||
color: #63666a;
|
||||
line-height: 1.375;
|
||||
text-decoration: none;
|
||||
}
|
||||
.projectLogo img {
|
||||
margin: -1px 0 -4px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style></head><body><h1 id="g" class="projectLogo"><a href="//www.google.com/fonts"><img src="//www.google.com/images/logos/google_logo_41.png" alt="Google"/> Fonts</a></h1><p><b>400:</b> <ins>Missing font family</ins></p><p>The requested font families are not available.<p>Requested: Noto Sans KR (style: normal, weight: 500)<p><ins>For reference, see the <a href="https://developers.google.com/fonts/docs/getting_started">Google Fonts API documentation</a>.</ins></p></body></html>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><title>400: Font family not found</title><link href="//fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet" type="text/css"/><style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
html,code {
|
||||
font: 15px/22px arial,sans-serif;
|
||||
}
|
||||
html {
|
||||
background: #fff;
|
||||
color: #222;
|
||||
padding: 15px;
|
||||
}
|
||||
body {
|
||||
background: 100% 5px no-repeat;
|
||||
margin-top: 0;
|
||||
max-width: none:
|
||||
min-height: 180px;
|
||||
padding: 30px 0 15px;
|
||||
}
|
||||
* > body {
|
||||
padding-right: 205px;
|
||||
}
|
||||
p {
|
||||
margin: 22px 0 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
ins {
|
||||
text-decoration: none;
|
||||
}
|
||||
ins {
|
||||
color: #777;
|
||||
}
|
||||
/* Google Fonts logo styling*/
|
||||
.projectLogo a {
|
||||
font-family: "Open Sans", arial, sans-serif;
|
||||
font-size: 32px;
|
||||
font-weight: 300;
|
||||
color: #63666a;
|
||||
line-height: 1.375;
|
||||
text-decoration: none;
|
||||
}
|
||||
.projectLogo img {
|
||||
margin: -1px 0 -4px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style></head><body><h1 id="g" class="projectLogo"><a href="//www.google.com/fonts"><img src="//www.google.com/images/logos/google_logo_41.png" alt="Google"/> Fonts</a></h1><p><b>400:</b> <ins>Missing font family</ins></p><p>The requested font families are not available.<p>Requested: Noto Sans KR (style: normal, weight: 700)<p><ins>For reference, see the <a href="https://developers.google.com/fonts/docs/getting_started">Google Fonts API documentation</a>.</ins></p></body></html>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><title>400: Font family not found</title><link href="//fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet" type="text/css"/><style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
html,code {
|
||||
font: 15px/22px arial,sans-serif;
|
||||
}
|
||||
html {
|
||||
background: #fff;
|
||||
color: #222;
|
||||
padding: 15px;
|
||||
}
|
||||
body {
|
||||
background: 100% 5px no-repeat;
|
||||
margin-top: 0;
|
||||
max-width: none:
|
||||
min-height: 180px;
|
||||
padding: 30px 0 15px;
|
||||
}
|
||||
* > body {
|
||||
padding-right: 205px;
|
||||
}
|
||||
p {
|
||||
margin: 22px 0 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
ins {
|
||||
text-decoration: none;
|
||||
}
|
||||
ins {
|
||||
color: #777;
|
||||
}
|
||||
/* Google Fonts logo styling*/
|
||||
.projectLogo a {
|
||||
font-family: "Open Sans", arial, sans-serif;
|
||||
font-size: 32px;
|
||||
font-weight: 300;
|
||||
color: #63666a;
|
||||
line-height: 1.375;
|
||||
text-decoration: none;
|
||||
}
|
||||
.projectLogo img {
|
||||
margin: -1px 0 -4px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style></head><body><h1 id="g" class="projectLogo"><a href="//www.google.com/fonts"><img src="//www.google.com/images/logos/google_logo_41.png" alt="Google"/> Fonts</a></h1><p><b>400:</b> <ins>Missing font family</ins></p><p>The requested font families are not available.<p>Requested: Noto Sans KR (style: normal, weight: 900)<p><ins>For reference, see the <a href="https://developers.google.com/fonts/docs/getting_started">Google Fonts API documentation</a>.</ins></p></body></html>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,47 @@
|
||||
<!DOCTYPE html><html lang=en><head><meta charset=utf-8><title>400: Font family not found</title><link href="//fonts.googleapis.com/css?family=Open+Sans:300,400" rel="stylesheet" type="text/css"/><style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
html,code {
|
||||
font: 15px/22px arial,sans-serif;
|
||||
}
|
||||
html {
|
||||
background: #fff;
|
||||
color: #222;
|
||||
padding: 15px;
|
||||
}
|
||||
body {
|
||||
background: 100% 5px no-repeat;
|
||||
margin-top: 0;
|
||||
max-width: none:
|
||||
min-height: 180px;
|
||||
padding: 30px 0 15px;
|
||||
}
|
||||
* > body {
|
||||
padding-right: 205px;
|
||||
}
|
||||
p {
|
||||
margin: 22px 0 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
ins {
|
||||
text-decoration: none;
|
||||
}
|
||||
ins {
|
||||
color: #777;
|
||||
}
|
||||
/* Google Fonts logo styling*/
|
||||
.projectLogo a {
|
||||
font-family: "Open Sans", arial, sans-serif;
|
||||
font-size: 32px;
|
||||
font-weight: 300;
|
||||
color: #63666a;
|
||||
line-height: 1.375;
|
||||
text-decoration: none;
|
||||
}
|
||||
.projectLogo img {
|
||||
margin: -1px 0 -4px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
</style></head><body><h1 id="g" class="projectLogo"><a href="//www.google.com/fonts"><img src="//www.google.com/images/logos/google_logo_41.png" alt="Google"/> Fonts</a></h1><p><b>400:</b> <ins>Missing font family</ins></p><p>The requested font families are not available.<p>Requested: Noto Sans KR (style: normal, weight: 400)<p><ins>For reference, see the <a href="https://developers.google.com/fonts/docs/getting_started">Google Fonts API documentation</a>.</ins></p></body></html>
|
||||
Binary file not shown.
Binary file not shown.
25
src/main/webapp/kofair_case_seed/script/lib/jquery-3.5.0.js
vendored
Normal file
25
src/main/webapp/kofair_case_seed/script/lib/jquery-3.5.0.js
vendored
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019 Vladimir Kharlampidi
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@ -0,0 +1,11 @@
|
||||
Swiper
|
||||
==========
|
||||
|
||||
Swiper - is the free and most modern mobile touch slider with hardware accelerated transitions and amazing native behavior. It is intended to be used in mobile websites, mobile web apps, and mobile native/hybrid apps.
|
||||
|
||||
Swiper is not compatible with all platforms, it is a modern touch slider which is focused only on modern apps/platforms to bring the best experience and simplicity.
|
||||
|
||||
# Getting Started
|
||||
* [Getting Started Guide](https://swiperjs.com/get-started/)
|
||||
* [API](https://swiperjs.com/swiper-api/)
|
||||
* [Demos](https://swiperjs.com/demos/)
|
||||
@ -0,0 +1,9 @@
|
||||
/* a11y */
|
||||
.swiper .swiper-notification {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
z-index: -1000;
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
.swiper .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}
|
||||
@ -0,0 +1,9 @@
|
||||
/* a11y */
|
||||
.swiper .swiper-notification {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
z-index: -1000;
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
/* a11y */
|
||||
.swiper .swiper-notification {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
z-index: -1000;
|
||||
}
|
||||
1
src/main/webapp/kofair_case_seed/script/plugin/swiper-11.1.9/package/modules/a11y.min.css
vendored
Normal file
1
src/main/webapp/kofair_case_seed/script/plugin/swiper-11.1.9/package/modules/a11y.min.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
.swiper .swiper-notification{position:absolute;left:0;top:0;pointer-events:none;opacity:0;z-index:-1000}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,374 @@
|
||||
import { g as getDocument } from '../shared/ssr-window.esm.mjs';
|
||||
import { c as classesToSelector } from '../shared/classes-to-selector.mjs';
|
||||
import { c as createElement, h as elementIndex, m as makeElementsArray } from '../shared/utils.mjs';
|
||||
|
||||
function A11y(_ref) {
|
||||
let {
|
||||
swiper,
|
||||
extendParams,
|
||||
on
|
||||
} = _ref;
|
||||
extendParams({
|
||||
a11y: {
|
||||
enabled: true,
|
||||
notificationClass: 'swiper-notification',
|
||||
prevSlideMessage: 'Previous slide',
|
||||
nextSlideMessage: 'Next slide',
|
||||
firstSlideMessage: 'This is the first slide',
|
||||
lastSlideMessage: 'This is the last slide',
|
||||
paginationBulletMessage: 'Go to slide {{index}}',
|
||||
slideLabelMessage: '{{index}} / {{slidesLength}}',
|
||||
containerMessage: null,
|
||||
containerRoleDescriptionMessage: null,
|
||||
itemRoleDescriptionMessage: null,
|
||||
slideRole: 'group',
|
||||
id: null,
|
||||
scrollOnFocus: true
|
||||
}
|
||||
});
|
||||
swiper.a11y = {
|
||||
clicked: false
|
||||
};
|
||||
let liveRegion = null;
|
||||
let preventFocusHandler;
|
||||
let focusTargetSlideEl;
|
||||
let visibilityChangedTimestamp = new Date().getTime();
|
||||
function notify(message) {
|
||||
const notification = liveRegion;
|
||||
if (notification.length === 0) return;
|
||||
notification.innerHTML = '';
|
||||
notification.innerHTML = message;
|
||||
}
|
||||
function getRandomNumber(size) {
|
||||
if (size === void 0) {
|
||||
size = 16;
|
||||
}
|
||||
const randomChar = () => Math.round(16 * Math.random()).toString(16);
|
||||
return 'x'.repeat(size).replace(/x/g, randomChar);
|
||||
}
|
||||
function makeElFocusable(el) {
|
||||
el = makeElementsArray(el);
|
||||
el.forEach(subEl => {
|
||||
subEl.setAttribute('tabIndex', '0');
|
||||
});
|
||||
}
|
||||
function makeElNotFocusable(el) {
|
||||
el = makeElementsArray(el);
|
||||
el.forEach(subEl => {
|
||||
subEl.setAttribute('tabIndex', '-1');
|
||||
});
|
||||
}
|
||||
function addElRole(el, role) {
|
||||
el = makeElementsArray(el);
|
||||
el.forEach(subEl => {
|
||||
subEl.setAttribute('role', role);
|
||||
});
|
||||
}
|
||||
function addElRoleDescription(el, description) {
|
||||
el = makeElementsArray(el);
|
||||
el.forEach(subEl => {
|
||||
subEl.setAttribute('aria-roledescription', description);
|
||||
});
|
||||
}
|
||||
function addElControls(el, controls) {
|
||||
el = makeElementsArray(el);
|
||||
el.forEach(subEl => {
|
||||
subEl.setAttribute('aria-controls', controls);
|
||||
});
|
||||
}
|
||||
function addElLabel(el, label) {
|
||||
el = makeElementsArray(el);
|
||||
el.forEach(subEl => {
|
||||
subEl.setAttribute('aria-label', label);
|
||||
});
|
||||
}
|
||||
function addElId(el, id) {
|
||||
el = makeElementsArray(el);
|
||||
el.forEach(subEl => {
|
||||
subEl.setAttribute('id', id);
|
||||
});
|
||||
}
|
||||
function addElLive(el, live) {
|
||||
el = makeElementsArray(el);
|
||||
el.forEach(subEl => {
|
||||
subEl.setAttribute('aria-live', live);
|
||||
});
|
||||
}
|
||||
function disableEl(el) {
|
||||
el = makeElementsArray(el);
|
||||
el.forEach(subEl => {
|
||||
subEl.setAttribute('aria-disabled', true);
|
||||
});
|
||||
}
|
||||
function enableEl(el) {
|
||||
el = makeElementsArray(el);
|
||||
el.forEach(subEl => {
|
||||
subEl.setAttribute('aria-disabled', false);
|
||||
});
|
||||
}
|
||||
function onEnterOrSpaceKey(e) {
|
||||
if (e.keyCode !== 13 && e.keyCode !== 32) return;
|
||||
const params = swiper.params.a11y;
|
||||
const targetEl = e.target;
|
||||
if (swiper.pagination && swiper.pagination.el && (targetEl === swiper.pagination.el || swiper.pagination.el.contains(e.target))) {
|
||||
if (!e.target.matches(classesToSelector(swiper.params.pagination.bulletClass))) return;
|
||||
}
|
||||
if (swiper.navigation && swiper.navigation.prevEl && swiper.navigation.nextEl) {
|
||||
const prevEls = makeElementsArray(swiper.navigation.prevEl);
|
||||
const nextEls = makeElementsArray(swiper.navigation.nextEl);
|
||||
if (nextEls.includes(targetEl)) {
|
||||
if (!(swiper.isEnd && !swiper.params.loop)) {
|
||||
swiper.slideNext();
|
||||
}
|
||||
if (swiper.isEnd) {
|
||||
notify(params.lastSlideMessage);
|
||||
} else {
|
||||
notify(params.nextSlideMessage);
|
||||
}
|
||||
}
|
||||
if (prevEls.includes(targetEl)) {
|
||||
if (!(swiper.isBeginning && !swiper.params.loop)) {
|
||||
swiper.slidePrev();
|
||||
}
|
||||
if (swiper.isBeginning) {
|
||||
notify(params.firstSlideMessage);
|
||||
} else {
|
||||
notify(params.prevSlideMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (swiper.pagination && targetEl.matches(classesToSelector(swiper.params.pagination.bulletClass))) {
|
||||
targetEl.click();
|
||||
}
|
||||
}
|
||||
function updateNavigation() {
|
||||
if (swiper.params.loop || swiper.params.rewind || !swiper.navigation) return;
|
||||
const {
|
||||
nextEl,
|
||||
prevEl
|
||||
} = swiper.navigation;
|
||||
if (prevEl) {
|
||||
if (swiper.isBeginning) {
|
||||
disableEl(prevEl);
|
||||
makeElNotFocusable(prevEl);
|
||||
} else {
|
||||
enableEl(prevEl);
|
||||
makeElFocusable(prevEl);
|
||||
}
|
||||
}
|
||||
if (nextEl) {
|
||||
if (swiper.isEnd) {
|
||||
disableEl(nextEl);
|
||||
makeElNotFocusable(nextEl);
|
||||
} else {
|
||||
enableEl(nextEl);
|
||||
makeElFocusable(nextEl);
|
||||
}
|
||||
}
|
||||
}
|
||||
function hasPagination() {
|
||||
return swiper.pagination && swiper.pagination.bullets && swiper.pagination.bullets.length;
|
||||
}
|
||||
function hasClickablePagination() {
|
||||
return hasPagination() && swiper.params.pagination.clickable;
|
||||
}
|
||||
function updatePagination() {
|
||||
const params = swiper.params.a11y;
|
||||
if (!hasPagination()) return;
|
||||
swiper.pagination.bullets.forEach(bulletEl => {
|
||||
if (swiper.params.pagination.clickable) {
|
||||
makeElFocusable(bulletEl);
|
||||
if (!swiper.params.pagination.renderBullet) {
|
||||
addElRole(bulletEl, 'button');
|
||||
addElLabel(bulletEl, params.paginationBulletMessage.replace(/\{\{index\}\}/, elementIndex(bulletEl) + 1));
|
||||
}
|
||||
}
|
||||
if (bulletEl.matches(classesToSelector(swiper.params.pagination.bulletActiveClass))) {
|
||||
bulletEl.setAttribute('aria-current', 'true');
|
||||
} else {
|
||||
bulletEl.removeAttribute('aria-current');
|
||||
}
|
||||
});
|
||||
}
|
||||
const initNavEl = (el, wrapperId, message) => {
|
||||
makeElFocusable(el);
|
||||
if (el.tagName !== 'BUTTON') {
|
||||
addElRole(el, 'button');
|
||||
el.addEventListener('keydown', onEnterOrSpaceKey);
|
||||
}
|
||||
addElLabel(el, message);
|
||||
addElControls(el, wrapperId);
|
||||
};
|
||||
const handlePointerDown = e => {
|
||||
if (focusTargetSlideEl && focusTargetSlideEl !== e.target && !focusTargetSlideEl.contains(e.target)) {
|
||||
preventFocusHandler = true;
|
||||
}
|
||||
swiper.a11y.clicked = true;
|
||||
};
|
||||
const handlePointerUp = () => {
|
||||
preventFocusHandler = false;
|
||||
requestAnimationFrame(() => {
|
||||
requestAnimationFrame(() => {
|
||||
if (!swiper.destroyed) {
|
||||
swiper.a11y.clicked = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
const onVisibilityChange = e => {
|
||||
visibilityChangedTimestamp = new Date().getTime();
|
||||
};
|
||||
const handleFocus = e => {
|
||||
if (swiper.a11y.clicked || !swiper.params.a11y.scrollOnFocus) return;
|
||||
if (new Date().getTime() - visibilityChangedTimestamp < 100) return;
|
||||
const slideEl = e.target.closest(`.${swiper.params.slideClass}, swiper-slide`);
|
||||
if (!slideEl || !swiper.slides.includes(slideEl)) return;
|
||||
focusTargetSlideEl = slideEl;
|
||||
const isActive = swiper.slides.indexOf(slideEl) === swiper.activeIndex;
|
||||
const isVisible = swiper.params.watchSlidesProgress && swiper.visibleSlides && swiper.visibleSlides.includes(slideEl);
|
||||
if (isActive || isVisible) return;
|
||||
if (e.sourceCapabilities && e.sourceCapabilities.firesTouchEvents) return;
|
||||
if (swiper.isHorizontal()) {
|
||||
swiper.el.scrollLeft = 0;
|
||||
} else {
|
||||
swiper.el.scrollTop = 0;
|
||||
}
|
||||
requestAnimationFrame(() => {
|
||||
if (preventFocusHandler) return;
|
||||
if (swiper.params.loop) {
|
||||
swiper.slideToLoop(parseInt(slideEl.getAttribute('data-swiper-slide-index')), 0);
|
||||
} else {
|
||||
swiper.slideTo(swiper.slides.indexOf(slideEl), 0);
|
||||
}
|
||||
preventFocusHandler = false;
|
||||
});
|
||||
};
|
||||
const initSlides = () => {
|
||||
const params = swiper.params.a11y;
|
||||
if (params.itemRoleDescriptionMessage) {
|
||||
addElRoleDescription(swiper.slides, params.itemRoleDescriptionMessage);
|
||||
}
|
||||
if (params.slideRole) {
|
||||
addElRole(swiper.slides, params.slideRole);
|
||||
}
|
||||
const slidesLength = swiper.slides.length;
|
||||
if (params.slideLabelMessage) {
|
||||
swiper.slides.forEach((slideEl, index) => {
|
||||
const slideIndex = swiper.params.loop ? parseInt(slideEl.getAttribute('data-swiper-slide-index'), 10) : index;
|
||||
const ariaLabelMessage = params.slideLabelMessage.replace(/\{\{index\}\}/, slideIndex + 1).replace(/\{\{slidesLength\}\}/, slidesLength);
|
||||
addElLabel(slideEl, ariaLabelMessage);
|
||||
});
|
||||
}
|
||||
};
|
||||
const init = () => {
|
||||
const params = swiper.params.a11y;
|
||||
swiper.el.append(liveRegion);
|
||||
|
||||
// Container
|
||||
const containerEl = swiper.el;
|
||||
if (params.containerRoleDescriptionMessage) {
|
||||
addElRoleDescription(containerEl, params.containerRoleDescriptionMessage);
|
||||
}
|
||||
if (params.containerMessage) {
|
||||
addElLabel(containerEl, params.containerMessage);
|
||||
}
|
||||
|
||||
// Wrapper
|
||||
const wrapperEl = swiper.wrapperEl;
|
||||
const wrapperId = params.id || wrapperEl.getAttribute('id') || `swiper-wrapper-${getRandomNumber(16)}`;
|
||||
const live = swiper.params.autoplay && swiper.params.autoplay.enabled ? 'off' : 'polite';
|
||||
addElId(wrapperEl, wrapperId);
|
||||
addElLive(wrapperEl, live);
|
||||
|
||||
// Slide
|
||||
initSlides();
|
||||
|
||||
// Navigation
|
||||
let {
|
||||
nextEl,
|
||||
prevEl
|
||||
} = swiper.navigation ? swiper.navigation : {};
|
||||
nextEl = makeElementsArray(nextEl);
|
||||
prevEl = makeElementsArray(prevEl);
|
||||
if (nextEl) {
|
||||
nextEl.forEach(el => initNavEl(el, wrapperId, params.nextSlideMessage));
|
||||
}
|
||||
if (prevEl) {
|
||||
prevEl.forEach(el => initNavEl(el, wrapperId, params.prevSlideMessage));
|
||||
}
|
||||
|
||||
// Pagination
|
||||
if (hasClickablePagination()) {
|
||||
const paginationEl = makeElementsArray(swiper.pagination.el);
|
||||
paginationEl.forEach(el => {
|
||||
el.addEventListener('keydown', onEnterOrSpaceKey);
|
||||
});
|
||||
}
|
||||
|
||||
// Tab focus
|
||||
const document = getDocument();
|
||||
document.addEventListener('visibilitychange', onVisibilityChange);
|
||||
swiper.el.addEventListener('focus', handleFocus, true);
|
||||
swiper.el.addEventListener('focus', handleFocus, true);
|
||||
swiper.el.addEventListener('pointerdown', handlePointerDown, true);
|
||||
swiper.el.addEventListener('pointerup', handlePointerUp, true);
|
||||
};
|
||||
function destroy() {
|
||||
if (liveRegion) liveRegion.remove();
|
||||
let {
|
||||
nextEl,
|
||||
prevEl
|
||||
} = swiper.navigation ? swiper.navigation : {};
|
||||
nextEl = makeElementsArray(nextEl);
|
||||
prevEl = makeElementsArray(prevEl);
|
||||
if (nextEl) {
|
||||
nextEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
|
||||
}
|
||||
if (prevEl) {
|
||||
prevEl.forEach(el => el.removeEventListener('keydown', onEnterOrSpaceKey));
|
||||
}
|
||||
|
||||
// Pagination
|
||||
if (hasClickablePagination()) {
|
||||
const paginationEl = makeElementsArray(swiper.pagination.el);
|
||||
paginationEl.forEach(el => {
|
||||
el.removeEventListener('keydown', onEnterOrSpaceKey);
|
||||
});
|
||||
}
|
||||
const document = getDocument();
|
||||
document.removeEventListener('visibilitychange', onVisibilityChange);
|
||||
// Tab focus
|
||||
if (swiper.el && typeof swiper.el !== 'string') {
|
||||
swiper.el.removeEventListener('focus', handleFocus, true);
|
||||
swiper.el.removeEventListener('pointerdown', handlePointerDown, true);
|
||||
swiper.el.removeEventListener('pointerup', handlePointerUp, true);
|
||||
}
|
||||
}
|
||||
on('beforeInit', () => {
|
||||
liveRegion = createElement('span', swiper.params.a11y.notificationClass);
|
||||
liveRegion.setAttribute('aria-live', 'assertive');
|
||||
liveRegion.setAttribute('aria-atomic', 'true');
|
||||
});
|
||||
on('afterInit', () => {
|
||||
if (!swiper.params.a11y.enabled) return;
|
||||
init();
|
||||
});
|
||||
on('slidesLengthChange snapGridLengthChange slidesGridLengthChange', () => {
|
||||
if (!swiper.params.a11y.enabled) return;
|
||||
initSlides();
|
||||
});
|
||||
on('fromEdge toEdge afterInit lock unlock', () => {
|
||||
if (!swiper.params.a11y.enabled) return;
|
||||
updateNavigation();
|
||||
});
|
||||
on('paginationUpdate', () => {
|
||||
if (!swiper.params.a11y.enabled) return;
|
||||
updatePagination();
|
||||
});
|
||||
on('destroy', () => {
|
||||
if (!swiper.params.a11y.enabled) return;
|
||||
destroy();
|
||||
});
|
||||
}
|
||||
|
||||
export { A11y as default };
|
||||
@ -0,0 +1,9 @@
|
||||
/* a11y */
|
||||
.swiper .swiper-notification {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
pointer-events: none;
|
||||
opacity: 0;
|
||||
z-index: -1000;
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
import{g as getDocument}from"../shared/ssr-window.esm.min.mjs";function Autoplay(e){let a,t,{swiper:n,extendParams:i,on:r,emit:o,params:s}=e;n.autoplay={running:!1,paused:!1,timeLeft:0},i({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let l,p,u,d,y,m,c,g,v=s&&s.autoplay?s.autoplay.delay:3e3,T=s&&s.autoplay?s.autoplay.delay:3e3,f=(new Date).getTime();function w(e){n&&!n.destroyed&&n.wrapperEl&&e.target===n.wrapperEl&&(n.wrapperEl.removeEventListener("transitionend",w),g||e.detail&&e.detail.bySwiperTouchMove||S())}const b=()=>{if(n.destroyed||!n.autoplay.running)return;n.autoplay.paused?p=!0:p&&(T=l,p=!1);const e=n.autoplay.paused?l:f+T-(new Date).getTime();n.autoplay.timeLeft=e,o("autoplayTimeLeft",e,e/v),t=requestAnimationFrame((()=>{b()}))},E=e=>{if(n.destroyed||!n.autoplay.running)return;cancelAnimationFrame(t),b();let i=void 0===e?n.params.autoplay.delay:e;v=n.params.autoplay.delay,T=n.params.autoplay.delay;const r=(()=>{let e;if(e=n.virtual&&n.params.virtual.enabled?n.slides.filter((e=>e.classList.contains("swiper-slide-active")))[0]:n.slides[n.activeIndex],!e)return;return parseInt(e.getAttribute("data-swiper-autoplay"),10)})();!Number.isNaN(r)&&r>0&&void 0===e&&(i=r,v=r,T=r),l=i;const s=n.params.speed,p=()=>{n&&!n.destroyed&&(n.params.autoplay.reverseDirection?!n.isBeginning||n.params.loop||n.params.rewind?(n.slidePrev(s,!0,!0),o("autoplay")):n.params.autoplay.stopOnLastSlide||(n.slideTo(n.slides.length-1,s,!0,!0),o("autoplay")):!n.isEnd||n.params.loop||n.params.rewind?(n.slideNext(s,!0,!0),o("autoplay")):n.params.autoplay.stopOnLastSlide||(n.slideTo(0,s,!0,!0),o("autoplay")),n.params.cssMode&&(f=(new Date).getTime(),requestAnimationFrame((()=>{E()}))))};return i>0?(clearTimeout(a),a=setTimeout((()=>{p()}),i)):requestAnimationFrame((()=>{p()})),i},L=()=>{f=(new Date).getTime(),n.autoplay.running=!0,E(),o("autoplayStart")},D=()=>{n.autoplay.running=!1,clearTimeout(a),cancelAnimationFrame(t),o("autoplayStop")},O=(e,t)=>{if(n.destroyed||!n.autoplay.running)return;clearTimeout(a),e||(c=!0);const i=()=>{o("autoplayPause"),n.params.autoplay.waitForTransition?n.wrapperEl.addEventListener("transitionend",w):S()};if(n.autoplay.paused=!0,t)return m&&(l=n.params.autoplay.delay),m=!1,void i();const r=l||n.params.autoplay.delay;l=r-((new Date).getTime()-f),n.isEnd&&l<0&&!n.params.loop||(l<0&&(l=0),i())},S=()=>{n.isEnd&&l<0&&!n.params.loop||n.destroyed||!n.autoplay.running||(f=(new Date).getTime(),c?(c=!1,E(l)):E(),n.autoplay.paused=!1,o("autoplayResume"))},M=()=>{if(n.destroyed||!n.autoplay.running)return;const e=getDocument();"hidden"===e.visibilityState&&(c=!0,O(!0)),"visible"===e.visibilityState&&S()},h=e=>{"mouse"===e.pointerType&&(c=!0,g=!0,n.animating||n.autoplay.paused||O(!0))},A=e=>{"mouse"===e.pointerType&&(g=!1,n.autoplay.paused&&S())};r("init",(()=>{n.params.autoplay.enabled&&(n.params.autoplay.pauseOnMouseEnter&&(n.el.addEventListener("pointerenter",h),n.el.addEventListener("pointerleave",A)),getDocument().addEventListener("visibilitychange",M),L())})),r("destroy",(()=>{n.el&&"string"!=typeof n.el&&(n.el.removeEventListener("pointerenter",h),n.el.removeEventListener("pointerleave",A)),getDocument().removeEventListener("visibilitychange",M),n.autoplay.running&&D()})),r("_freeModeStaticRelease",(()=>{(d||c)&&S()})),r("_freeModeNoMomentumRelease",(()=>{n.params.autoplay.disableOnInteraction?D():O(!0,!0)})),r("beforeTransitionStart",((e,a,t)=>{!n.destroyed&&n.autoplay.running&&(t||!n.params.autoplay.disableOnInteraction?O(!0,!0):D())})),r("sliderFirstMove",(()=>{!n.destroyed&&n.autoplay.running&&(n.params.autoplay.disableOnInteraction?D():(u=!0,d=!1,c=!1,y=setTimeout((()=>{c=!0,d=!0,O(!0)}),200)))})),r("touchEnd",(()=>{if(!n.destroyed&&n.autoplay.running&&u){if(clearTimeout(y),clearTimeout(a),n.params.autoplay.disableOnInteraction)return d=!1,void(u=!1);d&&n.params.cssMode&&S(),d=!1,u=!1}})),r("slideChange",(()=>{!n.destroyed&&n.autoplay.running&&(m=!0)})),Object.assign(n.autoplay,{start:L,stop:D,pause:O,resume:S})}export{Autoplay as default};
|
||||
//# sourceMappingURL=autoplay.min.mjs.map
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,304 @@
|
||||
import { g as getDocument } from '../shared/ssr-window.esm.mjs';
|
||||
|
||||
/* eslint no-underscore-dangle: "off" */
|
||||
/* eslint no-use-before-define: "off" */
|
||||
function Autoplay(_ref) {
|
||||
let {
|
||||
swiper,
|
||||
extendParams,
|
||||
on,
|
||||
emit,
|
||||
params
|
||||
} = _ref;
|
||||
swiper.autoplay = {
|
||||
running: false,
|
||||
paused: false,
|
||||
timeLeft: 0
|
||||
};
|
||||
extendParams({
|
||||
autoplay: {
|
||||
enabled: false,
|
||||
delay: 3000,
|
||||
waitForTransition: true,
|
||||
disableOnInteraction: false,
|
||||
stopOnLastSlide: false,
|
||||
reverseDirection: false,
|
||||
pauseOnMouseEnter: false
|
||||
}
|
||||
});
|
||||
let timeout;
|
||||
let raf;
|
||||
let autoplayDelayTotal = params && params.autoplay ? params.autoplay.delay : 3000;
|
||||
let autoplayDelayCurrent = params && params.autoplay ? params.autoplay.delay : 3000;
|
||||
let autoplayTimeLeft;
|
||||
let autoplayStartTime = new Date().getTime();
|
||||
let wasPaused;
|
||||
let isTouched;
|
||||
let pausedByTouch;
|
||||
let touchStartTimeout;
|
||||
let slideChanged;
|
||||
let pausedByInteraction;
|
||||
let pausedByPointerEnter;
|
||||
function onTransitionEnd(e) {
|
||||
if (!swiper || swiper.destroyed || !swiper.wrapperEl) return;
|
||||
if (e.target !== swiper.wrapperEl) return;
|
||||
swiper.wrapperEl.removeEventListener('transitionend', onTransitionEnd);
|
||||
if (pausedByPointerEnter || e.detail && e.detail.bySwiperTouchMove) {
|
||||
return;
|
||||
}
|
||||
resume();
|
||||
}
|
||||
const calcTimeLeft = () => {
|
||||
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||
if (swiper.autoplay.paused) {
|
||||
wasPaused = true;
|
||||
} else if (wasPaused) {
|
||||
autoplayDelayCurrent = autoplayTimeLeft;
|
||||
wasPaused = false;
|
||||
}
|
||||
const timeLeft = swiper.autoplay.paused ? autoplayTimeLeft : autoplayStartTime + autoplayDelayCurrent - new Date().getTime();
|
||||
swiper.autoplay.timeLeft = timeLeft;
|
||||
emit('autoplayTimeLeft', timeLeft, timeLeft / autoplayDelayTotal);
|
||||
raf = requestAnimationFrame(() => {
|
||||
calcTimeLeft();
|
||||
});
|
||||
};
|
||||
const getSlideDelay = () => {
|
||||
let activeSlideEl;
|
||||
if (swiper.virtual && swiper.params.virtual.enabled) {
|
||||
activeSlideEl = swiper.slides.filter(slideEl => slideEl.classList.contains('swiper-slide-active'))[0];
|
||||
} else {
|
||||
activeSlideEl = swiper.slides[swiper.activeIndex];
|
||||
}
|
||||
if (!activeSlideEl) return undefined;
|
||||
const currentSlideDelay = parseInt(activeSlideEl.getAttribute('data-swiper-autoplay'), 10);
|
||||
return currentSlideDelay;
|
||||
};
|
||||
const run = delayForce => {
|
||||
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||
cancelAnimationFrame(raf);
|
||||
calcTimeLeft();
|
||||
let delay = typeof delayForce === 'undefined' ? swiper.params.autoplay.delay : delayForce;
|
||||
autoplayDelayTotal = swiper.params.autoplay.delay;
|
||||
autoplayDelayCurrent = swiper.params.autoplay.delay;
|
||||
const currentSlideDelay = getSlideDelay();
|
||||
if (!Number.isNaN(currentSlideDelay) && currentSlideDelay > 0 && typeof delayForce === 'undefined') {
|
||||
delay = currentSlideDelay;
|
||||
autoplayDelayTotal = currentSlideDelay;
|
||||
autoplayDelayCurrent = currentSlideDelay;
|
||||
}
|
||||
autoplayTimeLeft = delay;
|
||||
const speed = swiper.params.speed;
|
||||
const proceed = () => {
|
||||
if (!swiper || swiper.destroyed) return;
|
||||
if (swiper.params.autoplay.reverseDirection) {
|
||||
if (!swiper.isBeginning || swiper.params.loop || swiper.params.rewind) {
|
||||
swiper.slidePrev(speed, true, true);
|
||||
emit('autoplay');
|
||||
} else if (!swiper.params.autoplay.stopOnLastSlide) {
|
||||
swiper.slideTo(swiper.slides.length - 1, speed, true, true);
|
||||
emit('autoplay');
|
||||
}
|
||||
} else {
|
||||
if (!swiper.isEnd || swiper.params.loop || swiper.params.rewind) {
|
||||
swiper.slideNext(speed, true, true);
|
||||
emit('autoplay');
|
||||
} else if (!swiper.params.autoplay.stopOnLastSlide) {
|
||||
swiper.slideTo(0, speed, true, true);
|
||||
emit('autoplay');
|
||||
}
|
||||
}
|
||||
if (swiper.params.cssMode) {
|
||||
autoplayStartTime = new Date().getTime();
|
||||
requestAnimationFrame(() => {
|
||||
run();
|
||||
});
|
||||
}
|
||||
};
|
||||
if (delay > 0) {
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(() => {
|
||||
proceed();
|
||||
}, delay);
|
||||
} else {
|
||||
requestAnimationFrame(() => {
|
||||
proceed();
|
||||
});
|
||||
}
|
||||
|
||||
// eslint-disable-next-line
|
||||
return delay;
|
||||
};
|
||||
const start = () => {
|
||||
autoplayStartTime = new Date().getTime();
|
||||
swiper.autoplay.running = true;
|
||||
run();
|
||||
emit('autoplayStart');
|
||||
};
|
||||
const stop = () => {
|
||||
swiper.autoplay.running = false;
|
||||
clearTimeout(timeout);
|
||||
cancelAnimationFrame(raf);
|
||||
emit('autoplayStop');
|
||||
};
|
||||
const pause = (internal, reset) => {
|
||||
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||
clearTimeout(timeout);
|
||||
if (!internal) {
|
||||
pausedByInteraction = true;
|
||||
}
|
||||
const proceed = () => {
|
||||
emit('autoplayPause');
|
||||
if (swiper.params.autoplay.waitForTransition) {
|
||||
swiper.wrapperEl.addEventListener('transitionend', onTransitionEnd);
|
||||
} else {
|
||||
resume();
|
||||
}
|
||||
};
|
||||
swiper.autoplay.paused = true;
|
||||
if (reset) {
|
||||
if (slideChanged) {
|
||||
autoplayTimeLeft = swiper.params.autoplay.delay;
|
||||
}
|
||||
slideChanged = false;
|
||||
proceed();
|
||||
return;
|
||||
}
|
||||
const delay = autoplayTimeLeft || swiper.params.autoplay.delay;
|
||||
autoplayTimeLeft = delay - (new Date().getTime() - autoplayStartTime);
|
||||
if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop) return;
|
||||
if (autoplayTimeLeft < 0) autoplayTimeLeft = 0;
|
||||
proceed();
|
||||
};
|
||||
const resume = () => {
|
||||
if (swiper.isEnd && autoplayTimeLeft < 0 && !swiper.params.loop || swiper.destroyed || !swiper.autoplay.running) return;
|
||||
autoplayStartTime = new Date().getTime();
|
||||
if (pausedByInteraction) {
|
||||
pausedByInteraction = false;
|
||||
run(autoplayTimeLeft);
|
||||
} else {
|
||||
run();
|
||||
}
|
||||
swiper.autoplay.paused = false;
|
||||
emit('autoplayResume');
|
||||
};
|
||||
const onVisibilityChange = () => {
|
||||
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||
const document = getDocument();
|
||||
if (document.visibilityState === 'hidden') {
|
||||
pausedByInteraction = true;
|
||||
pause(true);
|
||||
}
|
||||
if (document.visibilityState === 'visible') {
|
||||
resume();
|
||||
}
|
||||
};
|
||||
const onPointerEnter = e => {
|
||||
if (e.pointerType !== 'mouse') return;
|
||||
pausedByInteraction = true;
|
||||
pausedByPointerEnter = true;
|
||||
if (swiper.animating || swiper.autoplay.paused) return;
|
||||
pause(true);
|
||||
};
|
||||
const onPointerLeave = e => {
|
||||
if (e.pointerType !== 'mouse') return;
|
||||
pausedByPointerEnter = false;
|
||||
if (swiper.autoplay.paused) {
|
||||
resume();
|
||||
}
|
||||
};
|
||||
const attachMouseEvents = () => {
|
||||
if (swiper.params.autoplay.pauseOnMouseEnter) {
|
||||
swiper.el.addEventListener('pointerenter', onPointerEnter);
|
||||
swiper.el.addEventListener('pointerleave', onPointerLeave);
|
||||
}
|
||||
};
|
||||
const detachMouseEvents = () => {
|
||||
if (swiper.el && typeof swiper.el !== 'string') {
|
||||
swiper.el.removeEventListener('pointerenter', onPointerEnter);
|
||||
swiper.el.removeEventListener('pointerleave', onPointerLeave);
|
||||
}
|
||||
};
|
||||
const attachDocumentEvents = () => {
|
||||
const document = getDocument();
|
||||
document.addEventListener('visibilitychange', onVisibilityChange);
|
||||
};
|
||||
const detachDocumentEvents = () => {
|
||||
const document = getDocument();
|
||||
document.removeEventListener('visibilitychange', onVisibilityChange);
|
||||
};
|
||||
on('init', () => {
|
||||
if (swiper.params.autoplay.enabled) {
|
||||
attachMouseEvents();
|
||||
attachDocumentEvents();
|
||||
start();
|
||||
}
|
||||
});
|
||||
on('destroy', () => {
|
||||
detachMouseEvents();
|
||||
detachDocumentEvents();
|
||||
if (swiper.autoplay.running) {
|
||||
stop();
|
||||
}
|
||||
});
|
||||
on('_freeModeStaticRelease', () => {
|
||||
if (pausedByTouch || pausedByInteraction) {
|
||||
resume();
|
||||
}
|
||||
});
|
||||
on('_freeModeNoMomentumRelease', () => {
|
||||
if (!swiper.params.autoplay.disableOnInteraction) {
|
||||
pause(true, true);
|
||||
} else {
|
||||
stop();
|
||||
}
|
||||
});
|
||||
on('beforeTransitionStart', (_s, speed, internal) => {
|
||||
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||
if (internal || !swiper.params.autoplay.disableOnInteraction) {
|
||||
pause(true, true);
|
||||
} else {
|
||||
stop();
|
||||
}
|
||||
});
|
||||
on('sliderFirstMove', () => {
|
||||
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||
if (swiper.params.autoplay.disableOnInteraction) {
|
||||
stop();
|
||||
return;
|
||||
}
|
||||
isTouched = true;
|
||||
pausedByTouch = false;
|
||||
pausedByInteraction = false;
|
||||
touchStartTimeout = setTimeout(() => {
|
||||
pausedByInteraction = true;
|
||||
pausedByTouch = true;
|
||||
pause(true);
|
||||
}, 200);
|
||||
});
|
||||
on('touchEnd', () => {
|
||||
if (swiper.destroyed || !swiper.autoplay.running || !isTouched) return;
|
||||
clearTimeout(touchStartTimeout);
|
||||
clearTimeout(timeout);
|
||||
if (swiper.params.autoplay.disableOnInteraction) {
|
||||
pausedByTouch = false;
|
||||
isTouched = false;
|
||||
return;
|
||||
}
|
||||
if (pausedByTouch && swiper.params.cssMode) resume();
|
||||
pausedByTouch = false;
|
||||
isTouched = false;
|
||||
});
|
||||
on('slideChange', () => {
|
||||
if (swiper.destroyed || !swiper.autoplay.running) return;
|
||||
slideChanged = true;
|
||||
});
|
||||
Object.assign(swiper.autoplay, {
|
||||
start,
|
||||
stop,
|
||||
pause,
|
||||
resume
|
||||
});
|
||||
}
|
||||
|
||||
export { Autoplay as default };
|
||||
@ -0,0 +1,2 @@
|
||||
import{n as nextTick,k as elementTransitionEnd}from"../shared/utils.min.mjs";function Controller(t){let{swiper:r,extendParams:e,on:n}=t;function o(t,r){const e=function(){let t,r,e;return(n,o)=>{for(r=-1,t=n.length;t-r>1;)e=t+r>>1,n[e]<=o?r=e:t=e;return t}}();let n,o;return this.x=t,this.y=r,this.lastIndex=t.length-1,this.interpolate=function(t){return t?(o=e(this.x,t),n=o-1,(t-this.x[n])*(this.y[o]-this.y[n])/(this.x[o]-this.x[n])+this.y[n]):0},this}function l(){r.controller.control&&r.controller.spline&&(r.controller.spline=void 0,delete r.controller.spline)}e({controller:{control:void 0,inverse:!1,by:"slide"}}),r.controller={control:void 0},n("beforeInit",(()=>{if("undefined"!=typeof window&&("string"==typeof r.params.controller.control||r.params.controller.control instanceof HTMLElement)){("string"==typeof r.params.controller.control?[...document.querySelectorAll(r.params.controller.control)]:[r.params.controller.control]).forEach((t=>{if(r.controller.control||(r.controller.control=[]),t&&t.swiper)r.controller.control.push(t.swiper);else if(t){const e=`${r.params.eventsPrefix}init`,n=o=>{r.controller.control.push(o.detail[0]),r.update(),t.removeEventListener(e,n)};t.addEventListener(e,n)}}))}else r.controller.control=r.params.controller.control})),n("update",(()=>{l()})),n("resize",(()=>{l()})),n("observerUpdate",(()=>{l()})),n("setTranslate",((t,e,n)=>{r.controller.control&&!r.controller.control.destroyed&&r.controller.setTranslate(e,n)})),n("setTransition",((t,e,n)=>{r.controller.control&&!r.controller.control.destroyed&&r.controller.setTransition(e,n)})),Object.assign(r.controller,{setTranslate:function(t,e){const n=r.controller.control;let l,s;const i=r.constructor;function a(t){if(t.destroyed)return;const e=r.rtlTranslate?-r.translate:r.translate;"slide"===r.params.controller.by&&(!function(t){r.controller.spline=r.params.loop?new o(r.slidesGrid,t.slidesGrid):new o(r.snapGrid,t.snapGrid)}(t),s=-r.controller.spline.interpolate(-e)),s&&"container"!==r.params.controller.by||(l=(t.maxTranslate()-t.minTranslate())/(r.maxTranslate()-r.minTranslate()),!Number.isNaN(l)&&Number.isFinite(l)||(l=1),s=(e-r.minTranslate())*l+t.minTranslate()),r.params.controller.inverse&&(s=t.maxTranslate()-s),t.updateProgress(s),t.setTranslate(s,r),t.updateActiveIndex(),t.updateSlidesClasses()}if(Array.isArray(n))for(let t=0;t<n.length;t+=1)n[t]!==e&&n[t]instanceof i&&a(n[t]);else n instanceof i&&e!==n&&a(n)},setTransition:function(t,e){const n=r.constructor,o=r.controller.control;let l;function s(e){e.destroyed||(e.setTransition(t,r),0!==t&&(e.transitionStart(),e.params.autoHeight&&nextTick((()=>{e.updateAutoHeight()})),elementTransitionEnd(e.wrapperEl,(()=>{o&&e.transitionEnd()}))))}if(Array.isArray(o))for(l=0;l<o.length;l+=1)o[l]!==e&&o[l]instanceof n&&s(o[l]);else o instanceof n&&e!==o&&s(o)}})}export{Controller as default};
|
||||
//# sourceMappingURL=controller.min.mjs.map
|
||||
@ -0,0 +1 @@
|
||||
{"version":3,"file":"controller.mjs.mjs","names":["nextTick","elementTransitionEnd","Controller","_ref","swiper","extendParams","on","LinearSpline","x","y","binarySearch","maxIndex","minIndex","guess","array","val","length","i1","i3","this","lastIndex","interpolate","x2","removeSpline","controller","control","spline","undefined","inverse","by","window","params","HTMLElement","document","querySelectorAll","forEach","controlElement","push","eventName","eventsPrefix","onControllerSwiper","e","detail","update","removeEventListener","addEventListener","_s","translate","byController","destroyed","setTranslate","duration","setTransition","Object","assign","_t","controlled","multiplier","controlledTranslate","Swiper","constructor","setControlledTranslate","c","rtlTranslate","loop","slidesGrid","snapGrid","getInterpolateFunction","maxTranslate","minTranslate","Number","isNaN","isFinite","updateProgress","updateActiveIndex","updateSlidesClasses","Array","isArray","i","setControlledTransition","transitionStart","autoHeight","updateAutoHeight","wrapperEl","transitionEnd"],"sources":["0"],"mappings":"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"}
|
||||
@ -0,0 +1,191 @@
|
||||
import { n as nextTick, k as elementTransitionEnd } from '../shared/utils.mjs';
|
||||
|
||||
/* eslint no-bitwise: ["error", { "allow": [">>"] }] */
|
||||
function Controller(_ref) {
|
||||
let {
|
||||
swiper,
|
||||
extendParams,
|
||||
on
|
||||
} = _ref;
|
||||
extendParams({
|
||||
controller: {
|
||||
control: undefined,
|
||||
inverse: false,
|
||||
by: 'slide' // or 'container'
|
||||
}
|
||||
});
|
||||
|
||||
swiper.controller = {
|
||||
control: undefined
|
||||
};
|
||||
function LinearSpline(x, y) {
|
||||
const binarySearch = function search() {
|
||||
let maxIndex;
|
||||
let minIndex;
|
||||
let guess;
|
||||
return (array, val) => {
|
||||
minIndex = -1;
|
||||
maxIndex = array.length;
|
||||
while (maxIndex - minIndex > 1) {
|
||||
guess = maxIndex + minIndex >> 1;
|
||||
if (array[guess] <= val) {
|
||||
minIndex = guess;
|
||||
} else {
|
||||
maxIndex = guess;
|
||||
}
|
||||
}
|
||||
return maxIndex;
|
||||
};
|
||||
}();
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.lastIndex = x.length - 1;
|
||||
// Given an x value (x2), return the expected y2 value:
|
||||
// (x1,y1) is the known point before given value,
|
||||
// (x3,y3) is the known point after given value.
|
||||
let i1;
|
||||
let i3;
|
||||
this.interpolate = function interpolate(x2) {
|
||||
if (!x2) return 0;
|
||||
|
||||
// Get the indexes of x1 and x3 (the array indexes before and after given x2):
|
||||
i3 = binarySearch(this.x, x2);
|
||||
i1 = i3 - 1;
|
||||
|
||||
// We have our indexes i1 & i3, so we can calculate already:
|
||||
// y2 := ((x2−x1) × (y3−y1)) ÷ (x3−x1) + y1
|
||||
return (x2 - this.x[i1]) * (this.y[i3] - this.y[i1]) / (this.x[i3] - this.x[i1]) + this.y[i1];
|
||||
};
|
||||
return this;
|
||||
}
|
||||
function getInterpolateFunction(c) {
|
||||
swiper.controller.spline = swiper.params.loop ? new LinearSpline(swiper.slidesGrid, c.slidesGrid) : new LinearSpline(swiper.snapGrid, c.snapGrid);
|
||||
}
|
||||
function setTranslate(_t, byController) {
|
||||
const controlled = swiper.controller.control;
|
||||
let multiplier;
|
||||
let controlledTranslate;
|
||||
const Swiper = swiper.constructor;
|
||||
function setControlledTranslate(c) {
|
||||
if (c.destroyed) return;
|
||||
|
||||
// this will create an Interpolate function based on the snapGrids
|
||||
// x is the Grid of the scrolled scroller and y will be the controlled scroller
|
||||
// it makes sense to create this only once and recall it for the interpolation
|
||||
// the function does a lot of value caching for performance
|
||||
const translate = swiper.rtlTranslate ? -swiper.translate : swiper.translate;
|
||||
if (swiper.params.controller.by === 'slide') {
|
||||
getInterpolateFunction(c);
|
||||
// i am not sure why the values have to be multiplicated this way, tried to invert the snapGrid
|
||||
// but it did not work out
|
||||
controlledTranslate = -swiper.controller.spline.interpolate(-translate);
|
||||
}
|
||||
if (!controlledTranslate || swiper.params.controller.by === 'container') {
|
||||
multiplier = (c.maxTranslate() - c.minTranslate()) / (swiper.maxTranslate() - swiper.minTranslate());
|
||||
if (Number.isNaN(multiplier) || !Number.isFinite(multiplier)) {
|
||||
multiplier = 1;
|
||||
}
|
||||
controlledTranslate = (translate - swiper.minTranslate()) * multiplier + c.minTranslate();
|
||||
}
|
||||
if (swiper.params.controller.inverse) {
|
||||
controlledTranslate = c.maxTranslate() - controlledTranslate;
|
||||
}
|
||||
c.updateProgress(controlledTranslate);
|
||||
c.setTranslate(controlledTranslate, swiper);
|
||||
c.updateActiveIndex();
|
||||
c.updateSlidesClasses();
|
||||
}
|
||||
if (Array.isArray(controlled)) {
|
||||
for (let i = 0; i < controlled.length; i += 1) {
|
||||
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
|
||||
setControlledTranslate(controlled[i]);
|
||||
}
|
||||
}
|
||||
} else if (controlled instanceof Swiper && byController !== controlled) {
|
||||
setControlledTranslate(controlled);
|
||||
}
|
||||
}
|
||||
function setTransition(duration, byController) {
|
||||
const Swiper = swiper.constructor;
|
||||
const controlled = swiper.controller.control;
|
||||
let i;
|
||||
function setControlledTransition(c) {
|
||||
if (c.destroyed) return;
|
||||
c.setTransition(duration, swiper);
|
||||
if (duration !== 0) {
|
||||
c.transitionStart();
|
||||
if (c.params.autoHeight) {
|
||||
nextTick(() => {
|
||||
c.updateAutoHeight();
|
||||
});
|
||||
}
|
||||
elementTransitionEnd(c.wrapperEl, () => {
|
||||
if (!controlled) return;
|
||||
c.transitionEnd();
|
||||
});
|
||||
}
|
||||
}
|
||||
if (Array.isArray(controlled)) {
|
||||
for (i = 0; i < controlled.length; i += 1) {
|
||||
if (controlled[i] !== byController && controlled[i] instanceof Swiper) {
|
||||
setControlledTransition(controlled[i]);
|
||||
}
|
||||
}
|
||||
} else if (controlled instanceof Swiper && byController !== controlled) {
|
||||
setControlledTransition(controlled);
|
||||
}
|
||||
}
|
||||
function removeSpline() {
|
||||
if (!swiper.controller.control) return;
|
||||
if (swiper.controller.spline) {
|
||||
swiper.controller.spline = undefined;
|
||||
delete swiper.controller.spline;
|
||||
}
|
||||
}
|
||||
on('beforeInit', () => {
|
||||
if (typeof window !== 'undefined' && (
|
||||
// eslint-disable-line
|
||||
typeof swiper.params.controller.control === 'string' || swiper.params.controller.control instanceof HTMLElement)) {
|
||||
const controlElements = typeof swiper.params.controller.control === 'string' ? [...document.querySelectorAll(swiper.params.controller.control)] : [swiper.params.controller.control];
|
||||
controlElements.forEach(controlElement => {
|
||||
if (!swiper.controller.control) swiper.controller.control = [];
|
||||
if (controlElement && controlElement.swiper) {
|
||||
swiper.controller.control.push(controlElement.swiper);
|
||||
} else if (controlElement) {
|
||||
const eventName = `${swiper.params.eventsPrefix}init`;
|
||||
const onControllerSwiper = e => {
|
||||
swiper.controller.control.push(e.detail[0]);
|
||||
swiper.update();
|
||||
controlElement.removeEventListener(eventName, onControllerSwiper);
|
||||
};
|
||||
controlElement.addEventListener(eventName, onControllerSwiper);
|
||||
}
|
||||
});
|
||||
return;
|
||||
}
|
||||
swiper.controller.control = swiper.params.controller.control;
|
||||
});
|
||||
on('update', () => {
|
||||
removeSpline();
|
||||
});
|
||||
on('resize', () => {
|
||||
removeSpline();
|
||||
});
|
||||
on('observerUpdate', () => {
|
||||
removeSpline();
|
||||
});
|
||||
on('setTranslate', (_s, translate, byController) => {
|
||||
if (!swiper.controller.control || swiper.controller.control.destroyed) return;
|
||||
swiper.controller.setTranslate(translate, byController);
|
||||
});
|
||||
on('setTransition', (_s, duration, byController) => {
|
||||
if (!swiper.controller.control || swiper.controller.control.destroyed) return;
|
||||
swiper.controller.setTransition(duration, byController);
|
||||
});
|
||||
Object.assign(swiper.controller, {
|
||||
setTranslate,
|
||||
setTransition
|
||||
});
|
||||
}
|
||||
|
||||
export { Controller as default };
|
||||
@ -0,0 +1,9 @@
|
||||
.swiper-cards {
|
||||
overflow: visible;
|
||||
}
|
||||
.swiper-cards ::slotted(swiper-slide) {
|
||||
transform-origin: center bottom;
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
overflow: hidden;
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
.swiper-cards{overflow:visible}.swiper-cards ::slotted(swiper-slide){transform-origin:center bottom;-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden}
|
||||
@ -0,0 +1,9 @@
|
||||
.swiper-cards {
|
||||
overflow: visible;
|
||||
}
|
||||
.swiper-cards .swiper-slide {
|
||||
transform-origin: center bottom;
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
overflow: hidden;
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
.swiper-cards {
|
||||
overflow: visible;
|
||||
.swiper-slide {
|
||||
transform-origin: center bottom;
|
||||
backface-visibility: hidden;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
.swiper-cards{overflow:visible}.swiper-cards .swiper-slide{transform-origin:center bottom;-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden}
|
||||
@ -0,0 +1,2 @@
|
||||
import{c as createShadow}from"../shared/create-shadow.min.mjs";import{e as effectInit}from"../shared/effect-init.min.mjs";import{e as effectTarget}from"../shared/effect-target.min.mjs";import{e as effectVirtualTransitionEnd}from"../shared/effect-virtual-transition-end.min.mjs";import{g as getSlideTransformEl}from"../shared/utils.min.mjs";function EffectCards(e){let{swiper:t,extendParams:a,on:s}=e;a({cardsEffect:{slideShadows:!0,rotate:!0,perSlideRotate:2,perSlideOffset:8}});effectInit({effect:"cards",swiper:t,on:s,setTranslate:()=>{const{slides:e,activeIndex:a,rtlTranslate:s}=t,r=t.params.cardsEffect,{startTranslate:i,isTouched:n}=t.touchEventsData,o=s?-t.translate:t.translate;for(let l=0;l<e.length;l+=1){const d=e[l],f=d.progress,c=Math.min(Math.max(f,-4),4);let m=d.swiperSlideOffset;t.params.centeredSlides&&!t.params.cssMode&&(t.wrapperEl.style.transform=`translateX(${t.minTranslate()}px)`),t.params.centeredSlides&&t.params.cssMode&&(m-=e[0].swiperSlideOffset);let p=t.params.cssMode?-m-t.translate:-m,h=0;const M=-100*Math.abs(c);let u=1,w=-r.perSlideRotate*c,S=r.perSlideOffset-.75*Math.abs(c);const $=t.virtual&&t.params.virtual.enabled?t.virtual.from+l:l,E=($===a||$===a-1)&&c>0&&c<1&&(n||t.params.cssMode)&&o<i,T=($===a||$===a+1)&&c<0&&c>-1&&(n||t.params.cssMode)&&o>i;if(E||T){const e=(1-Math.abs((Math.abs(c)-.5)/.5))**.5;w+=-28*c*e,u+=-.5*e,S+=96*e,h=-25*e*Math.abs(c)+"%"}if(p=c<0?`calc(${p}px ${s?"-":"+"} (${S*Math.abs(c)}%))`:c>0?`calc(${p}px ${s?"-":"+"} (-${S*Math.abs(c)}%))`:`${p}px`,!t.isHorizontal()){const e=h;h=p,p=e}const g=c<0?""+(1+(1-u)*c):""+(1-(1-u)*c),x=`\n translate3d(${p}, ${h}, ${M}px)\n rotateZ(${r.rotate?s?-w:w:0}deg)\n scale(${g})\n `;if(r.slideShadows){let e=d.querySelector(".swiper-slide-shadow");e||(e=createShadow("cards",d)),e&&(e.style.opacity=Math.min(Math.max((Math.abs(c)-.5)/.5,0),1))}d.style.zIndex=-Math.abs(Math.round(f))+e.length;effectTarget(r,d).style.transform=x}},setTransition:e=>{const a=t.slides.map((e=>getSlideTransformEl(e)));a.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),effectVirtualTransitionEnd({swiper:t,duration:e,transformElements:a})},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}export{EffectCards as default};
|
||||
//# sourceMappingURL=effect-cards.min.mjs.map
|
||||
@ -0,0 +1 @@
|
||||
{"version":3,"file":"effect-cards.mjs.mjs","names":["createShadow","effectInit","effectTarget","effectVirtualTransitionEnd","getSlideTransformEl","EffectCards","_ref","swiper","extendParams","on","cardsEffect","slideShadows","rotate","perSlideRotate","perSlideOffset","effect","setTranslate","slides","activeIndex","rtlTranslate","rtl","params","startTranslate","isTouched","touchEventsData","currentTranslate","translate","i","length","slideEl","slideProgress","progress","Math","min","max","offset","swiperSlideOffset","centeredSlides","cssMode","wrapperEl","style","transform","minTranslate","tX","tY","tZ","abs","scale","tXAdd","slideIndex","virtual","enabled","from","isSwipeToNext","isSwipeToPrev","subProgress","isHorizontal","prevY","scaleString","shadowEl","querySelector","opacity","zIndex","round","setTransition","duration","transformElements","map","forEach","el","transitionDuration","querySelectorAll","perspective","overwriteParams","watchSlidesProgress","virtualTranslate"],"sources":["0"],"mappings":"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"}
|
||||
@ -0,0 +1,125 @@
|
||||
import { c as createShadow } from '../shared/create-shadow.mjs';
|
||||
import { e as effectInit } from '../shared/effect-init.mjs';
|
||||
import { e as effectTarget } from '../shared/effect-target.mjs';
|
||||
import { e as effectVirtualTransitionEnd } from '../shared/effect-virtual-transition-end.mjs';
|
||||
import { g as getSlideTransformEl } from '../shared/utils.mjs';
|
||||
|
||||
function EffectCards(_ref) {
|
||||
let {
|
||||
swiper,
|
||||
extendParams,
|
||||
on
|
||||
} = _ref;
|
||||
extendParams({
|
||||
cardsEffect: {
|
||||
slideShadows: true,
|
||||
rotate: true,
|
||||
perSlideRotate: 2,
|
||||
perSlideOffset: 8
|
||||
}
|
||||
});
|
||||
const setTranslate = () => {
|
||||
const {
|
||||
slides,
|
||||
activeIndex,
|
||||
rtlTranslate: rtl
|
||||
} = swiper;
|
||||
const params = swiper.params.cardsEffect;
|
||||
const {
|
||||
startTranslate,
|
||||
isTouched
|
||||
} = swiper.touchEventsData;
|
||||
const currentTranslate = rtl ? -swiper.translate : swiper.translate;
|
||||
for (let i = 0; i < slides.length; i += 1) {
|
||||
const slideEl = slides[i];
|
||||
const slideProgress = slideEl.progress;
|
||||
const progress = Math.min(Math.max(slideProgress, -4), 4);
|
||||
let offset = slideEl.swiperSlideOffset;
|
||||
if (swiper.params.centeredSlides && !swiper.params.cssMode) {
|
||||
swiper.wrapperEl.style.transform = `translateX(${swiper.minTranslate()}px)`;
|
||||
}
|
||||
if (swiper.params.centeredSlides && swiper.params.cssMode) {
|
||||
offset -= slides[0].swiperSlideOffset;
|
||||
}
|
||||
let tX = swiper.params.cssMode ? -offset - swiper.translate : -offset;
|
||||
let tY = 0;
|
||||
const tZ = -100 * Math.abs(progress);
|
||||
let scale = 1;
|
||||
let rotate = -params.perSlideRotate * progress;
|
||||
let tXAdd = params.perSlideOffset - Math.abs(progress) * 0.75;
|
||||
const slideIndex = swiper.virtual && swiper.params.virtual.enabled ? swiper.virtual.from + i : i;
|
||||
const isSwipeToNext = (slideIndex === activeIndex || slideIndex === activeIndex - 1) && progress > 0 && progress < 1 && (isTouched || swiper.params.cssMode) && currentTranslate < startTranslate;
|
||||
const isSwipeToPrev = (slideIndex === activeIndex || slideIndex === activeIndex + 1) && progress < 0 && progress > -1 && (isTouched || swiper.params.cssMode) && currentTranslate > startTranslate;
|
||||
if (isSwipeToNext || isSwipeToPrev) {
|
||||
const subProgress = (1 - Math.abs((Math.abs(progress) - 0.5) / 0.5)) ** 0.5;
|
||||
rotate += -28 * progress * subProgress;
|
||||
scale += -0.5 * subProgress;
|
||||
tXAdd += 96 * subProgress;
|
||||
tY = `${-25 * subProgress * Math.abs(progress)}%`;
|
||||
}
|
||||
if (progress < 0) {
|
||||
// next
|
||||
tX = `calc(${tX}px ${rtl ? '-' : '+'} (${tXAdd * Math.abs(progress)}%))`;
|
||||
} else if (progress > 0) {
|
||||
// prev
|
||||
tX = `calc(${tX}px ${rtl ? '-' : '+'} (-${tXAdd * Math.abs(progress)}%))`;
|
||||
} else {
|
||||
tX = `${tX}px`;
|
||||
}
|
||||
if (!swiper.isHorizontal()) {
|
||||
const prevY = tY;
|
||||
tY = tX;
|
||||
tX = prevY;
|
||||
}
|
||||
const scaleString = progress < 0 ? `${1 + (1 - scale) * progress}` : `${1 - (1 - scale) * progress}`;
|
||||
|
||||
/* eslint-disable */
|
||||
const transform = `
|
||||
translate3d(${tX}, ${tY}, ${tZ}px)
|
||||
rotateZ(${params.rotate ? rtl ? -rotate : rotate : 0}deg)
|
||||
scale(${scaleString})
|
||||
`;
|
||||
/* eslint-enable */
|
||||
|
||||
if (params.slideShadows) {
|
||||
// Set shadows
|
||||
let shadowEl = slideEl.querySelector('.swiper-slide-shadow');
|
||||
if (!shadowEl) {
|
||||
shadowEl = createShadow('cards', slideEl);
|
||||
}
|
||||
if (shadowEl) shadowEl.style.opacity = Math.min(Math.max((Math.abs(progress) - 0.5) / 0.5, 0), 1);
|
||||
}
|
||||
slideEl.style.zIndex = -Math.abs(Math.round(slideProgress)) + slides.length;
|
||||
const targetEl = effectTarget(params, slideEl);
|
||||
targetEl.style.transform = transform;
|
||||
}
|
||||
};
|
||||
const setTransition = duration => {
|
||||
const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl));
|
||||
transformElements.forEach(el => {
|
||||
el.style.transitionDuration = `${duration}ms`;
|
||||
el.querySelectorAll('.swiper-slide-shadow').forEach(shadowEl => {
|
||||
shadowEl.style.transitionDuration = `${duration}ms`;
|
||||
});
|
||||
});
|
||||
effectVirtualTransitionEnd({
|
||||
swiper,
|
||||
duration,
|
||||
transformElements
|
||||
});
|
||||
};
|
||||
effectInit({
|
||||
effect: 'cards',
|
||||
swiper,
|
||||
on,
|
||||
setTranslate,
|
||||
setTransition,
|
||||
perspective: () => true,
|
||||
overwriteParams: () => ({
|
||||
watchSlidesProgress: true,
|
||||
virtualTranslate: !swiper.params.cssMode
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
export { EffectCards as default };
|
||||
@ -0,0 +1,8 @@
|
||||
.swiper-cards {
|
||||
overflow: visible;
|
||||
.swiper-slide {
|
||||
transform-origin: center bottom;
|
||||
backface-visibility: hidden;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
.swiper-coverflow {
|
||||
}
|
||||
@ -0,0 +1,2 @@
|
||||
import{c as createShadow}from"../shared/create-shadow.min.mjs";import{e as effectInit}from"../shared/effect-init.min.mjs";import{e as effectTarget}from"../shared/effect-target.min.mjs";import{g as getSlideTransformEl,o as getRotateFix}from"../shared/utils.min.mjs";function EffectCoverflow(e){let{swiper:t,extendParams:s,on:r}=e;s({coverflowEffect:{rotate:50,stretch:0,depth:100,scale:1,modifier:1,slideShadows:!0}});effectInit({effect:"coverflow",swiper:t,on:r,setTranslate:()=>{const{width:e,height:s,slides:r,slidesSizesGrid:o}=t,a=t.params.coverflowEffect,i=t.isHorizontal(),l=t.translate,f=i?e/2-l:s/2-l,d=i?a.rotate:-a.rotate,c=a.depth,h=getRotateFix(t);for(let e=0,t=r.length;e<t;e+=1){const t=r[e],s=o[e],l=(f-t.swiperSlideOffset-s/2)/s,n="function"==typeof a.modifier?a.modifier(l):l*a.modifier;let w=i?d*n:0,p=i?0:d*n,m=-c*Math.abs(n),g=a.stretch;"string"==typeof g&&-1!==g.indexOf("%")&&(g=parseFloat(a.stretch)/100*s);let y=i?0:g*n,S=i?g*n:0,b=1-(1-a.scale)*Math.abs(n);Math.abs(S)<.001&&(S=0),Math.abs(y)<.001&&(y=0),Math.abs(m)<.001&&(m=0),Math.abs(w)<.001&&(w=0),Math.abs(p)<.001&&(p=0),Math.abs(b)<.001&&(b=0);const u=`translate3d(${S}px,${y}px,${m}px) rotateX(${h(p)}deg) rotateY(${h(w)}deg) scale(${b})`;if(effectTarget(a,t).style.transform=u,t.style.zIndex=1-Math.abs(Math.round(n)),a.slideShadows){let e=i?t.querySelector(".swiper-slide-shadow-left"):t.querySelector(".swiper-slide-shadow-top"),s=i?t.querySelector(".swiper-slide-shadow-right"):t.querySelector(".swiper-slide-shadow-bottom");e||(e=createShadow("coverflow",t,i?"left":"top")),s||(s=createShadow("coverflow",t,i?"right":"bottom")),e&&(e.style.opacity=n>0?n:0),s&&(s.style.opacity=-n>0?-n:0)}}},setTransition:e=>{t.slides.map((e=>getSlideTransformEl(e))).forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach((t=>{t.style.transitionDuration=`${e}ms`}))}))},perspective:()=>!0,overwriteParams:()=>({watchSlidesProgress:!0})})}export{EffectCoverflow as default};
|
||||
//# sourceMappingURL=effect-coverflow.min.mjs.map
|
||||
@ -0,0 +1 @@
|
||||
{"version":3,"file":"effect-coverflow.mjs.mjs","names":["createShadow","effectInit","effectTarget","getSlideTransformEl","getRotateFix","EffectCoverflow","_ref","swiper","extendParams","on","coverflowEffect","rotate","stretch","depth","scale","modifier","slideShadows","effect","setTranslate","width","swiperWidth","height","swiperHeight","slides","slidesSizesGrid","params","isHorizontal","transform","translate","center","r","i","length","slideEl","slideSize","centerOffset","swiperSlideOffset","offsetMultiplier","rotateY","rotateX","translateZ","Math","abs","indexOf","parseFloat","translateY","translateX","slideTransform","style","zIndex","round","shadowBeforeEl","querySelector","shadowAfterEl","opacity","setTransition","duration","map","forEach","el","transitionDuration","querySelectorAll","shadowEl","perspective","overwriteParams","watchSlidesProgress"],"sources":["0"],"mappings":"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"}
|
||||
@ -0,0 +1,104 @@
|
||||
import { c as createShadow } from '../shared/create-shadow.mjs';
|
||||
import { e as effectInit } from '../shared/effect-init.mjs';
|
||||
import { e as effectTarget } from '../shared/effect-target.mjs';
|
||||
import { g as getSlideTransformEl, o as getRotateFix } from '../shared/utils.mjs';
|
||||
|
||||
function EffectCoverflow(_ref) {
|
||||
let {
|
||||
swiper,
|
||||
extendParams,
|
||||
on
|
||||
} = _ref;
|
||||
extendParams({
|
||||
coverflowEffect: {
|
||||
rotate: 50,
|
||||
stretch: 0,
|
||||
depth: 100,
|
||||
scale: 1,
|
||||
modifier: 1,
|
||||
slideShadows: true
|
||||
}
|
||||
});
|
||||
const setTranslate = () => {
|
||||
const {
|
||||
width: swiperWidth,
|
||||
height: swiperHeight,
|
||||
slides,
|
||||
slidesSizesGrid
|
||||
} = swiper;
|
||||
const params = swiper.params.coverflowEffect;
|
||||
const isHorizontal = swiper.isHorizontal();
|
||||
const transform = swiper.translate;
|
||||
const center = isHorizontal ? -transform + swiperWidth / 2 : -transform + swiperHeight / 2;
|
||||
const rotate = isHorizontal ? params.rotate : -params.rotate;
|
||||
const translate = params.depth;
|
||||
const r = getRotateFix(swiper);
|
||||
// Each slide offset from center
|
||||
for (let i = 0, length = slides.length; i < length; i += 1) {
|
||||
const slideEl = slides[i];
|
||||
const slideSize = slidesSizesGrid[i];
|
||||
const slideOffset = slideEl.swiperSlideOffset;
|
||||
const centerOffset = (center - slideOffset - slideSize / 2) / slideSize;
|
||||
const offsetMultiplier = typeof params.modifier === 'function' ? params.modifier(centerOffset) : centerOffset * params.modifier;
|
||||
let rotateY = isHorizontal ? rotate * offsetMultiplier : 0;
|
||||
let rotateX = isHorizontal ? 0 : rotate * offsetMultiplier;
|
||||
// var rotateZ = 0
|
||||
let translateZ = -translate * Math.abs(offsetMultiplier);
|
||||
let stretch = params.stretch;
|
||||
// Allow percentage to make a relative stretch for responsive sliders
|
||||
if (typeof stretch === 'string' && stretch.indexOf('%') !== -1) {
|
||||
stretch = parseFloat(params.stretch) / 100 * slideSize;
|
||||
}
|
||||
let translateY = isHorizontal ? 0 : stretch * offsetMultiplier;
|
||||
let translateX = isHorizontal ? stretch * offsetMultiplier : 0;
|
||||
let scale = 1 - (1 - params.scale) * Math.abs(offsetMultiplier);
|
||||
|
||||
// Fix for ultra small values
|
||||
if (Math.abs(translateX) < 0.001) translateX = 0;
|
||||
if (Math.abs(translateY) < 0.001) translateY = 0;
|
||||
if (Math.abs(translateZ) < 0.001) translateZ = 0;
|
||||
if (Math.abs(rotateY) < 0.001) rotateY = 0;
|
||||
if (Math.abs(rotateX) < 0.001) rotateX = 0;
|
||||
if (Math.abs(scale) < 0.001) scale = 0;
|
||||
const slideTransform = `translate3d(${translateX}px,${translateY}px,${translateZ}px) rotateX(${r(rotateX)}deg) rotateY(${r(rotateY)}deg) scale(${scale})`;
|
||||
const targetEl = effectTarget(params, slideEl);
|
||||
targetEl.style.transform = slideTransform;
|
||||
slideEl.style.zIndex = -Math.abs(Math.round(offsetMultiplier)) + 1;
|
||||
if (params.slideShadows) {
|
||||
// Set shadows
|
||||
let shadowBeforeEl = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-left') : slideEl.querySelector('.swiper-slide-shadow-top');
|
||||
let shadowAfterEl = isHorizontal ? slideEl.querySelector('.swiper-slide-shadow-right') : slideEl.querySelector('.swiper-slide-shadow-bottom');
|
||||
if (!shadowBeforeEl) {
|
||||
shadowBeforeEl = createShadow('coverflow', slideEl, isHorizontal ? 'left' : 'top');
|
||||
}
|
||||
if (!shadowAfterEl) {
|
||||
shadowAfterEl = createShadow('coverflow', slideEl, isHorizontal ? 'right' : 'bottom');
|
||||
}
|
||||
if (shadowBeforeEl) shadowBeforeEl.style.opacity = offsetMultiplier > 0 ? offsetMultiplier : 0;
|
||||
if (shadowAfterEl) shadowAfterEl.style.opacity = -offsetMultiplier > 0 ? -offsetMultiplier : 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
const setTransition = duration => {
|
||||
const transformElements = swiper.slides.map(slideEl => getSlideTransformEl(slideEl));
|
||||
transformElements.forEach(el => {
|
||||
el.style.transitionDuration = `${duration}ms`;
|
||||
el.querySelectorAll('.swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left').forEach(shadowEl => {
|
||||
shadowEl.style.transitionDuration = `${duration}ms`;
|
||||
});
|
||||
});
|
||||
};
|
||||
effectInit({
|
||||
effect: 'coverflow',
|
||||
swiper,
|
||||
on,
|
||||
setTranslate,
|
||||
setTransition,
|
||||
perspective: () => true,
|
||||
overwriteParams: () => ({
|
||||
watchSlidesProgress: true
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
export { EffectCoverflow as default };
|
||||
@ -0,0 +1,2 @@
|
||||
.swiper-coverflow {
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
.swiper-creative ::slotted(swiper-slide) {
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
overflow: hidden;
|
||||
transition-property: transform, opacity, height;
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
.swiper-creative ::slotted(swiper-slide){-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden;transition-property:transform,opacity,height}
|
||||
@ -0,0 +1,6 @@
|
||||
.swiper-creative .swiper-slide {
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
overflow: hidden;
|
||||
transition-property: transform, opacity, height;
|
||||
}
|
||||
@ -0,0 +1,7 @@
|
||||
.swiper-creative {
|
||||
.swiper-slide {
|
||||
backface-visibility: hidden;
|
||||
overflow: hidden;
|
||||
transition-property: transform, opacity, height;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1 @@
|
||||
.swiper-creative .swiper-slide{-webkit-backface-visibility:hidden;backface-visibility:hidden;overflow:hidden;transition-property:transform,opacity,height}
|
||||
@ -0,0 +1,2 @@
|
||||
import{c as createShadow}from"../shared/create-shadow.min.mjs";import{e as effectInit}from"../shared/effect-init.min.mjs";import{e as effectTarget}from"../shared/effect-target.min.mjs";import{e as effectVirtualTransitionEnd}from"../shared/effect-virtual-transition-end.min.mjs";import{g as getSlideTransformEl,o as getRotateFix}from"../shared/utils.min.mjs";function EffectCreative(e){let{swiper:t,extendParams:s,on:r}=e;s({creativeEffect:{limitProgress:1,shadowPerProgress:!1,progressMultiplier:1,perspective:!0,prev:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1},next:{translate:[0,0,0],rotate:[0,0,0],opacity:1,scale:1}}});const a=e=>"string"==typeof e?e:`${e}px`;effectInit({effect:"creative",swiper:t,on:r,setTranslate:()=>{const{slides:e,wrapperEl:s,slidesSizesGrid:r}=t,i=t.params.creativeEffect,{progressMultiplier:o}=i,l=t.params.centeredSlides,n=getRotateFix(t);if(l){const e=r[0]/2-t.params.slidesOffsetBefore||0;s.style.transform=`translateX(calc(50% - ${e}px))`}for(let s=0;s<e.length;s+=1){const r=e[s],c=r.progress,f=Math.min(Math.max(r.progress,-i.limitProgress),i.limitProgress);let m=f;l||(m=Math.min(Math.max(r.originalProgress,-i.limitProgress),i.limitProgress));const p=r.swiperSlideOffset,d=[t.params.cssMode?-p-t.translate:-p,0,0],g=[0,0,0];let h=!1;t.isHorizontal()||(d[1]=d[0],d[0]=0);let w={translate:[0,0,0],rotate:[0,0,0],scale:1,opacity:1};f<0?(w=i.next,h=!0):f>0&&(w=i.prev,h=!0),d.forEach(((e,t)=>{d[t]=`calc(${e}px + (${a(w.translate[t])} * ${Math.abs(f*o)}))`})),g.forEach(((e,t)=>{let s=w.rotate[t]*Math.abs(f*o);g[t]=s})),r.style.zIndex=-Math.abs(Math.round(c))+e.length;const y=d.join(", "),u=`rotateX(${n(g[0])}deg) rotateY(${n(g[1])}deg) rotateZ(${n(g[2])}deg)`,v=m<0?`scale(${1+(1-w.scale)*m*o})`:`scale(${1-(1-w.scale)*m*o})`,E=m<0?1+(1-w.opacity)*m*o:1-(1-w.opacity)*m*o,M=`translate3d(${y}) ${u} ${v}`;if(h&&w.shadow||!h){let e=r.querySelector(".swiper-slide-shadow");if(!e&&w.shadow&&(e=createShadow("creative",r)),e){const t=i.shadowPerProgress?f*(1/i.limitProgress):f;e.style.opacity=Math.min(Math.max(Math.abs(t),0),1)}}const $=effectTarget(i,r);$.style.transform=M,$.style.opacity=E,w.origin&&($.style.transformOrigin=w.origin)}},setTransition:e=>{const s=t.slides.map((e=>getSlideTransformEl(e)));s.forEach((t=>{t.style.transitionDuration=`${e}ms`,t.querySelectorAll(".swiper-slide-shadow").forEach((t=>{t.style.transitionDuration=`${e}ms`}))})),effectVirtualTransitionEnd({swiper:t,duration:e,transformElements:s,allSlides:!0})},perspective:()=>t.params.creativeEffect.perspective,overwriteParams:()=>({watchSlidesProgress:!0,virtualTranslate:!t.params.cssMode})})}export{EffectCreative as default};
|
||||
//# sourceMappingURL=effect-creative.min.mjs.map
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user