|
| 1 | +html, body { |
| 2 | + min-height:100vh; |
| 3 | +} |
| 4 | + |
| 5 | +body { |
| 6 | + display:flex; |
| 7 | + align-items:center; |
| 8 | + flex-flow:column nowrap; |
| 9 | + overflow-x:hidden; |
| 10 | +} |
| 11 | + |
| 12 | +.title { |
| 13 | + font:1.3em/1 monospace; |
| 14 | + font-variant:small-caps; |
| 15 | + letter-spacing:0.5em; |
| 16 | + margin:4em; |
| 17 | +} |
| 18 | + |
| 19 | +.gallery { |
| 20 | + -webkit-perspective:700px; |
| 21 | + perspective:700px; |
| 22 | + width:50vw; |
| 23 | + display:flex; justify-content:center; align-items:center; flex-flow:row wrap; |
| 24 | +} |
| 25 | + |
| 26 | +ul { |
| 27 | + position:relative; |
| 28 | + width:100px; height:100px; |
| 29 | + margin:0.1em; |
| 30 | + -webkit-perspective-origin:center center; |
| 31 | + perspective-origin:center center; |
| 32 | + -webkit-transform-style:preserve-3d; |
| 33 | + transform-style:preserve-3d; |
| 34 | + -webkit-transform:rotateX(40deg); |
| 35 | + transform:rotateX(40deg); |
| 36 | + transition:all 0.4s; |
| 37 | +} |
| 38 | + |
| 39 | +ul:hover { |
| 40 | + -webkit-transform:translateZ(100px) rotateX(20deg); |
| 41 | + transform:translateZ(100px) rotateX(20deg); z-index:999; |
| 42 | +} |
| 43 | + |
| 44 | +ul:hover li { |
| 45 | + -webkit-filter:grayscale(0); |
| 46 | + filter:grayscale(0); |
| 47 | +} |
| 48 | + |
| 49 | +li { |
| 50 | + position:absolute; left:0; top:0; |
| 51 | + -webkit-backface-visibility:hidden; |
| 52 | + backface-visibility:hidden; |
| 53 | + width:100%; height:100%; |
| 54 | + transition:-webkit-transform 0.3s, -webkit-filter 1s; |
| 55 | + transition:transform 0.3s, filter 1s; |
| 56 | + transition:transform 0.3s, filter 1s, -webkit-transform 0.3s, -webkit-filter 1s; |
| 57 | + background:coral; |
| 58 | + -webkit-filter:grayscale(0.9); |
| 59 | + filter:grayscale(0.9); |
| 60 | +} |
| 61 | +/* |
| 62 | +Setup individual planes final poistion(by left top) and initial position(by transform) |
| 63 | +*/ |
| 64 | +li:first-of-type {-webkit-transform:none;transform:none;} |
| 65 | +li:nth-of-type(2) {left:100%; -webkit-transform-origin:left center; transform-origin:left center; -webkit-transform:rotateY(180deg); transform:rotateY(180deg);} |
| 66 | +li:nth-of-type(3) {top:100%; -webkit-transform-origin:center top; transform-origin:center top; -webkit-transform:rotateX(-180deg); transform:rotateX(-180deg);} |
| 67 | +li:nth-of-type(4) {left:-100%; -webkit-transform-origin:right center; transform-origin:right center; -webkit-transform:rotateY(-180deg); transform:rotateY(-180deg);} |
| 68 | +li:nth-of-type(5) {top:-100%; -webkit-transform-origin:center bottom; transform-origin:center bottom; -webkit-transform:rotateX(180deg); transform:rotateX(180deg);} |
| 69 | +li:nth-of-type(6) {top:100%; left:100%; -webkit-transform-origin:center top; transform-origin:center top; -webkit-transform:rotateX(-180deg); transform:rotateX(-180deg);} |
| 70 | +li:nth-of-type(7) {top:100%; left:-100%; -webkit-transform-origin:right center; transform-origin:right center; -webkit-transform:rotateY(-180deg); transform:rotateY(-180deg);} |
| 71 | +li:nth-of-type(8) {top:-100%; left:-100%; -webkit-transform-origin:center bottom; transform-origin:center bottom; -webkit-transform:rotateX(180deg); transform:rotateX(180deg);} |
| 72 | +li:nth-of-type(9) {top:-100%; left:100%; -webkit-transform-origin:left center; transform-origin:left center; -webkit-transform:rotateY(180deg); transform:rotateY(180deg);} |
| 73 | +/* |
| 74 | +Setup transition-delay, for mouseout state |
| 75 | +*/ |
| 76 | +li:nth-of-type(2),li:nth-of-type(3),li:nth-of-type(4),li:nth-of-type(5) {transition-delay:0.03s;} |
| 77 | +li:nth-of-type(6),li:nth-of-type(7),li:nth-of-type(8),li:nth-of-type(9) {transition-delay:0s;} |
| 78 | +ul:hover :nth-of-type(2),ul:hover :nth-of-type(3),ul:hover :nth-of-type(4),ul:hover :nth-of-type(5) {transition-delay:0s} |
| 79 | +ul:hover :nth-of-type(6),ul:hover :nth-of-type(7),ul:hover :nth-of-type(8),ul:hover :nth-of-type(9) {transition-delay:0.2s} |
| 80 | +/* |
| 81 | +Setup planes final state |
| 82 | +*/ |
| 83 | +ul:hover :nth-of-type(2),ul:hover :nth-of-type(4),ul:hover :nth-of-type(7),ul:hover :nth-of-type(9) {-webkit-transform:rotateY(0);transform:rotateY(0);} |
| 84 | +ul:hover :nth-of-type(3), ul:hover :nth-of-type(5),ul:hover :nth-of-type(6), ul:hover :nth-of-type(8) {-webkit-transform:rotateX(0);transform:rotateX(0);} |
| 85 | +/* |
| 86 | +Set background position |
| 87 | +*/ |
| 88 | +ul li {background-size:300% 300%;} |
| 89 | +li:nth-of-type(1) {background-position:center center;} |
| 90 | +li:nth-of-type(2) {background-position:right center;} |
| 91 | +li:nth-of-type(3) {background-position:center bottom;} |
| 92 | +li:nth-of-type(4) {background-position:left center;} |
| 93 | +li:nth-of-type(5) {background-position:center top;} |
| 94 | +li:nth-of-type(6) {background-position:right bottom;} |
| 95 | +li:nth-of-type(7) {background-position:left bottom;} |
| 96 | +li:nth-of-type(8) {background-position:left top;} |
| 97 | +li:nth-of-type(9) {background-position:right top;} |
| 98 | +/* |
| 99 | +Set background image source |
| 100 | +*/ |
| 101 | +ul:nth-of-type(1) li { background-image:url(../Photos/chetan.jpg);} |
| 102 | +ul:nth-of-type(1) { width:90px; height:90px; } |
| 103 | +ul:nth-of-type(2) li { background-image:url(../Photos/harsh_lathwal.jpeg);} |
| 104 | +ul:nth-of-type(2) { width:66px; height:66px; } |
| 105 | +ul:nth-of-type(3) li { background-image:url(../Photos/dilpreet.jpg);} |
| 106 | +ul:nth-of-type(3) { width:130px; height:90px; } |
| 107 | +ul:nth-of-type(4) li { background-image:url(../Photos/#.jpg);} |
| 108 | +ul:nth-of-type(4) { width:120px; height:80px; } |
| 109 | +ul:nth-of-type(5) li { background-image:url(../Photos/#.jpg);} |
| 110 | +ul:nth-of-type(5) { width:64px; height:84px; } |
| 111 | +ul:nth-of-type(6) li { background-image:url(../Photos/#.jpg);} |
| 112 | +ul:nth-of-type(6) { width:100px; height:66px; } |
| 113 | +/* |
| 114 | +Hide debug label |
| 115 | +*/ |
| 116 | +li { text-indent:999px; overflow:hidden; } |
0 commit comments