日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > HTML >内容正文

HTML

HTML+CSS 旋转照片墙!源代码(简易动画干货快收藏!!)

發布時間:2024/3/24 HTML 47 豆豆
生活随笔 收集整理的這篇文章主要介紹了 HTML+CSS 旋转照片墙!源代码(简易动画干货快收藏!!) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

拿走請三連,并注明出處

新手上路,路過的大佬請多多指教~

動畫特效為11張照片,環繞著旋轉(照片可自改添加,源代碼中用到的照片未上傳)

?

<!DOCTYPE?html>

<html?lang="en">

<head>

????<meta?charset="UTF-8">

????<meta?http-equiv="X-UA-Compatible"?content="IE=edge">

????<meta?name="viewport"?content="width=device-width,?initial-scale=1.0">

????<title>照片墻</title>

????<style>

????????body?{

????????????margin:?0px;

???????????

????????}

????????#div1?{

????????????width:?100%;

????????????height:?50px;

????????????background:?rgba(50,?161,?235,?0.966);

????????}

????????#div2?{

????????????background-image:?url(w3.jpeg);

????????????position:fixed;

????????????top:?0;

????????????left:?0;

????????????width:100%;

????????????height:100%;

????????????min-width:?1000px;

????????????z-index:-10;

????????????zoom:?1;

????????????background-color:?#fff;

????????????background-repeat:?no-repeat;

????????????background-size:?cover;

????????????-webkit-background-size:?cover;

????????????-o-background-size:?cover;

????????????background-position:?center?0;

????????}

????????#photo_box{

????????????width:?280px;

????????????height:?400px;

????????????position:?fixed;

????????????left:?0;

????????????right:?0;

????????????top:0;

????????????bottom:?0;

????????????margin:?200px?auto;

????????????transform-style:?preserve-3d;/*表示所有子元素在3D空間中呈現*/

????????????transform:?rotateX(-5deg)?rotateY(0deg);

????????????animation:?run?30s?linear?infinite;/*循環執行run動畫,每30秒執行一次*/

????????}

?

????????/*設置圖像大小、邊框、圓角、位置*/

????????#photo_box?img{

????????????width:?250px;

????????????height:?350px;

????????????border:?5px?solid?#ccc;

????????????border-radius:?5px;

????????????position:?absolute;

????????????left:?0;

????????????top:?0;

????????}

?

????????/*依次設置圖像盒子中每個圖像旋轉后位置*/

????????#photo_box?img:nth-child(1){

????????????transform:?rotateY(0deg)?translateZ(500px);

????????}

????????#photo_box?img:nth-child(2){

????????????transform:?rotateY(36deg)?translateZ(500px);

????????}

????????#photo_box?img:nth-child(3){

????????????transform:?rotateY(72deg)?translateZ(500px);

????????}

????????#photo_box?img:nth-child(4){

????????????transform:?rotateY(108deg)?translateZ(500px);

????????}

????????#photo_box?img:nth-child(5){

????????????transform:?rotateY(144deg)?translateZ(500px);

????????}

????????#photo_box?img:nth-child(6){

????????????transform:?rotateY(180deg)?translateZ(500px);

????????}

????????#photo_box?img:nth-child(7){

????????????transform:?rotateY(216deg)?translateZ(500px);

????????}

????????#photo_box?img:nth-child(8){

????????????transform:?rotateY(252deg)?translateZ(500px);

????????}

????????#photo_box?img:nth-child(9){

????????????transform:?rotateY(288deg)?translateZ(500px);

????????}

????????#photo_box?img:nth-child(10){

????????????transform:?rotateY(324deg)?translateZ(500px);

????????}

????????#photo_box?img:nth-child(11){

????????????transform:?rotateY(360deg)?translateZ(500px);

????????}

?

????????????/*采用@keyframes?規則創建run動畫。*/

????????@keyframes?run?{

????????????0%{transform:?rotateX(0deg)?rotateY(0deg);

????????????}

????????????25%{transform:?rotateX(10deg)?rotateY(90deg);

????????????}

????????????50%{transform:?rotateX(0deg)?rotateY(180deg);

????????????}

????????????75%{transform:?rotateX(-10deg)?rotateY(270deg);

????????????}

????????????100%{transform:?rotateX(0deg)?rotateY(360deg);

????????????}

????????}

????????#text1?{

????????????float:?left;

????????????color:#fff;

????????????width:?150px;

????????????padding:12px?0;

????????????height:?50px;

????????}

????????#text2?{

????????????float:?right;

????????????width:?100px;

????????????color:#fff;

????????????padding:12px?0;

????????????height:?50px;

????????}

????????#text3?{

????????????float:?right;

????????????width:?100px;

????????????color:#fff;

????????????padding:12px?0;

????????????height:?50px;

????????}

?

????</style>

</head>

<body>

????<div?id="div1">

????????<div?id="text1">歡迎登錄!</div>

????????<div?id="text2"?οnclick="outclick()"?>退出</div>

????????<div?id="text3">個人信息</div>

????</div>

????<div?id="div2">

????????<div?id="photo_box">

????????????<img?src="image/1.jpg">

????????????<img?src="image/2.jpg">

????????????<img?src="image/3.jpg">

????????????<img?src="image/4.jpg">

????????????<img?src="image/5.jpg">

????????????<img?src="image/6.jpg">

????????????<img?src="image/7.jpg">

????????????<img?src="image/8.jpg">

????????????<img?src="image/9.jpg">

????????????<img?src="image/10.jpg">

????????????<img?src="image/11.jpg">

????????</div>

????</div>

</body>

/*簡單設置頁面*/

<script>

????var?name=localStorage.getItem("username");

????var?div1=document.getElementById("text1");

????div1.innerHTML="歡迎"+name+"登錄!";

????function?outclick()?{

????????localStorage.clear();

????????window.location.href="登錄頁面.html";

????}

</script>

</html>

?

記得點贊關注喔~

總結

以上是生活随笔為你收集整理的HTML+CSS 旋转照片墙!源代码(简易动画干货快收藏!!)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。