1
- import Image from 'next/image'
2
- import Link from 'next/link'
3
-
4
1
import docsIcon from '@/assets/docs-icon.png'
5
- import docsShare from '@/assets/docs.jpg '
2
+ import dreiIcon from '@/assets/drei-icon.svg '
6
3
import jotaiIcon from '@/assets/jotai-icon.png'
7
- import reactPostprocessingShare from '@/assets/react-postprocessing.jpg'
8
- import reactThreeA11yShare from '@/assets/react-three-a11y.jpg'
9
- import reactThreeFiberShare from '@/assets/react-three-fiber.jpg'
10
- import zustandIcon from '@/assets/zustand-icon.png'
11
- import zustandShare from '@/assets/zustand.jpg'
4
+ import r3fIcon from '@/assets/r3f-icon.svg'
5
+ import reactSpringIcon from '@/assets/react-spring-icon.svg'
6
+ import uiKitIcon from '@/assets/uikit-icon.svg'
7
+ import zustandIcon from '@/assets/zustand-icon.svg'
12
8
import Icon from '@/components/Icon'
13
9
import { svg } from '@/utils/icon'
14
10
import { Metadata } from 'next'
11
+ import Image from 'next/image'
12
+ import Link from 'next/link'
15
13
import { redirect } from 'next/navigation'
16
14
17
15
export interface Library {
@@ -36,21 +34,29 @@ const libs: Record<string, Library> = {
36
34
url : '/react-three-fiber' ,
37
35
github : 'https://github.com/pmndrs/react-three-fiber' ,
38
36
description : 'React-three-fiber is a React renderer for three.js' ,
39
- image : reactThreeFiberShare . src ,
40
37
docs : 'pmndrs/react-three-fiber/master/docs' ,
38
+ icon : r3fIcon . src ,
39
+ iconWidth : r3fIcon . width ,
40
+ iconHeight : r3fIcon . height ,
41
41
} ,
42
42
'react-spring' : {
43
43
title : 'React Spring' ,
44
44
url : 'https://react-spring.io' ,
45
45
github : 'https://github.com/pmndrs/react-spring' ,
46
46
description : 'Bring your components to life with simple spring animation primitives for React' ,
47
+ icon : reactSpringIcon . src ,
48
+ iconWidth : reactSpringIcon . width ,
49
+ iconHeight : reactSpringIcon . height ,
47
50
} ,
48
51
drei : {
49
52
title : 'Drei' ,
50
53
url : '/drei' ,
51
54
github : 'https://github.com/pmndrs/drei' ,
52
55
description :
53
56
'Drei is a growing collection of useful helpers and abstractions for react-three-fiber' ,
57
+ icon : dreiIcon . src ,
58
+ iconWidth : dreiIcon . width ,
59
+ iconHeight : dreiIcon . height ,
54
60
} ,
55
61
zustand : {
56
62
title : 'Zustand' ,
@@ -61,7 +67,6 @@ const libs: Record<string, Library> = {
61
67
icon : zustandIcon . src ,
62
68
iconWidth : zustandIcon . width ,
63
69
iconHeight : zustandIcon . height ,
64
- image : zustandShare . src ,
65
70
docs : 'pmndrs/zustand/main/docs' ,
66
71
} ,
67
72
jotai : {
@@ -85,22 +90,23 @@ const libs: Record<string, Library> = {
85
90
github : 'https://github.com/pmndrs/react-three-a11y' ,
86
91
description :
87
92
'@react-three/a11y brings accessibility to webGL with easy-to-use react-three-fiber components' ,
88
- image : reactThreeA11yShare . src ,
89
93
docs : 'pmndrs/react-three-a11y/main/docs' ,
90
94
} ,
91
95
'react-postprocessing' : {
92
96
title : 'React Postprocessing' ,
93
97
url : '/react-postprocessing' ,
94
98
github : 'https://github.com/pmndrs/react-postprocessing' ,
95
99
description : 'React Postprocessing is a postprocessing wrapper for @react-three/fiber' ,
96
- image : reactPostprocessingShare . src ,
97
100
docs : 'pmndrs/react-postprocessing/master/docs' ,
98
101
} ,
99
102
uikit : {
100
103
title : 'uikit' ,
101
104
url : '/uikit' ,
102
105
github : 'https://github.com/pmndrs/uikit' ,
103
106
description : 'uikit brings user interfaces to @react-three/fiber' ,
107
+ icon : uiKitIcon . src ,
108
+ iconWidth : uiKitIcon . width ,
109
+ iconHeight : uiKitIcon . height ,
104
110
docs : 'pmndrs/uikit/main/docs' ,
105
111
} ,
106
112
xr : {
@@ -115,7 +121,6 @@ const libs: Record<string, Library> = {
115
121
url : '/getting-started/introduction' ,
116
122
github : 'https://github.com/pmndrs/docs' ,
117
123
description : 'Documentation generator for `pmndrs/*`' ,
118
- image : docsShare . src ,
119
124
icon : docsIcon . src ,
120
125
iconWidth : docsIcon . width ,
121
126
iconHeight : docsIcon . height ,
@@ -165,13 +170,13 @@ export default function Page() {
165
170
{ Object . entries ( libs ) . map ( ( [ id , data ] ) => (
166
171
< div
167
172
key = { id }
168
- className = "bg-surface-container relative overflow-hidden rounded-md border border-outline-variant font-normal"
173
+ className = "group/card bg-surface-container relative overflow-hidden rounded-md border border-outline-variant font-normal"
169
174
>
170
175
< div className = "relative z-10 flex h-full flex-col justify-between" >
171
- < div className = "flex items-center justify-between px -6" >
176
+ < div className = "flex items-center justify-between gap-2 px-6 py -6" >
172
177
< div className = "max-w-md" >
173
- < div className = "pt-4 text-lg font-bold" > { data . title } </ div >
174
- < div className = "flex-grow pb-4 pr-4 pt-1 text-sm !leading-relaxed text-on-surface-variant/50" >
178
+ < div className = "text-lg font-bold" > { data . title } </ div >
179
+ < div className = "flex-grow text-sm !leading-relaxed text-on-surface-variant/50" >
175
180
{ data . description }
176
181
</ div >
177
182
</ div >
@@ -184,7 +189,7 @@ export default function Page() {
184
189
>
185
190
< Image
186
191
src = { data . icon }
187
- className = "absolute inset-0 h-full w-full object-contain"
192
+ className = "absolute inset-0 h-full w-full object-contain grayscale transition group-hover/card:grayscale-0 "
188
193
alt = { data . title }
189
194
aria-hidden
190
195
width = { data . iconWidth }
0 commit comments