avaScript案例講解:3D相冊拖拽旋轉(zhuǎn)
知識點(diǎn):利用for循環(huán)動態(tài)布局,獲取元素,css3與js的結(jié)合,3D場景的打造,JS加載問題,編程思維,定時器,鼠標(biāo)事件,event事件。
效果圖:
拖拽可旋轉(zhuǎn)
櫻花飄落3D相冊],程序員也可以很浪漫哦 ! 程序員向妹子表白專用代碼!?HTML+css3+js 抖音很火的3d旋轉(zhuǎn)相冊-包含音樂,(送女友,表白,生日)動態(tài)生成效果,這樣制作的~,現(xiàn)在,越來越多的人喜歡用視頻記錄生活,照片多的友友也會選擇制作動態(tài)相冊視頻,不僅創(chuàng)意十足,同時還能展現(xiàn)自我風(fēng)采, 撩妹神器哦!
? 櫻花雨3D相冊(含背景音樂)
在線演示地址
文字開場白+演示地址
? 加點(diǎn)螢火蟲金光閃閃的效果??在線演示地址
文字開場白+演示地址
? 藍(lán)色背景
?
3d相冊制作教程
需要12張圖片, 1-6 圖片是大圖 400400 ,01-06 圖片是小圖 100100
將準(zhǔn)備好的圖片,自行替換images 文件中的圖片即可
美圖秀秀(電腦版)裁剪圖片
在線裁剪圖片鏈接
MP3 免費(fèi)下載
mp3免費(fèi)下載地址如需更換mp3 背景音樂,可自行下載更換即可…
mp3下載教程
?解決上線問題> (不需要服務(wù)器就能免費(fèi)部署上線)部署上線工具(永久可用)
不需要買服務(wù)器就能部署線上,全世界都能訪問你的連接啦, 這里給大家推薦一個程序員必備軟件 ,插件集成了超級多好用的插件,免費(fèi)下載安裝,簡單易懂, 簡直神器
1.部署流程
2.連接成功
將你寫好的頁面部署上線后, 全世界的人都可以愉快的訪問到你的網(wǎng)頁了(永久免費(fèi)使用哦)
? -------------------- 好了廢話不多說 上正題 >>>>櫻花雨3D相冊代碼如下--------------------
? 櫻花雨3D相冊代碼如下
? 文件目錄
? html代碼
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="js/jquery.min.js"></script>
<link type="text/css" href="./css/style.css" rel="stylesheet" />
<style>
html,
body {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
overflow: hidden;
}
.container {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
background-color: #000000;
}
</style>
</head>
<body>
<audio autoplay="autopaly">
<source src="renxi.mp3" type="audio/mp3" />
</audio>
<div id="jsi-cherry-container" class="container">
<div class="box">
<ul class="minbox">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ul>
<ol class="maxbox">
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
<li></li>
</ol>
</div>
</div>
<script>
....
</script>
</body>
</html>
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
? 相冊旋轉(zhuǎn) css代碼
@charset "utf-8";
*{
margin:0;
padding:0;
}
body{
max-width: 100%;
min-width: 100%;
height: 100%;
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
background-size:100% 100%;
position: absolute;
margin-left: auto;
margin-right: auto;
}
li{
list-style: none;
}
.box{
width:200px;
height:200px;
background-size: cover;
background-repeat: no-repeat;
background-attachment: fixed;
background-size:100% 100%;
position: absolute;
margin-left: 42%;
margin-top: 22%;
-webkit-transform-style:preserve-3d;
-webkit-transform:rotateX(13deg);
-webkit-animation:move 5s linear infinite;
}
.minbox{
width:100px;
height:100px;
position: absolute;
left:50px;
top:30px;
-webkit-transform-style:preserve-3d;
}
.minbox li{
width:100px;
height:100px;
position: absolute;
left:0;
top:0;
}
.minbox li:nth-child(1){
background: url(../images/01.png) no-repeat 0 0;
-webkit-transform:translateZ(50px);
}
.minbox li:nth-child(2){
background: url(../images/02.png) no-repeat 0 0;
-webkit-transform:rotateX(180deg) translateZ(50px);
}
.minbox li:nth-child(3){
background: url(../images/03.png) no-repeat 0 0;
-webkit-transform:rotateX(-90deg) translateZ(50px);
}
.minbox li:nth-child(4){
background: url(../images/04.png) no-repeat 0 0;
-webkit-transform:rotateX(90deg) translateZ(50px);
}
.minbox li:nth-child(5){
background: url(../images/05.png) no-repeat 0 0;
-webkit-transform:rotateY(-90deg) translateZ(50px);
}
.minbox li:nth-child(6){
background: url(../images/06.png) no-repeat 0 0;
-webkit-transform:rotateY(90deg) translateZ(50px);
}
.maxbox li:nth-child(1){
background: url(../images/1.png) no-repeat 0 0;
-webkit-transform:translateZ(50px);
}
.maxbox li:nth-child(2){
background: url(../images/2.png) no-repeat 0 0;
-webkit-transform:translateZ(50px);
}
.maxbox li:nth-child(3){
background: url(../images/3.png) no-repeat 0 0;
-webkit-transform:rotateX(-90deg) translateZ(50px);
}
.maxbox li:nth-child(4){
background: url(../images/4.png) no-repeat 0 0;
-webkit-transform:rotateX(90deg) translateZ(50px);
}
.maxbox li:nth-child(5){
background: url(../images/5.png) no-repeat 0 0;
-webkit-transform:rotateY(-90deg) translateZ(50px);
}
.maxbox li:nth-child(6){
background: url(../images/6.png) no-repeat 0 0;
-webkit-transform:rotateY(90deg) translateZ(50px);
}
....
完整代碼在下方↓公眾號獲取
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
? 櫻花飄落 js代碼
發(fā)語言:Html5
開發(fā)工具:HBuilderX
先說一下,開發(fā)工具下載,可以直接去百度搜HBuilderX,
百度搜“HBuilder”
根據(jù)自己的系統(tǒng)點(diǎn)擊直接下載
準(zhǔn)備工作
提前準(zhǔn)備好js,css,img圖片
廢話不多說,我們直接把代碼敲起來
開發(fā)步驟:
1、雙擊打開HBuilderX
2、點(diǎn)擊創(chuàng)建項(xiàng)目
3、 在項(xiàng)目中添加素材
1)將圖片素材拷貝至img文件夾中
2)將style.css文件拷貝至css文件夾中
3)將3d-tv.js文件拷貝至js文件夾中
4、編輯index.html
5、運(yùn)行看效果
<script src="https://lf6-cdn-tos.bytescm.com/obj/cdn-static-resource/tt_player/tt.player.js?v=20160723"></script>
小伙伴,如果你覺得不錯,幫忙點(diǎn)贊噢
*請認(rèn)真填寫需求信息,我們會在24小時內(nèi)與您取得聯(lián)系。