2022-12-08 12:14:18 +08:00
|
|
|
import React from 'react';
|
2024-04-06 16:11:17 +08:00
|
|
|
import { css, Global } from '@emotion/react';
|
2023-07-20 19:27:33 +08:00
|
|
|
import { useTheme } from 'antd-style';
|
2022-12-08 12:14:18 +08:00
|
|
|
|
|
|
|
export default () => {
|
2023-07-20 19:27:33 +08:00
|
|
|
const token = useTheme();
|
2022-12-08 12:14:18 +08:00
|
|
|
|
|
|
|
const { antCls, iconCls } = token;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Global
|
|
|
|
styles={css`
|
2022-12-19 13:23:28 +08:00
|
|
|
ul.anticons-list {
|
|
|
|
margin: 10px 0;
|
|
|
|
overflow: hidden;
|
|
|
|
direction: ltr;
|
|
|
|
list-style: none;
|
|
|
|
|
|
|
|
li {
|
|
|
|
position: relative;
|
|
|
|
float: left;
|
|
|
|
width: 16.66%;
|
|
|
|
height: 100px;
|
|
|
|
margin: 3px 0;
|
|
|
|
padding: 10px 0 0;
|
2022-12-08 12:14:18 +08:00
|
|
|
overflow: hidden;
|
2022-12-19 13:23:28 +08:00
|
|
|
color: #555;
|
|
|
|
text-align: center;
|
2022-12-08 12:14:18 +08:00
|
|
|
list-style: none;
|
2022-12-19 13:23:28 +08:00
|
|
|
background-color: inherit;
|
2024-04-06 16:11:17 +08:00
|
|
|
border-radius: ${token.borderRadiusSM}px;
|
2022-12-19 13:23:28 +08:00
|
|
|
cursor: pointer;
|
2024-04-06 16:11:17 +08:00
|
|
|
transition:
|
|
|
|
color ${token.motionDurationSlow} ease-in-out,
|
|
|
|
background-color ${token.motionDurationSlow} ease-in-out;
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
.rtl & {
|
2022-12-08 12:14:18 +08:00
|
|
|
margin: 3px 0;
|
|
|
|
padding: 10px 0 0;
|
2022-12-19 13:23:28 +08:00
|
|
|
}
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
${iconCls} {
|
2024-04-06 16:11:17 +08:00
|
|
|
margin: ${token.marginSM}px 0 ${token.marginXS}px;
|
2022-12-19 13:23:28 +08:00
|
|
|
font-size: 36px;
|
2024-04-06 16:11:17 +08:00
|
|
|
transition: transform ${token.motionDurationSlow} ease-in-out;
|
2022-12-19 13:23:28 +08:00
|
|
|
will-change: transform;
|
|
|
|
}
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
.anticon-class {
|
|
|
|
display: block;
|
|
|
|
font-family: 'Lucida Console', Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono',
|
|
|
|
monospace;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-align: center;
|
|
|
|
transform: scale(0.83);
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
${antCls}-badge {
|
2024-04-06 16:11:17 +08:00
|
|
|
transition: color ${token.motionDurationSlow} ease-in-out;
|
2022-12-08 12:14:18 +08:00
|
|
|
}
|
2022-12-19 13:23:28 +08:00
|
|
|
}
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
&:hover {
|
|
|
|
color: #fff;
|
|
|
|
background-color: ${token.colorPrimary};
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
${iconCls} {
|
|
|
|
transform: scale(1.4);
|
2022-12-08 12:14:18 +08:00
|
|
|
}
|
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
${antCls}-badge {
|
2022-12-08 12:14:18 +08:00
|
|
|
color: #fff;
|
|
|
|
}
|
2022-12-19 13:23:28 +08:00
|
|
|
}
|
2022-12-08 12:14:18 +08:00
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
&.TwoTone:hover {
|
|
|
|
background-color: #8ecafe;
|
2022-12-08 12:14:18 +08:00
|
|
|
}
|
|
|
|
|
2022-12-19 13:23:28 +08:00
|
|
|
&.copied:hover {
|
|
|
|
color: rgba(255, 255, 255, 0.2);
|
|
|
|
}
|
|
|
|
|
|
|
|
&::after {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
color: #fff;
|
|
|
|
line-height: 110px;
|
|
|
|
text-align: center;
|
|
|
|
background: #1677ff;
|
|
|
|
opacity: 0;
|
2024-04-06 16:11:17 +08:00
|
|
|
transition: all ${token.motionDurationSlow} cubic-bezier(0.18, 0.89, 0.32, 1.28);
|
2022-12-19 13:23:28 +08:00
|
|
|
content: 'Copied!';
|
|
|
|
}
|
|
|
|
|
|
|
|
&.copied::after {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
2022-12-08 12:14:18 +08:00
|
|
|
}
|
2022-12-19 13:23:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.copied-code {
|
|
|
|
padding: 2px 4px;
|
2024-04-06 16:11:17 +08:00
|
|
|
font-size: ${token.fontSizeSM}px;
|
|
|
|
background: ${token.colorBgLayout};
|
|
|
|
border-radius: ${token.borderRadiusXS}px;
|
2022-12-19 13:23:28 +08:00
|
|
|
}
|
|
|
|
`}
|
2022-12-08 12:14:18 +08:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|