關於純cs3動畫的五個原創實例分享
1.落葉動畫(狀態描述:形如秋風吹落葉,落葉無情逗秋風)
代碼如下:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>texiao1</title>
<style>
{
margin: 0;
padding: 0;
}
body {
background: url("./image/timg.jpg")no-repeat;/ 設置落葉背景圖*/
background-size: 100%;
} .one{ height: 160px; width: 120px; } .one>img{ width: 60%; height: 60%; } @keyframes yezi { 0% { transform: rotatez(0deg); }/* 自定義動畫*/ 20%{ transform: rotatez(720deg); height: 10%; width: 10%; } 40%{ transform: rotatez(1440deg); height: 40%; width: 40%; } 60%{ transform: rotatez(1620deg); height: 40%; width: 40%; } 80%{ transform: rotatez(1800deg); height: 60%; width: 60%; } 100%{ transform: rotatez(1980deg); height: 60%; width: 60%; } }/* 動畫分五個步驟*/ .one_1{ position: absolute; animation: yezi 20s linear infinite; animation-direction:alternate; }/*動畫應用,落葉旋轉*/ .one_2{ animation: yezi 20s linear infinite; animation-timing-function: cubic-bezier(0.42,0,1,1);/*設置個別動畫軌跡*/ } .bao{ width: 1500px; height: 1000px; margin: 0 auto; } .one1{ margin-left: 200px; margin-top: -100px; } .one2{ margin-left: 200px; margin-top: -300px; } .one3{ margin-right: 200px; margin-top: -500px; } </style>
</head>
<body>
<div class="bao" >
<div style="float: left" class="one1">
<div class="one one_1">
<img src="./image/ye1.png " alt="" >
</div>
</div>
<div class="one one_1">
<img src="./image/ye1.png " alt="" >
<div class="one one_1">
<img src="./image/ye1.png " alt="" >
</div>
<div style="float: left" class="one2">
<div class="one one_2">
<img src="./image/ye3.png " >
</div>
</div>
<div class="one one_1">
<img src="./image/ye1.png " >
</div>
<div class="one one_1">
<img src="./image/ye1.png " >
</div>
<div class="one one_2">
<img src="./image/ye3.png " alt="" >
</div> <div class="one one_2">
<img src="./image/ye3.png " alt="" >
</div>
<div style="float: right" class="one3">
<div class="one one_1">
<img src="./image/ye1.png " alt="" >
</div>
<div class="one one_2">
<img src="./image/ye3.png " alt="" >
</div>
</div>
<div class="one one_1">
<img src="./image/ye1.png " alt="" >
</div> <div class="one one_1">
<img src="./image/ye1.png " alt="" >
</div>
<div class="one one_2">
<img src="./image/ye2.png " alt="" >
</div>
<div style="float: right" >
<div class="one one_1">
<img src="./image/ye1.png " alt="" >
</div>
<div class="one one_2">
<img src="./image/ye3.png " alt="" >
</div>
<div class="one one_2">
<img src="./image/ye2.png " alt="" >
</div>
</div>
</div>
</body>
</html>
由於是動態圖,效果還是請大家復制代碼,替換圖片,自行觀看。
2.小車跑跑圖(我噠噠的馬蹄聲是個美麗的錯誤,我不是歸人,因為我開奧迪奔奔)
代碼如下:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>texiao2</title>
<style>
*{
margin: 0;
padding: 0;
}
body {
background: url("./image/b999a9014c086e062487d66e08087bf40ad1cbec.jpg")no-repeat;
background-size: 100%;
background-position: 0 -150px ;
position: relative;
}
.che{
position: absolute;
width: 400px;
height: 200px;
top:400px;
left: -400px;
background: url("./image/cheshen.png")no-repeat;
background-size: 145%;
background-position: -95px -40px;
animation: pao 10s ease-in-out infinite;
}/*定義最外圍車身的框架及背景圖片*/
@keyframes pao {
from { left: -400px; }
to{
left: 1400px;
}
}/*定義車整體動畫*/
.houlun {
width: 65px;
height: 65px;
top: 115px;
left: 28px;
border-radius: 50%;
border: 1px solid red;
position: absolute;
animation: che 0.5s linear infinite;
}/*後輪div定義*/
.qianlun {
width: 65px;
height: 65px;
top: 115px;
left:293px;
border-radius: 50%;
border: 1px solid red;
position: absolute;
animation: che 0.5s linear infinite;
}/*前輪div定義*/
.che img{
max-height: 100%;
max-width: 100%;
}
@keyframes che {
from {
transform: rotatez(90deg);
}
to {
transform: rotatez(810deg);
}
}
</style>
</head>
<body>
<div class="che" >
<div class="qianlun">
<img src="./image/qianlun.png" >
</div>
<div class="houlun">
<img src="./image/houlun.png" >
</div>
</div>
</body>
</html>
3.扇子(還可以點擊一下)
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>shanzi</title>
.one{ <style>
*{
margin: 0;
padding: 0;
}
body {
background: url("./image/shui.jpg")no-repeat;
background-size: 100%;
position: relative;
}
.one{
position: absolute;
width: 30px;
height: 500px;
border-radius: 20px;
text-align: center;
font-size: 18px;
top: 0px;
font-family:"華文楷體","STKaiti " ;
box-shadow: 0 0 20px #806000;
border: 2px solid #997835;
animation: shanzi 5s 2;
animation-direction:alternate;
}
@keyframes shanzi {
from {
transform: rotatez(0deg);
}
to{
transform: rotatez(-60deg);
}
}
.one_1 {
left: 400px;
}
.one_1:hover .one_2 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_3 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_4 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_5 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_6 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_7 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_8 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_9 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_10 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_11 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_12{
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_13 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_14 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_15 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_16 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_17 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_18 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_19 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_20 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_21 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_22 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_23 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_24 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_25 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_26 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_27 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
.one_1:hover .one_28 {
transform: rotatez(5deg);
transform-origin:0% 90%;
}
</style>
</head>
<body>
<div class="one one_1" >
寂寞花開寂寞處
<div class="one one_2">
寂寞處裏尋無路
<div class="one one_3">
誰怨秋風催人思
<div class="one one_4">
一重相思一重癡
<div class="one one_5">
癡子揮筆署情詩
<div class="one one_6">
情在墨裏安可知
<div class="one one_7">
天高地闊自逍遙
<div class="one one_8">
無緣也罷莫悴憔
<div class="one one_9">
世間情人多離分
<div class="one one_10">
莫笑僧尼斷紅塵
<div class="one one_11">
佳人不待癡情人
<div class="one one_12">
癡情枉然苦情深
<div class="one one_13">
蕩胸且懷壯誌在
<div class="one one_14">
行路不懼冰雪塞
<div class="one one_15">
浮雲不逐金日高
<div class="one one_16">
吾又何必為折腰
<div class="one one_17">
淌過綠水上青山
<div class="one one_18">
山青景秀人欲瞻
<div class="one one_19">
居巍俯瞰路千萬
<div class="one one_20">
不知何去恨寡斷
<div class="one one_21">
忽見潔雲遊蒼穹
<div class="one one_22">
無拘不羈多羨崇
<div class="one one_23">
吾輩躊躇疑西東
<div class="one one_24">
如斯怎能化騰龍
<div class="one one_25">
吾輩躊躇疑西東
<div class="one one_26">
,如斯怎能化騰龍
<div class="one one_27">
如斯怎能化騰龍
<div class="one one_28">
【二十八絕句】
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
4.發光字體(不是很炫酷)
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>faguangzi</title>
<style>
{
margin: 0;
padding: 0;
}
body {
background-color:black ;
font-size: 50px;
}
.one{
text-align: center;
color: white;
animation: faguang 4s linear infinite;
}
@keyframes faguang {
25%{color: #744800;
text-shadow:0 0 10px darkgray;
}
50%{color: #744800;
text-shadow:0 0 50px #f2f2f2;
}
75%{color: #d39200;
text-shadow:0 0 100px #f2f2f2;
}
100%{color: orangered;
text-shadow:0 0 150px #f2f2f2;
}
}
.five{
text-align: center;
color: white;
animation: faguang5 4s linear infinite;
}
@keyframes faguang5 {
25%{color: #744800;
text-shadow:0 0 10px darkgray;
}
50%{color: #744800;
text-shadow:0 0 50px #f2f2f2;
}
75%{color: #d39200;
text-shadow:0 0 100px #f2f2f2;
}
100%{color: orangered;
text-shadow:0 0 150px #f2f2f2;
}
}
.two{
text-align: center;
color: white;
animation: faguang2 4s linear infinite;
}
@keyframes faguang2 {
25%{color: #744800;
text-shadow:0 0 10px #7c0515;
}
50%{color: #a36700;
text-shadow:0 0 50px #ae051d;
}
75%{color: #e8a300;
text-shadow:0 0 100px #d75f00;
}
100%{color: #ffc683;
text-shadow:0 0 150px #ff0a2c;
}
}
.three{
text-align: center;
color: white;
animation: faguang3 4s linear infinite;
}
@keyframes faguang3 {
25%{color: #214838;
text-shadow:0 0 10px #0e4a1a;
}
50%{color: #3f8567;
text-shadow:0 0 50px #3a7538;
}
75%{color: #54bf99;
text-shadow:0 0 100px #20bf43;
}
100%{color: #73ffcc;
text-shadow:0 0 150px #2eff54;
}
}
.four{
text-align: center;
color: white;
animation: faguang4 4s linear infinite;
}
@keyframes faguang4 {
25%{color: #744800;
text-shadow:0 0 10px darkgray;
}
50%{color: #744800;
text-shadow:0 0 50px #f2f2f2;
}
75%{color: #d39200;
text-shadow:0 0 100px #f2f2f2;
}
100%{color: orangered;
text-shadow:0 0 150px #f2f2f2;
}
}
</style>
</head>
<body>
<p class="one">世界四大邪術</p>
<p class="two">×××術</p>
<p class="three">變性術</p>
<p class="four">化妝術</p>
<p class="five">PS術</p>
</body>
</html>
5.大風車吱呦呦的轉
代碼如下:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>風箏</title>
<style>
<style>
{
margin: 0;
padding: 0;
}
body {
background: url("./image/fengche.jpg")no-repeat;
background-size: 100%;
position: relative;
}
.wai{
width: 600px;
height: 600px;
position: absolute;
top: 100px;
left: 400px;
animation: fengche 5s ease-in-out infinite;
}/*定義大框*/
@keyframes fengche {
from {transform: rotatez(90deg)}
to{
transform: rotatez(-3600deg);
}
}/*定義動畫*/
.che {
position: absolute;
overflow: hidden;
}
.one{
height: 300px;
width: 100px;
left: 200px;
border-radius:150px 0 30px 0;
background-color: #85ff5d;
}/*調整四個小風葉之一*/
.three{
height: 300px;
width: 100px;
bottom: 0px;
left: 300px;
overflow:hidden ;
border-radius: 30px 0 150px 0;
background-color: #ffc22d;
}/*調整四個小風葉之一*/
.two{
height: 100px;
width: 300px;
top: 300px;
overflow: hidden;
border-radius:0 30px 0 150px;
background-color: #46c1ff;
}/*調整四個小風葉之一*/
.four{
height: 100px;
width: 300px;
right: 0px;
top: 200px;
overflow: hidden;
border-radius: 0 150px 0 30px;
background-color: #ff2540;
}/*調整四個小風葉之一*/
.xian1{
display: block;
height: 300px;
position: absolute;
background-color: #cecece;
width: 1px;
bottom: 0px;
right: 0px;
transform: rotatez(-25deg);
transform-origin: 0% 100%;
}/*調整分割虛線*/
.xian2{
display: block;
height: 1px;
position: absolute;
background-color: #cecece;
width: 300px;
right: 0;
top: 0;
transform: rotatez(-25deg);
transform-origin: 100% 0%;
}/*調整分割虛線*/
.xian3{
display: block;
height: 300px;
position: absolute;
background-color: #cecece;
width: 1px;
bottom: 0px;
left: 0px;
transform: rotatez(-25deg);
transform-origin: 0% 0%;
}/*調整分割虛線*/
.xian4{
display: block;
height: 1px;
position: absolute;
background-color: #cecece;
width: 300px;
bottom: 0px;
right: 0px;
transform: rotatez(-25deg);
transform-origin: 0% 100%;
}/*調整分割虛線*/
</style>
</head>
<body>
<div class="wai">
<div class="che one">
<i class="xian1"></i>
</div>
<div class="che two">
<i class="xian2"></i>
</div>
<div class="che three">
<i class="xian3"></i>
</div>
<div class="che four">
<i class="xian4"></i>
</div>
</div>
</body>
</html>
今天就寫到這裏,如有錯誤賀問題歡迎大家指正賀探討!
關於純cs3動畫的五個原創實例分享