|
1 |
| -/* |
2 |
| - * Check this site which seems to show what I want to do |
3 |
| - * https://blog.fullstackdigital.com/how-to-create-a-flawless-responsive-post-grid-with-flexbox-e5c7cc9d28e |
4 |
| - */ |
5 |
| - |
6 | 1 | .projects-board {
|
7 | 2 | display: flex;
|
8 | 3 | flex-wrap: wrap;
|
9 |
| - justify-content: space-between; |
| 4 | + justify-content: center; |
| 5 | + |
| 6 | + /* Overflow from the body to be as large as the page */ |
| 7 | + position: absolute; |
| 8 | + left: 0; |
| 9 | + right: 0; |
| 10 | + |
| 11 | + gap: 10px 10px; |
10 | 12 | }
|
11 | 13 |
|
12 | 14 | .project-card {
|
|
18 | 20 | padding-top: 10px;
|
19 | 21 | margin: 10px;
|
20 | 22 |
|
21 |
| - /* By default two cards by row */ |
22 |
| - /* Need a bit less of 50% because of the margin (I think) */ |
23 |
| - width: 47%; |
| 23 | + width: 400px; |
| 24 | + |
| 25 | + display: flex; |
| 26 | + flex-direction: column; |
24 | 27 | }
|
25 | 28 |
|
26 | 29 | /* On smaller screens 1 card by row */
|
|
31 | 34 | }
|
32 | 35 |
|
33 | 36 | /* On mouse-over, add a deeper shadow */
|
34 |
| -.project-card:hover { |
35 |
| - box-shadow: 0 8px 16px 0 rgba(0,0,0,0.5); |
36 |
| - padding-top: 0px; |
37 |
| -} |
38 |
| -/* Trying to use active because hover doesn't work on mobile */ |
| 37 | +/* Also using `active` because hover doesn't work on mobile */ |
| 38 | +.project-card:hover, |
39 | 39 | .project-card:active {
|
40 | 40 | box-shadow: 0 8px 16px 0 rgba(0,0,0,0.5);
|
41 | 41 | padding-top: 0px;
|
| 42 | + background: var(--nc-bg-2); |
42 | 43 | }
|
43 | 44 |
|
44 | 45 | /* On mouse-over, mark the name as clickable */
|
45 |
| -.project-card:hover div h3 { |
46 |
| - color: var(--nc-lk-2); |
47 |
| -} |
| 46 | +.project-card:hover div h3 , |
48 | 47 | .project-card:active div h3 {
|
49 | 48 | color: var(--nc-lk-2);
|
50 | 49 | }
|
51 | 50 |
|
52 | 51 | .project-img {
|
53 |
| - width: 80%; |
54 |
| - height: 250px; |
| 52 | + width: 90%; |
| 53 | + height: 350px; |
55 | 54 | transition: 0.3s;
|
56 | 55 | border-radius: 10px 10px 10px 10px;
|
57 | 56 | margin-bottom: auto;
|
58 | 57 | }
|
59 | 58 |
|
60 |
| -.project-card:hover .project-img { |
61 |
| - width: 100% |
62 |
| -} |
| 59 | +.project-card:hover .project-img, |
63 | 60 | .project-card:active .project-img {
|
64 |
| - width: 100% |
| 61 | + width: 100%; |
| 62 | + height: 360px; |
65 | 63 | }
|
66 | 64 |
|
67 | 65 | .text-overlay {
|
68 | 66 | padding: 2px 16px;
|
69 |
| - border-radius: 0 0 10px 10px; |
| 67 | + |
| 68 | + /* Make height 100% so that it spread until the bottom of the card |
| 69 | + * then use display flex and flex-grow: 50 on project-description so that |
| 70 | + * The code/demo/article links are aligned at the bottom of the cards |
| 71 | + */ |
| 72 | + height: 100%; |
| 73 | + display: flex; |
| 74 | + flex-direction: column; |
| 75 | +} |
| 76 | + |
| 77 | +.project-description { |
| 78 | + flex-grow: 50; |
70 | 79 | }
|
71 | 80 |
|
72 | 81 | h3.project-title {
|
|
0 commit comments