Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit 3607c55

Browse files
committed
Change all animations to CSS transitions; bugfixes + code tweaks
1 parent a764aea commit 3607c55

10 files changed

+809
-1075
lines changed

dist/jquery.fancybox.css

+118-135
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,20 @@
1919
width: 100%;
2020
height: 100%;
2121
z-index: 99993;
22+
-webkit-tap-highlight-color: transparent;
2223
-webkit-backface-visibility: hidden;
23-
backface-visibility: hidden; }
24+
backface-visibility: hidden;
25+
-webkit-transform: translateZ(0);
26+
transform: translateZ(0); }
2427

2528
/* Make sure that the first one is on the top */
2629
.fancybox-container ~ .fancybox-container {
2730
z-index: 99992; }
2831

2932
.fancybox-outer,
3033
.fancybox-inner,
31-
.fancybox-bg {
34+
.fancybox-bg,
35+
.fancybox-stage {
3236
position: absolute;
3337
top: 0;
3438
right: 0;
@@ -41,22 +45,19 @@
4145

4246
.fancybox-bg {
4347
background: #1e1e1e;
44-
opacity: 0.87;
48+
opacity: 0;
4549
transition-duration: inherit;
4650
transition-property: opacity;
47-
transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
48-
49-
.fancybox-is-hidden .fancybox-bg,
50-
.fancybox-is-closing .fancybox-bg {
51-
opacity: 0;
5251
transition-timing-function: cubic-bezier(0.47, 0, 0.74, 0.71); }
5352

53+
.fancybox-is-open .fancybox-bg {
54+
opacity: 0.87;
55+
transition-timing-function: cubic-bezier(0.22, 0.61, 0.36, 1); }
56+
5457
.fancybox-infobar,
5558
.fancybox-toolbar,
5659
.fancybox-caption-wrap {
5760
position: absolute;
58-
-webkit-backface-visibility: hidden;
59-
backface-visibility: hidden;
6061
direction: ltr;
6162
z-index: 99997;
6263
opacity: 0;
@@ -101,17 +102,8 @@
101102
.fancybox-stage {
102103
overflow: hidden;
103104
direction: ltr;
104-
position: absolute;
105-
top: 0;
106-
left: 0;
107-
bottom: 0;
108-
right: 0;
109-
padding: 0;
110-
margin: 0;
111105
z-index: 99994;
112-
-webkit-backface-visibility: hidden;
113-
backface-visibility: hidden;
114-
-webkit-tap-highlight-color: transparent; }
106+
-webkit-transform: translate3d(0, 0, 0); }
115107

116108
.fancybox-slide {
117109
position: absolute;
@@ -129,7 +121,13 @@
129121
z-index: 99994;
130122
-webkit-overflow-scrolling: touch;
131123
display: none;
132-
transition-duration: inherit; }
124+
-webkit-backface-visibility: hidden;
125+
backface-visibility: hidden;
126+
transition-property: opacity, -webkit-transform;
127+
transition-property: transform, opacity;
128+
transition-property: transform, opacity, -webkit-transform;
129+
-webkit-transform-style: preserve-3d;
130+
transform-style: preserve-3d; }
133131

134132
.fancybox-slide::before {
135133
content: '';
@@ -154,6 +152,10 @@
154152
.fancybox-slide--video iframe {
155153
background: #000; }
156154

155+
.fancybox-slide--map .fancybox-content,
156+
.fancybox-slide--map iframe {
157+
background: #E5E3DF; }
158+
157159
.fancybox-slide--next {
158160
z-index: 99995; }
159161

@@ -226,7 +228,8 @@
226228
height: 80%;
227229
max-width: calc(100% - 100px);
228230
max-height: calc(100% - 88px);
229-
overflow: visible; }
231+
overflow: visible;
232+
background: #fff; }
230233

231234
.fancybox-iframe {
232235
display: block;
@@ -350,7 +353,7 @@
350353

351354
.fancybox-button[disabled] {
352355
cursor: default;
353-
pinter-events: none; }
356+
pointer-events: none; }
354357

355358
.fancybox-infobar__body, .fancybox-button {
356359
background: rgba(30, 30, 30, 0.6); }
@@ -438,7 +441,6 @@
438441
-moz-user-select: none;
439442
-ms-user-select: none;
440443
user-select: none;
441-
pointer-events: none;
442444
transition: opacity .25s; }
443445

444446
.fancybox-arrow::after {
@@ -456,21 +458,18 @@
456458
.fancybox-arrow--right {
457459
right: 0; }
458460

459-
.fancybox-arrow--right::after {
460-
left: 0; }
461-
462461
.fancybox-arrow--left {
463462
left: 0;
464463
-webkit-transform: scaleX(-1);
465464
-ms-transform: scaleX(-1);
466465
transform: scaleX(-1); }
467466

467+
.fancybox-arrow--right::after,
468468
.fancybox-arrow--left::after {
469469
left: 0; }
470470

471471
.fancybox-show-nav .fancybox-arrow {
472-
opacity: 0.6;
473-
pointer-events: all; }
472+
opacity: 0.6; }
474473

475474
.fancybox-show-nav .fancybox-arrow[disabled] {
476475
opacity: 0.3; }
@@ -508,11 +507,7 @@
508507
-webkit-transform: rotate(359deg);
509508
transform: rotate(359deg); } }
510509

511-
/*
512-
513-
Transition effects
514-
515-
*/
510+
/* Transition effects */
516511
.fancybox-animated {
517512
transition-timing-function: cubic-bezier(0, 0, 0.25, 1); }
518513

@@ -648,110 +643,98 @@
648643
border-width: 0 2px 0 2px; }
649644

