Sep 11th 2020
14 |├── README.md └── public ├── avatar.png ├── card.css └── index.html /README.md: -------------------------------------------------------------------------------- 1 | # Stacked Card List 2 | 3 | A stacked card list inspired by css-tricks.com. -------------------------------------------------------------------------------- /public/avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fireship-io/stacked-card-list/ef90458ff2d795e3ae6f993834208c18e081d320/public/avatar.png -------------------------------------------------------------------------------- /public/card.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@300;400;500&display=swap'); 2 | 3 | body { 4 | padding: 0; 5 | margin: 0; 6 | background-color: #17141d; 7 | color: white; 8 | font-family: 'DM Mono', monospace; 9 | } 10 | 11 | a { 12 | text-decoration: none; 13 | } 14 | 15 | .card-list { 16 | display: flex; 17 | padding: 3rem; 18 | overflow-x: scroll; 19 | } 20 | 21 | .card-list::-webkit-scrollbar { 22 | width: 10px; 23 | height: 10px; 24 | } 25 | .card-list::-webkit-scrollbar-thumb { 26 | background: #201c29; 27 | border-radius: 10px; 28 | box-shadow: inset 2px 2px 2px hsla(0,0%,100%,.25), inset -2px -2px 2px rgba(0,0,0,.25); 29 | } 30 | 31 | .card-list::-webkit-scrollbar-track { 32 | background: linear-gradient(90deg,#201c29,#201c29 1px,#17141d 0,#17141d); 33 | } 34 | 35 | 36 | .card { 37 | height: 350px; 38 | width: 400px; 39 | min-width: 250px; 40 | padding: 1.5rem; 41 | border-radius: 16px; 42 | background: #17141d; 43 | box-shadow: -1rem 0 3rem #000; 44 | display: flex; 45 | flex-direction: column; 46 | transition: .2s; 47 | margin: 0; 48 | scroll-snap-align: start; 49 | clear: both; 50 | position: relative; 51 | } 52 | 53 | .card:focus-within~.card, .card:hover~.card { 54 | transform: translateX(130px); 55 | } 56 | 57 | .card:hover { 58 | transform: translateY(-1rem); 59 | } 60 | 61 | .card:not(:first-child) { 62 | margin-left: -130px; 63 | } 64 | 65 | 66 | .card-header { 67 | margin-bottom: auto; 68 | } 69 | 70 | .card-header p { 71 | font-size: 14px; 72 | margin: 0 0 1rem; 73 | color: #7a7a8c; 74 | } 75 | 76 | .card-header h2 { 77 | font-size: 20px; 78 | margin: .25rem 0 auto; 79 | text-decoration: none; 80 | color: inherit; 81 | border: 0; 82 | display: inline-block; 83 | cursor: pointer; 84 | } 85 | 86 | .card-header h2:hover { 87 | background: linear-gradient(90deg,#ff8a00,#e52e71); 88 | text-shadow: none; 89 | -webkit-text-fill-color: transparent; 90 | -webkit-background-clip: text; 91 | background-clip: text; 92 | } 93 | 94 | .card-author { 95 | margin: 3rem 0 0; 96 | display: grid; 97 | grid-template-columns: 75px 1fr; 98 | align-items: center; 99 | position: relative; 100 | } 101 | 102 | .author-avatar { 103 | grid-area: auto; 104 | align-self: start; 105 | position: relative; 106 | box-sizing: border-box; 107 | } 108 | 109 | .author-avatar img { 110 | width: 40px; 111 | height: 40px; 112 | border-radius: 50%; 113 | filter: grayscale(100%); 114 | display: block; 115 | overflow: hidden; 116 | margin: 16px 10px; 117 | } 118 | 119 | .author-name { 120 | grid-area: auto; 121 | box-sizing: border-box; 122 | } 123 | 124 | .author-name-prefix { 125 | font-style: normal; 126 | font-weight: 700; 127 | color: #7a7a8c; 128 | } 129 | 130 | .half-circle { 131 | position: absolute; 132 | bottom: 0; 133 | left: 0; 134 | width: 60px; 135 | height: 48px; 136 | fill: none; 137 | stroke: #ff8a00; 138 | stroke-width: 8; 139 | stroke-linecap: round; 140 | pointer-events: none; 141 | } 142 | 143 | .tags { 144 | margin: 1rem 0 2rem; 145 | padding: .5rem 0 1rem; 146 | line-height: 2; 147 | margin-bottom: 0; 148 | } 149 | 150 | .tags a { 151 | font-style: normal; 152 | font-weight: 700; 153 | font-size: .5rem; 154 | color: #7a7a8c; 155 | text-transform: uppercase; 156 | font-size: .66rem; 157 | border: 3px solid #28242f; 158 | border-radius: 2rem; 159 | padding: .2rem .85rem .25rem; 160 | position: relative; 161 | } 162 | 163 | .tags a:hover { 164 | background: linear-gradient(90deg,#ff8a00,#e52e71); 165 | text-shadow: none; 166 | -webkit-text-fill-color: transparent; 167 | -webkit-background-clip: text; 168 | -webkit-box-decoration-break: clone; 169 | background-clip: text; 170 | border-color: white; 171 | } -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 |Sep 11th 2020
14 |Sep 11th 2020
42 |Sep 11th 2020
70 |Sep 11th 2020
95 |Sep 11th 2020
121 |Sep 11th 2020
146 |Sep 11th 2020
171 |