⬆️ upgrade baguetteBox.min.js to v1.13.0

This commit is contained in:
2025-11-10 15:41:18 +07:00
parent 742c61aba2
commit 8a2b8c3532
2 changed files with 204 additions and 163 deletions

View File

@@ -1,196 +1,237 @@
/*! /*!
* baguetteBox.js * baguetteBox.js
* @author feimosi * @author feimosi
* @version %%INJECT_VERSION%% * @version 1.13.0
* @url https://github.com/feimosi/baguetteBox.js * @url https://github.com/feimosi/baguetteBox.js
*/ */
#baguetteBox-overlay { #baguetteBox-overlay {
display: none; display: none;
opacity: 0; opacity: 0;
position: fixed; position: fixed;
overflow: hidden; overflow: hidden;
top: 0; top: 0;
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
z-index: 1000000; z-index: 1000000;
background-color: #222; background-color: #222;
background-color: rgba(0,0,0,.8); background-color: rgba(0, 0, 0, 0.8);
transition: opacity .5s ease; -webkit-transition: opacity 0.5s ease;
transition: opacity 0.5s ease;
&.visible { }
opacity: 1; #baguetteBox-overlay.visible {
} opacity: 1;
}
.full-image { #baguetteBox-overlay .full-image {
display: inline-block; display: inline-block;
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
text-align: center; text-align: center;
}
figure { #baguetteBox-overlay .full-image figure {
display: inline; display: inline;
margin: 0; // needed for mobile margin: 0;
height: 100%; // Opera 12 image stretching fix height: 100%;
} }
#baguetteBox-overlay .full-image img {
img { display: inline-block;
// IE8 fix width: auto;
display: inline-block; height: auto;
width: auto; max-height: 100%;
height: auto; max-width: 100%;
vertical-align: middle;
max-height: 100%; -webkit-box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
max-width: 100%; -moz-box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
vertical-align: middle; box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
box-shadow: 0 0 8px rgba(0,0,0,.6); }
} #baguetteBox-overlay .full-image figcaption {
display: block;
figcaption { position: absolute;
display: block; bottom: 0;
position: absolute; width: 100%;
bottom: 0; text-align: center;
width: 100%; line-height: 1.8;
text-align: center; white-space: normal;
line-height: 1.8; color: #ccc;
white-space: normal; background-color: #000;
color: #ccc; background-color: rgba(0, 0, 0, 0.6);
background-color: #000; font-family: sans-serif;
background-color: rgba(0,0,0,.6); }
font-family: sans-serif; #baguetteBox-overlay .full-image:before {
} content: "";
display: inline-block;
&:before { height: 50%;
content: ""; width: 1px;
display: inline-block; margin-right: -1px;
height: 50%;
width: 1px;
margin-right:-1px;
}
}
} }
#baguetteBox-slider { #baguetteBox-slider {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
height: 100%; height: 100%;
width: 100%; width: 100%;
white-space: nowrap; white-space: nowrap;
transition: left .4s ease, transform .4s ease; -webkit-transition: left 0.4s ease, -webkit-transform 0.4s ease;
transition: left 0.4s ease, -webkit-transform 0.4s ease;
&.bounce-from-right { transition: left 0.4s ease, transform 0.4s ease;
animation: bounceFromRight .4s ease-out; transition: left 0.4s ease, transform 0.4s ease, -webkit-transform 0.4s ease, -moz-transform 0.4s ease;
} }
#baguetteBox-slider.bounce-from-right {
&.bounce-from-left { -webkit-animation: bounceFromRight 0.4s ease-out;
animation: bounceFromLeft .4s ease-out; animation: bounceFromRight 0.4s ease-out;
} }
#baguetteBox-slider.bounce-from-left {
-webkit-animation: bounceFromLeft 0.4s ease-out;
animation: bounceFromLeft 0.4s ease-out;
} }
@keyframes bounceFromRight{ @-webkit-keyframes bounceFromRight {
0% { margin-left: 0; } 0% {
50% { margin-left: -30px; } margin-left: 0;
100% { margin-left: 0; } }
50% {
margin-left: -30px;
}
100% {
margin-left: 0;
}
} }
@keyframes bounceFromLeft{ @keyframes bounceFromRight {
0% { margin-left: 0; } 0% {
50% { margin-left: 30px; } margin-left: 0;
100% { margin-left: 0; } }
50% {
margin-left: -30px;
}
100% {
margin-left: 0;
}
} }
@-webkit-keyframes bounceFromLeft {
%arrow-button { 0% {
top: 50%; margin-left: 0;
top: calc(50% - 30px); }
width: 44px; 50% {
height: 60px; margin-left: 30px;
}
100% {
margin-left: 0;
}
}
@keyframes bounceFromLeft {
0% {
margin-left: 0;
}
50% {
margin-left: 30px;
}
100% {
margin-left: 0;
}
}
.baguetteBox-button#previous-button, .baguetteBox-button#next-button {
top: 50%;
top: calc(50% - 30px);
width: 44px;
height: 60px;
} }
.baguetteBox-button { .baguetteBox-button {
position: absolute; position: absolute;
cursor: pointer; cursor: pointer;
outline: none; outline: none;
padding: 0; padding: 0;
margin: 0; margin: 0;
border: 0; border: 0;
border-radius: 15%; -moz-border-radius: 15%;
background-color: #323232; border-radius: 15%;
background-color: rgba(50,50,50,.5); background-color: #323232;
color: #ddd; background-color: rgba(50, 50, 50, 0.5);
font: 1.6em sans-serif; color: #ddd;
transition: background-color .4s ease; font: 1.6em sans-serif;
-webkit-transition: background-color 0.4s ease;
&:focus, transition: background-color 0.4s ease;
&:hover { }
background-color: rgba(50,50,50,.9); .baguetteBox-button:focus, .baguetteBox-button:hover {
} background-color: rgba(50, 50, 50, 0.9);
}
&#next-button { .baguetteBox-button#next-button {
@extend %arrow-button; right: 2%;
right: 2%; }
} .baguetteBox-button#previous-button {
left: 2%;
&#previous-button { }
@extend %arrow-button; .baguetteBox-button#close-button {
left: 2%; top: 20px;
} right: 2%;
right: calc(2% + 6px);
&#close-button { width: 30px;
top: 20px; height: 30px;
right: 2%; }
right: calc(2% + 6px); .baguetteBox-button svg {
width: 30px; position: absolute;
height: 30px; left: 0;
} top: 0;
// Firefox fix
svg {
position: absolute;
left: 0;
top: 0;
}
} }
/* /*
Preloader Preloader
Borrowed from http://tobiasahlin.com/spinkit/ Borrowed from http://tobiasahlin.com/spinkit/
*/ */
.baguetteBox-spinner { .baguetteBox-spinner {
width: 40px; width: 40px;
height: 40px; height: 40px;
display: inline-block; display: inline-block;
position: absolute; position: absolute;
top: 50%; top: 50%;
left: 50%; left: 50%;
margin-top: -20px; margin-top: -20px;
margin-left: -20px; margin-left: -20px;
} }
.baguetteBox-double-bounce1, .baguetteBox-double-bounce1,
.baguetteBox-double-bounce2 { .baguetteBox-double-bounce2 {
width: 100%; width: 100%;
height: 100%; height: 100%;
border-radius: 50%; -moz-border-radius: 50%;
background-color: #fff; border-radius: 50%;
opacity: .6; background-color: #fff;
position: absolute; opacity: 0.6;
top: 0; position: absolute;
left: 0; top: 0;
animation: bounce 2s infinite ease-in-out; left: 0;
-webkit-animation: bounce 2s infinite ease-in-out;
animation: bounce 2s infinite ease-in-out;
} }
.baguetteBox-double-bounce2 { .baguetteBox-double-bounce2 {
animation-delay: -1s; -webkit-animation-delay: -1s;
animation-delay: -1s;
}
@-webkit-keyframes bounce {
0%, 100% {
-webkit-transform: scale(0);
transform: scale(0);
}
50% {
-webkit-transform: scale(1);
transform: scale(1);
}
} }
@keyframes bounce { @keyframes bounce {
0%, 100% { 0%, 100% {
transform: scale(0); -webkit-transform: scale(0);
} 50% { -moz-transform: scale(0);
transform: scale(1); transform: scale(0);
} }
50% {
-webkit-transform: scale(1);
-moz-transform: scale(1);
transform: scale(1);
}
} }

File diff suppressed because one or more lines are too long