Skip to content

Commit e812102

Browse files
author
mmorito
committed
feat: personal sponsor
1 parent 88b1ed3 commit e812102

File tree

4 files changed

+81
-5
lines changed

4 files changed

+81
-5
lines changed

public/img/2025/avatar.png

11.8 KB
Loading

src/atoms/PersonalSponsorAvatar.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// @flow strict
2+
import React from 'react'
3+
4+
export type Props = {
5+
href: string,
6+
src: string,
7+
name: string,
8+
}
9+
10+
const personalSponsorStyle = {
11+
margin: '0.5%',
12+
textAlign: 'center',
13+
display: 'inline-block',
14+
}
15+
16+
const avatarStyle = {
17+
width: '80px',
18+
height: '80px',
19+
borderRadius: '50%',
20+
objectFit: 'cover',
21+
border: '2px solid #ddd',
22+
cursor: 'pointer',
23+
transition: 'transform 0.3s ease',
24+
}
25+
26+
export function PersonalSponsorAvatar({ name, href, src }: Props) {
27+
return (
28+
<div style={personalSponsorStyle}>
29+
<a href={href} target="_blank" rel="noopener noreferrer">
30+
<img
31+
src={src || '/img/2025/avatar.png'}
32+
alt={`${name} アバター`}
33+
style={avatarStyle}
34+
onMouseOver={(e) => { e.target.style.transform = 'scale(1.1)' }}
35+
onMouseOut={(e) => { e.target.style.transform = 'scale(1)' }}
36+
onFocus={(e) => { e.target.style.transform = 'scale(1.1)' }}
37+
onBlur={(e) => { e.target.style.transform = 'scale(1)' }}
38+
/>
39+
</a>
40+
</div>
41+
)
42+
}

src/organisms/2025/Sponsors.js

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Cell, Grid, Row } from '@material/react-layout-grid'
44
import { Headline2, Headline3 } from '@material/react-typography'
55

66
import { SponsorBanner as Banner } from '../../atoms/SponsorBanner'
7+
import { PersonalSponsorAvatar } from '../../atoms/PersonalSponsorAvatar'
78
import type { Props as SponsorProps } from '../../atoms/SponsorBanner'
89
import type { Sponsor as Resource } from '../../resources'
910

@@ -17,11 +18,13 @@ export function Sponsors({
1718
gold,
1819
silver,
1920
supporter,
21+
personal,
2022
}: {
2123
platinum: Resource[],
2224
gold: Resource[],
2325
silver: Resource[],
2426
supporter: Resource[],
27+
personal: Resource[],
2528
}) {
2629
return (
2730
<Grid>
@@ -43,7 +46,7 @@ export function Sponsors({
4346
<Headline3>Platinum</Headline3>
4447
</Cell>
4548
{platinum.map(sponsor => (
46-
<Cell columns={12} style={style}>
49+
<Cell columns={12} style={style} key={sponsor.key}>
4750
{Banner(toSponsor(sponsor))}
4851
</Cell>
4952
))}
@@ -53,7 +56,7 @@ export function Sponsors({
5356
</Cell>
5457
<Row>
5558
{gold.map(sponsor => (
56-
<Cell columns={6} desktopColumns={6} style={style}>
59+
<Cell columns={6} desktopColumns={6} style={style} key={sponsor.key}>
5760
{Banner(toSponsor(sponsor))}
5861
</Cell>
5962
))}
@@ -63,7 +66,7 @@ export function Sponsors({
6366
</Cell>
6467
<Row>
6568
{silver.map(sponsor => (
66-
<Cell columns={4} desktopColumns={3} style={style}>
69+
<Cell columns={4} desktopColumns={3} style={style} key={sponsor.key}>
6770
{Banner(toSponsor(sponsor))}
6871
</Cell>
6972
))}
@@ -73,11 +76,30 @@ export function Sponsors({
7376
</Cell>
7477
<Row>
7578
{supporter.map(sponsor => (
76-
<Cell columns={4} desktopColumns={3} style={style}>
79+
<Cell columns={4} desktopColumns={3} style={style} key={sponsor.key}>
7780
{Banner(toSponsor(sponsor))}
7881
</Cell>
7982
))}
8083
</Row>
84+
{personal.length > 0 && (
85+
<>
86+
<Cell>
87+
<Headline3>Personal Sponsors</Headline3>
88+
</Cell>
89+
<Row>
90+
<Cell columns={12} style={{ textAlign: 'left', padding: '20px' }}>
91+
{personal.map(sponsor => (
92+
<PersonalSponsorAvatar
93+
key={sponsor.key}
94+
name={sponsor.name}
95+
href={sponsor.url}
96+
src={sponsor.banner}
97+
/>
98+
))}
99+
</Cell>
100+
</Row>
101+
</>
102+
)}
81103
</Grid>
82104
)
83105
}

src/resources/2025/sponsors.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,21 @@ export const eventHandler = {
6666
height: 120,
6767
}
6868

69+
// 個人スポンサー
70+
// 森 将記さん
71+
export const mori_masaki = {
72+
name: '森 将記',
73+
key: 'mori_masaki',
74+
url: 'https://www.facebook.com/masakimori0314',
75+
banner: '',
76+
height: 80,
77+
}
78+
79+
6980
// スポンサーカテゴリ
7081
export const platinum: Sponsor[] = [subthread, smarthr]
7182
export const gold: Sponsor[] = [cybozu, pyconjp2025]
7283
export const silver: Sponsor[] = [nextvision]
7384
export const supporter: Sponsor[] = [eventHandler]
74-
export const sponsors = { platinum, gold, silver, supporter }
85+
export const personal: Sponsor[] = [mori_masaki]
86+
export const sponsors = { platinum, gold, silver, supporter, personal }

0 commit comments

Comments
 (0)