css skeleton loading & skeleton components
css skeleton loading
css & :empty
See the Pen Skeleton Screen with CSS by xgqfrms
(@xgqfrms) on CodePen.
dom
https://www.italki.com/contacts/teacher/favorited
<div class="teacher-card">
<div class="teacher-card-left">
<div class="teacher-card-detail-top">
<div class="teacher-card-avatar">
<div class="teacher-card-avatar-placeholder"></div>
</div>
<div class="teacher-card-information">
<div class="teacher-card-name-placerholder"></div>
<div class="teacher-card-type-placerholder"></div>
<div class="teacher-card-divider"></div>
<div class="teacher-card-small-head-placeholder"></div>
<div class="teacher-card-small-languages-placeholder"></div>
</div>
</div>
<div class="teacher-card-detail-bottom">
<div class="teacher-card-rating">
<div class="teacher-card-stars">
<div class="teacher-card-rating-placeholder"></div>
</div>
</div>
<div class="teacher-card-information">
<div class="teacher-card-small-head-placeholder"></div>
<div class="teacher-card-small-speaks-placeholder"></div>
<div class="teacher-card-rate">
<div class="teacher-card-hourly">
<div class="teacher-card-small-head-placeholder"></div>
<div class="teacher-card-small-hourly-placeholder"></div>
</div>
<div class="teacher-card-trial">
<div class="teacher-card-small-head-placeholder"></div>
<div class="teacher-card-small-hourly-placeholder"></div>
</div>
</div>
</div>
</div><i class="teacher-card-favorite"></i>
</div>
<div class="teacher-card-right">
<div class="teacher-card-tab-placeholder"></div>
</div>
</div>
@charset "UTf-8";
/* app.css */
:root {
--color: #000;
--default-color: green;
--new-color: #0f0;
}
html{
font-size: 62.5%;
/* 10px = 1rem */
}
* {
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
html, body, div, h1, h2, h3, h4, h5, h6, hr, p, blockquote, dl, dt, dd, ul, ol, li, pre, form, fieldset, object, code, legend, button, input, textarea, th, td, a, img, video {
margin: 0;
padding: 0;
border: 0;
outline: 0;
}
*, :after, :before {
box-sizing: border-box;
}
.teacher-card {
position: relative;
display: flex;
margin-bottom: 20px;
}
@-webkit-keyframes pulse {
0% {
-webkit-transform: scaleX(1);
transform: scaleX(1)
}
50% {
-webkit-transform: scale3d(1.0075,1.0075,1.0075);
transform: scale3d(1.0075,1.0075,1.0075)
}
to {
-webkit-transform: scaleX(1);
transform: scaleX(1)
}
}
@keyframes pulse {
0% {
-webkit-transform: scaleX(1);
transform: scaleX(1)
}
50% {
-webkit-transform: scale3d(1.0075,1.0075,1.0075);
transform: scale3d(1.0075,1.0075,1.0075)
}
to {
-webkit-transform: scaleX(1);
transform: scaleX(1)
}
}
.teacher-card-left {
position: relative;
padding: 25px 25px 20px;
width: 564px;
min-height: 284px;
border-radius: 6px;
background: #fff;
box-shadow: 0 7px 25px 0 rgba(0,0,0,.1);
cursor: pointer
}
.teacher-card-right {
padding: 25px 20px 20px;
width: 386px;
border-radius: 0 6px 6px 0;
background: #fff;
box-shadow: 5px 7px 25px 0 rgba(0,0,0,.1);
}
.teacher-card-detail-bottom,
.teacher-card-detail-top {
display: flex;
}
.teacher-card-avatar {
display: flex;
align-items: flex-start;
text-align: center;
}
.teacher-card-avatar-placeholder,
.teacher-card-tab-placeholder {
background-image: -webkit-gradient(linear,right top,left top,from(#ccc),color-stop(0,#eee),color-stop(0,#ccc),to(#eee));
background-image: -webkit-linear-gradient(right,#ccc,#eee,#ccc 0,#eee);
background-image: linear-gradient(270deg,#ccc,#eee 0,#ccc 0,#eee);
}
.teacher-card-avatar-placeholder {
margin: 0 auto;
width: 100px;
height: 100px;
border-radius: 50%;
box-shadow: 0 5px 15px 0 rgba(0,0,0,.2);
}
.teacher-card-information {
margin-left: 30px;
flex: 1 1;
}
.teacher-card-name-placerholder {
margin-bottom: 10px;
width: 170px;
height: 20px;
border-radius: 10px;
background-image: -webkit-gradient(linear,right top,left top,from(#ccc),color-stop(0,#eee),color-stop(0,#ccc),to(#eee));
background-image: -webkit-linear-gradient(right,#ccc,#eee,#ccc 0,#eee);
background-image: linear-gradient(270deg,#ccc,#eee 0,#ccc 0,#eee);
}
.teacher-card-small-head-placeholder,
.teacher-card-type-placerholder {
height: 15px;
border-radius: 7.5px;
background-image: -webkit-gradient(linear,right top,left top,from(#ccc),color-stop(0,#eee),color-stop(0,#ccc),to(#eee));
background-image: -webkit-linear-gradient(right,#ccc,#eee,#ccc 0,#eee);
background-image: linear-gradient(270deg,#ccc,#eee 0,#ccc 0,#eee);
}
.teacher-card-divider {
margin: 12px 0;
width: 15px;
height: 2px;
border-radius: 1px;
background: #ff4338;
}
.teacher-card-small-head-placeholder {
margin-bottom: 10px;
width: 80px;
}
.teacher-card-small-languages-placeholder,
.teacher-card-small-speaks-placeholder {
height: 20px;
border-radius: 10px;
background-image: -webkit-gradient(linear,right top,left top,from(#ccc),color-stop(0,#eee),color-stop(0,#ccc),to(#eee));
background-image: -webkit-linear-gradient(right,#ccc,#eee,#ccc 0,#eee);
background-image: linear-gradient(270deg,#ccc,#eee 0,#ccc 0,#eee);
}
.newteacher-card-favorite,
.teacher-card-favorite {
position: absolute;
top: 25px;
right: 25px;
cursor: pointer;
}
.teacher-card-favorite {
width: 30px;
height: 30px;
background: url(heart-empty.96354e1f.svg) no-repeat 50%/30px 30px;
background: url(https://www.italki.com/static/media/heart-empty.96354e1f.svg) no-repeat 50%/30px 30px;
/* background: url(/static/media/heart-empty.96354e1f.svg) no-repeat 50%/30px 30px; */
}
.teacher-card-right {
padding: 25px 20px 20px;
width: 386px;
border-radius: 0 6px 6px 0;
background: #fff;
box-shadow: 5px 7px 25px 0 rgba(0,0,0,.1);
}
.teacher-card-tab-placeholder {
margin: 50px auto 0;
width: 343px;
height: 195px;
border-radius: 6px;
}
skeleton components
https://ant.design/components/skeleton-cn/
import { Skeleton, Button } from 'antd';
class Demo extends React.Component {
state = {
loading: false,
};
showSkeleton = () => {
this.setState({ loading: true });
setTimeout(() => {
this.setState({ loading: false });
}, 3000);
};
render() {
return (
<div className="article">
<Skeleton loading={this.state.loading}>
<div>
<h4>Ant Design, a design language</h4>
<p>
We supply a series of design principles, practical patterns and high quality design
resources (Sketch and Axure), to help people create their product prototypes
beautifully and efficiently.
</p>
</div>
</Skeleton>
<Button onClick={this.showSkeleton} disabled={this.state.loading}>
Show Skeleton
</Button>
</div>
);
}
}
ReactDOM.render(<Demo />, mountNode);
xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
css skeleton loading & skeleton components的更多相关文章
- 利用animation和text-shadow纯CSS实现loading点点点的效果
经常在网上看到loading状态时的点点点的动态效果,自己也用JS写了一个,思路是使用一个计数参数,然后在需要添加点的元素后面利用setInterval一个一个加点,当计数到3时,把点变为一个--写完 ...
- 使用css实现loading的加载
使用css实现loading的加载的效果图 html代码 <div id="caseVerteClaire"> <div id="transform&q ...
- 基于Vuejs实现 Skeleton Loading 骨架图
原文地址:https://cloud.tencent.com/developer/article/1006169 https://mp.weixin.qq.com/s/qmyn6mGrO6hRKuvK ...
- 纯js+css实现loading等待效果
此插件是基于jqueryUI的widget,下面是具体实现代码 第一部分css: /***loading***/ .loading-box{ position:absolute; text-align ...
- css 三彩loading
<!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title&g ...
- css动画 loading
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 6种纯css实现loading效果
1. <div id="loadingWrap1"> <span></span> <span></span> <s ...
- css skeleton & web app skeleton
css skeleton & web app skeleton skeleton https://www.cnblogs.com/xgqfrms/p/10437258.html https:/ ...
- images & Skeleton
images & Skeleton image placeholder & loading ... skeleton.css https://github.com/dhg/Skelet ...
随机推荐
- Service Mesh架构的持续演进 单体模块化 SOA 微服务 Service Mesh
架构不止-严选Service Mesh架构的持续演进 网易严选 王育松 严选技术团队 2019-11-25 前言同严选的业务一样,在下层承载它的IT系统架构一样要生存.呼吸.增长和发展,否则过时的.僵 ...
- http发送
package cn.com.yitong.wdph.util; import java.io.BufferedReader;import java.io.InputStream;import jav ...
- Python学习【第2篇】:基本数据类型
基本数据类型 字符串 ---------n1 = "xiaoxing" n2 = "admin" n3 = "123" n4 = & ...
- Hash Map集合和Hash Set集合
HashMap集合的使用 1.1.每个集合对象的创建(new) 1.2.从集合中添加元素 1.3.从集合中取出某个元素 1.4.遍历集合 public class HashMapTest { publ ...
- loj10171
牧场的安排 内存限制:512 MiB 时间限制:1000 ms 原题来自:USACO 2006 Nov. Gold Farmer John 新买了一块长方形的牧场,这块牧场被划分成 MMM 行 NNN ...
- 虚函数表-C++多态的实现原理
目录 1.说明 2.虚函数表 3.代码示例 参考:http://c.biancheng.net/view/267.html 1.说明 我们都知道多态指的是父类的指针在运行中指向子类,那么它的实现原理是 ...
- HarmonyOS三方件开发指南(7)——compress组件
目录:1. 组件compress功能介绍2. 组件compress使用方法3. 组件compress开发实现 1. 组件compress功能介绍1.1. 组件介绍: compress是 ...
- 一:优化Docker中的Spring Boot应用:单层镜像方法
优化Docker中的Spring Boot应用:单层镜像方法 1.Docker关键概念 2.镜像层内容很重要 3.镜像层影响部署 4.Docker中的Spring Boot应用 5.单层方法 5.1 ...
- HTML 5 学习第二课
元素:<p>+++++++++</P> 全部内容 标签:<P></P> 属性:标签内部的内容 eg:<img src=" "& ...
- java中的IO处理和使用,API详细介绍(一)
写在前面:本文章基本覆盖了java IO的全部内容,java新IO没有涉及,因为我想和这个分开,以突出那个的重要性,新IO哪一篇文章还没有开始写,估计很快就能和大家见面.照旧,文章依旧以例子为主,因为 ...