达成此效果需要准备两张图

头像
外边框(带A通道),若背景未白色将看不到图片,请长按空白处点击显示图片

效果展示:www.zhidaoys.com(头像布局未更新,移动端会看到两个头像)

HTML+CSS代码

<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		
		<meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="renderer" content="webkit" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="force-rendering" content="webkit" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="个人网页Create by Lu">
    <meta name="keywords" content="hot_effervescent_noodles,主页,个人主页,个人网站">
    <meta name="author" content="hot_effervescent_noodles">
	<title>hot_effervescent_noodles的个人网页</title>
		<style type="text/css">
			/* CSS Document */
			* {
				margin: 0;
				padding: 0;
			}

			a {
				text-decoration: none;
			}

			.clearfix:after {
				content: "";
				display: block;
				height: 0;
				visibility: hidden;
				clear: both;
			}

			.clearfix {
				*zoom: 1;
			}

			body {
				background: url(./img/background5.jpg) no-repeat;
				background-size: cover;
				background-attachment: fixed;
			}
            /*登录区域*/  
            .loginArea {
                position: absolute;
                z-index: 100;
                top: 59%;
                right: 58%;
                margin-top: -150px;
                width: 337px;
                height: 400px;
            }

            .loginArea .loginForm_area {
                padding: 0 35px 15px 35px;
                background: url(../images/loginArea_bg.png?V=V5_6_2015_03_31) 0 0 repeat;
                border-top-left-radius: 6px;
                border-top-right-radius: 6px;
            }

            .loginArea .loginForm_area .pic {
                position: relative;
                height: 75px;
            }
                /*旋转背景区域*/
            .loginArea .loginForm_area .pic .pic_box_bg {
                position: absolute;
                z-index: 1;
                left: 65px;
                top: -67px;
                width: 235px;
                height: 235px;
                background: url(./pic_box_bg.png) 2px 2px no-repeat;
            }
                /*有边框头像区域*/
            .loginArea .loginForm_area .pic .touxiang {
                position: absolute;
                z-index: 2;
                left: 83px;
                top: -47px;
                overflow: hidden;
                width: 200px;
                height: 200px;
                border-radius: 130px;
                
            }
			.content {
				width: 900px;
				height: 500px;
				margin: 200px auto 0 auto;
				border-radius: 10px;
				background-color: rgba(236, 236, 236, 0.59);
				transition: all 1.0s;
				/*box-shadow: 0px 0px 20px rgba(0,0,0,0.3);*/
			}
			/*无边框头像大小属性*/
			.content img {
				float: left;
				width: 200px;
				height: 200px;
				margin: 150px 0 0 80px;
				border-radius: 100px;/*改变圆角强度*/

			}

			.content:hover {
				box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.52);
			}

			.content_r {
				float: right;
				width: 500px;
				margin: 80px 60px 0 0;
				/*	background-color: pink;*/
			}

			.content_l {
				float: left;
				width: 100%;
				text-align: center;
			}

			.content_l h5 {

				font-size: 17px;
			}

			.cc {
				margin-top: 10px;
				color: #1F2023;
				font-size: 18px;
			}

			.color_1 {
				color: #4855EC;
				font-size: 18px;
			}

			.deeppink {
				color: deeppink;
			}

			.link {
				margin-top: 30px;
			}

			.link a {
				display: block;
				float: left;
				width: 120px;
				height: 45px;
				margin: 5px 5px 0 0;
				/*	padding: 0 15px;*/
				color: #fff;
				line-height: 45px;
				transition: all 0.8s;
				/*	background-color: deeppink;*/

			}

			.link a:hover {
				background-color: rgba(0, 201, 243, 0.35);
			}

			.deeppink_1 {
				background-color: deeppink;
			}

			.dodgerblue {
				background-color: dodgerblue;
			}

			.magenta {
				background-color: magenta;
			}

			.orange {
				background-color: orange;
			}
            /* **********
             * 这里是太阳
             * **********/
            .sun {
                position: absolute;
                width: 20px;
                height: 20px;
                border: 2px solid #333;
                border-radius: 50%;
                left: 270px;
                top: 50px;
                display: flex;
                justify-content: center;
                align-items: center;
                animation: sun_rotate 10s linear infinite;
            }

            @keyframes sun_rotate {
                0% {
                    transform: rotate(0deg);
                }

                100% {
                    transform: rotate(-360deg);
                }
            }

            .sun span{
                position: absolute;
                display: block;
                height: 2px;
                width: 16px;
                background-color: #333;
                box-shadow: 4px 4px 0 0 var(--color5);
                transform: rotate(calc(var(--i) * 45deg)) translateX(-20px);
                animation: sun_ray 1s linear infinite;
                animation-delay: calc(var(--i) * -0.5s);
            }

            @keyframes sun_ray {
                0% {
                    transform: rotate(calc(var(--i) * 45deg)) translateX(-20px) scaleX(1)
                }

                50% {
                    transform: rotate(calc(var(--i) * 45deg)) translateX(-20px) scaleX(0.6)
                }

                100% {
                    transform: rotate(calc(var(--i) * 45deg)) translateX(-20px) scaleX(1)
                }
            }
            
	
            /*头像外圈旋转动画*/
            .pic_box_bg {
                -webkit-animation-name: myfirst;
                -webkit-animation-duration: 10s;
                -webkit-animation-timing-function: linear;
                -webkit-animation-iteration-count: infinite;
                -webkit-animation-play-state: running;
                animation-name: myfirst;
                animation-duration: 10s;
                animation-timing-function: linear;
                animation-iteration-count: infinite;
                animation-play-state: running;
            }


            @-webkit-keyframes myfirst {
                0% {
                    -webkit-transform: rotate(0deg);
                }

                100% {
                    -webkit-transform: rotate(360deg);
                }
            }

            @keyframes myfirst {
                0% {
                    transform: rotate(0deg);
                }

                100% {
                    transform: rotate(360deg);
                }
            }
		</style>
	</head>

	<body>
		<!-- 外框旋转 -->
		<div id="loginArea" class="loginArea" style="">
			<div class="loginForm_area">
				<div class="pic">
					<div class="pic_box_bg"></div><!-- 旋转区域 -->
					<div class="touxiang"><img src="./touxiang2.png" alt=""></div><!-- 头像区域 -->
				</div>
			</div>
		</div>

		<div class="content">
			<!-- 太阳 -->
			<div class="sun">
				<span style="--i:1"></span>
				<span style="--i:2"></span>
				<span style="--i:3"></span>
				<span style="--i:4"></span>
				<span style="--i:5"></span>
				<span style="--i:6"></span>
				<span style="--i:7"></span>
				<span style="--i:8"></span>
			</div>
			<img src="./touxiang.jpeg" alt="">
			<div class="content_r clearfix">
				<div class="content_l clearfix">
					<h2>Welcome</h2>
					<p class="cc">日常记录</p>
					<br>
					<p class="color_1">Create</p>
					<p class="color_1">Imagine</p>
					<br>
					<p class="deeppink">Love, Persevere。</p>
					<p class="deeppink">Create a world where magic and technology coexist.</p>
					<div class="link">
						<a href="#" class="dodgerblue" target="_blank">主页</a>
						<a href="http://43.142.21.106/" class="deeppink_1" target="_blank">博客</a>
						<a href="http://www.zhidaoys.com/animation" class="magenta" target="_blank">动画</a>
						<a href="http://note.LU.cn" class="orange" target="_blank">备忘</a>
					</div>
				</div>
			</div>
			</div>
</body>
</html>

Categories:

Tags:

Comments are closed

 
     
渝ICP备20005137号-1

渝公网安备 50022302000607号