update 优化首屏加载提示

This commit is contained in:
2021-06-22 11:25:09 +08:00
parent f05f476789
commit af002cffcf
2 changed files with 69 additions and 7 deletions

View File

@@ -17,14 +17,73 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: @layout-header-background;
>.ant-spin-nested-loading { >.ant-spin-nested-loading {
height: 100%; height: 100%;
>div>.ant-spin { >div>.ant-spin {
max-height: none; max-height: none;
@-webkit-keyframes borderScale {
0% {
border: 5px solid white;
}
50% {
border: 25px solid transparent;
}
100% {
border: 5px solid white;
}
}
@keyframes borderScale {
0% {
border: 5px solid white;
}
50% {
border: 25px solid transparent;
}
100% {
border: 5px solid white;
}
}
.loader-container {
position: absolute;
top: 50%;
left: 50%;
box-sizing: content-box;
width: 200px;
height: 200px;
margin: 0 auto;
margin-right: -50%;
transform: translate(-50%, -50%);
-webkit-animation: borderScale 1s infinite ease-in-out;
animation: borderScale 1s infinite ease-in-out;
color: white;
border: 5px solid transparent;
border-radius: 50%;
>p {
font-family: 'Raleway', sans-serif;
font-size: 2em;
font-weight: bold;
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
}
}
} }
>.ant-spin-container { >.ant-spin-container {
width: 100%; width: 100%;
height: 100%; height: 100%;
&.ant-spin-blur {
opacity: 0;
}
} }
} }
} }

View File

@@ -232,21 +232,24 @@ export default class index extends Component {
} }
render() { render() {
const antIcon = <LoadingOutlined style={{ fontSize: 24 }} spin /> const { loading, panes, actived } = this.state
return ( return (
<section className="yo-layout--spin"> <section className="yo-layout--spin">
<Spin spinning={this.state.loading} indicator={antIcon}> <Spin
spinning={loading}
indicator={
<div className="loader-container">
<p>Loading</p>
</div>
}
>
<Layout className="yo-layout--top-nav--container-fluid yo-layout--top-nav"> <Layout className="yo-layout--top-nav--container-fluid yo-layout--top-nav">
<Layout> <Layout>
<Header /> <Header />
<Layout className="yo-nav-theme--light"> <Layout className="yo-nav-theme--light">
<Sider /> <Sider />
<Content <Content parent={this} panes={panes} actived={actived} />
parent={this}
panes={this.state.panes}
actived={this.state.actived}
/>
</Layout> </Layout>
</Layout> </Layout>
</Layout> </Layout>