1. 程式人生 > >生日快樂網站模板(個人製作)(HTML5+CSS3+JS)

生日快樂網站模板(個人製作)(HTML5+CSS3+JS)

.ly-box01 {
	width:50px;
	height:50px;
	background-color:#FFF;
	border-radius: 25px;
	position: absolute;
	left: 48%;
	bottom: 50%;
	margin-bottom:50%;
	overflow: hidden;
	transform-origin:center bottom;
	animation:box_to_point 18.5s 0s,bounce 2.5s 18.5s;
}

@keyframes box_to_point{
	0% {
		margin-bottom:50%;
		width:50px;
		height:50px;
		border-radius: 25px;
		position: absolute;
		left: 48%;
		bottom: 50%;
		}
	10% {
		margin-bottom:0;
		width:50px;
		height:50px;
		border-radius: 25px;
		background-color:rgba(255,255,255,1);
		position: absolute;
		left: 48%;
		bottom: 50%;
	}
	14% {
		margin-bottom:0;
		width: 80%;
		height: 550px;
		border-radius: 6px;
		background-color:rgba(255,255,255,0.5);
		position: absolute;
		left: 10%;
		bottom: 12%;
	}
	96% {
		margin-bottom:0;
		width: 80%;
		height: 550px;
		border-radius: 6px;
		background-color:rgba(255,255,255,0.6);
		position: absolute;
		left: 10%;
		bottom: 12%;
	}
	100% {
		margin-bottom:0;
		width:50px;
		height:50px;
		border-radius: 25px;
		background-color:rgba(255,255,255,1);
		position: absolute;
		left: 48%;
		bottom: 50%;
	}
}
@-webkit-keyframes box_to_point{
	0% {
		margin-bottom:50%;
		width:50px;
		height:50px;
		border-radius: 25px;
		position: absolute;
		left: 48%;
		bottom: 50%;
		}
	10% {
		margin-bottom:0;
		width:50px;
		height:50px;
		border-radius: 25px;
		background-color:rgba(255,255,255,1);
		position: absolute;
		left: 48%;
		bottom: 50%;
	}
	14% {
		margin-bottom:0;
		width: 80%;
		height: 550px;
		border-radius: 6px;
		background-color:rgba(255,255,255,0.5);
		position: absolute;
		left: 10%;
		bottom: 12%;
	}
	96% {
		margin-bottom:0;
		width: 80%;
		height: 550px;
		border-radius: 6px;
		background-color:rgba(255,255,255,0.6);
		position: absolute;
		left: 10%;
		bottom: 12%;
	}
	100% {
		margin-bottom:0;
		width:50px;
		height:50px;
		border-radius: 25px;
		background-color:rgba(255,255,255,1);
		position: absolute;
		left: 48%;
		bottom: 50%;
	}
}
@keyframes bounce{
	0% {
		margin-bottom:0;
		width: 50px;
		height: 50px;
		border-radius: 25px;
		bottom:50%;
		left: 48%;
	}
	50% {
		margin-bottom:0;
		left: 48%;
		width: 50px;
		height: 50px;
		border-radius: 25px;
		bottom:0;
		left: 48%;
	}
	100% {
		margin-bottom:0;
		width: 20px;
		height: 20px;
		border-radius: 10px;
		left: 48%;
		bottom: 0;
		left: 20%;
	}
}
@-webkit-keyframes bounce{
		0% {
		margin-bottom:0;
		width: 50px;
		height: 50px;
		border-radius: 25px;
		bottom:50%;
		left: 48%;
	}
	50% {
		margin-bottom:0;
		left: 48%;
		width: 50px;
		height: 50px;
		border-radius: 25px;
		bottom:0;
		left: 48%;
	}
	100% {
		margin-bottom:0;
		width: 20px;
		height: 20px;
		border-radius: 10px;
		left: 48%;
		bottom: 0;
		left: 20%;
	}
}
/*文字*/
.ly-txt01 {
	position:absolute;
	width: 40%;
	left:10%;
	top:10%;
}
.ly-txt02 {
	position:absolute;
	width: 40%;
	left:60%;
	top:10%;
}
.ly-stxt01 {
	font-family: Microsoft YaHei;
	font-size: 30px;
	font-color: #000;
	position: relative;
	left: 5%;
	top: 5%;
	opacity: 0;
	animation:ly-stxt01_move 15s;
	animation-delay:3s;
	-webkit-animation:ly-stxt01_move 15s;
	-webkit-animation-delay:3s;
}
@keyframes ly-stxt01_move{
	0% {opacity:0;}
	8% {opacity:1;}
	90% {opacity:1;}
	98% {opacity:0;}
	100% {opacity:0;}
}
@-webkit-keyframes ly-stxt01_move{
	0% {opacity:0;}
	8% {opacity:0;}
	90% {opacity:1;}
	98% {opacity:0;}
	100% {opacity:0;}
}

