|
| 1 | +@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap'); |
| 2 | + |
| 3 | +:root { |
| 4 | + --left-bg-color: rgba(87, 84, 236, 0.7); |
| 5 | + --right-bg-color: rgba(43, 43, 43, 0.8); |
| 6 | + --left-btn-hover-color: rgba(87, 84, 236, 1); |
| 7 | + --right-btn-hover-color: rgba(28, 122, 28, 1); |
| 8 | + --hover-width: 75%; |
| 9 | + --other-width: 25%; |
| 10 | + --speed: 1000ms; |
| 11 | +} |
| 12 | + |
| 13 | +* { |
| 14 | + box-sizing: border-box; |
| 15 | +} |
| 16 | + |
| 17 | +body { |
| 18 | + font-family: 'Roboto', sans-serif; |
| 19 | + height: 100vh; |
| 20 | + overflow: hidden; |
| 21 | + margin: 0; |
| 22 | +} |
| 23 | + |
| 24 | +h1 { |
| 25 | + font-size: 4rem; |
| 26 | + color: #fff; |
| 27 | + position: absolute; |
| 28 | + left: 50%; |
| 29 | + top: 20%; |
| 30 | + transform: translateX(-50%); |
| 31 | + white-space: nowrap; |
| 32 | +} |
| 33 | + |
| 34 | +.btn { |
| 35 | + position: absolute; |
| 36 | + display: flex; |
| 37 | + align-items: center; |
| 38 | + justify-content: center; |
| 39 | + left: 50%; |
| 40 | + top: 40%; |
| 41 | + transform: translateX(-50%); |
| 42 | + text-decoration: none; |
| 43 | + color: #fff; |
| 44 | + border: #fff solid 0.2rem; |
| 45 | + font-size: 1rem; |
| 46 | + font-weight: bold; |
| 47 | + text-transform: uppercase; |
| 48 | + width: 15rem; |
| 49 | + padding: 1.5rem; |
| 50 | +} |
| 51 | + |
| 52 | +.split.left .btn:hover { |
| 53 | + background-color: var(--left-btn-hover-color); |
| 54 | + border-color: var(--left-btn-hover-color); |
| 55 | +} |
| 56 | + |
| 57 | +.split.right .btn:hover { |
| 58 | + background-color: var(--right-btn-hover-color); |
| 59 | + border-color: var(--right-btn-hover-color); |
| 60 | +} |
| 61 | + |
| 62 | +.container { |
| 63 | + position: relative; |
| 64 | + width: 100%; |
| 65 | + height: 100%; |
| 66 | + background: #333; |
| 67 | +} |
| 68 | + |
| 69 | +.split { |
| 70 | + position: absolute; |
| 71 | + width: 50%; |
| 72 | + height: 100%; |
| 73 | + overflow: hidden; |
| 74 | +} |
| 75 | + |
| 76 | +.split.left { |
| 77 | + left: 0; |
| 78 | + background: url('ps.jpg'); |
| 79 | + background-repeat: no-repeat; |
| 80 | + background-size: cover; |
| 81 | +} |
| 82 | + |
| 83 | +.split.left::before { |
| 84 | + content: ''; |
| 85 | + position: absolute; |
| 86 | + width: 100%; |
| 87 | + height: 100%; |
| 88 | + background-color: var(--left-bg-color); |
| 89 | +} |
| 90 | + |
| 91 | +.split.right { |
| 92 | + right: 0; |
| 93 | + background: url('xbox.jpg'); |
| 94 | + background-repeat: no-repeat; |
| 95 | + background-size: cover; |
| 96 | +} |
| 97 | + |
| 98 | +.split.right::before { |
| 99 | + content: ''; |
| 100 | + position: absolute; |
| 101 | + width: 100%; |
| 102 | + height: 100%; |
| 103 | + background-color: var(--right-bg-color); |
| 104 | +} |
| 105 | + |
| 106 | +.split.right, |
| 107 | +.split.left, |
| 108 | +.split.right::before, |
| 109 | +.split.left::before { |
| 110 | + transition: all var(--speed) ease-in-out; |
| 111 | +} |
| 112 | + |
| 113 | +.hover-left .left { |
| 114 | + width: var(--hover-width); |
| 115 | +} |
| 116 | + |
| 117 | +.hover-left .right { |
| 118 | + width: var(--other-width); |
| 119 | +} |
| 120 | + |
| 121 | +.hover-right .right { |
| 122 | + width: var(--hover-width); |
| 123 | +} |
| 124 | + |
| 125 | +.hover-right .left { |
| 126 | + width: var(--other-width); |
| 127 | +} |
| 128 | + |
| 129 | +@media (max-width: 800px) { |
| 130 | + h1 { |
| 131 | + font-size: 2rem; |
| 132 | + top: 30%; |
| 133 | + } |
| 134 | + |
| 135 | + .btn { |
| 136 | + padding: 1.2rem; |
| 137 | + width: 12rem; |
| 138 | + } |
| 139 | +} |
0 commit comments