html5 心跳效果,html5-心跳

html5-心跳效果

(1) 基础布局(架子)

I Love You

(2)css基础样式

* {

margin: 0;

padding: 0;

}

html {

background: -webkit-radial-gradient(center, #153170, #000);

}

设置的背景:

86cfc9014fadfa99be2b2f6f46ca1bc0.png

(3) 爱心的组成样式

.heart {

position: relative;

width: 300px;

height: 300px;

margin: 200px auto;

transform: rotate(45deg);

animation: move 2s infinite alternate;

}

.heart div {

position: absolute;

width: 200px;

height: 200px;

background: red;

}

.heart .middle {

right: 0;

bottom: 0;

width: 200px;

height: 200px;

}

.heart .left {

left: 0;

bottom: 0;

border-radius: 50%;

}

.heart .right {

top: 0;

right: 0;

border-radius: 50%;

}

.heart p {

width: 200px;

height: 30px;

font: bold 25px/30px "";

text-align: center;

color: #fff;

}

.heart p {

position: absolute;

right: 0;

bottom: 85px;

transform: rotate(-45deg);

}

组合效果如图:

0b59b843ca168caf2abd76e0f1ba24f3.png

组合分解如图:div.left如图:

1a6f9ce24aae49ffc0fd6bdcffa643ad.png

其他类似

(4)加个跳动的动画:

@-webkit-keyframes move {

10% {

transform: rotate(45deg) scale(1.1);

text-shadow: 0 0 5px #fff;

}

20% {

transform: rotate(45deg) scale(1.2);

text-shadow: 0 0 5px #fff;

}

30% {

transform: rotate(45deg) scale(1.3);

text-shadow: 0 0 5px #fff;

}

40% {

transform: rotate(45deg) scale(1.2);

text-shadow: 0 0 5px #fff;

}

50% {

transform: rotate(45deg) scale(1.3);

text-shadow: 0 0 5px #fff;

}

60% {

transform: rotate(45deg) scale(1.2);

text-shadow: 0 0 5px #fff;

}

70% {

transform: rotate(45deg) scale(1.3);

text-shadow: 0 0 5px #fff;

}

80% {

transform: rotate(45deg) scale(1.2);

text-shadow: 0 0 10px #fff;

}

90% {

transform: rotate(45deg) scale(1.1);

text-shadow: 0 0 5px #fff;

}

(5)组合效果就出来啦;

来源:https://www.cnblogs.com/xy88/p/12077307.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值