idea-react 2.0.0-rc.2 → 2.0.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ReadMe.md +18 -14
- package/dist/index.css +2 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +60 -51
- package/source/CodeBlock.tsx +1 -1
- package/source/EditorHTML.tsx +1 -1
- package/source/HorizontalMarquee/index.module.less +52 -0
- package/source/HorizontalMarquee/index.tsx +65 -0
- package/source/Icon.tsx +1 -1
- package/source/ShareBox.tsx +1 -1
- package/source/TypeEcho.tsx +1 -1
- package/source/UserRank/Address.tsx +20 -0
- package/source/UserRank/index.module.less +227 -0
- package/source/UserRank/index.tsx +120 -0
- package/source/VerticalMarquee/index.module.less +43 -0
- package/source/VerticalMarquee/index.tsx +26 -0
- package/source/index.ts +3 -0
- package/dist/index.js.map +0 -1
package/source/CodeBlock.tsx
CHANGED
package/source/EditorHTML.tsx
CHANGED
|
@@ -16,7 +16,7 @@ export const EditorHTML: FC<EditorHTMLProps> = ({ className, data }) => {
|
|
|
16
16
|
const __html = parser.parse(data).join('');
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
|
-
<article
|
|
19
|
+
<article dangerouslySetInnerHTML={{ __html }} className={className} />
|
|
20
20
|
);
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
@keyframes scrollItem {
|
|
2
|
+
0%,
|
|
3
|
+
10% {
|
|
4
|
+
transform: translateX(0);
|
|
5
|
+
}
|
|
6
|
+
90%,
|
|
7
|
+
100% {
|
|
8
|
+
transform: translateX(-100%);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
@keyframes scrollWrap {
|
|
12
|
+
0%,
|
|
13
|
+
10% {
|
|
14
|
+
transform: translateX(0);
|
|
15
|
+
}
|
|
16
|
+
90%,
|
|
17
|
+
100% {
|
|
18
|
+
transform: translateX(100%);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.scrollWrap {
|
|
23
|
+
animation: scrollWrap linear 4s alternate infinite;
|
|
24
|
+
.scrollItem {
|
|
25
|
+
animation: scrollItem linear 4s alternate infinite;
|
|
26
|
+
}
|
|
27
|
+
&:hover {
|
|
28
|
+
animation-play-state: paused;
|
|
29
|
+
.scrollItem {
|
|
30
|
+
animation-play-state: paused;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.scrollHeightWrap {
|
|
36
|
+
--scroll-height: 20px;
|
|
37
|
+
height: var(--scroll-height);
|
|
38
|
+
.scrollContainer {
|
|
39
|
+
transform: translateY(
|
|
40
|
+
calc(calc(-100% + var(--scroll-height) + var(--scroll-height)) * 2)
|
|
41
|
+
);
|
|
42
|
+
max-height: calc(var(--scroll-height) * 3);
|
|
43
|
+
.unScrollItem {
|
|
44
|
+
max-height: calc(var(--scroll-height) * 2);
|
|
45
|
+
line-height: var(--scroll-height);
|
|
46
|
+
}
|
|
47
|
+
.scrollItem {
|
|
48
|
+
height: var(--scroll-height);
|
|
49
|
+
line-height: var(--scroll-height);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
import * as style from './index.module.less';
|
|
4
|
+
|
|
5
|
+
export type HorizontalMarqueeProps = HTMLAttributes<HTMLDivElement> &
|
|
6
|
+
Partial<Record<'maxWidth' | 'duration' | 'height', string>>;
|
|
7
|
+
|
|
8
|
+
export const HorizontalMarquee: FC<HorizontalMarqueeProps> = ({
|
|
9
|
+
className = '',
|
|
10
|
+
children,
|
|
11
|
+
maxWidth = '100%',
|
|
12
|
+
duration,
|
|
13
|
+
height,
|
|
14
|
+
...props
|
|
15
|
+
}) => (
|
|
16
|
+
<div className={`overflow-hidden mw-100 ${className}`} {...props}>
|
|
17
|
+
<div
|
|
18
|
+
className={`d-inline-block align-top text-nowrap ${style.scrollWrap}`}
|
|
19
|
+
style={{
|
|
20
|
+
maxWidth,
|
|
21
|
+
animationDuration: duration,
|
|
22
|
+
height,
|
|
23
|
+
lineHeight: height
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
<div
|
|
27
|
+
className={`d-inline-block ${style.scrollItem}`}
|
|
28
|
+
style={{ animationDuration: duration }}
|
|
29
|
+
>
|
|
30
|
+
{children}
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const HorizontalMarqueeBox: FC<HorizontalMarqueeProps> = ({
|
|
37
|
+
children,
|
|
38
|
+
maxWidth,
|
|
39
|
+
duration,
|
|
40
|
+
height
|
|
41
|
+
}) =>
|
|
42
|
+
height ? (
|
|
43
|
+
<div
|
|
44
|
+
className={`overflow-hidden ${style.scrollHeightWrap}`}
|
|
45
|
+
// @ts-expect-error remove after React 19 released
|
|
46
|
+
style={{ maxWidth: maxWidth, '--scroll-height': height }}
|
|
47
|
+
>
|
|
48
|
+
<div
|
|
49
|
+
className={`d-inline-block overflow-hidden mw-100 ${style.scrollContainer}`}
|
|
50
|
+
>
|
|
51
|
+
<div
|
|
52
|
+
className={`d-block overflow-hidden text-wrap text-break ${style.unScrollItem}`}
|
|
53
|
+
>
|
|
54
|
+
{children}
|
|
55
|
+
</div>
|
|
56
|
+
<HorizontalMarquee duration={duration}>
|
|
57
|
+
{children}
|
|
58
|
+
</HorizontalMarquee>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
) : (
|
|
62
|
+
<HorizontalMarquee {...{ maxWidth, duration, height }}>
|
|
63
|
+
{children}
|
|
64
|
+
</HorizontalMarquee>
|
|
65
|
+
);
|
package/source/Icon.tsx
CHANGED
package/source/ShareBox.tsx
CHANGED
package/source/TypeEcho.tsx
CHANGED
|
@@ -38,7 +38,7 @@ export class TypeEcho extends PureComponent<TypeEchoProps> {
|
|
|
38
38
|
{ echoed } = this;
|
|
39
39
|
|
|
40
40
|
return (
|
|
41
|
-
<pre className={classNames('text-wrap', className)}
|
|
41
|
+
<pre ref={this.init} className={classNames('text-wrap', className)}>
|
|
42
42
|
{echoed + (echoed === text ? '' : '_')}
|
|
43
43
|
</pre>
|
|
44
44
|
);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
import { Icon } from '../Icon';
|
|
4
|
+
|
|
5
|
+
export type UserAddressProps = Partial<Record<'email' | 'website', string>>;
|
|
6
|
+
|
|
7
|
+
export const UserAddress: FC<UserAddressProps> = ({ email, website }) => (
|
|
8
|
+
<address className="mb-0 d-flex justify-content-around gap-2">
|
|
9
|
+
{email && (
|
|
10
|
+
<a rel="noreferrer" target="_blank" href={'mailto:' + email}>
|
|
11
|
+
<Icon name="envelope" />
|
|
12
|
+
</a>
|
|
13
|
+
)}
|
|
14
|
+
{website && (
|
|
15
|
+
<a rel="noreferrer" target="_blank" href={website}>
|
|
16
|
+
<Icon name="globe2" />
|
|
17
|
+
</a>
|
|
18
|
+
)}
|
|
19
|
+
</address>
|
|
20
|
+
);
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
@keyframes suspension {
|
|
2
|
+
0% {
|
|
3
|
+
position: relative;
|
|
4
|
+
top: 0px;
|
|
5
|
+
}
|
|
6
|
+
50% {
|
|
7
|
+
position: relative;
|
|
8
|
+
top: -0.8rem;
|
|
9
|
+
}
|
|
10
|
+
100% {
|
|
11
|
+
position: relative;
|
|
12
|
+
top: 0px;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.rankBox {
|
|
17
|
+
--logo-image: url('https://github.com/idea2app.png');
|
|
18
|
+
--title-background-image: url('https://hackathon-api.static.kaiyuanshe.cn/6342619375fa1817e0f56ce1/2022/10/09/rrrr.png');
|
|
19
|
+
a {
|
|
20
|
+
color: inherit;
|
|
21
|
+
text-decoration: none;
|
|
22
|
+
}
|
|
23
|
+
.image {
|
|
24
|
+
width: 2.1rem;
|
|
25
|
+
&:hover img {
|
|
26
|
+
transform: scale(1.1);
|
|
27
|
+
transition: all 0.3s;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
.title {
|
|
31
|
+
position: relative;
|
|
32
|
+
z-index: 4;
|
|
33
|
+
margin-top: 1.5rem;
|
|
34
|
+
background-image: var(--title-background-image);
|
|
35
|
+
background-size: 21rem auto;
|
|
36
|
+
background-attachment: fixed;
|
|
37
|
+
padding-top: 1.2rem;
|
|
38
|
+
height: 4.8rem;
|
|
39
|
+
&::before {
|
|
40
|
+
display: block;
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 0;
|
|
43
|
+
left: 0;
|
|
44
|
+
border-radius: 0.3rem;
|
|
45
|
+
background-color: rgba(161, 160, 152, 0.7);
|
|
46
|
+
width: 100%;
|
|
47
|
+
height: 100%;
|
|
48
|
+
content: '';
|
|
49
|
+
}
|
|
50
|
+
.medal {
|
|
51
|
+
position: absolute;
|
|
52
|
+
top: -1.2rem;
|
|
53
|
+
left: 5%;
|
|
54
|
+
i {
|
|
55
|
+
box-shadow: 0 0 0.5rem 0 #ffd83a;
|
|
56
|
+
border: 0.1rem solid #ffd83a;
|
|
57
|
+
background-image: var(--logo-image),
|
|
58
|
+
linear-gradient(#ffd83a, #fdeba0);
|
|
59
|
+
background-position: center;
|
|
60
|
+
background-size: 1.5rem 1.5rem;
|
|
61
|
+
background-repeat: no-repeat;
|
|
62
|
+
background-blend-mode: lighten;
|
|
63
|
+
width: 1.7rem;
|
|
64
|
+
height: 1.7rem;
|
|
65
|
+
&:first-child {
|
|
66
|
+
box-shadow: 0 0 0.5rem 0 #d8d8d8;
|
|
67
|
+
border-color: #d8d8d8;
|
|
68
|
+
background-image: var(--logo-image),
|
|
69
|
+
linear-gradient(#d8d8d8, #eeeeee);
|
|
70
|
+
}
|
|
71
|
+
&:last-child {
|
|
72
|
+
box-shadow: 0 0 0.5rem 0 #fab36e;
|
|
73
|
+
border-color: #fab36e;
|
|
74
|
+
background-image: var(--logo-image),
|
|
75
|
+
linear-gradient(#fab36e, #fbe7d3);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
h3 {
|
|
80
|
+
position: relative;
|
|
81
|
+
z-index: 2;
|
|
82
|
+
cursor: default;
|
|
83
|
+
width: 10rem;
|
|
84
|
+
color: transparent;
|
|
85
|
+
font-size: 2rem;
|
|
86
|
+
font-family: "'book antiqua', palatino, serif";
|
|
87
|
+
letter-spacing: 0.4rem;
|
|
88
|
+
text-shadow:
|
|
89
|
+
0px 1px 0px #c0c0c0,
|
|
90
|
+
0px 2px 0px #b0b0b0,
|
|
91
|
+
0px 3px 0px #a0a0a0,
|
|
92
|
+
0px 4px 0px #909090,
|
|
93
|
+
0px 5px 10px rgba(0, 0, 0, 0.6);
|
|
94
|
+
&::after {
|
|
95
|
+
display: block;
|
|
96
|
+
position: absolute;
|
|
97
|
+
top: 0;
|
|
98
|
+
left: 0;
|
|
99
|
+
z-index: 1;
|
|
100
|
+
margin: 0 auto;
|
|
101
|
+
background-image: linear-gradient(
|
|
102
|
+
to right,
|
|
103
|
+
#d8d8d8 10%,
|
|
104
|
+
#ffd83a 60%,
|
|
105
|
+
#fab36e 75%
|
|
106
|
+
);
|
|
107
|
+
background-clip: text;
|
|
108
|
+
width: 10rem;
|
|
109
|
+
content: attr(data-text);
|
|
110
|
+
text-shadow: none;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
.topUsers {
|
|
115
|
+
z-index: 5;
|
|
116
|
+
li {
|
|
117
|
+
cursor: default;
|
|
118
|
+
text-align: center;
|
|
119
|
+
.topUser {
|
|
120
|
+
z-index: 3;
|
|
121
|
+
min-height: 6rem;
|
|
122
|
+
letter-spacing: 1px;
|
|
123
|
+
}
|
|
124
|
+
.image {
|
|
125
|
+
z-index: 2;
|
|
126
|
+
animation: 3.5s suspension ease-in-out infinite;
|
|
127
|
+
transition: all 0.6s;
|
|
128
|
+
}
|
|
129
|
+
&:nth-child(1) {
|
|
130
|
+
order: 2;
|
|
131
|
+
padding-top: 0.3rem;
|
|
132
|
+
.topUser {
|
|
133
|
+
border-bottom: 1.5rem solid #ffd83a;
|
|
134
|
+
color: #ffd83a;
|
|
135
|
+
text-shadow:
|
|
136
|
+
0px 1px 0px #969653,
|
|
137
|
+
0px 2px 5px rgba(240, 219, 100, 0.4);
|
|
138
|
+
i {
|
|
139
|
+
background-image: var(--logo-image),
|
|
140
|
+
linear-gradient(#ffd83a, #fdeba0);
|
|
141
|
+
background-position: center;
|
|
142
|
+
background-size: 2.5rem auto;
|
|
143
|
+
background-repeat: no-repeat;
|
|
144
|
+
background-blend-mode: lighten;
|
|
145
|
+
width: 2.5rem;
|
|
146
|
+
height: 2.6rem;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
.image {
|
|
150
|
+
animation-delay: 3.5s;
|
|
151
|
+
width: 6.4rem;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
&:nth-child(2) {
|
|
155
|
+
order: 1;
|
|
156
|
+
padding-top: 1rem;
|
|
157
|
+
.topUser {
|
|
158
|
+
border-bottom: 1.2rem solid #d8d8d8;
|
|
159
|
+
color: #d8d8d8;
|
|
160
|
+
text-shadow: 0px 1px 0px #d9cdcd 0px 2px 5px
|
|
161
|
+
rgba(133, 132, 130, 0.4);
|
|
162
|
+
i {
|
|
163
|
+
background-image: var(--logo-image),
|
|
164
|
+
linear-gradient(#d8d8d8, #eeeeee);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
.image {
|
|
168
|
+
animation-delay: 1.4s;
|
|
169
|
+
width: 6rem;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
&:nth-child(3) {
|
|
173
|
+
order: 3;
|
|
174
|
+
padding-top: 1.5rem;
|
|
175
|
+
.topUser {
|
|
176
|
+
border-bottom: 1rem solid #fab36e;
|
|
177
|
+
color: #fab36e;
|
|
178
|
+
text-shadow:
|
|
179
|
+
0px 1px 0px #aa8865,
|
|
180
|
+
0px 2px 5px rgba(167, 129, 67, 0.4);
|
|
181
|
+
i {
|
|
182
|
+
background-image: var(--logo-image),
|
|
183
|
+
linear-gradient(#fab36e, #fbe7d3);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
.image {
|
|
187
|
+
animation-delay: 2.4s;
|
|
188
|
+
width: 5.6rem;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
&:hover .image {
|
|
192
|
+
animation-play-state: paused;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
.restUsers {
|
|
197
|
+
tr {
|
|
198
|
+
&::before {
|
|
199
|
+
display: block;
|
|
200
|
+
position: absolute;
|
|
201
|
+
right: 0;
|
|
202
|
+
bottom: 0;
|
|
203
|
+
transition: all 0.5s;
|
|
204
|
+
background: #9fc2ef;
|
|
205
|
+
width: 0;
|
|
206
|
+
height: 2px;
|
|
207
|
+
content: '';
|
|
208
|
+
}
|
|
209
|
+
&:hover::before {
|
|
210
|
+
left: 0;
|
|
211
|
+
width: 100%;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
td {
|
|
215
|
+
cursor: default;
|
|
216
|
+
background-color: transparent;
|
|
217
|
+
.name {
|
|
218
|
+
font-size: 0;
|
|
219
|
+
&:hover {
|
|
220
|
+
.image > img {
|
|
221
|
+
transform: scale(1.2);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { PureComponent } from 'react';
|
|
2
|
+
import { Badge, Col, Image, Row, RowProps, Table } from 'react-bootstrap';
|
|
3
|
+
|
|
4
|
+
import { UserAddress, UserAddressProps } from './Address';
|
|
5
|
+
import * as style from './index.module.less';
|
|
6
|
+
|
|
7
|
+
export interface UserRank extends UserAddressProps {
|
|
8
|
+
id: number | string;
|
|
9
|
+
name: string;
|
|
10
|
+
avatar?: string;
|
|
11
|
+
score: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface UserRankViewProps extends RowProps {
|
|
15
|
+
title: string;
|
|
16
|
+
rank: UserRank[];
|
|
17
|
+
linkOf?: (user: UserRank) => string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class UserRankView extends PureComponent<UserRankViewProps> {
|
|
21
|
+
renderMedal = (user: UserRank) => (
|
|
22
|
+
<Col key={user.id} as="li">
|
|
23
|
+
<div
|
|
24
|
+
className={`shadow-lg overflow-hidden rounded-circle m-auto ${style.image}`}
|
|
25
|
+
>
|
|
26
|
+
<Image src={user.avatar} alt={user.name} loading="lazy" fluid />
|
|
27
|
+
</div>
|
|
28
|
+
<div
|
|
29
|
+
className={`position-relative overflow-hidden ${style.topUser}`}
|
|
30
|
+
>
|
|
31
|
+
<div className="position-relative">
|
|
32
|
+
<i className="d-block overflow-hidden m-auto mb-1 rounded-circle" />
|
|
33
|
+
<a
|
|
34
|
+
className="d-block mb-0 stretched-link"
|
|
35
|
+
href={this.props.linkOf?.(user) || '#'}
|
|
36
|
+
>
|
|
37
|
+
{user.name}
|
|
38
|
+
</a>
|
|
39
|
+
<strong>{user.score}</strong>
|
|
40
|
+
</div>
|
|
41
|
+
<UserAddress {...user} />
|
|
42
|
+
</div>
|
|
43
|
+
</Col>
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
renderRow = (user: UserRank, index: number, { length }: UserRank[]) => (
|
|
47
|
+
<tr key={user.id} className="position-relative">
|
|
48
|
+
<td className="align-middle">
|
|
49
|
+
<Badge className="fw-bold fst-italic">
|
|
50
|
+
{(index + 4 + '').padStart((length + '').length, '0')}
|
|
51
|
+
</Badge>
|
|
52
|
+
</td>
|
|
53
|
+
<td
|
|
54
|
+
className={`position-relative mw-50 text-truncate ${style.name}`}
|
|
55
|
+
>
|
|
56
|
+
<div
|
|
57
|
+
className={`d-inline-block overflow-hidden align-middle rounded-circle ${style.image}`}
|
|
58
|
+
>
|
|
59
|
+
<Image
|
|
60
|
+
src={user.avatar}
|
|
61
|
+
alt={user.name}
|
|
62
|
+
loading="lazy"
|
|
63
|
+
fluid
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
<a
|
|
67
|
+
className="ms-2 d-inline-block align-middle stretched-link"
|
|
68
|
+
style={{
|
|
69
|
+
color: `rgb(248, ${(index + 2) * 15}, ${(index + 2) * 35})`
|
|
70
|
+
}}
|
|
71
|
+
href={this.props.linkOf?.(user) || '#'}
|
|
72
|
+
>
|
|
73
|
+
{user.name}
|
|
74
|
+
</a>
|
|
75
|
+
</td>
|
|
76
|
+
<td className="align-middle">{user.score}</td>
|
|
77
|
+
<td className="align-middle">
|
|
78
|
+
<UserAddress {...user} />
|
|
79
|
+
</td>
|
|
80
|
+
</tr>
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
render() {
|
|
84
|
+
const { className = '', title, rank = [], ...props } = this.props;
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<Row className={`${style.rankBox} ${className}`} {...props}>
|
|
88
|
+
<Col sm={12} xs={12} lg={7}>
|
|
89
|
+
<div className={`shadow rounded-3 ${style.title}`}>
|
|
90
|
+
<div className={style.medal}>
|
|
91
|
+
<i className="d-inline-block ms-1 overflow-hidden rounded-circle" />
|
|
92
|
+
<i className="d-inline-block ms-1 overflow-hidden rounded-circle" />
|
|
93
|
+
<i className="d-inline-block ms-1 overflow-hidden rounded-circle" />
|
|
94
|
+
</div>
|
|
95
|
+
<h3
|
|
96
|
+
data-text={title}
|
|
97
|
+
className="position-relative m-auto mb-0 fw-bold text-center"
|
|
98
|
+
>
|
|
99
|
+
{title}
|
|
100
|
+
</h3>
|
|
101
|
+
</div>
|
|
102
|
+
<Row
|
|
103
|
+
as="ul"
|
|
104
|
+
className={`mt-2 g-0 align-items-end text-center ps-0 pt-2 list-unstyled ${style.topUsers}`}
|
|
105
|
+
>
|
|
106
|
+
{rank.slice(0, 3).map(this.renderMedal)}
|
|
107
|
+
</Row>
|
|
108
|
+
</Col>
|
|
109
|
+
<Col xs={12} sm={12} lg={5}>
|
|
110
|
+
<Table
|
|
111
|
+
className={`my-3 pt-2 ${style.restUsers}`}
|
|
112
|
+
responsive
|
|
113
|
+
>
|
|
114
|
+
<tbody>{rank.slice(3, 10).map(this.renderRow)}</tbody>
|
|
115
|
+
</Table>
|
|
116
|
+
</Col>
|
|
117
|
+
</Row>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
@keyframes scrollItem {
|
|
2
|
+
0%,
|
|
3
|
+
10% {
|
|
4
|
+
transform: translateY(0);
|
|
5
|
+
}
|
|
6
|
+
90%,
|
|
7
|
+
100% {
|
|
8
|
+
transform: translateY(-100%);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
@keyframes scrollWrap {
|
|
12
|
+
0%,
|
|
13
|
+
10% {
|
|
14
|
+
transform: translateY(0);
|
|
15
|
+
}
|
|
16
|
+
90%,
|
|
17
|
+
100% {
|
|
18
|
+
transform: translateY(100%);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.scrollWrap {
|
|
23
|
+
--duration: 10s;
|
|
24
|
+
animation: scrollWrap;
|
|
25
|
+
animation-duration: var(--duration);
|
|
26
|
+
animation-timing-function: linear;
|
|
27
|
+
animation-iteration-count: infinite;
|
|
28
|
+
animation-direction: alternate;
|
|
29
|
+
font-size: 0;
|
|
30
|
+
&:hover {
|
|
31
|
+
animation-play-state: paused;
|
|
32
|
+
.scrollItem {
|
|
33
|
+
animation-play-state: paused;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
.scrollItem {
|
|
37
|
+
animation: scrollItem;
|
|
38
|
+
animation-duration: var(--duration);
|
|
39
|
+
animation-timing-function: linear;
|
|
40
|
+
animation-iteration-count: infinite;
|
|
41
|
+
animation-direction: alternate;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
|
|
3
|
+
import * as style from './index.module.less';
|
|
4
|
+
|
|
5
|
+
export interface VerticalMarqueeProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
duration?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const VerticalMarquee: FC<VerticalMarqueeProps> = ({
|
|
10
|
+
className = '',
|
|
11
|
+
children,
|
|
12
|
+
duration,
|
|
13
|
+
...props
|
|
14
|
+
}) => (
|
|
15
|
+
<div className={`overflow-hidden ${className}`} {...props}>
|
|
16
|
+
<div
|
|
17
|
+
className={`d-inline-block mw-100 mh-100 ${style.scrollWrap}`}
|
|
18
|
+
// @ts-expect-error remove after React 19 released
|
|
19
|
+
style={{ '--duration': duration }}
|
|
20
|
+
>
|
|
21
|
+
<div className={`d-inline-block ${style.scrollItem}`}>
|
|
22
|
+
{children}
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
package/source/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from './color';
|
|
|
6
6
|
export * from './Dialog';
|
|
7
7
|
export * from './Editor';
|
|
8
8
|
export * from './EditorHTML';
|
|
9
|
+
export * from './HorizontalMarquee';
|
|
9
10
|
export * from './Icon';
|
|
10
11
|
export * from './Loading';
|
|
11
12
|
export * from './MonthCalendar';
|
|
@@ -18,3 +19,5 @@ export * from './SpinnerButton';
|
|
|
18
19
|
export * from './TableSpinner';
|
|
19
20
|
export * from './TimeDistance';
|
|
20
21
|
export * from './TypeEcho';
|
|
22
|
+
export * from './UserRank';
|
|
23
|
+
export * from './VerticalMarquee';
|