|
| 1 | +html { |
| 2 | + box-sizing: border-box; |
| 3 | + background: url('https://source.unsplash.com/NFs6dRTBgaM/2000x2000') fixed; |
| 4 | + background-size: cover; |
| 5 | +} |
| 6 | + |
| 7 | +*, *:before, *:after { |
| 8 | + box-sizing: inherit; |
| 9 | +} |
| 10 | + |
| 11 | +body { |
| 12 | + min-height: 100vh; |
| 13 | + display: flex; |
| 14 | + justify-content: center; |
| 15 | + align-items: center; |
| 16 | + font-family: sans-serif; |
| 17 | + font-size: 20px; |
| 18 | + margin: 0; |
| 19 | +} |
| 20 | + |
| 21 | +.items { |
| 22 | + height: 800px; |
| 23 | + padding: 100px; |
| 24 | + width: 100%; |
| 25 | + border: 1px solid white; |
| 26 | + overflow-x: scroll; |
| 27 | + overflow-y: hidden; |
| 28 | + white-space: nowrap; |
| 29 | + user-select: none; |
| 30 | + cursor: pointer; |
| 31 | + transition: all 0.2s; |
| 32 | + transform: scale(0.98); |
| 33 | + will-change: transform; |
| 34 | + position: relative; |
| 35 | + background: rgba(255,255,255,0.1); |
| 36 | + font-size: 0; |
| 37 | + perspective: 500px; |
| 38 | +} |
| 39 | + |
| 40 | +.items.active { |
| 41 | + background: rgba(255,255,255,0.3); |
| 42 | + cursor: grabbing; |
| 43 | + cursor: -webkit-grabbing; |
| 44 | + transform: scale(1); |
| 45 | +} |
| 46 | + |
| 47 | +.item { |
| 48 | + width: 200px; |
| 49 | + height: calc(100% - 40px); |
| 50 | + display: inline-flex; |
| 51 | + align-items: center; |
| 52 | + justify-content: center; |
| 53 | + font-size: 80px; |
| 54 | + font-weight: 100; |
| 55 | + color: rgba(0,0,0,0.15); |
| 56 | + box-shadow: inset 0 0 0 10px rgba(0,0,0,0.15); |
| 57 | +} |
| 58 | + |
| 59 | +.item:nth-child(9n+1) { background: dodgerblue;} |
| 60 | +.item:nth-child(9n+2) { background: goldenrod;} |
| 61 | +.item:nth-child(9n+3) { background: paleturquoise;} |
| 62 | +.item:nth-child(9n+4) { background: gold;} |
| 63 | +.item:nth-child(9n+5) { background: cadetblue;} |
| 64 | +.item:nth-child(9n+6) { background: tomato;} |
| 65 | +.item:nth-child(9n+7) { background: lightcoral;} |
| 66 | +.item:nth-child(9n+8) { background: darkslateblue;} |
| 67 | +.item:nth-child(9n+9) { background: rebeccapurple;} |
| 68 | + |
| 69 | +.item:nth-child(even) { transform: scaleX(1.31) rotateY(40deg); } |
| 70 | +.item:nth-child(odd) { transform: scaleX(1.31) rotateY(-40deg); } |
0 commit comments