idea-react 2.0.0-rc.7 → 2.0.0-rc.9
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 +208 -206
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +47 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/eslint.config.ts +69 -0
- package/package.json +70 -53
- package/source/CodeBlock.tsx +1 -1
- package/source/Dialog.tsx +41 -41
- package/source/Editor.tsx +46 -46
- package/source/EditorHTML.tsx +21 -23
- package/source/HorizontalMarquee/index.module.less +52 -52
- package/source/HorizontalMarquee/index.tsx +67 -65
- package/source/Loading.tsx +21 -21
- package/source/MonthCalendar.tsx +1 -1
- package/source/PageNav.tsx +102 -102
- package/source/Select.tsx +84 -84
- package/source/ShareBox.tsx +99 -99
- package/source/TableSpinner.tsx +24 -24
- package/source/Time.tsx +14 -0
- package/source/TimeDistance.tsx +41 -41
- package/source/Timeline/index.module.less +53 -0
- package/source/Timeline/index.tsx +70 -0
- package/source/TypeEcho.tsx +49 -49
- package/source/UserRank/index.tsx +122 -120
- package/source/VerticalMarquee/index.module.less +43 -43
- package/source/VerticalMarquee/index.tsx +27 -26
- package/source/index.ts +25 -23
- package/tsconfig.build.json +11 -11
- package/tsconfig.json +2 -1
package/source/Time.tsx
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FC, TimeHTMLAttributes } from 'react';
|
|
2
|
+
import { formatDate, TimeData } from 'web-utility';
|
|
3
|
+
|
|
4
|
+
export interface TimeProps
|
|
5
|
+
extends Omit<TimeHTMLAttributes<HTMLTimeElement>, 'dateTime'> {
|
|
6
|
+
dateTime: TimeData;
|
|
7
|
+
format?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Time: FC<TimeProps> = ({ dateTime, format, ...props }) => (
|
|
11
|
+
<time dateTime={new Date(dateTime).toJSON()} {...props}>
|
|
12
|
+
{formatDate(dateTime, format)}
|
|
13
|
+
</time>
|
|
14
|
+
);
|
package/source/TimeDistance.tsx
CHANGED
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
import { FC, HTMLAttributes } from 'react';
|
|
2
|
-
import { diffTime, TimeData } from 'web-utility';
|
|
3
|
-
|
|
4
|
-
export interface TimeDistanceProps extends HTMLAttributes<HTMLTimeElement> {
|
|
5
|
-
date: TimeData;
|
|
6
|
-
unitWords?: Record<string, string>;
|
|
7
|
-
beforeWord?: string;
|
|
8
|
-
afterWord?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const UnitWords = {
|
|
12
|
-
ms: 'millisecond(s)',
|
|
13
|
-
s: 'second(s)',
|
|
14
|
-
m: 'minute(s)',
|
|
15
|
-
H: 'hour(s)',
|
|
16
|
-
D: 'day(s)',
|
|
17
|
-
W: 'week(s)',
|
|
18
|
-
M: 'month(s)',
|
|
19
|
-
Y: 'year(s)'
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const TimeDistance: FC<TimeDistanceProps> = ({
|
|
23
|
-
date,
|
|
24
|
-
unitWords = UnitWords,
|
|
25
|
-
beforeWord = ' before',
|
|
26
|
-
afterWord = ' after',
|
|
27
|
-
...props
|
|
28
|
-
}) => {
|
|
29
|
-
date = new Date(date);
|
|
30
|
-
|
|
31
|
-
const { distance, unit } = diffTime(date);
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<time {...props} dateTime={date.toJSON()} title={date.toLocaleString()}>
|
|
35
|
-
{Math.abs(distance)} {unitWords[unit]}
|
|
36
|
-
{distance < 0 ? beforeWord : afterWord}
|
|
37
|
-
</time>
|
|
38
|
-
);
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
TimeDistance.displayName = 'TimeDistance';
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { diffTime, TimeData } from 'web-utility';
|
|
3
|
+
|
|
4
|
+
export interface TimeDistanceProps extends HTMLAttributes<HTMLTimeElement> {
|
|
5
|
+
date: TimeData;
|
|
6
|
+
unitWords?: Record<string, string>;
|
|
7
|
+
beforeWord?: string;
|
|
8
|
+
afterWord?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const UnitWords = {
|
|
12
|
+
ms: 'millisecond(s)',
|
|
13
|
+
s: 'second(s)',
|
|
14
|
+
m: 'minute(s)',
|
|
15
|
+
H: 'hour(s)',
|
|
16
|
+
D: 'day(s)',
|
|
17
|
+
W: 'week(s)',
|
|
18
|
+
M: 'month(s)',
|
|
19
|
+
Y: 'year(s)'
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const TimeDistance: FC<TimeDistanceProps> = ({
|
|
23
|
+
date,
|
|
24
|
+
unitWords = UnitWords,
|
|
25
|
+
beforeWord = ' before',
|
|
26
|
+
afterWord = ' after',
|
|
27
|
+
...props
|
|
28
|
+
}) => {
|
|
29
|
+
date = new Date(date);
|
|
30
|
+
|
|
31
|
+
const { distance, unit } = diffTime(date);
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<time {...props} dateTime={date.toJSON()} title={date.toLocaleString()}>
|
|
35
|
+
{Math.abs(distance)} {unitWords[unit]}
|
|
36
|
+
{distance < 0 ? beforeWord : afterWord}
|
|
37
|
+
</time>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
TimeDistance.displayName = 'TimeDistance';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
.timeline {
|
|
2
|
+
position: relative;
|
|
3
|
+
margin: 0 auto;
|
|
4
|
+
max-width: 50%;
|
|
5
|
+
@media (max-width: 991px) {
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
}
|
|
8
|
+
&::after {
|
|
9
|
+
position: absolute;
|
|
10
|
+
top: 0;
|
|
11
|
+
bottom: 0;
|
|
12
|
+
left: 10px;
|
|
13
|
+
margin-left: -3px;
|
|
14
|
+
background-color: #fff;
|
|
15
|
+
width: 3px;
|
|
16
|
+
content: '';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.timelineItem {
|
|
20
|
+
position: relative;
|
|
21
|
+
background-color: inherit;
|
|
22
|
+
width: 100%;
|
|
23
|
+
|
|
24
|
+
&::after {
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 18px;
|
|
27
|
+
right: 1px;
|
|
28
|
+
z-index: 1;
|
|
29
|
+
border-radius: 50%;
|
|
30
|
+
background-color: #fff;
|
|
31
|
+
width: 17px;
|
|
32
|
+
height: 17px;
|
|
33
|
+
content: '';
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
.right {
|
|
37
|
+
left: auto;
|
|
38
|
+
padding: 0px 0px 20px 40px;
|
|
39
|
+
|
|
40
|
+
&::before {
|
|
41
|
+
position: absolute;
|
|
42
|
+
top: 18px;
|
|
43
|
+
left: 30px;
|
|
44
|
+
z-index: 1;
|
|
45
|
+
border: medium solid #fff;
|
|
46
|
+
border-width: 10px 10px 10px 0;
|
|
47
|
+
border-color: transparent #fff transparent transparent;
|
|
48
|
+
content: ' ';
|
|
49
|
+
}
|
|
50
|
+
&::after {
|
|
51
|
+
left: 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { FC, HTMLAttributes } from 'react';
|
|
2
|
+
import { Card } from 'react-bootstrap';
|
|
3
|
+
import { TimeData } from 'web-utility';
|
|
4
|
+
|
|
5
|
+
import { Nameplate, NameplateProps } from '../Nameplate';
|
|
6
|
+
import { Time } from '../Time';
|
|
7
|
+
import * as styles from './index.module.less';
|
|
8
|
+
|
|
9
|
+
export interface TimelineEvent {
|
|
10
|
+
title: string;
|
|
11
|
+
summary?: string;
|
|
12
|
+
time: [TimeData, TimeData?];
|
|
13
|
+
|
|
14
|
+
link?: string;
|
|
15
|
+
people?: NameplateProps[];
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface TimelineProps extends HTMLAttributes<HTMLOListElement> {
|
|
19
|
+
events: TimelineEvent[];
|
|
20
|
+
timeFormat?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @see {@link https://mdbootstrap.com/docs/standard/extended/timeline/#section-timeline-gradient-bg}
|
|
25
|
+
*/
|
|
26
|
+
export const Timeline: FC<TimelineProps> = ({
|
|
27
|
+
className,
|
|
28
|
+
events,
|
|
29
|
+
timeFormat,
|
|
30
|
+
...props
|
|
31
|
+
}) => (
|
|
32
|
+
<ol className={`list-unstyled ${styles.timeline} ${className}`} {...props}>
|
|
33
|
+
{events.map(({ title, summary, time, link, people }) => (
|
|
34
|
+
<li
|
|
35
|
+
key={title as string}
|
|
36
|
+
className={`position-relative ${styles.timelineItem} ${styles.right}`}
|
|
37
|
+
>
|
|
38
|
+
<Card>
|
|
39
|
+
<Card.Body className="p-4 d-flex flex-column gap-3 align-items-center">
|
|
40
|
+
<h3 className="h5 m-0">
|
|
41
|
+
<a
|
|
42
|
+
className="text-decoration-none stretched-link"
|
|
43
|
+
href={link}
|
|
44
|
+
>
|
|
45
|
+
{title as string}
|
|
46
|
+
</a>
|
|
47
|
+
</h3>
|
|
48
|
+
<div className="small text-muted d-flex gap-2">
|
|
49
|
+
⏲️
|
|
50
|
+
<Time dateTime={time[0]} format={timeFormat} />
|
|
51
|
+
{time[1] && '~'}
|
|
52
|
+
{time[1] && (
|
|
53
|
+
<Time dateTime={time[1]} format={timeFormat} />
|
|
54
|
+
)}
|
|
55
|
+
</div>
|
|
56
|
+
<ul className="list-unstyled m-0 d-flex gap-2 flex-wrap justify-content-around">
|
|
57
|
+
{people?.map(person => (
|
|
58
|
+
<li key={person.name}>
|
|
59
|
+
<Nameplate {...person} />
|
|
60
|
+
</li>
|
|
61
|
+
))}
|
|
62
|
+
</ul>
|
|
63
|
+
<p className="m-0">{summary as string}</p>
|
|
64
|
+
</Card.Body>
|
|
65
|
+
</Card>
|
|
66
|
+
</li>
|
|
67
|
+
))}
|
|
68
|
+
</ol>
|
|
69
|
+
);
|
|
70
|
+
Timeline.displayName = 'Timeline';
|
package/source/TypeEcho.tsx
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import { observable } from 'mobx';
|
|
3
|
-
import { observer } from 'mobx-react';
|
|
4
|
-
import { Component, HTMLAttributes, RefCallback } from 'react';
|
|
5
|
-
import { sleep } from 'web-utility';
|
|
6
|
-
|
|
7
|
-
export interface TypeEchoProps extends HTMLAttributes<HTMLPreElement> {
|
|
8
|
-
text: string;
|
|
9
|
-
intervals?: number;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@observer
|
|
13
|
-
export class TypeEcho extends Component<TypeEchoProps> {
|
|
14
|
-
static displayName = 'TypeEcho';
|
|
15
|
-
|
|
16
|
-
@observable
|
|
17
|
-
accessor echoed = '';
|
|
18
|
-
|
|
19
|
-
init: RefCallback<HTMLPreElement> = node =>
|
|
20
|
-
node &&
|
|
21
|
-
new IntersectionObserver(async ([{ isIntersecting }], observer) => {
|
|
22
|
-
if (!isIntersecting) return;
|
|
23
|
-
|
|
24
|
-
observer.disconnect();
|
|
25
|
-
|
|
26
|
-
const { text, intervals = 150 } = this.props;
|
|
27
|
-
|
|
28
|
-
for (const char of text) {
|
|
29
|
-
await sleep(intervals / 1000);
|
|
30
|
-
|
|
31
|
-
this.echoed += char;
|
|
32
|
-
}
|
|
33
|
-
}).observe(node);
|
|
34
|
-
|
|
35
|
-
render() {
|
|
36
|
-
const { className, text, ...props } = this.props,
|
|
37
|
-
{ echoed } = this;
|
|
38
|
-
|
|
39
|
-
return (
|
|
40
|
-
<pre
|
|
41
|
-
{...props}
|
|
42
|
-
ref={this.init}
|
|
43
|
-
className={classNames('text-wrap', className)}
|
|
44
|
-
>
|
|
45
|
-
{echoed + (echoed === text ? '' : '_')}
|
|
46
|
-
</pre>
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
1
|
+
import classNames from 'classnames';
|
|
2
|
+
import { observable } from 'mobx';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import { Component, HTMLAttributes, RefCallback } from 'react';
|
|
5
|
+
import { sleep } from 'web-utility';
|
|
6
|
+
|
|
7
|
+
export interface TypeEchoProps extends HTMLAttributes<HTMLPreElement> {
|
|
8
|
+
text: string;
|
|
9
|
+
intervals?: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@observer
|
|
13
|
+
export class TypeEcho extends Component<TypeEchoProps> {
|
|
14
|
+
static displayName = 'TypeEcho';
|
|
15
|
+
|
|
16
|
+
@observable
|
|
17
|
+
accessor echoed = '';
|
|
18
|
+
|
|
19
|
+
init: RefCallback<HTMLPreElement> = node =>
|
|
20
|
+
node &&
|
|
21
|
+
new IntersectionObserver(async ([{ isIntersecting }], observer) => {
|
|
22
|
+
if (!isIntersecting) return;
|
|
23
|
+
|
|
24
|
+
observer.disconnect();
|
|
25
|
+
|
|
26
|
+
const { text, intervals = 150 } = this.props;
|
|
27
|
+
|
|
28
|
+
for (const char of text) {
|
|
29
|
+
await sleep(intervals / 1000);
|
|
30
|
+
|
|
31
|
+
this.echoed += char;
|
|
32
|
+
}
|
|
33
|
+
}).observe(node);
|
|
34
|
+
|
|
35
|
+
render() {
|
|
36
|
+
const { className, text, ...props } = this.props,
|
|
37
|
+
{ echoed } = this;
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<pre
|
|
41
|
+
{...props}
|
|
42
|
+
ref={this.init}
|
|
43
|
+
className={classNames('text-wrap', className)}
|
|
44
|
+
>
|
|
45
|
+
{echoed + (echoed === text ? '' : '_')}
|
|
46
|
+
</pre>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -1,120 +1,122 @@
|
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
{user
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
{user
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
<i className="d-inline-block ms-1 overflow-hidden rounded-circle" />
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
+
static displayName = 'UserRankView';
|
|
22
|
+
|
|
23
|
+
renderMedal = (user: UserRank) => (
|
|
24
|
+
<Col key={user.id} as="li">
|
|
25
|
+
<div
|
|
26
|
+
className={`shadow-lg overflow-hidden rounded-circle m-auto ${style.image}`}
|
|
27
|
+
>
|
|
28
|
+
<Image src={user.avatar} alt={user.name} loading="lazy" fluid />
|
|
29
|
+
</div>
|
|
30
|
+
<div
|
|
31
|
+
className={`position-relative overflow-hidden ${style.topUser}`}
|
|
32
|
+
>
|
|
33
|
+
<div className="position-relative">
|
|
34
|
+
<i className="d-block overflow-hidden m-auto mb-1 rounded-circle" />
|
|
35
|
+
<a
|
|
36
|
+
className="d-block mb-0 stretched-link"
|
|
37
|
+
href={this.props.linkOf?.(user) || '#'}
|
|
38
|
+
>
|
|
39
|
+
{user.name}
|
|
40
|
+
</a>
|
|
41
|
+
<strong>{user.score}</strong>
|
|
42
|
+
</div>
|
|
43
|
+
<UserAddress {...user} />
|
|
44
|
+
</div>
|
|
45
|
+
</Col>
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
renderRow = (user: UserRank, index: number, { length }: UserRank[]) => (
|
|
49
|
+
<tr key={user.id} className="position-relative">
|
|
50
|
+
<td className="align-middle">
|
|
51
|
+
<Badge className="fw-bold fst-italic">
|
|
52
|
+
{(index + 4 + '').padStart((length + '').length, '0')}
|
|
53
|
+
</Badge>
|
|
54
|
+
</td>
|
|
55
|
+
<td
|
|
56
|
+
className={`position-relative mw-50 text-truncate ${style.name}`}
|
|
57
|
+
>
|
|
58
|
+
<div
|
|
59
|
+
className={`d-inline-block overflow-hidden align-middle rounded-circle ${style.image}`}
|
|
60
|
+
>
|
|
61
|
+
<Image
|
|
62
|
+
src={user.avatar}
|
|
63
|
+
alt={user.name}
|
|
64
|
+
loading="lazy"
|
|
65
|
+
fluid
|
|
66
|
+
/>
|
|
67
|
+
</div>
|
|
68
|
+
<a
|
|
69
|
+
className="ms-2 d-inline-block align-middle stretched-link"
|
|
70
|
+
style={{
|
|
71
|
+
color: `rgb(248, ${(index + 2) * 15}, ${(index + 2) * 35})`
|
|
72
|
+
}}
|
|
73
|
+
href={this.props.linkOf?.(user) || '#'}
|
|
74
|
+
>
|
|
75
|
+
{user.name}
|
|
76
|
+
</a>
|
|
77
|
+
</td>
|
|
78
|
+
<td className="align-middle">{user.score}</td>
|
|
79
|
+
<td className="align-middle">
|
|
80
|
+
<UserAddress {...user} />
|
|
81
|
+
</td>
|
|
82
|
+
</tr>
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
render() {
|
|
86
|
+
const { className = '', title, rank = [], ...props } = this.props;
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<Row className={`${style.rankBox} ${className}`} {...props}>
|
|
90
|
+
<Col sm={12} xs={12} lg={7}>
|
|
91
|
+
<div className={`shadow rounded-3 ${style.title}`}>
|
|
92
|
+
<div className={style.medal}>
|
|
93
|
+
<i className="d-inline-block ms-1 overflow-hidden rounded-circle" />
|
|
94
|
+
<i className="d-inline-block ms-1 overflow-hidden rounded-circle" />
|
|
95
|
+
<i className="d-inline-block ms-1 overflow-hidden rounded-circle" />
|
|
96
|
+
</div>
|
|
97
|
+
<h3
|
|
98
|
+
data-text={title}
|
|
99
|
+
className="position-relative m-auto mb-0 fw-bold text-center"
|
|
100
|
+
>
|
|
101
|
+
{title}
|
|
102
|
+
</h3>
|
|
103
|
+
</div>
|
|
104
|
+
<Row
|
|
105
|
+
as="ul"
|
|
106
|
+
className={`mt-2 g-0 align-items-end text-center ps-0 pt-2 list-unstyled ${style.topUsers}`}
|
|
107
|
+
>
|
|
108
|
+
{rank.slice(0, 3).map(this.renderMedal)}
|
|
109
|
+
</Row>
|
|
110
|
+
</Col>
|
|
111
|
+
<Col xs={12} sm={12} lg={5}>
|
|
112
|
+
<Table
|
|
113
|
+
className={`my-3 pt-2 ${style.restUsers}`}
|
|
114
|
+
responsive
|
|
115
|
+
>
|
|
116
|
+
<tbody>{rank.slice(3, 10).map(this.renderRow)}</tbody>
|
|
117
|
+
</Table>
|
|
118
|
+
</Col>
|
|
119
|
+
</Row>
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
@@ -1,43 +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
|
-
}
|
|
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
|
+
}
|