current position:Home>520 watch meteor shower with her on Valentine's Day ~ HTML + CSS + JavaScript make 3D photo album of meteor shower (including music)
520 watch meteor shower with her on Valentine's Day ~ HTML + CSS + JavaScript make 3D photo album of meteor shower (including music)
2021-08-22 22:54:49 【@. code out the future】
* 520 Watch the meteor shower with her on Valentine's Day ~html+css+javascript meteor shower 3D Photo album ( Including music )
annual /520 Valentine's Day / Valentine's day on Chinese Valentine's day / a birthday present / Confession younger martial sister / Programmer's confession
, Do you want to surprise your girlfriend or your sister , Today's blog will share the front-end code html+css+javascript How to achieve 3D Three dimensional dynamic album . I quickly learned , Let's make the romance that belongs to our programmers !
* List of articles
- * 520 Watch the meteor shower with her on Valentine's Day ~html+css+javascript meteor shower 3D Photo album ( Including music )
- * Preface
- * meteor shower 3D Album Demo ( With background music )
- * Code file directory
- One 、3D Photo album ( Code implementation )
- Two 、3D Album replacement ( course )
- 3、 ... and 、 song mp3 Replace tutorial ( course )
- Four 、 Good web effect , How to send links to others ?
- 5、 ... and 、 front end Zero basis Entry to advanced ( video + Source code + Development software + Learning materials + Interview questions ) a full set of ( course )
- 6、 ... and 、* The source code for
- 7、 ... and 、* More confession source code
* Preface
Tanabata Valentine's day ,520/ Valentine's day on Chinese Valentine's day / To marry him / 3D Photo album Programmers can also be romantic
520 Creative expression website , Let your girlfriend die for you . The goddess brought home easily
html+css+javascript Realization 3d Rotating album - Including music ,( My girlfriend for my birthday , Confession , Liao sister ), Dynamic generation effect , Tiktok: a rotated album with a very loud voice , It's made in this way ~, Now? , More and more people like to use video to record their lives , Friends with more photos will also choose to make dynamic album videos , Not only is it creative , At the same time, you can show yourself , It's a magic tool for teasing girls !
* meteor shower 3D Album Demo ( With background music )
meteor shower 3D Photo album - Online demo address
1. PC( Computer terminal ) demonstration
Effect two
Effect three
2. H5( Mobile terminal ) demonstration
* Code file directory
One 、3D Photo album ( Code implementation )
html (3D Album section )
<body>
<!-- The music part -->
<audio autoplay="autopaly">
<source src="renxi.mp3" type="audio/mp3" />
</audio>
<!-- Photo album -->
<div id="box">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<p></p>
</div>
<!-- A shooting star -->
<div class="stars">
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
<div class="star"></div>
</div>
</body>
js ( Meteor shower part )
<script>
setTimeout(init,100);
function init(){
var obox = document.getElementById('box'),
aDiv = obox.getElementsByTagName('div');
for (var i = 0; i < aDiv.length; i++) {
aDiv[i].style.background = "url(img/"+(i+1)+".jpg) center/cover";
aDiv[i].style.transform = "rotateY("+(i*36)+"deg) translate3d(0,0,350px)";
aDiv[i].style.transition = "transform 1s "+(aDiv.length-i)*0.2+"s";
}
var sX,
sY,
nX,
nY,
desX = 0,
desY = 0,
tX = 0,
tY = 10,
index = 0;// Initial value of roller
document.onmousedown = function(e){
clearInterval(obox.timer);
e = e || window.event;
var sX = e.clientX,
sY = e.clientY;
this.onmousemove = function(e){
e = e || window.event;
var nX = e.clientX,
nY = e.clientY;
// The difference between the coordinates of the current point and the coordinates of the previous point
desX = nX - sX;
desY = nY - sY;
tX += desX*0.1;
tY += desY*0.1;
obox.style.transform = "rotateX("+(-tY)+"deg) rotateY("+tX+"deg)";
sX = nX;
sY = nY;
}
this.onmouseup = function(){
this.onmousemove = this.onmouseup = null;
obox.timer = setInterval(function(){
desX *= 0.95;
desY *= 0.95;
tX += desX*0.1;
tY += desY*0.1;
obox.style.transform = "rotateX("+(-tY)+"deg) rotateY("+tX+"deg)";
if (Math.abs(desX)<0.5 && Math.abs(desY)<0.5) {
clearInterval(obox.timer);
}
},13);
}
return false;
}
// The scroll wheel zooms in and out
mousewheel(document,function(e){
e = e || window.event;
var d = e.wheelDelta/120 || -e.detail/3;
if (d>0) {
index-=20;
}else{
index+=30;
}
(index<(-1050)&&(index=(-1050)));
document.body.style.perspective = 1000 + index + "px";
})
function mousewheel(obj,fn){
document.onmousewheel===null?obj.onmousewheel=fn:addEvent(obj,"DOMMouseScroll",fn)
}
function addEvent(obj,eName,fn){
obj.attachEvent?obj.attachEvent("on"+eName,fn):obj.addEventListener(eName,fn);
}
}
</script>
css (3D Album section )
*{
margin: 0;padding: 0;}
html,body{
height: 100%;}
body{
display: flex;
perspective: 1000px;
transform-style: preserve-3d;
/* background-image: url(./img/3.png); */
background: #0c0c0c;
height:100%;
width: 100%;
}
#box{
z-index: 9999;
position: relative;
display: flex;
width: 130px;
height: 200px;
margin: auto;
transform-style: preserve-3d;
transform: rotateX(-10deg);
}
#box > div{
transform-style: preserve-3d;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
line-height: 200px;
font-size: 50px;
text-align: center;
box-shadow:0 0 10px #fff;
-webkit-box-reflect:below 10px -webkit-linear-gradient(top,rgba(0,0,0,0) 40%,rgba(0,0,0,.8) 100%);
}
#box p{
position: absolute;
left: 0;
top: 0;
bottom: 0;
right: 0;
margin: auto;
width: 1200px;
height: 1200px;
background: -webkit-radial-gradient(center center,600px 600px,rgba(50,50,50,1),rgba(0,0,0,0));
border-radius: 50%;
transform: rotateX(90deg) translate3d(-600px,0,-105px);
}
/* Rain effects */
#codepen-link {
position: absolute;
bottom: 30px;
right: 30px;
height: 40px;
width: 40px;
z-index: 10;
border-radius: 50%;
box-sizing: border-box;
background-image: url("https://s3-us-west-2.amazonaws.com/s.cdpn.io/544318/logo.jpg");
background-position: center center;
background-size: cover;
opacity: 0.5;
-webkit-transition: all 0.25s;
transition: all 0.25s;
}
#codepen-link:hover {
opacity: 0.8;
box-shadow: 0 0 6px #efefef;
}
Two 、3D Album replacement ( course )
The tutorial is as follows : First of all, you need to prepare 10 A picture can be cut without cutting , The image format is .jpg
Don't be wrong
3、 ... and 、 song mp3 Replace tutorial ( course )
If it needs to be replaced mp3
The background music , You can download and replace it by yourself ~ mp3 Free download address
1. Search for songs you need
2. download
3 Get songs id
4 Pay attention to the official account. / Copy link to browser open
5 download mp3 ~ After downloading, replace it by yourself mp3 File can ( If you don't want to modify the code , The name must be consistent )
Four 、 Good web effect , How to send links to others ?
1.1 Solve the deployment online ~> Deploy online tools ( It can be used permanently and free of charge )
1. You don't need to buy a server to deploy online , Your connection is accessible all over the world , Here is a necessary artifact for programmers ~
Plugins are integrated with super easy-to-use plug-ins , Download and install for free , Simple and easy to understand , It's an artifact ~ If necessary, it can be found in the article ↓ Xiagong Z Number acquisition
2. Is to do your code effect well , Deploy online , Send links to others , You can let the other party click in through your connection , You can see the effect of your web page , Both computer and mobile terminals are OK ! ( Otherwise, people will send files when they see your web page , The experience is not very good ~)
1.1 Deployment process
1.2 wow ~ Deployment success
wow ~ Deployment success ! Deploy your written page online , People all over the world can access your web page through links ( Free forever )~
5、 ... and 、 front end Zero basis Entry to advanced ( video + Source code + Development software + Learning materials + Interview questions ) a full set of ( course )
Suitable for children's shoes from entry to advanced ~
6、 ... and 、* The source code for
* ~ Pay attention to me , Like the blog ~ Every day brings you knowledge !
* 1. See here, just [ give the thumbs-up + Praise + Collection ] Three even ~ Support me , Yours 「 give the thumbs-up , Praise , Collection 」 It's the driving force of my creation .
* 2. Pay attention to me ~ Take you to study every day : Various front-end plug-ins 、3D Cool effect 、 Pictures show 、 Text effect 、 And the whole station template 、 College graduation template 、 Final assignment template 、 etc. ! 「 There are a lot of front end developer , To discuss front end Node knowledge , learn from each other 」!
* 3. We can learn from each other about the above technical issues , can Focus on ↓ Male Z Number Get more source code !
7、 ... and 、* More confession source code
copyright notice
author[@. code out the future],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2021/08/20210822225447605w.html
The sidebar is recommended
- Crazy blessing! Tencent boss's "million JVM learning notes", real topic of Huawei Java interview 2020-2021
- JS JavaScript how to get the subscript of a value in the array
- How to implement injection in vuex source code?
- JQuery operation select (value, setting, selected)
- One line of code teaches you how to advertise on Tanabata Valentine's Day - Animation 3D photo album (music + text) HTML + CSS + JavaScript
- An article disassembles the pyramid architecture behind the gamefi outbreak
- BEM - a front-end CSS naming methodology
- [vue3] encapsulate custom global plug-ins
- Error using swiper plug-in in Vue
- Another ruthless character fell by 40000, which was "more beautiful" than Passat and maiteng, and didn't lose BMW
guess what you like
-
Huang Lei basks in Zhang Yixing's album, and the relationship between teachers and apprentices is no less than that in the past. Netizens envy Huang Lei
-
He was cheated by Wang Xiaofei and Li Chengxuan successively. Is an Yixuan a blessed daughter and not a blessed home?
-
Zhou Shen sang the theme song of the film "summer friends and sunny days" in mainland China. Netizen: endless aftertaste
-
Pink is Wangyuan online! Back to the peak! The new hairstyle is creamy and sassy
-
Front end interview daily 3 + 1 - day 858
-
Spring Webflux tutorial: how to build reactive web applications
-
[golang] walk into go language lesson 24 TCP high-level operation
-
August 23, 2021 Daily: less than three years after its establishment, Google dissolved the health department
-
The female doctor of Southeast University is no less beautiful than the female star. She has been married four times, and her personal experience has been controversial
-
There are many potential safety hazards in Chinese restaurant. The top of the program recording shed collapses, and the artist will fall down if he is careless
Random recommended
- Anti Mafia storm: He Yun's helpless son, Sun Xing, is destined to be caught by his dry son
- Introduction to flex flexible layout in CSS -- learning notes
- CSS learning notes - Flex layout (Ruan Yifeng tutorial summary)
- Today, let's talk about the arrow function of ES6
- Some thoughts on small program development
- Talk about mobile terminal adaptation
- Unwilling to cooperate with Wang Yibo again, Zhao Liying's fans went on a collective strike and made a public apology in less than a day
- JS function scope, closure, let, const
- Zheng Shuang's 30th birthday is deserted. Chen Jia has been sending blessings for ten years. Is it really just forgetting to make friends?
- Unveil the mystery of ascension
- Asynchronous solution async await
- Analysis and expansion of Vue infinite scroll source code
- Compression webpack plugin first screen loading optimization
- Specific usage of vue3 video play plug-in
- "The story of huiyeji" -- people are always greedy, and fairies should be spotless!
- Installing Vue devtool for chrome and Firefox
- Basic usage of JS object
- 1. JavaScript variable promotion mechanism
- Two easy-to-use animation JS that make the page move
- Front end Engineering - scaffold
- Java SQL Server intelligent fixed asset management, back end + front end + mobile end
- Mediator pattern of JavaScript Design Pattern
- Array de duplication problem solution - Nan recognition problem
- New choice for app development: building mobile applications using Vue native
- New gs8 Chengdu auto show announces interior Toyota technology blessing
- Vieira officially terminated his contract and left the team. The national security club sent blessings to him
- Less than 200000 to buy a Ford RV? 2.0T gasoline / diesel power, horizontal bed / longitudinal bed layout can be selected
- How does "heart 4" come to an end? Pinhole was boycotted by the brand, Ma Dong deleted the bad comments, and no one blessed him
- We are fearless in epidemic prevention and control -- pay tribute to the front-line workers of epidemic prevention!
- Front end, netty framework tutorial
- Xiaomi 11 | miui12.5 | android11 solves the problem that the httpcanary certificate cannot be installed
- The wireless charging of SAIC Roewe rx5 plus is so easy to use!
- Upload and preview pictures with JavaScript, and summarize the most complete mybatis core configuration file
- [25] typescript
- CSS transform Complete Guide (Second Edition) flight.archives 007
- Ajax foundation - HTTP foundation of interview essential knowledge
- Cloud lesson | explain in detail how Huawei cloud exclusive load balancing charges
- Decorator pattern of JavaScript Design Pattern
- [JS] 10. Closure application (loop processing)
- Left hand IRR, right hand NPV, master the password of getting rich