.ly-stxt02 {
	font-family: Microsoft YaHei;
	font-size: 30px;
	font-color: #000;
	position: relative;
	left: 5%;
	top: 5%;
	margin-top:-71px;
	opacity: 0;
	animation:ly-stxt02_move 15s;
	animation-delay:3s;
	-webkit-animation:ly-stxt02_move 15s;
	-webkit-animation-delay:3s;
}
@keyframes ly-stxt02_move{
	0% {opacity:0;margin-top:-71px;}
	8% {opacity:0;margin-top:-71px;}
	16% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}
@-webkit-keyframes ly-stxt02_move{
	0% {opacity:0;margin-top:-71px;}
	8% {opacity:0;margin-top:-71px;}
	16% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}

.ly-stxt03 {
	font-family: Microsoft YaHei;
	font-size: 30px;
	font-color: #000;
	position: relative;
	left: 5%;
	top: 5%;
	opacity: 0;
	margin-top:-71px;
	animation:ly-stxt03_move 15s;
	animation-delay:3s;
	-webkit-animation:ly-stxt03_move 15s;
	-webkit-animation-delay:3s;
}
@keyframes ly-stxt03_move{
	0% {opacity:0;margin-top:-71px;}
	16% {opacity:0;margin-top:-71px;}
	24% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}
@-webkit-keyframes ly-stxt03_move{
	0% {opacity:0;margin-top:-71px;}
	16% {opacity:0;margin-top:-71px;}
	24% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}

.ly-stxt04 {
	font-family: Microsoft YaHei;
	font-size: 30px;
	font-color: #000;
	position: relative;
	left: 5%;
	top: 5%;
	opacity: 0;
	margin-top:-71px;
	animation:ly-stxt04_move 15s;
	animation-delay:3s;
	-webkit-animation:ly-stxt04_move 15s;
	-webkit-animation-delay:3s;
}
@keyframes ly-stxt04_move{
	0% {opacity:0;margin-top:-71px;}
	24% {opacity:0;margin-top:-71px;}
	32% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}
@-webkit-keyframes ly-stxt04_move{
	0% {opacity:0;margin-top:-71px;}
	24% {opacity:0;margin-top:-71px;}
	32% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}

.ly-stxt05 {
	font-family: Microsoft YaHei;
	font-size: 30px;
	font-color: #000;
	position: relative;
	left: 5%;
	top: 5%;
	opacity: 0;
	margin-top:-71px;
	animation:ly-stxt05_move 15s;
	animation-delay:3s;
	-webkit-animation:ly-stxt05_move 15s;
	-webkit-animation-delay:3s;
}
@keyframes ly-stxt05_move{
	0% {opacity:0;margin-top:-71px;}
	32% {opacity:0;margin-top:-71px;}
	40% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}
@-webkit-keyframes ly-stxt05_move{
	0% {opacity:0;margin-top:-71px;}
	32% {opacity:0;margin-top:-71px;}
	40% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}

