Skip to content

Commit ca0f615

Browse files
committed
Added a rotating orgs thing
1 parent 5568d93 commit ca0f615

9 files changed

Lines changed: 1610 additions & 167 deletions

File tree

package-lock.json

Lines changed: 1478 additions & 143 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
"deploy": "gh-pages -d dist -b master"
1414
},
1515
"dependencies": {
16+
"@carbon/charts-react": "^1.27.2",
1617
"@carbon/icons-react": "^11.74.0",
1718
"@carbon/react": "^1.100.0",
1819
"gh-pages": "^6.3.0",
20+
"motion": "^12.34.0",
1921
"react": "^19.1.0",
2022
"react-dom": "^19.1.0",
2123
"react-router-dom": "^7.0.1"

src/assets/organizations.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[
2+
"https://github.com/lariat-app",
3+
"https://github.com/PreGuardAI",
4+
"https://github.com/wxWidgets"
5+
]

src/components/OrgGraph.jsx

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
import { Link, Tile } from '@carbon/react';
2+
import * as motion from "motion/react-client"
3+
4+
const AvatarLink = ({ href, size = 96, linkProps = {} }) => {
5+
const iconSrc = `${href}.png`;
6+
return (
7+
<Link
8+
href={href}
9+
target="_blank"
10+
rel="noopener noreferrer"
11+
aria-label={href}
12+
className="org-graph__avatar-link"
13+
style={{ display: 'inline-flex' }}
14+
{...linkProps}
15+
>
16+
<img
17+
src={iconSrc}
18+
alt=""
19+
width={size}
20+
height={size}
21+
style={{ borderRadius: '50%', boxShadow: '0 0 0 4px rgba(0,0,0,0.2)' }}
22+
/>
23+
</Link>
24+
);
25+
};
26+
27+
const ORBIT_RADIUS = 140;
28+
const ORBIT_DURATION = 24;
29+
30+
const OrbitingAvatar = ({ href, index, total }) => {
31+
const startAngle = (index / total) * 360;
32+
const avatarSize = 72;
33+
34+
return (
35+
// 1. Position the pivot at the exact center of the container
36+
<div
37+
style={{
38+
position: 'absolute',
39+
top: '50%',
40+
left: '50%',
41+
marginTop: 0,
42+
marginLeft: 0,
43+
width: 0,
44+
height: 0,
45+
}}
46+
>
47+
{/* 2. Rotate around the pivot (Motion only handles rotation here) */}
48+
<motion.div
49+
initial={{ rotate: startAngle }}
50+
animate={{ rotate: startAngle + 360 }}
51+
transition={{ repeat: Infinity, ease: 'linear', duration: ORBIT_DURATION }}
52+
>
53+
{/* 3. Push outward by orbit radius */}
54+
<div style={{ transform: `translateX(${ORBIT_RADIUS}px)` }}>
55+
{/* 4. Counter-rotate to keep avatar upright */}
56+
<motion.div
57+
initial={{ rotate: -startAngle }}
58+
animate={{ rotate: -(startAngle + 360) }}
59+
transition={{ repeat: Infinity, ease: 'linear', duration: ORBIT_DURATION }}
60+
>
61+
{/* 5. Offset by half the avatar size so its center sits on the orbit path */}
62+
<div style={{ marginLeft: -avatarSize / 2, marginTop: -avatarSize / 2 }}>
63+
<AvatarLink href={href} size={avatarSize} />
64+
</div>
65+
</motion.div>
66+
</div>
67+
</motion.div>
68+
</div>
69+
);
70+
};
71+
72+
const OrgGraph = ({ members = [] }) => (
73+
<Tile>
74+
<div
75+
style={{
76+
position: 'relative',
77+
width: '100%',
78+
maxWidth: 420,
79+
aspectRatio: '1 / 1',
80+
margin: '0 auto',
81+
display: 'flex',
82+
alignItems: 'center',
83+
justifyContent: 'center',
84+
}}
85+
>
86+
<AvatarLink href="https://github.com/maxtek6" size={112} />
87+
{members.map((member, index) => (
88+
<OrbitingAvatar key={member} href={member} index={index} total={members.length} />
89+
))}
90+
</div>
91+
</Tile>
92+
);
93+
94+
export default OrgGraph;

src/components/ProjectTile.jsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ function ProjectTile({ name, description, documentation }) {
2626
const projectLink = `https://github.com/maxtek6/${name}`;
2727
return (
2828
<Tile className='project-tile'>
29-
<Column span={4}>
3029
<Stack gap={3}>
3130
<Grid>
3231
<Column span={2}>
@@ -41,7 +40,6 @@ function ProjectTile({ name, description, documentation }) {
4140
</Grid>
4241
<LinkStack projectLink={projectLink} documentation={documentation} />
4342
</Stack>
44-
</Column>
4543
</Tile>
4644
)
4745
}

src/content/Contact.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function Contact() {
3434
xlg={6}
3535
max={6} // max width: full width (4-column grid)
3636
>
37-
<Stack>
37+
<Stack gap={3}>
3838
<h3>How can we help you?</h3>
3939
<p>Whether you are an open source developer looking for guidance, or a business seeking consulting services, we're here to assist you. We offer expertise in the following areas:</p>
4040
<UnorderedList>

src/content/Home.jsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
import { Column, Content, Grid } from '@carbon/react';
1+
import { Column, Grid, Stack, Tile } from '@carbon/react';
2+
import OrgGraph from '../components/OrgGraph';
3+
4+
import organizations from '../assets/organizations.json';
25

36
function Home() {
47
return (
58
<Grid>
6-
<Column
7-
sm={4} // mobile: full width (4-column grid)
8-
md={4} // tablet: full width
9-
lg={6} // desktop: half width (2 columns total)
10-
>
11-
<h3>Maxtek</h3>
9+
<Column sm={0} md={1} lg={2} xlg={2} max={2} />
10+
<Column sm={4} md={4} lg={6} xlg={6} max={6}>
11+
<OrgGraph members={organizations} />
1212
</Column>
13-
<Column
14-
sm={4} // mobile: full width (4-column grid)
15-
md={4} // tablet: full width
16-
lg={6} // desktop: half width (2 columns total)
17-
>
18-
<h3>Consulting</h3>
13+
<Column sm={4} md={4} lg={6} xlg={6} max={6}>
14+
<Stack gap={3}>
15+
<h3>Maxtek Consulting</h3>
16+
<p>US-based consulting firm specializing in open source software.</p>
17+
</Stack>
1918
</Column>
19+
<Column sm={0} md={1} lg={2} xlg={2} max={2} />
2020
</Grid>
2121
);
2222
}

src/content/Projects.jsx

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,26 @@ import projects from '../assets/projects.json';
22
import ProjectTile from '../components/ProjectTile';
33
import { Column, Grid } from '@carbon/react';
44

5+
function ProjectColumn({ children }) {
6+
return (
7+
<Column span={4} style={{ marginLeft: -1, marginTop: -1, marginRight: 0, paddingLeft: 0, paddingRight: 0 }}>
8+
{children}
9+
</Column>
10+
)
11+
}
12+
513
function Projects() {
614
return (
7-
<Grid>
15+
<Grid condensed>
816
<Column sm={0} md={2} lg={2} xlg={2} max={2} />
917
<Column sm={4} md={4} lg={12} xlg={12} max={12}>
10-
<Grid sm={4} md={4} lg={12} xlg={12} max={12}>
11-
{projects.map(({ name, description, documentation }) => (
12-
<ProjectTile name={name} description={description} documentation={documentation} />
13-
))}
14-
</Grid>
18+
<Grid condensed>
19+
{projects.map(({ name, description, documentation }) => (
20+
<ProjectColumn>
21+
<ProjectTile name={name} description={description} documentation={documentation} />
22+
</ProjectColumn>
23+
))}
24+
</Grid>
1525
</Column>
1626
<Column sm={0} md={2} lg={2} xlg={2} max={2} />
1727
</Grid >

src/index.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,5 @@
88

99
.project-tile {
1010
min-height: 144px;
11-
margin-bottom: $spacing-01;
12-
//border: 1px solid theme.$border-strong-01;
11+
border: 1px solid theme.$border-strong-01;
1312
}

0 commit comments

Comments
 (0)