|
| 1 | +@font-face { |
| 2 | + font-family: "Exoct"; |
| 3 | + src: url("https://assets.codepen.io/1480814/films.EXH_____.ttf"); |
| 4 | +} |
| 5 | + |
| 6 | +body { |
| 7 | + margin: 0; |
| 8 | + min-height: 100vh; |
| 9 | + display: grid; |
| 10 | + grid-auto-flow: column; |
| 11 | + grid-auto-columns: min(230px, 35vmin); |
| 12 | + place-content: end center; |
| 13 | + gap: 50px; |
| 14 | + background: linear-gradient(#0000, rgb(50 50 50 / 88%)), |
| 15 | + url("img/back.jpg") top/cover; |
| 16 | +} |
| 17 | + |
| 18 | +figure { |
| 19 | + width: 100%; |
| 20 | + aspect-ratio: 1; |
| 21 | + margin: 0 0 60px; |
| 22 | + padding: 5px 20px 0; |
| 23 | + box-sizing: border-box; |
| 24 | + display: grid; |
| 25 | + grid-template-rows: 100%; |
| 26 | + cursor: pointer; |
| 27 | + position: relative; |
| 28 | + filter: drop-shadow(0 0 20px rgb(0 0 0/50%)); |
| 29 | +} |
| 30 | + |
| 31 | +figure:before { |
| 32 | + content: ""; |
| 33 | + position: absolute; |
| 34 | + z-index: -1; |
| 35 | + inset: 0; |
| 36 | + background: top/cover; |
| 37 | + transform-origin: bottom; |
| 38 | + filter: brightness(0.9); |
| 39 | + transition: 0.5s; |
| 40 | +} |
| 41 | + |
| 42 | +figure:before { |
| 43 | + background-image: url(https://assets.codepen.io/1480814/necro-back.jpg); |
| 44 | +} |
| 45 | + |
| 46 | +figure + figure:before { |
| 47 | + background-image: url(https://assets.codepen.io/1480814/druid-bac.jpg); |
| 48 | +} |
| 49 | + |
| 50 | +figure:hover::before { |
| 51 | + filter: brightness(0.3); |
| 52 | + transform: perspective(500px) rotateX(60deg); |
| 53 | +} |
| 54 | + |
| 55 | +figcaption { |
| 56 | + grid-area: 1/1; |
| 57 | + width: calc(100% + 40px); |
| 58 | + font-family: Exoct; |
| 59 | + color: white; |
| 60 | + font-size: min(32px, 5vmin); |
| 61 | + text-align: center; |
| 62 | + place-self: end center; |
| 63 | + transform: perspective(500px) translateY(100%) rotateX(-90deg); |
| 64 | + backface-visibility: hidden; |
| 65 | + transform-origin: top; |
| 66 | + background: #000; |
| 67 | + transition: 0.5s; |
| 68 | +} |
| 69 | + |
| 70 | +figure:hover figcaption { |
| 71 | + transform: perspective(500px) translateY(100%) rotateX(-30deg); |
| 72 | +} |
| 73 | + |
| 74 | +img { |
| 75 | + grid-area: 1/1; |
| 76 | + width: 100%; |
| 77 | + height: 100%; |
| 78 | + object-fit: cover; |
| 79 | + object-position: top; |
| 80 | + filter: contrast(0.8) brightness(0.7); |
| 81 | + place-self: end center; |
| 82 | + transition: 0.5s; |
| 83 | +} |
| 84 | + |
| 85 | +figure:hover img { |
| 86 | + width: 130%; |
| 87 | + height: 255%; |
| 88 | + filter: contrast(1); |
| 89 | +} |
0 commit comments