Skip to content

Commit fd5805b

Browse files
committed
docs(website): Make toolchain icons links to the tool descriptions
Change the toolchain icons to be links to the descriptions of the tools. While at it, also slightly improve the layout of the toolchain icons. Fixes #10552. Signed-off-by: Martin Nonnenmacher <[email protected]>
1 parent 6423c50 commit fd5805b

File tree

3 files changed

+57
-6
lines changed

3 files changed

+57
-6
lines changed

website/src/components/Features/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,11 @@ const FeatureList = [
193193
];
194194

195195
function Feature({Svg, title, link, command, description, reverse}) {
196+
// Create an ID based on the tool title for linking.
197+
const toolId = title.toLowerCase();
198+
196199
return (
197-
<div className={clsx(styles.feature, reverse && styles.featureReverse)}>
200+
<div id={toolId} className={clsx(styles.feature, reverse && styles.featureReverse)}>
198201
<div className={styles.featureSvgContainer}>
199202
<Link to={link}>
200203
<Svg className={styles.featureSvg} role="img" />

website/src/components/Toolchain/index.js

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,27 @@ import ReporterSvg from '@site/static/img/reporter.svg';
2828
import ScannerSvg from '@site/static/img/scanner.svg';
2929

3030
function Tool({title, Svg, description}) {
31+
const targetId = title.toLowerCase();
32+
33+
const handleClick = (e) => {
34+
e.preventDefault();
35+
36+
// Update the URL manually to support back button navigation.
37+
window.history.pushState(null, '', `#${targetId}`);
38+
39+
const element = document.getElementById(targetId);
40+
if (element) {
41+
element.scrollIntoView({ behavior: 'smooth', block: 'start' });
42+
}
43+
};
44+
3145
return (
3246
<div className={clsx(styles.tool, 'shadow--tl')}>
33-
<h3>{title}</h3>
34-
<Svg className={styles.toolSvg} role="img"/>
35-
<p>{description}</p>
47+
<a href={`#${targetId}`} onClick={handleClick} className={styles.toolLink}>
48+
<h3>{title}</h3>
49+
<Svg className={styles.toolSvg} role="img"/>
50+
<p>{description}</p>
51+
</a>
3652
</div>
3753
);
3854
}

website/src/components/Toolchain/styles.module.css

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
.tool {
3434
border: 2px solid var(--ifm-color-primary);
35-
border-radius: 8px;
35+
border-radius: 12px;
3636
padding: 0.5rem;
3737
text-align: center;
3838
margin: auto;
@@ -45,26 +45,59 @@
4545
justify-content: space-between;
4646
background: linear-gradient(to bottom, var(--ifm-color-primary-lightest), var(--ifm-color-primary));
4747
color: var(--ifm-hero-text-color);
48+
transition: all 0.3s ease;
49+
}
50+
51+
.tool:hover {
52+
transform: translateX(-2px) translateY(-4px);
53+
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
54+
border-color: var(--ifm-color-primary-darker);
55+
}
56+
57+
.toolLink {
58+
display: flex;
59+
flex-direction: column;
60+
justify-content: space-between;
61+
height: 100%;
62+
text-decoration: none;
63+
color: var(--ifm-hero-text-color);
64+
padding: 0.5rem;
65+
}
66+
67+
.toolLink:hover {
68+
color: var(--ifm-hero-text-color);
69+
text-decoration: none;
70+
}
71+
72+
.toolLink h3 {
73+
margin: 0;
74+
font-size: 1.2rem;
75+
font-weight: 600;
76+
color: var(--ifm-hero-text-color);
4877
}
4978

5079
.tool p {
5180
font-size: 0.8em;
5281
padding: 0;
5382
margin: 0;
83+
color: var(--ifm-hero-text-color);
84+
opacity: 0.9;
5485
}
5586

5687
.toolSvg {
5788
width: 4rem;
5889
height: 4rem;
5990
margin: auto;
6091
display: block;
92+
filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
6193
}
6294

6395
.arrow {
6496
font-size: 2rem;
6597
color: var(--ifm-color-primary);
6698
align-self: center;
6799
margin: 0;
100+
transition: color 0.3s ease;
68101
}
69102

70103
@media (max-width: 768px) {
@@ -80,4 +113,3 @@
80113
transform: rotate(90deg);
81114
}
82115
}
83-

0 commit comments

Comments
 (0)