.ly-stxt06 {
	font-family: Microsoft YaHei;
	font-size: 30px;
	font-color: #000;
	position: relative;
	right: 5%;
	top: 5%;
	opacity: 0;
	animation:ly-stxt06_move 15s;
	animation-delay:3s;
	-webkit-animation:ly-stxt06_move 15s;
	-webkit-animation-delay:3s;
}
@keyframes ly-stxt06_move{
	0% {opacity:0;}
	40% {opacity:0;}
	48% {opacity:1;}
	90% {opacity:1;}
	100% {opacity:0;}
}
@-webkit-keyframes ly-stxt06_move{
	0% {opacity:0;}
	40% {opacity:0;}
	48% {opacity:1;}
	90% {opacity:1;}
	100% {opacity:0;}
}

.ly-stxt07 {
	font-family: Microsoft YaHei;
	font-size: 30px;
	font-color: #000;
	position: relative;
	right: 5%;
	top: 5%;
	opacity: 0;
	margin-top:-71px;
	animation:ly-stxt07_move 15s;
	animation-delay:3s;
	-webkit-animation:ly-stxt07_move 15s;
	-webkit-animation-delay:3s;
}
@keyframes ly-stxt07_move{
	0% {opacity:0;margin-top:-71px;}
	48% {opacity:0;margin-top:-71px;}
	56% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}
@-webkit-keyframes ly-stxt07_move{
	0% {opacity:0;margin-top:-71px;}
	48% {opacity:0;margin-top:-71px;}
	56% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}

.ly-stxt08 {
	font-family: Microsoft YaHei;
	font-size: 30px;
	font-color: #000;
	position: relative;
	right: 5%;
	top: 5%;
	opacity: 0;
	margin-top:-71px;
	animation:ly-stxt08_move 15s;
	animation-delay:3s;
	-webkit-animation:ly-stxt08_move 15s;
	-webkit-animation-delay:3s;
}
@keyframes ly-stxt08_move{
	0% {opacity:0;margin-top:-71px;}
	56% {opacity:0;margin-top:-71px;}
	64% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}
@-webkit-keyframes ly-stxt08_move{
	0% {opacity:0;margin-top:-71px;}
	56% {opacity:0;margin-top:-71px;}
	64% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}

.ly-stxt09 {
	font-family: Microsoft YaHei;
	font-size: 30px;
	font-color: #000;
	position: relative;
	right: 5%;
	top: 5%;
	opacity: 0;
	margin-top:-71px;
	animation:ly-stxt09_move 15s;
	animation-delay:3s;
	-webkit-animation:ly-stxt09_move 15s;
	-webkit-animation-delay:3s;
}
@keyframes ly-stxt09_move{
	0% {opacity:0;margin-top:-71px;}
	64% {opacity:0;margin-top:-71px;}
	72% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}
@-webkit-keyframes ly-stxt09_move{
	0% {opacity:0;margin-top:-71px;}
	64% {opacity:0;margin-top:-71px;}
	72% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}

.ly-stxt10 {
	font-family: Microsoft YaHei;
	font-size: 30px;
	font-color: #000;
	position: relative;
	right: 5%;
	top: 5%;
	opacity: 0;
	margin-top:-71px;
	animation:ly-stxt10_move 15s;
	animation-delay:3s;
	-webkit-animation:ly-stxt10_move 15s;
	-webkit-animation-delay:3s;
}
@keyframes ly-stxt10_move{
	0% {opacity:0;margin-top:-71px;}
	72% {opacity:0;margin-top:-71px;}
	80% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}
@-webkit-keyframes ly-stxt10_move{
	0% {opacity:0;margin-top:-71px;}
	72% {opacity:0;margin-top:-71px;}
	80% {opacity:1;margin-top:0;}
	90% {opacity:1;margin-top:0;}
	100% {opacity:0;margin-top:0;}
}

      這全是我一行一行打的啊臥槽(其實一大半和上面一樣是複製的,修改一部分,但是也很累啊!),不說別的了都是淚,效果就是那個動態。這裡的最麻煩,因為使用了CSS3animation,而後面頁面的動態效果使用的主要是CSS3的過渡效果,比這個要簡單的多,所以後面的程式碼就不粘了。