前端JS特效第42集:js+css3猫头鹰眼睛跟随鼠标指针转动动画特效

js+css3猫头鹰眼睛跟随鼠标指针转动动画特效,先来看看效果:

部分核心的代码如下(全部代码在文章末尾):

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>js+css3猫头鹰眼睛跟随鼠标指针转动动画特效</title>

<style>
body {
  background: #333;  
}

#container {
  position: relative;
  height: 100%;
  width: 100%;
}

#owl {  
  position: absolute;
	left: 50%;	 
  -webkit-transform: translate(-50%, 0%);	 
          transform: translate(-50%, 0%);
}

#ear1_1 {
  position: absolute;
  width: 190px;
	height: 68px;
	background: #779943;
	border-radius: 130px / 50px;
  top: 20px;
  left: 210px;
  -webkit-transform: scale(0.5) rotate(-80deg);
          transform: scale(0.5) rotate(-80deg);
}

#ear1_2 {
  position: absolute;
  width: 190px;
	height: 68px;
	background: #779943;
	border-radius: 130px / 50px;
  top: 8px;
  left: 245px;
  -webkit-transform: scale(0.5) rotate(45deg);
          transform: scale(0.5) rotate(45deg);
}

#ear1_3 {
  position: absolute;
  width: 60px;
	height: 60px;
	background: #779943;
	border-radius: 150px;
  top: 37px;
  left: 295px;
  -webkit-transform: scale(1) rotate(45deg);
          transform: scale(1) rotate(45deg);
}

#ear2_1 {
  position: absolute;
  width: 190px;
	height: 68px;
	background: #779943;
	border-radius: 130px / 50px;
  top: 20px;
  left: 464px;
  -webkit-transform: scale(0.5) rotate(80deg);
          transform: scale(0.5) rotate(80deg);
}

#ear2_2 {
  position: absolute;
  width: 190px;
	height: 68px;
	background: #779943;
	border-radius: 130px / 50px;
  top: 8px;
  left: 429px;
  -webkit-transform: scale(0.5) rotate(-45deg);
          transform: scale(0.5) rotate(-45deg);
}

#ear2_3 {
  position: absolute;
  width: 60px;
	height: 60px;
	background: #779943;
	border-radius: 150px;
  top: 37px;
  left: 499px;
  -webkit-transform: scale(1) rotate(-45deg);
          transform: scale(1) rotate(-45deg);
}

#owl_body {
  position: absolute;
  width: 220px;
	height: 250px;
	background: #779943;
	border-radius: 180px / 200px;
  top: 157px;
  left: 320px;
  -webkit-transform: scale(2);
          transform: scale(2);
}

#eye1_1 {
  position: absolute;
  width: 180px;
	height: 180px;
	background: #e7e99e;
	border-radius: 150px;
  top: 80px;
  left: 265px;
  -webkit-transform: scale(1);
          transform: scale(1);
}

#eye2_1 {
  position: absolute;
  width: 180px;
	height: 180px;
	background: #e7e99e;
	border-radius: 150px;
  top: 80px;
  left: 416px;
  -webkit-transform: scale(1);
          transform: scale(1);
}

#eye1_2 {
  position: absolute;
  width: 180px;
	height: 180px;
	background: #779943;
	border-radius: 150px;
  top: 70px;
  left: 265px;
  -webkit-transform: scale(0.8);
          transform: scale(0.8);
}

#eye2_2 {
  position: absolute;
  width: 180px;
	height: 180px;
	background: #779943;
	border-radius: 150px;
  top: 70px;
  left: 416px;
  -webkit-transform: scale(0.8);
          transform: scale(0.8);
}

#eye1_3 {
  position: absolute;
  width: 180px;
	height: 180px;
	background: #ffffff;
	border-radius: 150px;
  top: 70px;
  left: 265px;
  -webkit-transform: scale(0.67);
          transform: scale(0.67);
}

#eye2_3 {
  position: absolute;
  width: 180px;
	height: 180px;
	background: #ffffff;
	border-radius: 150px;
  top: 70px;
  left: 416px;
  -webkit-transform: scale(0.67);
  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

强迫领导写Bug

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值