用html加css做一个心脏跳动的页面的代码

用html加css做一个心脏跳动的页面的代码,第1张

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>HTML5爱心跳动动画DEMO演示</title>

<style>

@import url(http://fonts.googleapis.com/css?family=Inconsolata:400,700)

@import url(http://fonts.googleapis.com/css?family=Hammersmith+One)

body {

background-color: #ccc

}

.container {

width: 512px

height: 380px

margin: auto

margin-top: 0

}

.heart {

z-index: 1

width: 150px

height: 150px

position: absolute

top: 50%

margin-top: -75px

left: 50%

margin-left: -75px

background-size: 100%

background-repeat: no-repeat

background-image:url("data:image/svg+xmlbase64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgd2lkdGg9IjE3M3B4IiBoZWlnaHQ9IjE1OHB4IiB2aWV3Qm94PSIwIDAgMTczIDE1OCIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMTczIDE1OCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8cGF0aCBmaWxsPSIjRUY0NjU3IiBkPSJNMTU3LjMzMSwxNS41MDRjLTE5LjU1OS0xOS41NTktNTEuMjcxLTE5LjU1OS03MC44MzEsMGMtMTkuNTU5LTE5LjU1OS01MS4yNzEtMTkuNTU5LTcwLjgzMSwwDQoJYy0xOS41NTksMTkuNTU5LTE5LjU1OSw1MS4yNzEsMCw3MC44MzFsNzAuODMxLDcwLjgzbDcwLjgzMS03MC44M0MxNzYuODksNjYuNzc1LDE3Ni44OSwzNS4wNjQsMTU3LjMzMSwxNS41MDR6Ii8+DQo8L3N2Zz4=")

}

.hometown {

font-family:'Inconsolata', sans-serif

font-weight: bold

font-size: 2.0em

text-transform: uppercase

position: relative

z-index: 1

width: 512px

height: 512px

color: #FFF

}

#top {

width: 200px

margin: auto

position: relative

}

#top span {

height: 350px

position: absolute

width: 20px

left: 50%

margin-left: -10px

top: 110px

}

.char1 {

transform: rotate(-36deg)

}

.char2 {

transform: rotate(-24deg)

}

.char3 {

transform: rotate(-12deg)

}

.char4 {

transform: rotate(0deg)

}

.char5 {

transform: rotate(12deg)

}

.char6 {

transform: rotate(24deg)

}

.char7 {

transform: rotate(36deg)

}

#bottom span {

height: 350px

line-height: 700px

position: absolute

width: 20px

left: 50%

margin-left: -10px

top: 10px

}

#bottom .char1 {

transform: rotate(36deg)

}

#bottom .char2 {

transform: rotate(27deg)

}

#bottom .char3 {

transform: rotate(18deg)

}

#bottom .char4 {

transform: rotate(9deg)

}

#bottom .char5 {

transform: rotate(0deg)

}

#bottom .char6 {

transform: rotate(-9deg)

}

#bottom .char7 {

transform: rotate(-18deg)

}

#bottom .char8 {

transform: rotate(-27deg)

}

#bottom .char9 {

transform: rotate(-36deg)

}

.city {

font-family:"Hammersmith One"

display: inline-block

width: 100%

height: 300px

padding-top: 45px

text-align: center

font-size: 3.0em

z-index: 100

position: absolute

top: 50%

margin-top: -110px

}

.heart {

animation: HEARTBEAT 2.5s infinite

}

#top span {

animation: BOUNCE 2.5s infinite

}

@keyframes HEARTBEAT {

0% {

transform: scale(1)

}

5% {

transform: scale(1.3)

}

10% {

transform: scale(1.1)

}

15% {

transform: scale(1.5)

}

50% {

transform: scale(1)

}

100% {

transform: scale(1)

}

}

@keyframes BOUNCE {

0% {

top: 110px

}

10% {

top: 80px

}

15% {

top: 85px

}

20% {

top: 70px

}

75% {

top: 110px

}

100% {

top: 110px

}

}

</style>

<script src="js/prefixfree.min.js"></script>

</head>

<body>

<div class="container bg">

<div class="hometown">

<div class="heart">

</div>

<div id="top">Made in</div>

<div class="city">Boise</div>

<div id="bottom">With love</div>

</div>

</div>

<div style="text-align:centerclear:both">

<script src="/gg_bd_ad_720x90.js" type="text/javascript"></script>

<script src="/follow.js" type="text/javascript"></script>

</div>

<script src='js/jquery.js'></script>

<script src='js/jquery.lettering.js'></script>

<script src="js/index.js"></script>

</body>

</html>

js部分

心率是指单位时间内心脏搏动的次数。一般指每分钟的心跳次数。正常成年人安静时的心率有显著的个体差异,平均在75次/分左右(60—100次/分之间)。心率可因年龄、性别及其他生理情况而不同。初生儿的心率很快,可达130次/分以上。在成年人中,女性的心率一般比男性稍快。同一个人,在安静或睡眠时心率减慢,运动时或情绪激动时心率加快,在某些药物或神经体液因素的影响下,会使心率发生加快或减慢。经常进行体力劳动和体育锻炼的人,平时心率较慢。

心动:心脏的跳动


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/7482743.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-06
下一篇 2023-04-06

发表评论

登录后才能评论

评论列表(0条)

保存