650645
/* Thumbs */
651-
.fancybox-button--thumbs span {
652-
font-size: 23px; }
653-
654-
.fancybox-button--thumbs::before {
655-
width: 3px;
656-
height: 3px;
657-
top: calc(50% - 2px);
658-
left: calc(50% - 2px);
659-
box-shadow: 0 -4px 0, -4px -4px 0, 4px -4px 0, 0 0 0 32px inset, -4px 0 0, 4px 0 0, 0 4px 0, -4px 4px 0, 4px 4px 0; }
660-
661646
.fancybox-thumbs {
662-
position: absolute;
663-
top: 0;
664-
right: 0;
665-
bottom: 0;
666-
left: auto;
667-
width: 220px;
668-
margin: 0;
669-
padding: 5px 5px 0 0;
670-
background: #fff;
671-
z-index: 99996;
672-
word-break: normal;
673-
-webkit-tap-highlight-color: transparent;
674-
-webkit-overflow-scrolling: touch;
675-
-ms-overflow-style: -ms-autohiding-scrollbar;
676-
box-sizing: border-box;
677-
z-index: 99995;
678647
display: none; }
679648

680-
.fancybox-show-thumbs .fancybox-thumbs {
681-
display: block; }
682-
683-
.fancybox-show-thumbs .fancybox-inner {
684-
right: 220px; }
685-
686-
.fancybox-thumbs > ul {
687-
list-style: none;
688-
position: absolute;
689-
position: relative;
690-
width: 100%;
691-
height: 100%;
692-
margin: 0;
693-
padding: 0;
694-
overflow-x: hidden;
695-
overflow-y: auto;
696-
font-size: 0; }
697-
698-
.fancybox-thumbs > ul > li {
699-
float: left;
700-
overflow: hidden;
701-
max-width: 50%;
702-
padding: 0;
703-
margin: 0;
704-
width: 105px;
705-
height: 75px;
706-
position: relative;
707-
cursor: pointer;
708-
outline: none;
709-
border: 5px solid transparent;
710-
border-top-width: 0;
711-
border-right-width: 0;
712-
-webkit-tap-highlight-color: transparent;
713-
-webkit-backface-visibility: hidden;
714-
backface-visibility: hidden;
715-
box-sizing: border-box; }
716-
717-
li.fancybox-thumbs-loading {
718-
background: rgba(0, 0, 0, 0.1); }
719-
720-
.fancybox-thumbs > ul > li > img {
721-
position: absolute;
722-
top: 0;
723-
left: 0;
724-
min-width: 100%;
725-
min-height: 100%;
726-
max-width: none;
727-
max-height: none;
728-
-webkit-touch-callout: none;
729-
-webkit-user-select: none;
730-
-moz-user-select: none;
731-
-ms-user-select: none;
732-
user-select: none; }
733-
734-
.fancybox-thumbs > ul > li:before {
735-
content: '';
736-
position: absolute;
737-
top: 0;
738-
right: 0;
739-
bottom: 0;
740-
left: 0;
741-
border-radius: 2px;
742-
border: 4px solid #4ea7f9;
743-
z-index: 99991;
744-
opacity: 0;
745-
transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
746-
747-
.fancybox-thumbs > ul > li.fancybox-thumbs-active:before {
748-
opacity: 1; }
649+
.fancybox-button--thumbs {
650+
display: none; }
749651

750-
/* Styling for Small-Screen Devices */
751-
@media all and (max-width: 800px) {
652+
@media all and (min-width: 800px) {
653+
.fancybox-button--thumbs {
654+
display: inline-block; }
655+
.fancybox-button--thumbs span {
656+
font-size: 23px; }
657+
.fancybox-button--thumbs::before {
658+
width: 3px;
659+
height: 3px;
660+
top: calc(50% - 2px);
661+
left: calc(50% - 2px);
662+
box-shadow: 0 -4px 0, -4px -4px 0, 4px -4px 0, 0 0 0 32px inset, -4px 0 0, 4px 0 0, 0 4px 0, -4px 4px 0, 4px 4px 0; }
663+
.fancybox-thumbs {
664+
position: absolute;
665+
top: 0;
666+
right: 0;
667+
bottom: 0;
668+
left: auto;
669+
width: 220px;
670+
margin: 0;
671+
padding: 5px 5px 0 0;
672+
background: #fff;
673+
word-break: normal;
674+
-webkit-tap-highlight-color: transparent;
675+
-webkit-overflow-scrolling: touch;
676+
-ms-overflow-style: -ms-autohiding-scrollbar;
677+
box-sizing: border-box;
678+
z-index: 99995; }
752679
.fancybox-show-thumbs .fancybox-thumbs {
753-
display: none; }
680+
display: block; }
754681
.fancybox-show-thumbs .fancybox-inner {
755-
right: 0; }
756-
.fancybox-toolbar .fancybox-button--thumbs {
757-
display: none; } }
682+
right: 220px; }
683+
.fancybox-thumbs > ul {
684+
list-style: none;
685+
position: absolute;
686+
position: relative;
687+
width: 100%;
688+
height: 100%;
689+
margin: 0;
690+
padding: 0;
691+
overflow-x: hidden;
692+
overflow-y: auto;
693+
font-size: 0; }
694+
.fancybox-thumbs > ul > li {
695+
float: left;
696+
overflow: hidden;
697+
max-width: 50%;
698+
padding: 0;
699+
margin: 0;
700+
width: 105px;
701+
height: 75px;
702+
position: relative;
703+
cursor: pointer;
704+
outline: none;
705+
border: 5px solid transparent;
706+
border-top-width: 0;
707+
border-right-width: 0;
708+
-webkit-tap-highlight-color: transparent;
709+
-webkit-backface-visibility: hidden;
710+
backface-visibility: hidden;
711+
box-sizing: border-box; }
712+
li.fancybox-thumbs-loading {
713+
background: rgba(0, 0, 0, 0.1); }
714+
.fancybox-thumbs > ul > li > img {
715+
position: absolute;
716+
top: 0;
717+
left: 0;
718+
min-width: 100%;
719+
min-height: 100%;
720+
max-width: none;
721+
max-height: none;
722+
-webkit-touch-callout: none;
723+
-webkit-user-select: none;
724+
-moz-user-select: none;
725+
-ms-user-select: none;
726+
user-select: none; }
727+
.fancybox-thumbs > ul > li:before {
728+
content: '';
729+
position: absolute;
730+
top: 0;
731+
right: 0;
732+
bottom: 0;
733+
left: 0;
734+
border-radius: 2px;
735+
border: 4px solid #4ea7f9;
736+
z-index: 99991;
737+
opacity: 0;
738+
transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
739+
.fancybox-thumbs > ul > li.fancybox-thumbs-active:before {
740+
opacity: 1; } }

0 commit comments

Comments
 (0)