当前位置:网站首页>Shandong University project training (VIII) design rotation map entry page
Shandong University project training (VIII) design rotation map entry page
2022-06-29 18:33:00 【MeditationRain】
List of articles
This time I designed an entry page for our project , Is a full screen dynamic carousel , And there are two buttons in the middle of the page for entering the actual project page .
One 、Swiper Introduce :
Swiper Is a free and lightweight mobile device touch slider js frame , Use hardware to accelerate the transition ( If the device supports ). Mainly used for mobile websites 、 Move web apps,native apps and hybrid apps. Mainly for IOS And designed , meanwhile , stay Android、WP8 The system also has a good user experience ,Swiper from 3.0 No more full support at first PC End . therefore , If you need to be in PC More browsers are compatible on the Internet , You can choose Swiper2.x.
Two 、Swiper introduce
Swiper download :

Import the used files into the project folder :

Add plug-ins :
<!DOCTYPE html> <html> <head> ... <link rel="stylesheet" href="dist/css/swiper-bundle.min.css"> </head> <body> ... <script src="dist/js/swiper-bundle.min.js"></script> ... </body> </html>add to HTML Content :
<div class="swiper">
<div class="swiper-wrapper">
<div class="swiper-slide">Slide 1</div>
<div class="swiper-slide">Slide 2</div>
<div class="swiper-slide">Slide 3</div>
</div>
<!-- If you need a pager -->
<div class="swiper-pagination"></div>
<!-- If you need a navigation button -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
<!-- If you need a scroll bar -->
<div class="swiper-scrollbar"></div>
</div>
Navigation and other components can be placed in Swiper Outside the container
3、 ... and 、Swiper Use
What I used in the project was a full screen carousel , There are dynamic indication points below , And it is played in a loop .

HTML file :
<div class="swiper mySwiper">
<!-- Loading pictures -->
<div class="swiper-wrapper">
<div class="swiper-slide"><img src="images/1.jpg" alt=""></div>
<div class="swiper-slide"><img src="images/2.jpg" alt=""></div>
<div class="swiper-slide"><img src="images/3.jpg" alt=""></div>
<div class="swiper-slide"><img src="images/4.jpg" alt=""></div>
<div class="swiper-slide"><img src="images/5.jpg" alt=""></div>
</div>
<!-- Dynamic indication point -->
<div class="swiper-pagination"></div>
<!-- Page switch button -->
<div class="middle">
<a class="btn btn3" href="./check.html"> Check the air quality of city stations </a>
<a class="btn btn4"> Check the pollution level of the city </a>
</div>
</div>
Pattern design :
.swiper {
width: 100%;
height: 100%;
}
.swiper-slide {
text-align: center;
font-size: 18px;
background: #fff;
/* Center slide text vertically */
display: -webkit-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
-webkit-box-pack: center;
-ms-flex-pack: center;
-webkit-justify-content: center;
justify-content: center;
-webkit-box-align: center;
-ms-flex-align: center;
-webkit-align-items: center;
align-items: center;
}
.swiper-slide img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.middle {
position: absolute;
top: 50%;
left: 50%;
z-index: 2;
transform: translate(-50%,-50%);
}
.btn{
z-index: 2;
display: inline-block;
position: relative;
color: white;
font-size: 14px;
font-family: "montserrat";
text-decoration: none;
margin: 30px 10px;
background: rgba(0, 0, 0, 0.8);
border: 2px solid #ff7675;
padding: 14px 60px;
text-transform: uppercase;
overflow: hidden;
transition: 1s all ease;
}
.btn::before{
background: #ff7675;
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
z-index: -1;
transition: all 0.6s ease;
}
.btn3::before{
width: 100%;
height: 0%;
transform: translate(-50%,-50%) rotate(45deg);
}
.btn3:hover::before{
height: 480%;
}
.btn4::before{
width: 100%;
height: 0%;
transform: translate(-50%,-50%) rotate(-45deg);
}
.btn4:hover::before{
height: 450%;
}
js Code :
var swiper = new Swiper(".mySwiper", {
pagination: {
el: ".swiper-pagination",
},
loop: true,
speed:2000,
autoplay: {
delay: 3000,
disableOnInteraction: false,
waitForTransition: false,
},
effect : 'fade',
fadeEffect: {
crossFade: true,
}
});
边栏推荐
- 保持jupyter notebook在终端关闭时的连接方法
- [tcapulusdb knowledge base] tcapulusdb doc acceptance - create business introduction
- Adobe Premiere Basics - general operations for editing material files (offline files, replacing materials, material labels and grouping, material enabling, convenient adjustment of opacity, project pa
- PostgreSQL database system table
- 数据分析基础--预测模型
- Adobe Premiere foundation - opacity (matte) (11)
- Adobe Premiere Foundation - réglage du son (correction du volume, réduction du bruit, tonalité téléphonique, changement de hauteur, égaliseur de paramètres) (XVIII)
- SD6.25集训总结
- Adobe Premiere基础-常用的视频特效(裁剪,黑白,剪辑速度,镜像,镜头光晕)(十五)
- Shell基本语法--流程控制
猜你喜欢

Sword finger offer 34 Path DFS method for binary tree neutralization

Servlet学生管理系统(萌新练手版)

Cannot retrieve repository metadata processing records

My first experience of remote office | community essay solicitation

通过 hosts文件配置本地域名

Adobe Premiere Foundation - réglage du son (correction du volume, réduction du bruit, tonalité téléphonique, changement de hauteur, égaliseur de paramètres) (XVIII)

【网络是怎么连接的】第三章 探索集线器,交换机和路由器

Understanding of strong caching and negotiation caching

Adobe Premiere基础-常用的视频特效(裁剪,黑白,剪辑速度,镜像,镜头光晕)(十五)

Leetcode 984. String without AAA or BBB (thought of netizens)
随机推荐
If the evaluation conclusion of waiting insurance is poor, does it mean that waiting insurance has been done in vain?
Adobe Premiere基础-不透明度(混合模式)(十二)
Elegant writing controller (parameter verification + unified exception handling)
jdbc认识上手
Sister Juan takes you to learn database -- 5-day dash day4
面试题 10.10. 数字流的秩
garbage collector
Sd6.22 summary of intensive training
Lodash deep copy usage
Weibo comments on high-performance and high availability architecture design (module 5 of architecture practice camp)
[tcapulusdb knowledge base] tcapulusdb doc acceptance - table creation approval introduction
POJ 1975 (transitive closure)
[tcapulusdb knowledge base] tcapulusdb doc acceptance - transaction execution introduction
mysql — 清空表中数据
Travel card "star picking" hot search first! Stimulate the search volume of tourism products to rise
codeforces每日5题(均1700)-第二天
Longest XOR path (dfs+01trie)
Adobe Premiere foundation - opacity (matte) (11)
Image feature computation and representation -- content based image retrieval
Source code installation mavros