当前位置:网站首页>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,
}
});
边栏推荐
- 程序员资源推荐指南
- Precondition end of script headers or end of script output before headers
- 第八届“互联网+”大赛 | 云原生赛道邀你来挑战
- RocketMQ的tag过滤和sql过滤
- 如何将OAK相机当做网络摄像头使用?
- Mysql database daily backup and scheduled cleanup script
- Weibo comments on high-performance and high availability architecture design (module 5 of architecture practice camp)
- 山东大学项目实训(七)添加导航栏选择城市
- jdbc_相關代碼
- Data-* attribute usage
猜你喜欢

Understanding of strong caching and negotiation caching

markdown知识轻轻来袭

Error building sqlsession problem

Fluent's MSH grid learning

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

美法官裁定,被控掩盖黑客行为的Uber前安全主管必须面对欺诈指控

About microservices

Servlet student management system (Mengxin hands-on version)

How to use idea?

C comparison of the performance of dapper efcore sqlsugar FreeSQL hisql sqlserver, an ORM framework at home and abroad
随机推荐
Know that Chuangyu has helped the energy industry in asset management and was selected into the 2021 IOT demonstration project of the Ministry of industry and information technology
Failed to allocate graph: myriad device is not opened
Sd6.24 summary of intensive training
JWT登录验证
第02章_MySQL的数据目录
Jar package background startup and log output
Fluent's MSH grid learning
Jar包后台启动并输出日志
3H proficient in opencv (V) - perspective transformation
/usr/bin/ld: warning: **libmysqlclient. so. 20**, needed by //usr/
mysql — 清空表中数据
Shell basic syntax -- process control
Detailed analysis on the use of MySQL stored procedure loop
Image feature computation and representation -- content based image retrieval
markdown常用字体
Shandong University project training (VII) add navigation bar to select city
Travel card "star picking" hot search first! Stimulate the search volume of tourism products to rise
Adobe Premiere基础-炫酷文字快闪(十四)
data-*属性用法
【TcaplusDB知识库】TcaplusDB单据受理-建表审批介绍