Skip to content

Commit 5f99a0d

Browse files
authored
Merge branch 'master' into fix/meshmate-logo-responsive
2 parents 20983c9 + 1936b6d commit 5f99a0d

13 files changed

Lines changed: 96 additions & 83 deletions

File tree

‎content-learn/mastering-meshery/introduction-to-meshery/index.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ cardImage: '../../../src/assets/images/meshery/icon-only/meshery-logo-white.svg'
1111
meshesYouLearn:
1212
[
1313
{
14-
imagepath: "../../../src/assets/images/meshery/icon-only/meshery-logo.svg",
14+
imagepath: "../../../src/assets/images/meshery/icon-only/meshery-logo-light.svg",
1515
name: "Meshery",
1616
},
1717
]

‎src/sections/Company/WhoWeAre/whoweare.style.js‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const AboutSectionWrapper = styled.section`
2424
}
2525
h3 {
2626
margin: 1.7vw;
27-
pa
2827
}
2928
3029
.row {
@@ -43,7 +42,6 @@ const AboutSectionWrapper = styled.section`
4342
margin-block-end: 1em;
4443
margin-inline-start: 0px;
4544
margin-inline-end: 0px;
46-
}
4745
}
4846
.columnWrap {
4947
display: flex;
@@ -53,11 +51,15 @@ const AboutSectionWrapper = styled.section`
5351
5452
}
5553
.second-row{
54+
justify-content:center;
5655
margin:2rem 5rem;
5756
}
5857
.third-row{
5958
justify-content:center;
6059
margin:2rem 5rem;
60+
}
61+
.row, .second-row, .third-row {
62+
flex-wrap: wrap;
6163
}
6264
.item {
6365
height: 100%;
@@ -120,14 +122,10 @@ const AboutSectionWrapper = styled.section`
120122
}
121123
@media screen and (max-width:991px)
122124
{
123-
.row{
124-
margin:0rem;
125-
}
126-
.second-row{
127-
margin:0rem;
128-
}
129-
.third-row{
130-
margin:0rem;
125+
display: flex;
126+
flex-wrap: wrap;
127+
.row, .second-row, .third-row {
128+
display: contents;
131129
}
132130
.col{
133131
margin:1rem 0rem;

‎src/sections/General/Footer/footer.style.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ const FooterWrapper = styled.section`
8484
margin: 0 2.5rem 2rem 0;
8585
justify-content: flex-end;
8686
87-
span {
87+
label {
8888
display: block;
8989
color: #FFFFFF;
9090
}

‎src/sections/General/Footer/index.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ const Footer = ({ location }) => {
333333
action="https://calcotestudios.us15.list-manage.com/subscribe/post?u=6b50be5aea3dfe1fd4c041d80&id=6bb65defeb"
334334
>
335335
<div>
336-
<span>Subscribe to our Newsletter</span>
336+
<label htmlFor="mce-EMAIL-2">Subscribe to our Newsletter</label>
337337
<input
338338
className="inputrow subscribe-email"
339339
type="email"
@@ -349,7 +349,7 @@ const Footer = ({ location }) => {
349349
<Button
350350
$secondary
351351
title="Subscribe"
352-
aria-label="subscribe-us"
352+
aria-label="Subscribe"
353353
id="mc-embedded-subscribe-2"
354354
/>
355355
</div>

‎src/sections/Home/CloudNativeManagement/index.js‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,10 @@ const BannerDefault = () => {
8383
style={{ fontSize: "24px" }}
8484
/>
8585
}
86-
width="auto"
87-
height="100%"
88-
style={{ margin: "auto" }}
86+
width="100%"
87+
height="auto"
8988
className="vidHero"
90-
>
91-
</ReactPlayer>
89+
/>
9290
</Col>
9391
</Row>
9492
</div>

‎src/sections/Home/CloudNativeManagement/statement.style.js‎

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ const BannerSectionWrapper = styled.section`
2929
padding-right: 0px;
3030
flex: 0 0 49%;
3131
max-width: 49%;
32+
overflow: hidden;
33+
display: flex;
34+
align-items: center;
35+
justify-content: center;
3236
}
3337
h2.statement {
3438
color: ${props => props.theme.offWhiteColor};
@@ -83,18 +87,19 @@ const BannerSectionWrapper = styled.section`
8387
font-weight: 600;
8488
}
8589
.imgHero {
86-
margin: auto;
90+
display: block;
91+
width: 100%;
92+
max-width: 100%;
93+
height: auto;
8794
object-fit: cover;
88-
width: inherit;
8995
box-shadow: -0.25rem 0.25rem 1.25rem rgba(0, 0, 0, 0.25);
9096
border-top-left-radius: 0.5rem;
9197
border-bottom-left-radius: 0.5rem;
9298
}
9399
.vidHero {
100+
aspect-ratio: 16 / 9;
94101
object-fit: cover;
95102
position: relative;
96-
top: 50%;
97-
transform: translate(0, -50%);
98103
box-shadow: -0.25rem 0.25rem 1.25rem rgba(0, 0, 0, 0.25);
99104
}
100105
.section-title {
@@ -176,10 +181,6 @@ const BannerSectionWrapper = styled.section`
176181
flex: 0 0 100%;
177182
max-width: 100%;
178183
}
179-
.vidHero {
180-
height: 25rem !important;
181-
transform: translate(0, -52%);
182-
}
183184
.join-community {
184185
text-align: center;
185186
}

‎src/sections/Learn-Layer5/Course-Overview/courseoverview.style.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const CourseOverviewWrapper = styled.div`
1010
display: flex;
1111
align-items: center;
1212
text-decoration: none;
13-
color: black;
13+
color: ${props => props.theme.whiteToBlack};
1414
}
1515
h4 {
1616
line-height: 1.75rem;

‎src/sections/Learn-Layer5/Courses-List/courseslist.style.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const CoursesListWrapper = styled.div`
3131
svg {
3232
align-self: center;
3333
font-size: 1.5rem;
34-
color: rgb(177, 182, 184);
34+
color: ${props => props.theme.whiteToBlack};
3535
width: 100%;
3636
max-width: 1.5rem;
3737
}
@@ -43,7 +43,7 @@ export const CoursesListWrapper = styled.div`
4343
}
4444
&:hover {
4545
svg, h3 {
46-
color: #3C494F;
46+
color: ${props => props.theme.primaryColor};
4747
}
4848
}
4949
}

‎src/sections/Meshery/Meshery-integrations/Honeycomb/Honeycomb.js‎

Lines changed: 52 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useEffect, useRef, useState } from "react";
1+
import React, { useEffect, useLayoutEffect, useRef, useState } from "react";
22
import { HoneycombGrid } from "./Honeycomb.style";
33

44
// Hexagon (cell) size for each viewport band. Keeping the hexagons sized to
@@ -13,65 +13,75 @@ const hexSizeForWidth = (width) => {
1313
return 150;
1414
};
1515

16+
// useLayoutEffect is a no-op (with a warning) during Gatsby's server-side
17+
// render, so fall back to useEffect there and only measure in the browser.
18+
const useIsomorphicLayoutEffect =
19+
typeof window !== "undefined" ? useLayoutEffect : useEffect;
20+
21+
// The resize event fires continuously while the user drags a window border
22+
// or resizes on mobile. layoutHoneycomb measures every child via
23+
// getBoundingClientRect, so running it on every tick is expensive. Debounce
24+
// to a trailing call so layout only recomputes once resizing settles.
25+
const debounce = (fn, delay) => {
26+
let timer = null;
27+
return (...args) => {
28+
clearTimeout(timer);
29+
timer = setTimeout(() => fn(...args), delay);
30+
};
31+
};
32+
1633
const Honeycomb = (props) => {
1734
const { items, renderItem } = props;
1835
const [height, setHeight] = useState(0);
1936
const [hexSize, setHexSize] = useState(150);
2037
const gridRef = useRef(null);
2138

22-
const setHoneycombHeight = () => {
39+
const layoutHoneycomb = () => {
2340
const grid = gridRef.current;
24-
// Total horizontal available space for hexagons (offsetWidth includes
25-
// the ul horizontal padding, so subtract it to get the usable width).
26-
const availableWidth = grid ? grid.offsetWidth : window.innerWidth;
27-
let usableWidth = availableWidth;
28-
if (grid && typeof window !== "undefined" && window.getComputedStyle) {
29-
const computedStyle = window.getComputedStyle(grid);
30-
const paddingLeft = parseFloat(computedStyle.paddingLeft) || 0;
31-
const paddingRight = parseFloat(computedStyle.paddingRight) || 0;
32-
usableWidth = availableWidth - paddingLeft - paddingRight;
33-
}
41+
if (!grid) return;
3442

43+
// The ul width depends on the current hex size. Use the viewport width
44+
// that the breakpoints are defined for.
45+
const availableWidth = window.innerWidth;
3546
const W = hexSizeForWidth(availableWidth);
36-
// Horizontal pitch (hexagon width + left/right margins)
37-
const P = W + 6;
3847

39-
// No. of hexagons that can be adjusted in first and second row
40-
const firstRow = Math.max(1, Math.floor((usableWidth - (W / 2 + 25)) / P));
41-
const secondRow = Math.max(1, Math.floor((usableWidth - (W + 28)) / P));
42-
43-
// Vertical pitch per row: hexagon height + margin-top + margin-bottom
44-
const rowHeight = Math.round(W * 0.8662 + 6);
45-
// Height of a first+second row pair / of a single leftover row
46-
const pairHeight = 2 * rowHeight;
47-
const singleHeight = rowHeight - 6;
48+
if (!grid.children.length) {
49+
setHexSize(W);
50+
setHeight(0);
51+
return;
52+
}
4853

49-
// No. of first-second row pairs possible
50-
const pairsCount = Math.floor(items.length / (firstRow + secondRow));
54+
// Make sure the hexagons are sized for this viewport, then temporarily
55+
// grow the grid tall enough for every hexagon to wrap into place (the
56+
// shape-outside float pattern repeats indefinitely, so any sufficiently
57+
// tall value lays the rows out identically). Measuring the real content
58+
// afterwards and shrinking the grid to fit avoids leaving blank space
59+
// below the mesh whenever the row count is hard to predict analytically.
60+
grid.style.setProperty("--hex-size", `${W}px`);
61+
const upperBoundHeight = items.length * (W * 1.3) + W;
62+
grid.style.height = `${upperBoundHeight}px`;
5163

52-
let newHeight;
53-
if (pairsCount * (firstRow + secondRow) < items.length) {
54-
// Calculate left off hexagons
55-
const left = items.length - pairsCount * (firstRow + secondRow);
56-
newHeight =
57-
left <= firstRow
58-
? pairsCount * pairHeight + singleHeight
59-
: pairsCount * pairHeight + pairHeight;
60-
} else {
61-
// All hexagons are covered in n pairs of 2 rows (first row with a
62-
// hexagon and second row with b hexagons).
63-
newHeight = pairsCount * pairHeight;
64-
}
64+
const gridTop = grid.getBoundingClientRect().top;
65+
let maxBottom = 0;
66+
Array.from(grid.children).forEach((li) => {
67+
const bottom = li.getBoundingClientRect().bottom - gridTop;
68+
if (bottom > maxBottom) maxBottom = bottom;
69+
});
6570

66-
if (!isNaN(newHeight)) setHeight(newHeight);
71+
grid.style.height = "";
6772
setHexSize(W);
73+
setHeight(Math.ceil(maxBottom));
6874
};
6975

76+
useIsomorphicLayoutEffect(() => {
77+
layoutHoneycomb();
78+
}, [items]);
79+
7080
useEffect(() => {
71-
window.addEventListener("resize", setHoneycombHeight);
72-
setHoneycombHeight();
81+
const debouncedLayout = debounce(layoutHoneycomb, 150);
82+
window.addEventListener("resize", debouncedLayout);
7383
return () => {
74-
window.removeEventListener("resize", setHoneycombHeight);
84+
window.removeEventListener("resize", debouncedLayout);
7585
};
7686
}, [items]);
7787

‎src/sections/Meshery/Meshery-integrations/Honeycomb/Honeycomb.style.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ export const HoneycombGrid = styled.div`
55
66
display: flex;
77
text-align: left;
8+
margin: 0;
89
910
ul {
1011
font-size: 0;
1112
line-height: 0;
12-
height: ${(props) => (props.$height === 0 ? "unset" : `calc(${props.$height}px + var(--hex-size, 150px) * 0.31)`)};
13+
height: ${(props) => (props.$height === 0 ? "unset" : `${props.$height}px`)};
1314
1415
&:before {
1516
content: "";

0 commit comments

Comments
 (0)