This commit is contained in:
2024-12-14 20:41:41 +03:00
parent 74cd10de8a
commit 0f779b7ebf
103 changed files with 3212 additions and 1387 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+572
View File
@@ -0,0 +1,572 @@
.jBox-wrapper {
text-align: left;
box-sizing: border-box;
}
.jBox-title,
.jBox-content,
.jBox-container {
position: relative;
word-break: break-word;
box-sizing: border-box;
}
.jBox-container {
background: #fff;
}
.jBox-content {
padding: 8px 12px;
overflow-x: hidden;
overflow-y: auto;
transition: opacity .2s;
}
.jBox-footer {
box-sizing: border-box;
}
.jBox-Tooltip .jBox-container,
.jBox-Mouse .jBox-container {
border-radius: 4px;
box-shadow: 0 0 3px rgba(0, 0, 0, 0.25);
}
.jBox-Tooltip .jBox-title,
.jBox-Mouse .jBox-title {
padding: 8px 10px 0;
font-weight: bold;
}
.jBox-Tooltip.jBox-hasTitle .jBox-content,
.jBox-Mouse.jBox-hasTitle .jBox-content {
padding-top: 5px;
}
.jBox-Mouse {
pointer-events: none;
}
.jBox-pointer {
position: absolute;
overflow: hidden;
box-sizing: border-box;
}
.jBox-pointer:after {
content: '';
width: 20px;
height: 20px;
position: absolute;
background: #fff;
transform: rotate(45deg);
box-sizing: border-box;
}
.jBox-pointer-top {
top: 0;
}
.jBox-pointer-top:after {
left: 5px;
top: 6px;
box-shadow: -1px -1px 2px rgba(0, 0, 0, 0.15);
}
.jBox-pointer-right {
right: 0;
}
.jBox-pointer-right:after {
top: 5px;
right: 6px;
box-shadow: 1px -1px 2px rgba(0, 0, 0, 0.15);
}
.jBox-pointer-left {
left: 0;
}
.jBox-pointer-left:after {
top: 5px;
left: 6px;
box-shadow: -1px 1px 2px rgba(0, 0, 0, 0.15);
}
.jBox-pointer-bottom {
bottom: 0;
}
.jBox-pointer-bottom:after {
left: 5px;
bottom: 6px;
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15);
}
.jBox-pointer-top, .jBox-pointer-bottom {
width: 30px;
height: 12px;
}
.jBox-pointer-left, .jBox-pointer-right {
width: 12px;
height: 30px;
}
.jBox-Modal .jBox-container {
border-radius: 4px;
}
.jBox-Modal .jBox-container, .jBox-Modal.jBox-closeButton-box:before {
box-shadow: 0 3px 15px rgba(0, 0, 0, 0.4), 0 0 5px rgba(0, 0, 0, 0.4);
}
.jBox-Modal .jBox-content {
padding: 15px 20px;
}
.jBox-Modal .jBox-title {
border-radius: 4px 4px 0 0;
padding: 15px 20px;
background: #fafafa;
border-bottom: 1px solid #eee;
}
.jBox-Modal.jBox-closeButton-title .jBox-title {
padding-right: 65px;
}
.jBox-Modal .jBox-footer {
border-radius: 0 0 4px 4px;
}
.jBox-closeButton {
z-index: 1;
cursor: pointer;
position: absolute;
box-sizing: border-box;
}
.jBox-closeButton svg {
position: absolute;
top: 50%;
right: 50%;
}
.jBox-closeButton path {
fill: #aaa;
transition: fill .2s;
}
.jBox-closeButton:hover path {
fill: #888;
}
.jBox-overlay .jBox-closeButton {
top: 0;
right: 0;
width: 40px;
height: 40px;
}
.jBox-overlay .jBox-closeButton svg {
width: 20px;
height: 20px;
margin-top: -10px;
margin-right: -10px;
}
.jBox-overlay .jBox-closeButton path {
fill: #ddd;
}
.jBox-overlay .jBox-closeButton:hover path {
fill: #fff;
}
.jBox-closeButton-title .jBox-closeButton {
top: 0;
right: 0;
bottom: 0;
width: 50px;
}
.jBox-closeButton-title svg {
width: 12px;
height: 12px;
margin-top: -6px;
margin-right: -6px;
}
.jBox-closeButton-box {
box-sizing: border-box;
}
.jBox-closeButton-box .jBox-closeButton {
top: -8px;
right: -10px;
width: 24px;
height: 24px;
background: #fff;
border-radius: 50%;
}
.jBox-closeButton-box .jBox-closeButton svg {
width: 10px;
height: 10px;
margin-top: -5px;
margin-right: -5px;
}
.jBox-closeButton-box:before {
content: '';
position: absolute;
top: -8px;
right: -10px;
width: 24px;
height: 24px;
border-radius: 50%;
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
.jBox-closeButton-box.jBox-pointerPosition-top:before {
top: 5px;
}
.jBox-closeButton-box.jBox-pointerPosition-right:before {
right: 2px;
}
.jBox-Modal.jBox-hasTitle.jBox-closeButton-box .jBox-closeButton {
background: #fafafa;
}
.jBox-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.82);
}
.jBox-footer {
background: #fafafa;
border-top: 1px solid #eee;
padding: 8px 10px;
border-radius: 0 0 3px 3px;
}
body[class^="jBox-blockScroll-"],
body[class*=" jBox-blockScroll-"] {
overflow: hidden;
}
.jBox-draggable {
cursor: move;
}
@keyframes jBoxLoading {
to {
transform: rotate(360deg);
}
}
.jBox-loading .jBox-content {
opacity: .2;
}
.jBox-loading-spinner .jBox-content {
min-height: 38px !important;
min-width: 38px !important;
opacity: 0;
}
.jBox-spinner {
box-sizing: border-box;
position: absolute;
top: 50%;
left: 50%;
width: 24px;
height: 24px;
margin-top: -12px;
margin-left: -12px;
}
.jBox-spinner:before {
display: block;
box-sizing: border-box;
content: '';
width: 24px;
height: 24px;
border-radius: 50%;
border: 2px solid rgba(0, 0, 0, 0.2);
border-top-color: rgba(0, 0, 0, 0.8);
animation: jBoxLoading .6s linear infinite;
}
.jBox-countdown {
border-radius: 4px 4px 0 0;
z-index: 0;
background: #000;
opacity: .2;
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3px;
overflow: hidden;
}
.jBox-countdown-inner {
top: 0;
right: 0;
width: 100%;
height: 3px;
position: absolute;
background: #fff;
}
[class^="jBox-animated-"],
[class*=" jBox-animated-"] {
animation-fill-mode: both;
}
@keyframes jBox-tada {
0% {
transform: scale(1);
}
10%,
20% {
transform: scale(0.8) rotate(-4deg);
}
30%,
50%,
70%,
90% {
transform: scale(1.2) rotate(4deg);
}
40%,
60%,
80% {
transform: scale(1.2) rotate(-4deg);
}
100% {
transform: scale(1) rotate(0);
}
}
.jBox-animated-tada {
animation: jBox-tada 1s;
}
@keyframes jBox-tadaSmall {
0% {
transform: scale(1);
}
10%,
20% {
transform: scale(0.9) rotate(-2deg);
}
30%,
50%,
70%,
90% {
transform: scale(1.1) rotate(2deg);
}
40%,
60%,
80% {
transform: scale(1.1) rotate(-2deg);
}
100% {
transform: scale(1) rotate(0);
}
}
.jBox-animated-tadaSmall {
animation: jBox-tadaSmall 1s;
}
@keyframes jBox-flash {
0%,
50%,
100% {
opacity: 1;
}
25%,
75% {
opacity: 0;
}
}
.jBox-animated-flash {
animation: jBox-flash .5s;
}
@keyframes jBox-shake {
0%,
100% {
transform: translateX(0);
}
20%,
60% {
transform: translateX(-6px);
}
40%,
80% {
transform: translateX(6px);
}
}
.jBox-animated-shake {
animation: jBox-shake .4s;
}
@keyframes jBox-pulseUp {
0% {
transform: scale(1);
}
50% {
transform: scale(1.15);
}
100% {
transform: scale(1);
}
}
.jBox-animated-pulseUp {
animation: jBox-pulseUp .25s;
}
@keyframes jBox-pulseDown {
0% {
transform: scale(1);
}
50% {
transform: scale(0.85);
}
100% {
transform: scale(1);
}
}
.jBox-animated-pulseDown {
animation: jBox-pulseDown .25s;
}
@keyframes jBox-popIn {
0% {
transform: scale(0);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(1);
}
}
.jBox-animated-popIn {
animation: jBox-popIn .25s;
}
@keyframes jBox-popOut {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1);
}
100% {
transform: scale(0);
}
}
.jBox-animated-popOut {
animation: jBox-popOut .25s;
}
@keyframes jBox-fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
.jBox-animated-fadeIn {
animation: jBox-fadeIn .2s;
}
@keyframes jBox-fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
.jBox-animated-fadeOut {
animation: jBox-fadeOut .2s;
}
@keyframes jBox-slideUp {
0% {
transform: translateY(0);
}
100% {
transform: translateY(-300px);
opacity: 0;
}
}
.jBox-animated-slideUp {
animation: jBox-slideUp .4s;
}
@keyframes jBox-slideRight {
0% {
transform: translateX(0);
}
100% {
transform: translateX(300px);
opacity: 0;
}
}
.jBox-animated-slideRight {
animation: jBox-slideRight .4s;
}
@keyframes jBox-slideDown {
0% {
transform: translateY(0);
}
100% {
transform: translateY(300px);
opacity: 0;
}
}
.jBox-animated-slideDown {
animation: jBox-slideDown .4s;
}
@keyframes jBox-slideLeft {
0% {
transform: translateX(0);
}
100% {
transform: translateX(-300px);
opacity: 0;
}
}
.jBox-animated-slideLeft {
animation: jBox-slideLeft .4s;
}
/*# sourceMappingURL=jBox.css.map */
+2330
View File
File diff suppressed because it is too large Load Diff
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,58 @@
.jBox-Confirm .jBox-content {
text-align: center;
padding: 46px 35px;
}
@media (max-width: 500px) {
.jBox-Confirm .jBox-content {
padding: 32px 20px;
}
}
.jBox-Confirm-footer {
height: 46px;
}
.jBox-Confirm-button {
display: block;
float: left;
cursor: pointer;
text-align: center;
width: 50%;
line-height: 46px;
height: 46px;
overflow: hidden;
padding: 0 10px;
transition: color .2s, background-color .2s;
box-sizing: border-box;
}
.jBox-Confirm-button-cancel {
border-bottom-left-radius: 4px;
background: #ddd;
color: #666;
}
.jBox-Confirm-button-cancel:hover, .jBox-Confirm-button-cancel:active {
background: #ccc;
}
.jBox-Confirm-button-cancel:active {
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}
.jBox-Confirm-button-submit {
border-bottom-right-radius: 4px;
background: #7d0;
color: #fff;
}
.jBox-Confirm-button-submit:hover, .jBox-Confirm-button-submit:active {
background: #6c0;
}
.jBox-Confirm-button-submit:active {
box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}
/*# sourceMappingURL=jBox.Confirm.css.map */
@@ -0,0 +1,97 @@
/**
* jBox Confirm plugin: Add a confirm dialog to links, buttons, etc.
*
* Author: Stephan Wagner <stephanwagner.me@gmail.com> (https://stephanwagner.me)
*
* License: MIT (https://opensource.org/licenses/MIT)
*
* Requires: jBox (https://cdn.jsdelivr.net/gh/StephanWagner/jBox@latest/dist/jBox.min.js)
*/
function jBoxConfirmWrapper(jBox, jQuery) {
new jBox.plugin('Confirm', {
// Options (https://stephanwagner.me/jBox/options#options-confirm)
confirmButton: 'Submit', // Text for the submit button
cancelButton: 'Cancel', // Text for the cancel button
confirm: null, // Function to execute when clicking the submit button. By default jBox will use the onclick or href attribute in that order if found
cancel: null, // Function to execute when clicking the cancel button
closeOnConfirm: true, // Close jBox when the user clicks the confirm button
target: window,
fixed: true,
attach: '[data-confirm]',
getContent: 'data-confirm',
content: 'Do you really want to do this?',
minWidth: 360,
maxWidth: 500,
blockScroll: true,
closeOnEsc: true,
closeOnClick: false,
closeButton: false,
overlay: true,
animation: 'zoomIn',
preventDefault: true,
// Triggered when jBox is attached to the element
_onAttach: function (el)
{
// Extract the href or the onclick event if no submit event is passed
if (!this.options.confirm) {
var submit = el.attr('onclick') ? el.attr('onclick') : (
el.attr('href') ? (
el.attr('target') ? 'window.open("' + el.attr('href') + '", "' + el.attr('target') + '");' : 'window.location.href = "' + el.attr('href') + '";'
) : '');
el.prop('onclick', null).data('jBox-Confirm-submit', submit);
}
},
// Triggered when jBox was created
_onCreated: function ()
{
// Add modal class to mimic jBox modal
this.wrapper.addClass('jBox-Modal');
// Add a footer to the jBox container
this.footer = jQuery('<div class="jBox-Confirm-footer"/>');
jQuery('<div class="jBox-Confirm-button jBox-Confirm-button-cancel"/>')
.html(this.options.cancelButton)
.on('click tap', function () {
this.options.cancel && this.options.cancel(this.source);
this.close();
}.bind(this))
.appendTo(this.footer);
this.submitButton = jQuery('<div class="jBox-Confirm-button jBox-Confirm-button-submit"/>')
.html(this.options.confirmButton)
.appendTo(this.footer);
this.footer.appendTo(this.container);
},
// Triggered when jBox is opened
_onOpen: function ()
{
// Set the new action for the submit button
this.submitButton
.off('click.jBox-Confirm' + this.id + ' tap.jBox-Confirm' + this.id)
.on('click.jBox-Confirm' + this.id + ' tap.jBox-Confirm' + this.id, function () {
this.options.confirm ? this.options.confirm(this.source) : eval(this.source.data('jBox-Confirm-submit'));
this.options.closeOnConfirm && this.close();
}.bind(this));
}
});
};
//# sourceMappingURL=jBox.Confirm.js.map
+1
View File
@@ -0,0 +1 @@
.jBox-Confirm .jBox-content{text-align:center;padding:46px 35px}@media (max-width:500px){.jBox-Confirm .jBox-content{padding:32px 20px}}.jBox-Confirm-footer{height:46px}.jBox-Confirm-button{display:block;float:left;cursor:pointer;text-align:center;width:50%;line-height:46px;height:46px;overflow:hidden;padding:0 10px;transition:color .2s,background-color .2s;box-sizing:border-box}.jBox-Confirm-button-cancel{border-bottom-left-radius:4px;background:#ddd;color:#666}.jBox-Confirm-button-cancel:active,.jBox-Confirm-button-cancel:hover{background:#ccc}.jBox-Confirm-button-cancel:active{box-shadow:inset 0 1px 3px rgba(0,0,0,.2)}.jBox-Confirm-button-submit{border-bottom-right-radius:4px;background:#7d0;color:#fff}.jBox-Confirm-button-submit:active,.jBox-Confirm-button-submit:hover{background:#6c0}.jBox-Confirm-button-submit:active{box-shadow:inset 0 1px 3px rgba(0,0,0,.2)}
+1
View File
@@ -0,0 +1 @@
function jBoxConfirmWrapper(jBox,jQuery){new jBox.plugin("Confirm",{confirmButton:"Submit",cancelButton:"Cancel",confirm:null,cancel:null,closeOnConfirm:!0,target:window,fixed:!0,attach:"[data-confirm]",getContent:"data-confirm",content:"Do you really want to do this?",minWidth:360,maxWidth:500,blockScroll:!0,closeOnEsc:!0,closeOnClick:!1,closeButton:!1,overlay:!0,animation:"zoomIn",preventDefault:!0,_onAttach:function(o){var t;this.options.confirm||(t=o.attr("onclick")?o.attr("onclick"):o.attr("href")?o.attr("target")?'window.open("'+o.attr("href")+'", "'+o.attr("target")+'");':'window.location.href = "'+o.attr("href")+'";':"",o.prop("onclick",null).data("jBox-Confirm-submit",t))},_onCreated:function(){this.wrapper.addClass("jBox-Modal"),this.footer=jQuery('<div class="jBox-Confirm-footer"/>'),jQuery('<div class="jBox-Confirm-button jBox-Confirm-button-cancel"/>').html(this.options.cancelButton).on("click tap",function(){this.options.cancel&&this.options.cancel(this.source),this.close()}.bind(this)).appendTo(this.footer),this.submitButton=jQuery('<div class="jBox-Confirm-button jBox-Confirm-button-submit"/>').html(this.options.confirmButton).appendTo(this.footer),this.footer.appendTo(this.container)},_onOpen:function(){this.submitButton.off("click.jBox-Confirm"+this.id+" tap.jBox-Confirm"+this.id).on("click.jBox-Confirm"+this.id+" tap.jBox-Confirm"+this.id,function(){this.options.confirm?this.options.confirm(this.source):eval(this.source.data("jBox-Confirm-submit")),this.options.closeOnConfirm&&this.close()}.bind(this))}})}
+201
View File
@@ -0,0 +1,201 @@
.jBox-Image .jBox-container {
background-color: transparent;
}
.jBox-Image .jBox-content {
padding: 0;
width: 100%;
height: 100%;
}
.jBox-image-container {
background: center center no-repeat;
position: absolute;
width: 100%;
height: 100%;
opacity: 0;
}
.jBox-image-label-wrapper {
position: absolute;
top: 100%;
left: 0;
right: 0;
height: 40px;
z-index: 100;
display: flex;
}
.jBox-image-label-container {
position: relative;
flex: 1;
}
.jBox-image-label {
box-sizing: border-box;
position: absolute;
left: 0;
bottom: 0;
width: 100%;
text-align: center;
color: #fff;
padding: 8px 12px;
font-size: 15px;
line-height: 24px;
transition: opacity .36s;
opacity: 0;
z-index: 0;
pointer-events: none;
}
.jBox-image-label.expanded {
background: #000;
}
.jBox-image-label:not(.expanded) {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.jBox-image-label.active {
opacity: 1;
pointer-events: all;
}
@media (max-width: 600px) {
.jBox-image-label {
font-size: 13px;
}
}
.jBox-image-pointer-next,
.jBox-image-pointer-prev {
flex-shrink: 0;
width: 40px;
height: 40px;
cursor: pointer;
opacity: .8;
transition: opacity .2s;
background: no-repeat center center url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ijc0LjcgMjI0IDE4LjcgMzIiPg0KPHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTkzLDIyNy40TDgwLjQsMjQwTDkzLDI1Mi42YzAuNCwwLjQsMC40LDEuMSwwLDEuNWwtMS42LDEuNmMtMC40LDAuNC0xLDAuNS0xLjUsMEw3NSwyNDAuN2MtMC40LTAuNC0wLjUtMSwwLTEuNWwxNC45LTE0LjljMC40LTAuNCwxLTAuNCwxLjUsMGwxLjYsMS42QzkzLjUsMjI2LjQsOTMuNCwyMjcsOTMsMjI3LjR6Ii8+DQo8L3N2Zz4=);
background-size: 11px auto;
user-select: none;
z-index: 1;
}
.jBox-image-pointer-next:hover,
.jBox-image-pointer-prev:hover {
opacity: 1;
}
.jBox-image-pointer-next {
transform: scaleX(-1);
}
.jBox-image-counter-container {
flex-shrink: 0;
white-space: nowrap;
height: 40px;
line-height: 40px;
font-size: 13px;
color: #fff;
text-align: right;
display: none;
}
.jBox-image-has-counter .jBox-image-counter-container {
display: block;
}
.jBox-overlay.jBox-overlay-Image {
background: #000;
}
.jBox-image-not-found {
background: #000;
}
.jBox-image-not-found:before {
content: '';
box-sizing: border-box;
display: block;
width: 80px;
height: 80px;
margin-top: -40px;
margin-left: -40px;
position: absolute;
top: 50%;
left: 50%;
border: 5px solid #222;
border-radius: 50%;
}
.jBox-image-not-found:after {
content: '';
display: block;
box-sizing: content-box;
z-index: auto;
width: 6px;
height: 74px;
margin-top: -37px;
margin-left: -3px;
position: absolute;
top: 50%;
left: 50%;
background: #222;
transform: rotateZ(45deg);
transform-origin: 50% 50% 0;
}
.jBox-image-download-button-wrapper {
position: absolute;
top: -40px;
right: 35px;
height: 40px;
display: flex;
cursor: pointer;
opacity: .8;
transition: opacity .2s;
}
.jBox-image-download-button-wrapper:hover {
opacity: 1;
}
.jBox-image-download-button-icon {
width: 40px;
height: 40px;
background: center center no-repeat url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NDAgNjQwIj48cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNNDE2IDI1NnYtMTkyaC0xOTJ2MTkyaC0xNjBsMjU2IDI1NiAyNTYtMjU2aC0xNjB6TTAgNTc2aDY0MHY2NGgtNjQwdi02NHoiPjwvcGF0aD48L3N2Zz4=);
background-size: 60%;
}
.jBox-image-download-button-text {
white-space: nowrap;
line-height: 40px;
padding: 0 10px 0 0;
color: #fff;
font-size: 14px;
}
@keyframes jBoxImageLoading {
to {
transform: rotate(360deg);
}
}
.jBox-image-loading:before {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 32px;
height: 32px;
margin-top: -16px;
margin-left: -16px;
border: 4px solid #333;
border-bottom-color: #666;
animation: jBoxImageLoading 1.2s linear infinite;
border-radius: 50%;
}
/*# sourceMappingURL=jBox.Image.css.map */
+358
View File
@@ -0,0 +1,358 @@
/**
* jBox Image plugin: Adds a lightbox to your images
*
* Author: Stephan Wagner <stephanwagner.me@gmail.com> (https://stephanwagner.me)
*
* License: MIT (https://opensource.org/licenses/MIT)
*
* Requires: jBox (https://cdn.jsdelivr.net/gh/StephanWagner/jBox@latest/dist/jBox.min.js)
*/
function jBoxImageWrapper(jBox, jQuery) {
new jBox.plugin('Image', {
// Options (https://stephanwagner.me/jBox/options#options-image)
src: 'href', // The attribute where jBox gets the image source from, e.g. href="/path_to_image/image.jpg"
gallery: 'data-jbox-image', // The attribute to set the galleries, e.g. data-jbox-image="gallery1"
imageLabel: 'title', // The attribute where jBox gets the image label from, e.g. title="My label"
imageFade: 360, // The fade duration for images in ms
imageSize: 'contain', // How to display the images. Use CSS background-position values, e.g. 'cover', 'contain', 'auto', 'initial', '50% 50%'
imageCounter: false, // Set to true to add an image counter, e.g. 4/20
imageCounterSeparator: '/', // HTML to separate the current image number from all image numbers, e.g. '/' or ' of '
downloadButton: false, // Adds a download button
downloadButtonText: null, // Text for the download button
downloadButtonUrl: null, // The attribute at the source element where to find the image to download, e.g. data-download="/path_to_image/image.jpg". If none provided, the currently active image will be downloaded
mobileImageAttr: null, // The attribute to look for an mobile version of the image
mobileImageBreakpoint: null, // The upper breakpoint to load the mobile image
preloadFirstImage: false, // Preload the first image when page is loaded
target: window,
attach: '[data-jbox-image]',
fixed: true,
blockScroll: true,
closeOnEsc: true,
closeOnClick: 'button',
closeButton: true,
overlay: true,
animation: 'zoomIn',
preventDefault: true,
width: '100%',
height: '100%',
adjustDistance: {
top: 40,
right: 0,
bottom: 40,
left: 0
},
// Triggered when jBox is initialized
_onInit: function ()
{
// Initial images and z-index
this.images = this.currentImage = {};
this.imageZIndex = 1;
this.initImage = function (item) {
item = jQuery(item);
// Abort if the item was added to a gallery already
if (item.data('jBox-image-gallery')) {
return;
}
// Get the image src
var src = item.attr(this.options.src);
// Update responsive image src
if (this.options.mobileImageAttr && this.options.mobileImageBreakpoint && item.attr(this.options.mobileImageAttr)) {
if (jQuery(window).width() <= this.options.mobileImageBreakpoint) {
src = item.attr(this.options.mobileImageAttr);
}
}
// Add item to a gallery
var gallery = item.attr(this.options.gallery) || 'default';
!this.images[gallery] && (this.images[gallery] = []);
this.images[gallery].push({
src: src,
label: (item.attr(this.options.imageLabel) || ''),
downloadUrl: this.options.downloadButtonUrl && item.attr(this.options.downloadButtonUrl) ? item.attr(this.options.downloadButtonUrl) : null
});
// Remove the title attribute so it won't show the browsers tooltip
this.options.imageLabel == 'title' && item.removeAttr('title');
// Store data in source element for easy access
item.data('jBox-image-gallery', gallery);
item.data('jBox-image-id', (this.images[gallery].length - 1));
}.bind(this);
// Loop through images, sort and save in global variable
this.attachedElements && this.attachedElements.length && jQuery.each(this.attachedElements, function (index, item) {
this.initImage(item);
}.bind(this));
// Helper to inject the image into content area
var appendImage = function (gallery, id, show, instant) {
// Abort if image was appended already
if (jQuery('#jBox-image-' + gallery + '-' + id).length) {
return;
}
// Create image container
var image = jQuery('<div/>', {
id: 'jBox-image-' + gallery + '-' + id,
'class': 'jBox-image-container' + (show ? ' jBox-image-' + gallery + '-current' : '')
}).css({
backgroundSize: this.options.imageSize,
opacity: (instant ? 1 : 0),
zIndex: (show ? this.imageZIndex++ : 0)
}).appendTo(this.content);
// Add swipe events
this.swipeDetector(image)
.on("swipeLeft.sd swipeRight.sd", function (event) {
if (event.type === "swipeLeft") {
this.showImage('next');
} else if (event.type === "swipeRight") {
this.showImage('prev');
}
}.bind(this));
// Create labels
jQuery('<div/>', {
id: 'jBox-image-label-' + gallery + '-' + id,
'class': 'jBox-image-label' + (show ? ' active' : '')
})
.html(this.images[gallery][id].label)
.on('click tap', function () {
jQuery(this).toggleClass('expanded');
})
.appendTo(this.imageLabelContainer);
// Show image
show && image.animate({opacity: 1}, instant ? 0 : this.options.imageFade);
return image;
}.bind(this);
// Function to download an image
this.downloadImage = function (imageUrl) {
var link = document.createElement('a');
link.href = imageUrl;
link.setAttribute('download', imageUrl.substring(imageUrl.lastIndexOf('/')+1));
document.body.appendChild(link);
link.click();
};
// Helper to show new image label
var showLabel = function (gallery, id) {
jQuery('.jBox-image-label.active').removeClass('active expanded');
jQuery('#jBox-image-label-' + gallery + '-' + id).addClass('active');
};
// Helper to load image
var loadImage = function (gallery, id, show, instant) {
var imageContainer = appendImage(gallery, id, show, instant);
imageContainer.addClass('jBox-image-loading');
jQuery('<img src="' + this.images[gallery][id].src + '" />').each(function () {
var tmpImg = new Image();
tmpImg.onload = function () {
imageContainer.removeClass('jBox-image-loading');
imageContainer.css({backgroundImage: 'url("' + this.images[gallery][id].src + '")'});
}.bind(this);
tmpImg.onerror = function () {
imageContainer.removeClass('jBox-image-loading');
imageContainer.addClass('jBox-image-not-found');
}.bind(this);
tmpImg.src = this.images[gallery][id].src;
}.bind(this));
}.bind(this);
// Show images when they are loaded or load them if not
this.showImage = function (img) {
// Get the gallery and the image id from the next or the previous image
var gallery;
var id;
if (img != 'open') {
gallery = this.currentImage.gallery;
id = this.currentImage.id + (1 * (img == 'prev') ? -1 : 1);
id = id > (this.images[gallery].length - 1) ? 0 : (id < 0 ? (this.images[gallery].length - 1) : id);
// Or get image data from source element
} else {
// Get gallery and image id from source element
if (this.source) {
gallery = this.source.data('jBox-image-gallery');
id = this.source.data('jBox-image-id');
// Get gallery and image id attached elements
} else if (this.attachedElements && this.attachedElements.length) {
gallery = jQuery(this.attachedElements[0]).data('jBox-image-gallery');
id = jQuery(this.attachedElements[0]).data('jBox-image-id');
} else {
return;
}
// Remove or show the next and prev buttons
if (this.images && this.images[gallery]) {
jQuery('.jBox-image-pointer-prev, .jBox-image-pointer-next').css({display: (this.images[gallery].length > 1 ? 'block' : 'none')});
}
}
// If there is a current image already shown, hide it
if (jQuery('.jBox-image-' + gallery + '-current').length) {
jQuery('.jBox-image-' + gallery + '-current').removeClass('jBox-image-' + gallery + '-current').animate({opacity: 0}, (img == 'open') ? 0 : this.options.imageFade);
}
// Set new current image
this.currentImage = {gallery: gallery, id: id};
// Show image if it already exists
if (jQuery('#jBox-image-' + gallery + '-' + id).length) {
jQuery('#jBox-image-' + gallery + '-' + id).addClass('jBox-image-' + gallery + '-current').css({zIndex: this.imageZIndex++, opacity: 0}).animate({opacity: 1}, (img == 'open') ? 0 : this.options.imageFade);
// Load image
} else {
loadImage(gallery, id, true, (img === 'open'));
}
// Show label
showLabel(gallery, id);
// Update the image counter numbers
if (this.imageCounter) {
if (this.images[gallery] && this.images[gallery].length > 1) {
this.wrapper.addClass('jBox-image-has-counter');
this.imageCounter.find('.jBox-image-counter-all').html(this.images[gallery].length);
this.imageCounter.find('.jBox-image-counter-current').html(id + 1);
} else {
this.wrapper.removeClass('jBox-image-has-counter');
}
}
// Preload next image
if (this.images[gallery] && this.images[gallery].length - 1) {
var next_id = id + 1;
next_id = next_id > (this.images[gallery].length - 1) ? 0 : (next_id < 0 ? (this.images[gallery].length - 1) : next_id);
if (!jQuery('#jBox-image-' + gallery + '-' + next_id).length) {
loadImage(gallery, next_id, false, false);
}
}
};
// Preload image
if (this.options.preloadFirstImage) {
jQuery(window).on('load', function() {
this.showImage('open');
}.bind(this));
}
},
// Triggered when jBox attaches a new element
_onAttach: function (item) {
this.initImage && this.initImage(item);
},
// Triggered when jBox was created
_onCreated: function ()
{
// Create image label and navigation buttons
this.imageLabelWrapper = jQuery('<div class="jBox-image-label-wrapper"/>').appendTo(this.wrapper);
this.imagePrevButton = jQuery('<div class="jBox-image-pointer-prev"/>')
.on('click tap', function () {
this.showImage('prev');
}.bind(this));
this.imageNextButton = jQuery('<div class="jBox-image-pointer-next"/>')
.on('click tap', function () {
this.showImage('next');
}.bind(this));
this.imageLabelContainer = jQuery('<div class="jBox-image-label-container"/>');
this.imageLabelWrapper
.append(this.imagePrevButton)
.append(this.imageLabelContainer)
.append(this.imageNextButton);
// Append the download button
if (this.options.downloadButton) {
this.downloadButton = jQuery('<div/>', {'class': 'jBox-image-download-button-wrapper'})
.appendTo(this.wrapper)
.append(
this.options.downloadButtonText ? jQuery('<div/>', {'class': 'jBox-image-download-button-text'}).html(this.options.downloadButtonText) : null
)
.append(
jQuery('<div/>', {'class': 'jBox-image-download-button-icon'})
).on('click tap', function () {
if (this.images[this.currentImage.gallery][this.currentImage.id].downloadUrl) {
var currentImageUrl = this.images[this.currentImage.gallery][this.currentImage.id].downloadUrl;
} else {
var currentImage = this.wrapper.find('.jBox-image-' + this.currentImage.gallery + '-current');
var currentImageStyle = currentImage[0].style.backgroundImage;
var currentImageUrl = currentImageStyle.slice(4, -1).replace(/["']/g, '');
}
this.downloadImage(currentImageUrl);
}.bind(this));
}
// Creating the image counter containers
if (this.options.imageCounter) {
this.imageCounter = jQuery('<div/>', {'class': 'jBox-image-counter-container'}).insertAfter(this.imageLabelContainer);
this.imageCounter.append(jQuery('<span/>', {'class': 'jBox-image-counter-current'})).append(jQuery('<span/>').html(this.options.imageCounterSeparator)).append(jQuery('<span/>', {'class': 'jBox-image-counter-all'}));
}
},
// Triggered when jBox opens
_onOpen: function ()
{
// Add key events
jQuery(document).on('keyup.jBox-Image-' + this.id, function (ev) {
(ev.keyCode == 37) && this.showImage('prev');
(ev.keyCode == 39) && this.showImage('next');
}.bind(this));
// Load the image from the attached element
this.showImage('open');
},
// Triggered when jBox closes
_onClose: function ()
{
// Remove key events
jQuery(document).off('keyup.jBox-Image-' + this.id);
},
// Triggered when jBox finished closing
_onCloseComplete: function ()
{
// Hide all image containers
this.wrapper.find('.jBox-image-container').css('opacity', 0);
}
});
};
//# sourceMappingURL=jBox.Image.js.map
+1
View File
@@ -0,0 +1 @@
.jBox-Image .jBox-container{background-color:transparent}.jBox-Image .jBox-content{padding:0;width:100%;height:100%}.jBox-image-container{background:center center no-repeat;position:absolute;width:100%;height:100%;opacity:0}.jBox-image-label-wrapper{position:absolute;top:100%;left:0;right:0;height:40px;z-index:100;display:flex}.jBox-image-label-container{position:relative;flex:1}.jBox-image-label{box-sizing:border-box;position:absolute;left:0;bottom:0;width:100%;text-align:center;color:#fff;padding:8px 12px;font-size:15px;line-height:24px;transition:opacity .36s;opacity:0;z-index:0;pointer-events:none}.jBox-image-label.expanded{background:#000}.jBox-image-label:not(.expanded){text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.jBox-image-label.active{opacity:1;pointer-events:all}@media (max-width:600px){.jBox-image-label{font-size:13px}}.jBox-image-pointer-next,.jBox-image-pointer-prev{flex-shrink:0;width:40px;height:40px;cursor:pointer;opacity:.8;transition:opacity .2s;background:no-repeat center center url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9Ijc0LjcgMjI0IDE4LjcgMzIiPg0KPHBhdGggZmlsbD0iI2ZmZmZmZiIgZD0iTTkzLDIyNy40TDgwLjQsMjQwTDkzLDI1Mi42YzAuNCwwLjQsMC40LDEuMSwwLDEuNWwtMS42LDEuNmMtMC40LDAuNC0xLDAuNS0xLjUsMEw3NSwyNDAuN2MtMC40LTAuNC0wLjUtMSwwLTEuNWwxNC45LTE0LjljMC40LTAuNCwxLTAuNCwxLjUsMGwxLjYsMS42QzkzLjUsMjI2LjQsOTMuNCwyMjcsOTMsMjI3LjR6Ii8+DQo8L3N2Zz4=);background-size:11px auto;user-select:none;z-index:1}.jBox-image-pointer-next:hover,.jBox-image-pointer-prev:hover{opacity:1}.jBox-image-pointer-next{transform:scaleX(-1)}.jBox-image-counter-container{flex-shrink:0;white-space:nowrap;height:40px;line-height:40px;font-size:13px;color:#fff;text-align:right;display:none}.jBox-image-has-counter .jBox-image-counter-container{display:block}.jBox-overlay.jBox-overlay-Image{background:#000}.jBox-image-not-found{background:#000}.jBox-image-not-found:before{content:'';box-sizing:border-box;display:block;width:80px;height:80px;margin-top:-40px;margin-left:-40px;position:absolute;top:50%;left:50%;border:5px solid #222;border-radius:50%}.jBox-image-not-found:after{content:'';display:block;box-sizing:content-box;z-index:auto;width:6px;height:74px;margin-top:-37px;margin-left:-3px;position:absolute;top:50%;left:50%;background:#222;transform:rotateZ(45deg);transform-origin:50% 50% 0}.jBox-image-download-button-wrapper{position:absolute;top:-40px;right:35px;height:40px;display:flex;cursor:pointer;opacity:.8;transition:opacity .2s}.jBox-image-download-button-wrapper:hover{opacity:1}.jBox-image-download-button-icon{width:40px;height:40px;background:center center no-repeat url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NDAgNjQwIj48cGF0aCBmaWxsPSIjRkZGRkZGIiBkPSJNNDE2IDI1NnYtMTkyaC0xOTJ2MTkyaC0xNjBsMjU2IDI1NiAyNTYtMjU2aC0xNjB6TTAgNTc2aDY0MHY2NGgtNjQwdi02NHoiPjwvcGF0aD48L3N2Zz4=);background-size:60%}.jBox-image-download-button-text{white-space:nowrap;line-height:40px;padding:0 10px 0 0;color:#fff;font-size:14px}@keyframes jBoxImageLoading{to{transform:rotate(360deg)}}.jBox-image-loading:before{content:'';position:absolute;top:50%;left:50%;width:32px;height:32px;margin-top:-16px;margin-left:-16px;border:4px solid #333;border-bottom-color:#666;animation:jBoxImageLoading 1.2s linear infinite;border-radius:50%}
File diff suppressed because one or more lines are too long
+122
View File
@@ -0,0 +1,122 @@
.jBox-Notice {
transition: margin .2s;
}
.jBox-Notice .jBox-container {
border-radius: 4px;
box-shadow: inset 1px 1px 0 0 rgba(255, 255, 255, 0.25), inset -1px -1px 0 0 rgba(0, 0, 0, 0.1);
}
.jBox-Notice .jBox-content {
border-radius: 4px;
padding: 12px 20px;
}
@media (max-width: 768px) {
.jBox-Notice .jBox-content {
padding: 10px 15px;
}
}
@media (max-width: 500px) {
.jBox-Notice .jBox-content {
padding: 8px 10px;
}
}
.jBox-Notice.jBox-hasTitle .jBox-content {
padding-top: 5px;
}
@media (max-width: 500px) {
.jBox-Notice.jBox-hasTitle .jBox-content {
padding-top: 0;
}
}
.jBox-Notice.jBox-hasTitle .jBox-title {
padding: 12px 20px 0;
font-weight: bold;
}
@media (max-width: 768px) {
.jBox-Notice.jBox-hasTitle .jBox-title {
padding: 10px 15px 0;
}
}
@media (max-width: 500px) {
.jBox-Notice.jBox-hasTitle .jBox-title {
padding: 8px 10px 0;
}
}
.jBox-Notice.jBox-closeButton-title .jBox-title {
padding-right: 55px;
}
.jBox-Notice.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton {
width: 40px;
}
.jBox-Notice.jBox-Notice-black .jBox-container {
color: #fff;
background: #000;
}
.jBox-Notice.jBox-Notice-black.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,
.jBox-Notice.jBox-Notice-black.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path {
fill: #fff;
}
.jBox-Notice.jBox-Notice-gray .jBox-container {
color: #222;
background: #f6f6f6;
}
.jBox-Notice.jBox-Notice-gray.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,
.jBox-Notice.jBox-Notice-gray.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path {
fill: #222;
}
.jBox-Notice.jBox-Notice-red .jBox-container {
color: #fff;
background: #d00;
}
.jBox-Notice.jBox-Notice-red.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,
.jBox-Notice.jBox-Notice-red.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path {
fill: #fff;
}
.jBox-Notice.jBox-Notice-green .jBox-container {
color: #fff;
background: #5d0;
}
.jBox-Notice.jBox-Notice-green.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,
.jBox-Notice.jBox-Notice-green.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path {
fill: #fff;
}
.jBox-Notice.jBox-Notice-blue .jBox-container {
color: #fff;
background: #49d;
}
.jBox-Notice.jBox-Notice-blue.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,
.jBox-Notice.jBox-Notice-blue.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path {
fill: #fff;
}
.jBox-Notice.jBox-Notice-yellow .jBox-container {
color: #000;
background: #fd0;
}
.jBox-Notice.jBox-Notice-yellow.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,
.jBox-Notice.jBox-Notice-yellow.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path {
fill: #fff;
}
/*# sourceMappingURL=jBox.Notice.css.map */
+173
View File
@@ -0,0 +1,173 @@
/**
* jBox Notice plugin: Opens a popup notice
*
* Author: Stephan Wagner <stephanwagner.me@gmail.com> (https://stephanwagner.me)
*
* License: MIT (https://opensource.org/licenses/MIT)
*
* Requires: jBox (https://cdn.jsdelivr.net/gh/StephanWagner/jBox@latest/dist/jBox.min.js)
*/
function jBoxNoticeWrapper(jBox, jQuery) {
new jBox.plugin('Notice', {
// Options (https://stephanwagner.me/jBox/options#options-notice)
color: null, // Add a color to your notices, use 'gray' (default), 'black', 'red', 'green', 'blue' or 'yellow'
stack: true, // Set to false to disable notice-stacking
stackSpacing: 10, // Spacing between notices when they stack
autoClose: 6000, // Time in ms after which the notice will disappear
attributes: { // Defines where the notice will pop up
x: 'right', // 'left' or 'right'
y: 'top' // 'top' or 'bottom'
},
position: { // Defines the distance to the viewport boundary
x: 15,
y: 15
},
responsivePositions: { // Responsive positions
500: { // The key defines the maximum width of the viewport, the values will replace the default position options
x: 5, // Start with the lowest viewport
y: 5
},
768: {
x: 10,
y: 10
}
},
target: window,
fixed: true,
animation: 'zoomIn',
closeOnClick: 'box',
zIndex: 12000,
// Triggered when notice is initialized
_onInit: function ()
{
// Cache position values
this.defaultNoticePosition = jQuery.extend({}, this.options.position);
// Type Notice has its own adjust position function
this._adjustNoticePositon = function () {
var win = jQuery(window);
var windowDimensions = {
x: win.width(),
y: win.height()
};
// Reset default position
this.options.position = jQuery.extend({}, this.defaultNoticePosition);
// Adjust depending on viewport
jQuery.each(this.options.responsivePositions, function (viewport, position) {
if (windowDimensions.x <= viewport) {
this.options.position = position;
return false;
}
}.bind(this));
// Set new padding options
this.options.adjustDistance = {
top: this.options.position.y,
right: this.options.position.x,
bottom: this.options.position.y,
left: this.options.position.x
};
};
// If jBox grabs an element as content, crab a clone instead
this.options.content instanceof jQuery && (this.options.content = this.options.content.clone().attr('id', ''));
// Adjust paddings when window resizes
jQuery(window).on('resize.responsivejBoxNotice-' + this.id, function (ev) { if (this.isOpen) { this._adjustNoticePositon(); } }.bind(this));
this.open();
},
// Triggered when notice was created
_onCreated: function ()
{
// Add color class
this.wrapper.addClass('jBox-Notice-color jBox-Notice-' + (this.options.color || 'gray'));
// Store position in jBox wrapper
this.wrapper.data('jBox-Notice-position', this.options.attributes.x + '-' + this.options.attributes.y);
},
// Triggered when notice opens
_onOpen: function ()
{
// Bail if we're stacking
if (this.options.stack) {
return;
}
// Adjust position when opening
this._adjustNoticePositon();
// Loop through notices at same window corner destroy them
jQuery.each(jQuery('.jBox-Notice'), function (index, el)
{
el = jQuery(el);
// Abort if the element is this notice or when it's not at the same position
if (el.attr('id') == this.id || el.data('jBox-Notice-position') != this.options.attributes.x + '-' + this.options.attributes.y) {
return;
}
// Remove notice when we don't wont to stack them
if (!this.options.stack) {
el.data('jBox').close({ignoreDelay: true});
return;
}
}.bind(this));
},
// Triggered when resizing window etc.
_onPosition: function ()
{
var stacks = {};
jQuery.each(jQuery('.jBox-Notice'), function (index, el)
{
el = jQuery(el);
var pos = el.data('jBox-Notice-position');
if (!stacks[pos]) {
stacks[pos] = [];
}
stacks[pos].push(el);
});
for (var pos in stacks) {
var position = pos.split('-');
var direction = position[1];
stacks[pos].reverse();
var margin = 0;
for (var i in stacks[pos]) {
var el = jQuery(stacks[pos][i]);
el.css('margin-' + direction, margin);
margin += el.outerHeight() + this.options.stackSpacing;
}
}
},
// Remove notice from DOM and reposition other notices when closing finishes
_onCloseComplete: function ()
{
this.destroy();
this.options._onPosition.bind(this).call();
}
});
};
//# sourceMappingURL=jBox.Notice.js.map
+1
View File
@@ -0,0 +1 @@
.jBox-Notice{transition:margin .2s}.jBox-Notice .jBox-container{border-radius:4px;box-shadow:inset 1px 1px 0 0 rgba(255,255,255,.25),inset -1px -1px 0 0 rgba(0,0,0,.1)}.jBox-Notice .jBox-content{border-radius:4px;padding:12px 20px}@media (max-width:768px){.jBox-Notice .jBox-content{padding:10px 15px}}@media (max-width:500px){.jBox-Notice .jBox-content{padding:8px 10px}}.jBox-Notice.jBox-hasTitle .jBox-content{padding-top:5px}@media (max-width:500px){.jBox-Notice.jBox-hasTitle .jBox-content{padding-top:0}}.jBox-Notice.jBox-hasTitle .jBox-title{padding:12px 20px 0;font-weight:700}@media (max-width:768px){.jBox-Notice.jBox-hasTitle .jBox-title{padding:10px 15px 0}}@media (max-width:500px){.jBox-Notice.jBox-hasTitle .jBox-title{padding:8px 10px 0}}.jBox-Notice.jBox-closeButton-title .jBox-title{padding-right:55px}.jBox-Notice.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton{width:40px}.jBox-Notice.jBox-Notice-black .jBox-container{color:#fff;background:#000}.jBox-Notice.jBox-Notice-black.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,.jBox-Notice.jBox-Notice-black.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path{fill:#fff}.jBox-Notice.jBox-Notice-gray .jBox-container{color:#222;background:#f6f6f6}.jBox-Notice.jBox-Notice-gray.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,.jBox-Notice.jBox-Notice-gray.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path{fill:#222}.jBox-Notice.jBox-Notice-red .jBox-container{color:#fff;background:#d00}.jBox-Notice.jBox-Notice-red.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,.jBox-Notice.jBox-Notice-red.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path{fill:#fff}.jBox-Notice.jBox-Notice-green .jBox-container{color:#fff;background:#5d0}.jBox-Notice.jBox-Notice-green.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,.jBox-Notice.jBox-Notice-green.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path{fill:#fff}.jBox-Notice.jBox-Notice-blue .jBox-container{color:#fff;background:#49d}.jBox-Notice.jBox-Notice-blue.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,.jBox-Notice.jBox-Notice-blue.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path{fill:#fff}.jBox-Notice.jBox-Notice-yellow .jBox-container{color:#000;background:#fd0}.jBox-Notice.jBox-Notice-yellow.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton path,.jBox-Notice.jBox-Notice-yellow.jBox-closeButton-title.jBox-hasTitle .jBox-closeButton:hover path{fill:#fff}
+1
View File
@@ -0,0 +1 @@
function jBoxNoticeWrapper(t,a){new t.plugin("Notice",{color:null,stack:!0,stackSpacing:10,autoClose:6e3,attributes:{x:"right",y:"top"},position:{x:15,y:15},responsivePositions:{500:{x:5,y:5},768:{x:10,y:10}},target:window,fixed:!0,animation:"zoomIn",closeOnClick:"box",zIndex:12e3,_onInit:function(){this.defaultNoticePosition=a.extend({},this.options.position),this._adjustNoticePositon=function(){var t=a(window),o=t.width();t.height();this.options.position=a.extend({},this.defaultNoticePosition),a.each(this.options.responsivePositions,function(t,i){if(o<=t)return this.options.position=i,!1}.bind(this)),this.options.adjustDistance={top:this.options.position.y,right:this.options.position.x,bottom:this.options.position.y,left:this.options.position.x}},this.options.content instanceof a&&(this.options.content=this.options.content.clone().attr("id","")),a(window).on("resize.responsivejBoxNotice-"+this.id,function(t){this.isOpen&&this._adjustNoticePositon()}.bind(this)),this.open()},_onCreated:function(){this.wrapper.addClass("jBox-Notice-color jBox-Notice-"+(this.options.color||"gray")),this.wrapper.data("jBox-Notice-position",this.options.attributes.x+"-"+this.options.attributes.y)},_onOpen:function(){this.options.stack||(this._adjustNoticePositon(),a.each(a(".jBox-Notice"),function(t,i){(i=a(i)).attr("id")!=this.id&&i.data("jBox-Notice-position")==this.options.attributes.x+"-"+this.options.attributes.y&&(this.options.stack||i.data("jBox").close({ignoreDelay:!0}))}.bind(this)))},_onPosition:function(){var t,s={};for(t in a.each(a(".jBox-Notice"),function(t,i){var o=(i=a(i)).data("jBox-Notice-position");s[o]||(s[o]=[]),s[o].push(i)}),s){var i=t.split("-")[1];s[t].reverse();var o,n=0;for(o in s[t]){var e=a(s[t][o]);e.css("margin-"+i,n),n+=e.outerHeight()+this.options.stackSpacing}}},_onCloseComplete:function(){this.destroy(),this.options._onPosition.bind(this).call()}})}
@@ -0,0 +1,49 @@
.jBox-NoticeFancy .jBox-content,
.jBox-NoticeFancy .jBox-title {
padding-left: 25px;
}
.jBox-NoticeFancy.jBox-Notice-color .jBox-container {
color: #fff;
background: #000;
}
.jBox-NoticeFancy.jBox-Notice-color .jBox-container:after {
content: '';
position: absolute;
top: 0;
left: 0;
bottom: 0;
width: 8px;
border-radius: 4px 0 0 4px;
background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.4) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.4) 75%, transparent 75%, transparent);
background-size: 14px 14px;
}
.jBox-NoticeFancy.jBox-Notice-black .jBox-container:after,
.jBox-NoticeFancy.jBox-Notice-gray .jBox-container:after {
background-color: #888;
}
.jBox-NoticeFancy.jBox-Notice-red .jBox-container:after {
background-color: #e00;
}
.jBox-NoticeFancy.jBox-Notice-green .jBox-container:after {
background-color: #6c0;
}
.jBox-NoticeFancy.jBox-Notice-blue .jBox-container:after {
background-color: #49d;
}
.jBox-NoticeFancy.jBox-Notice-yellow .jBox-container:after {
background-color: #fb0;
}
.jBox-NoticeFancy .jBox-countdown {
left: 8px;
border-radius: 0 4px 0 0;
}
/*# sourceMappingURL=jBox.NoticeFancy.css.map */
+1
View File
@@ -0,0 +1 @@
.jBox-NoticeFancy .jBox-content,.jBox-NoticeFancy .jBox-title{padding-left:25px}.jBox-NoticeFancy.jBox-Notice-color .jBox-container{color:#fff;background:#000}.jBox-NoticeFancy.jBox-Notice-color .jBox-container:after{content:'';position:absolute;top:0;left:0;bottom:0;width:8px;border-radius:4px 0 0 4px;background-image:linear-gradient(45deg,rgba(255,255,255,.4) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.4) 50%,rgba(255,255,255,.4) 75%,transparent 75%,transparent);background-size:14px 14px}.jBox-NoticeFancy.jBox-Notice-black .jBox-container:after,.jBox-NoticeFancy.jBox-Notice-gray .jBox-container:after{background-color:#888}.jBox-NoticeFancy.jBox-Notice-red .jBox-container:after{background-color:#e00}.jBox-NoticeFancy.jBox-Notice-green .jBox-container:after{background-color:#6c0}.jBox-NoticeFancy.jBox-Notice-blue .jBox-container:after{background-color:#49d}.jBox-NoticeFancy.jBox-Notice-yellow .jBox-container:after{background-color:#fb0}.jBox-NoticeFancy .jBox-countdown{left:8px;border-radius:0 4px 0 0}
@@ -0,0 +1,39 @@
.jBox-TooltipBorder .jBox-container,
.jBox-TooltipBorder .jBox-pointer:after {
border: 2px solid #49d;
}
.jBox-TooltipBorder .jBox-pointer:after {
width: 22px;
height: 22px;
}
.jBox-TooltipBorder .jBox-pointer-top,
.jBox-TooltipBorder .jBox-pointer-bottom {
width: 34px;
height: 13px;
}
.jBox-TooltipBorder .jBox-pointer-top:after,
.jBox-TooltipBorder .jBox-pointer-bottom:after {
left: 6px;
}
.jBox-TooltipBorder .jBox-pointer-left,
.jBox-TooltipBorder .jBox-pointer-right {
width: 13px;
height: 34px;
}
.jBox-TooltipBorder .jBox-pointer-left:after,
.jBox-TooltipBorder .jBox-pointer-right:after {
top: 6px;
}
.jBox-TooltipBorder.jBox-closeButton-box:before {
width: 28px;
height: 28px;
background: #49d;
}
/*# sourceMappingURL=jBox.TooltipBorder.css.map */
+1
View File
@@ -0,0 +1 @@
.jBox-TooltipBorder .jBox-container,.jBox-TooltipBorder .jBox-pointer:after{border:2px solid #49d}.jBox-TooltipBorder .jBox-pointer:after{width:22px;height:22px}.jBox-TooltipBorder .jBox-pointer-bottom,.jBox-TooltipBorder .jBox-pointer-top{width:34px;height:13px}.jBox-TooltipBorder .jBox-pointer-bottom:after,.jBox-TooltipBorder .jBox-pointer-top:after{left:6px}.jBox-TooltipBorder .jBox-pointer-left,.jBox-TooltipBorder .jBox-pointer-right{width:13px;height:34px}.jBox-TooltipBorder .jBox-pointer-left:after,.jBox-TooltipBorder .jBox-pointer-right:after{top:6px}.jBox-TooltipBorder.jBox-closeButton-box:before{width:28px;height:28px;background:#49d}
@@ -0,0 +1,32 @@
.jBox-TooltipBorderThick .jBox-container {
box-shadow: none;
border-radius: 8px;
border: 4px solid #ccc;
}
.jBox-TooltipBorderThick .jBox-pointer:after {
box-shadow: none;
border: 4px solid #ccc;
width: 24px;
height: 24px;
}
.jBox-TooltipBorderThick .jBox-pointer-top,
.jBox-TooltipBorderThick .jBox-pointer-bottom {
width: 38px;
height: 13px;
}
.jBox-TooltipBorderThick .jBox-pointer-left,
.jBox-TooltipBorderThick .jBox-pointer-right {
width: 13px;
height: 38px;
}
.jBox-TooltipBorderThick.jBox-closeButton-box:before {
width: 32px;
height: 32px;
background: #ccc;
}
/*# sourceMappingURL=jBox.TooltipBorderThick.css.map */
@@ -0,0 +1 @@
.jBox-TooltipBorderThick .jBox-container{box-shadow:none;border-radius:8px;border:4px solid #ccc}.jBox-TooltipBorderThick .jBox-pointer:after{box-shadow:none;border:4px solid #ccc;width:24px;height:24px}.jBox-TooltipBorderThick .jBox-pointer-bottom,.jBox-TooltipBorderThick .jBox-pointer-top{width:38px;height:13px}.jBox-TooltipBorderThick .jBox-pointer-left,.jBox-TooltipBorderThick .jBox-pointer-right{width:13px;height:38px}.jBox-TooltipBorderThick.jBox-closeButton-box:before{width:32px;height:32px;background:#ccc}
@@ -0,0 +1,32 @@
.jBox-TooltipDark .jBox-container {
border-radius: 4px;
background: #000;
color: #fff;
box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}
.jBox-TooltipDark .jBox-pointer:after {
background: #000;
}
.jBox-TooltipDark .jBox-closeButton {
background: #000;
}
.jBox-TooltipDark.jBox-closeButton-box:before {
box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}
.jBox-TooltipDark.jBox-closeButton-box .jBox-closeButton path {
fill: #ddd;
}
.jBox-TooltipDark.jBox-closeButton-box .jBox-closeButton:hover path {
fill: #fff;
}
.jBox-TooltipDark.jBox-closeButton-box .jBox-closeButton:active path {
fill: #bbb;
}
/*# sourceMappingURL=jBox.TooltipDark.css.map */
+1
View File
@@ -0,0 +1 @@
.jBox-TooltipDark .jBox-container{border-radius:4px;background:#000;color:#fff;box-shadow:0 0 6px rgba(0,0,0,.4)}.jBox-TooltipDark .jBox-pointer:after{background:#000}.jBox-TooltipDark .jBox-closeButton{background:#000}.jBox-TooltipDark.jBox-closeButton-box:before{box-shadow:0 0 6px rgba(0,0,0,.4)}.jBox-TooltipDark.jBox-closeButton-box .jBox-closeButton path{fill:#ddd}.jBox-TooltipDark.jBox-closeButton-box .jBox-closeButton:hover path{fill:#fff}.jBox-TooltipDark.jBox-closeButton-box .jBox-closeButton:active path{fill:#bbb}
@@ -0,0 +1,54 @@
.jBox-TooltipError {
pointer-events: none;
}
.jBox-TooltipError .jBox-container {
border-radius: 2px;
background: #d00;
color: #fff;
font-weight: bold;
font-size: 13px;
}
.jBox-TooltipError .jBox-content {
padding: 0 10px;
line-height: 28px;
}
.jBox-TooltipError .jBox-pointer:after {
background: #d00;
width: 20px;
height: 20px;
}
.jBox-TooltipError .jBox-pointer-top, .jBox-TooltipError .jBox-pointer-bottom {
width: 22px;
height: 8px;
}
.jBox-TooltipError .jBox-pointer-right, .jBox-TooltipError .jBox-pointer-left {
width: 8px;
height: 22px;
}
.jBox-TooltipError .jBox-pointer-top:after {
left: 1px;
top: 6px;
}
.jBox-TooltipError .jBox-pointer-right:after {
top: 1px;
right: 6px;
}
.jBox-TooltipError .jBox-pointer-bottom:after {
left: 1px;
bottom: 6px;
}
.jBox-TooltipError .jBox-pointer-left:after {
top: 1px;
left: 6px;
}
/*# sourceMappingURL=jBox.TooltipError.css.map */
+1
View File
@@ -0,0 +1 @@
.jBox-TooltipError{pointer-events:none}.jBox-TooltipError .jBox-container{border-radius:2px;background:#d00;color:#fff;font-weight:700;font-size:13px}.jBox-TooltipError .jBox-content{padding:0 10px;line-height:28px}.jBox-TooltipError .jBox-pointer:after{background:#d00;width:20px;height:20px}.jBox-TooltipError .jBox-pointer-bottom,.jBox-TooltipError .jBox-pointer-top{width:22px;height:8px}.jBox-TooltipError .jBox-pointer-left,.jBox-TooltipError .jBox-pointer-right{width:8px;height:22px}.jBox-TooltipError .jBox-pointer-top:after{left:1px;top:6px}.jBox-TooltipError .jBox-pointer-right:after{top:1px;right:6px}.jBox-TooltipError .jBox-pointer-bottom:after{left:1px;bottom:6px}.jBox-TooltipError .jBox-pointer-left:after{top:1px;left:6px}
@@ -0,0 +1,49 @@
.jBox-TooltipSmall {
pointer-events: none;
}
.jBox-TooltipSmall .jBox-container {
border-radius: 2px;
}
.jBox-TooltipSmall .jBox-content {
padding: 0 10px;
line-height: 28px;
}
.jBox-TooltipSmall .jBox-pointer:after {
width: 20px;
height: 20px;
}
.jBox-TooltipSmall .jBox-pointer-top, .jBox-TooltipSmall .jBox-pointer-bottom {
width: 22px;
height: 8px;
}
.jBox-TooltipSmall .jBox-pointer-right, .jBox-TooltipSmall .jBox-pointer-left {
width: 8px;
height: 22px;
}
.jBox-TooltipSmall .jBox-pointer-top:after {
left: 1px;
top: 6px;
}
.jBox-TooltipSmall .jBox-pointer-right:after {
top: 1px;
right: 6px;
}
.jBox-TooltipSmall .jBox-pointer-bottom:after {
left: 1px;
bottom: 6px;
}
.jBox-TooltipSmall .jBox-pointer-left:after {
top: 1px;
left: 6px;
}
/*# sourceMappingURL=jBox.TooltipSmall.css.map */
+1
View File
@@ -0,0 +1 @@
.jBox-TooltipSmall{pointer-events:none}.jBox-TooltipSmall .jBox-container{border-radius:2px}.jBox-TooltipSmall .jBox-content{padding:0 10px;line-height:28px}.jBox-TooltipSmall .jBox-pointer:after{width:20px;height:20px}.jBox-TooltipSmall .jBox-pointer-bottom,.jBox-TooltipSmall .jBox-pointer-top{width:22px;height:8px}.jBox-TooltipSmall .jBox-pointer-left,.jBox-TooltipSmall .jBox-pointer-right{width:8px;height:22px}.jBox-TooltipSmall .jBox-pointer-top:after{left:1px;top:6px}.jBox-TooltipSmall .jBox-pointer-right:after{top:1px;right:6px}.jBox-TooltipSmall .jBox-pointer-bottom:after{left:1px;bottom:6px}.jBox-TooltipSmall .jBox-pointer-left:after{top:1px;left:6px}
@@ -0,0 +1,53 @@
.jBox-TooltipSmallGray {
pointer-events: none;
}
.jBox-TooltipSmallGray .jBox-container {
font-size: 13px;
line-height: 24px;
border-radius: 12px;
background-image: linear-gradient(to bottom, #fafafa, #f2f2f2);
}
.jBox-TooltipSmallGray .jBox-content {
padding: 0 10px;
}
.jBox-TooltipSmallGray .jBox-pointer:after {
width: 20px;
height: 20px;
}
.jBox-TooltipSmallGray .jBox-pointer-top, .jBox-TooltipSmallGray .jBox-pointer-bottom {
width: 22px;
height: 8px;
}
.jBox-TooltipSmallGray .jBox-pointer-left, .jBox-TooltipSmallGray .jBox-pointer-right {
width: 8px;
height: 22px;
}
.jBox-TooltipSmallGray .jBox-pointer-top:after {
background: #fafafa;
left: 1px;
top: 6px;
}
.jBox-TooltipSmallGray .jBox-pointer-right:after {
top: 1px;
right: 6px;
}
.jBox-TooltipSmallGray .jBox-pointer-bottom:after {
background: #f2f2f2;
left: 1px;
bottom: 6px;
}
.jBox-TooltipSmallGray .jBox-pointer-left:after {
top: 1px;
left: 6px;
}
/*# sourceMappingURL=jBox.TooltipSmallGray.css.map */
@@ -0,0 +1 @@
.jBox-TooltipSmallGray{pointer-events:none}.jBox-TooltipSmallGray .jBox-container{font-size:13px;line-height:24px;border-radius:12px;background-image:linear-gradient(to bottom,#fafafa,#f2f2f2)}.jBox-TooltipSmallGray .jBox-content{padding:0 10px}.jBox-TooltipSmallGray .jBox-pointer:after{width:20px;height:20px}.jBox-TooltipSmallGray .jBox-pointer-bottom,.jBox-TooltipSmallGray .jBox-pointer-top{width:22px;height:8px}.jBox-TooltipSmallGray .jBox-pointer-left,.jBox-TooltipSmallGray .jBox-pointer-right{width:8px;height:22px}.jBox-TooltipSmallGray .jBox-pointer-top:after{background:#fafafa;left:1px;top:6px}.jBox-TooltipSmallGray .jBox-pointer-right:after{top:1px;right:6px}.jBox-TooltipSmallGray .jBox-pointer-bottom:after{background:#f2f2f2;left:1px;bottom:6px}.jBox-TooltipSmallGray .jBox-pointer-left:after{top:1px;left:6px}