Skip to content

Commit 2b3b054

Browse files
committed
feat(multiplatform): refactor Hero icons structure and update image sources
- Migrate Hero icons from inline SVGs to static assets under `/public/images/multiplatform/hero` - Update `HeroBanner` component to reference new image paths - Refactor `hero.module.css` to use new CSS classes for platform-specific styles
1 parent f8ff05d commit 2b3b054

File tree

8 files changed

+43
-29
lines changed

8 files changed

+43
-29
lines changed

blocks/multiplatform/hero/hero.module.css

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,12 @@
2929
align-items: center;
3030

3131
padding-block: 72px 96px;
32-
33-
--hero-logo-image: '';
3432
}
3533

3634
.hero::before {
3735
display: block;
3836
content: '';
39-
background: var(--hero-logo-image) no-repeat center;
37+
background: url('/images/multiplatform/hero/logo.svg') no-repeat center;
4038

4139
height: 72px;
4240
width: 72px;
@@ -103,6 +101,26 @@
103101
@media (--ktl-ms-in) {
104102
padding-inline: 14px;
105103
}
104+
105+
&.android {
106+
--hero-item-src: url('/images/multiplatform/hero/android.svg');
107+
}
108+
109+
&.ios {
110+
--hero-item-src: url('/images/multiplatform/hero/ios.svg');
111+
}
112+
113+
&.web {
114+
--hero-item-src: url('/images/multiplatform/hero/web.svg');
115+
}
116+
117+
&.desktop {
118+
--hero-item-src: url('/images/multiplatform/hero/desktop.svg');
119+
}
120+
121+
&.server {
122+
--hero-item-src: url('/images/multiplatform/hero/server.svg');
123+
}
106124
}
107125

108126
.platform::before {

blocks/multiplatform/hero/index.tsx

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,32 @@ import { Button } from '@rescui/button';
55

66
import { useML } from '@jetbrains/kotlin-web-site-ui/out/components/breakpoints-v2';
77

8-
import android from './icons/android.svg';
9-
import ios from './icons/ios.svg';
10-
import web from './icons/web.svg';
11-
import desktop from './icons/desktop.svg';
12-
import server from './icons/server.svg';
13-
14-
import logo from './logo.svg';
15-
168
import styles from './hero.module.css';
179

18-
const platforms = [
19-
{ title: 'Android', icon: android },
20-
{ title: 'iOS', icon: ios },
21-
{ title: 'Web', icon: web },
22-
{ title: 'Desktop', icon: desktop },
23-
{ title: 'Server', icon: server }
24-
] as const;
10+
const platforms = ['Android', 'iOS', 'Web', 'Desktop', 'Server'] as const;
2511

2612
export function HeroBanner({ url }: { url: string }) {
2713
const isML = useML();
2814
const textCn = useTextStyles();
2915

3016
return (
3117
<div className={styles.wrapper}>
32-
<div className={cn(styles.hero, 'ktl-layout', 'ktl-layout--center')}
33-
style={{ '--hero-logo-image': `url(${logo.src})` }}>
18+
<div className={cn(styles.hero, 'ktl-layout', 'ktl-layout--center')}>
3419
<h1 className={cn(styles.title, textCn('rs-hero'))}>Kotlin Multiplatform</h1>
3520
<p className={cn(styles.subtitle, textCn('rs-subtitle-1'))}>
3621
Go&nbsp;cross&#8209;platform without compromising performance, UX, or&nbsp;code&nbsp;quality
3722
</p>
3823
<ul className={styles.platforms}>
39-
{platforms.map(({ title, icon }) => (
40-
<li
41-
key={title.toLowerCase()}
42-
className={cn(styles.platform, textCn(isML ? 'rs-h5' : 'rs-h4'))}
43-
style={{ '--hero-item-src': `url(${icon.src})` }}
44-
>
45-
{title}
46-
</li>
47-
))}
24+
{platforms.map(title => {
25+
const key = title.toLowerCase();
26+
27+
return (
28+
<li key={key}
29+
className={cn(styles.platform, styles[`${key}`], textCn(isML ? 'rs-h5' : 'rs-h4'))}>
30+
{title}
31+
</li>
32+
);
33+
})}
4834
</ul>
4935
<Button className={cn(styles.button)} mode={'rock'} href={url} size={isML ? 'm' : 'l'}>Get
5036
Started</Button>
File renamed without changes.
Lines changed: 10 additions & 0 deletions
Loading
File renamed without changes.

0 commit comments

Comments
 (0)