Skip to content
This repository was archived by the owner on Apr 7, 2025. It is now read-only.

Commit 6d3fb2f

Browse files
committed
fix: responsive + dark mode fixes for collections
1 parent 38c315b commit 6d3fb2f

File tree

5 files changed

+72
-19
lines changed

5 files changed

+72
-19
lines changed

src/components/HomepageCollection.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2937,7 +2937,7 @@ const Footer = () => {
29372937
<div className={styles.homepageCollection}>
29382938
<h4 className={styles.title}>Instrumentation projects</h4>
29392939
<p className={styles.description}>
2940-
Donec id elit non mi porta gravida at eget metus. Donec sed odio dui. <a href="#">Other highlighted projects</a>
2940+
Donec id elit non mi porta gravida at eget metus. Donec sed odio dui. <a href="/collections">Other highlighted projects</a>
29412941
</p>
29422942

29432943
<div className={`${styles.projectsContainer} ${projectsHovered && styles.projectsHovered}`} onMouseOver={() => {setProjectsHovered(true)}} onMouseOut={() => {setProjectsHovered(false)}}>

src/components/HomepageCollection.module.scss

+17-2
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,23 @@
162162

163163
:global(.dark-mode) {
164164
.homepage-collection:before {
165+
background: linear-gradient(0deg, rgba(0,0,0, 0) 23.26%, var(--color-neutrals-100));
166+
}
165167

166-
background: linear-gradient(0deg, rgba(0,0,0, .2) 23.26%, var(--color-neutrals-100));
167-
168+
.projects-container {
169+
170+
&:before,
171+
&:after {
172+
top: -10px;
173+
background-image: url('../images/home-collection-mask-dark.png');
174+
}
175+
176+
&:after {
177+
top: -15px;
178+
left: inherit;
179+
right: 0;
180+
transform: rotateY(180deg) translateY(-19px);
181+
filter: brightness(.97);
182+
}
168183
}
169184
}
14.8 KB
Loading

src/pages/collection.module.scss

+52-13
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,20 @@
9595
display: inline;
9696
}
9797

98-
.collection-listing:after {
99-
content: "";
100-
display: block;
101-
width: 150px;
102-
height: calc(100% + 25px);
103-
position: absolute;
104-
top: -1px;
105-
right: -9px;
106-
z-index: 1000;
107-
108-
109-
background: linear-gradient(270deg, #F4F5F5 34.6%, rgba(244, 245, 245, 0) 78.29%);
98+
.collection-listing {
99+
&:after {
100+
content: "";
101+
display: block;
102+
width: 150px;
103+
height: calc(100% + 25px);
104+
position: absolute;
105+
top: -1px;
106+
right: -9px;
107+
z-index: 1000;
108+
background: linear-gradient(270deg, var(--color-neutrals-100) 34.6%, rgba(244, 245, 245, 0) 78.29%);
109+
}
110110
}
111+
111112

112113
.page-heading {
113114
margin-bottom: 100px;
@@ -128,6 +129,12 @@
128129
}
129130
}
130131

132+
.collection-project-count {
133+
margin: 0 2px;
134+
padding: 0 2px;
135+
border-radius: 3px;
136+
}
137+
131138
// ==============================================================
132139
// Responsive styles
133140
// ==============================================================
@@ -137,7 +144,23 @@
137144
padding: 0 28px;
138145
}
139146

140-
// .collection-listing {}
147+
.collections-page {
148+
.collection-listing-header-section {
149+
flex-direction: column;
150+
align-items: center;
151+
}
152+
153+
.collection-listing-header-section-heading {
154+
display: block;
155+
text-align: center;
156+
}
157+
158+
.collection-listing-header-section-description {
159+
display: block;
160+
text-align: center;
161+
margin-bottom: 4px;
162+
}
163+
}
141164
}
142165

143166
@media screen and (max-width: 1024px) {
@@ -179,4 +202,20 @@
179202
.collection-listing-header-section-heading {
180203
margin-top: 20px;
181204
}
205+
206+
.collections-page .collection-listing:after {
207+
display: none;
208+
}
209+
210+
.collections-page div.collection-listing-container {
211+
margin-top: 40px;
212+
213+
&:before {
214+
transform: skewY(-2deg) translateY(-30px);
215+
}
216+
}
217+
218+
.collections-page .page-heading {
219+
margin-bottom: 0px;
220+
}
182221
}

src/pages/collections.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ const CollectionPage = ({ data }) => {
6868
Explore the open source repositories for New Relic agent technology
6969
</p>
7070
</div>
71-
<a href="#" className={styles.collectionsPageCollectionLink}>
72-
View all {collection[1].edges.length} projects
71+
<a href={collection[0]} className={styles.collectionsPageCollectionLink}>
72+
View all <span className={styles.collectionProjectCount}>{collection[1].edges.length}</span> projects
7373
<ChevronRight />
7474
</a>
7575
</header>
@@ -84,7 +84,6 @@ const CollectionPage = ({ data }) => {
8484
/>
8585
);
8686
}
87-
8887
})}
8988
</div>
9089
</div>

0 commit comments

Comments
 (0)