js+css实现图文人物介绍幻灯片效果代码
代码语言:html
所属分类:幻灯片
代码描述:js+css实现图文人物介绍幻灯片效果代码,点击人物图片进行切换,还可通过视频文字进行介绍。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Fonts-->
<link href="https://fonts.googleapis.com/css?family=Atma" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Open+Sans+Condensed:300" rel="stylesheet">
<style>
*,
*::after,
*::before {
box-sizing: border-box;
}
@font-face {
font-family: "font";
src: url("//repo.bfw.wiki/bfwrepo/font/OakesGrotesk-Semi-Bold.woff2");
src: url("//repo.bfw.wiki/bfwrepo/font/OakesGrotesk-Semi-Bold.woff");
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: "font-2";
src: url("//repo.bfw.wiki/bfwrepo/font/MaisonNeue-Book.woff2");
src: url("//repo.bfw.wiki/bfwrepo/font/MaisonNeue-Book.woff");
font-weight: normal;
font-style: normal;
}
body {
font-family: 'Open Sans Condensed', sans-serif;
min-height: 100vh;
color: #fff8dc;
background-color: #000;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
padding-top: 10em;
font-size: 14px;
overflow: hidden;
}
@media screen and (min-width: 320px) {
body {
font-size: calc(14px + 6 * ((100vw - 320px) / 960));
}
}
@media screen and (min-width: 1280px) {
body {
font-size: 20px;
}
}
/* Page Loader */
.loading {
background: #000;
z-index: 200;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.js .loading::before {
content: '';
position: fixed;
z-index: 4;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #000;
}
.js .loading::after {
content: '';
position: fixed;
z-index: 4;
top: 50%;
left: 50%;
width: 60px;
height: 60px;
margin: -30px 0 0 -30px;
pointer-events: none;
border-radius: 50%;
opacity: 0.4;
background: rgba(255,99,71,0.6);
-webkit-animation: loaderAnim 0.7s linear infinite alternate forwards;
animation: loaderAnim 0.7s linear infinite alternate forwards;
}
a {
text-decoration: none;
color: rgba(255,99,71,0.6);
outline: none;
}
a:hover,
a:focus {
color: #ff4500;
outline: none;
}
.cit {
color: #cca700 !important;
font-style: italic;
}
.cit:before {
content: '« ';
}
.cit:after {
content: ' »';
}
.orangered {
color: #ff4500;
}
.gold {
color: #cca700;
}
.hidden {
position: absolute;
overflow: hidden;
width: 0;
height: 0;
pointer-events: none;
}
.message {
position: relative;
z-index: 1;
display: none;
padding: 1em;
text-align: center;
color: #000;
background: #fff8dc;
}
/* Icons */
.icon {
display: block;
width: 1.5em;
height: 1.5em;
margin: 0 auto;
fill: currentColor;
}
.frame {
position: fixed;
z-index: 3;
top: 2vh;
left: 0;
width: 100%;
max-width: none;
min-height: 0;
height: 90vh;
padding: 1em;
pointer-events: none;
}
.frame a {
pointer-events: auto;
}
/* Header */
.header {
position: relative;
z-index: 1;
margin-left: 31vw;
transform: translateX(-50%);
margin-top: -3vh;
font-family: font;
font-weight: 100;
}
.header__title {
position: absolute;
width: 150px;
font-size: 1em;
font-weight: normal;
line-height: 1;
color: $color--text;
flex-wrap: wrap;
align-items: top;
padding: 0;
display: flex;
justify-content: flex;
text-transform: uppercase;
flex-wrap: wrap;
align-items: top;
padding: 0;
letter-spacing: 0.3em;
}
.header__title:before {
content: "What You Gonna Do When the";
letter-spacing: 0.1em;
font-size: 1em;
}
.header__title:after {
content: " de Roberto Minervini";
letter-spacing: 0;
opacity: 0.7;
font-family: 'Open Sans Condensed', sans-serif;
text-transform: none;
font-size: 0.9em;
}
/* Top Navigation Style */
.icon {
display: inline-block;
padding: 0.25em;
margin: 0.25em 0 0 0;
}
/* SLIDESHOW */
.slideshow {
position: relative;
overflow: hidden;
margin: 0;
width: 100%;
height: calc(100vh - 20vh);
display: grid;
grid-template-columns: 33% 33% 33%;
grid-column-gap: 0.5%;
grid-template-rows: 100%;
grid-template-areas: '... slide ...';
}
.slide {
width: 100%;
display: flex;
pointer-events: none;
cursor: pointer;
position: relative;
height: 85vh;
grid-area: slide;
}
.slideshow--previewopen .slide {
cursor: default;
}
.slide--current {
pointer-events: auto;
}
.slide__img-wrap {
width: 100%;
overflow: hidden;
z-index: 1;
height: 65%;
top: 10%;
position: absolute;
}
.slide__img-wrap .bg--5 {
background-image: url("//repo.bfw.wiki/bfwrepo/image/5fb390d10ad81.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_770,h_420,/quality,q_90");
background-position: 8% bottom;
}
.slideshow__deco {
grid-area: slide;
background: linear-gradient(#000, rgba(254,246,225,0.11));
width: 100%;
height: 56%;
align-self: center;
position: relative;
margin: -4px 0 0 0;
right: -3px;
}
.nav {
position: absolute;
background: none;
width: 3em;
height: 3em;
z-index: 1;
border: 0;
padding: 0;
margin: 0;
pointer-events: none;
transition: transform 0.8s opacity 0.8s;
transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
}
.nav--next {
bottom: 0;
right: 0;
}
.icon--navarrow-next {
transform: rotate(0deg);
}
.nav--prev {
top: 0;
left: 0;
}
.icon--navarrow-prev {
transform: rotate(180deg);
}
.slideshow--previewopen .nav {
opacity: 0;
transition-duration: 0.4s;
}
.slideshow--previewopen .nav--next {
transform: translate3d(100%, 100%, 0);
}
.slideshow--previewopen .nav--prev {
transform: translate3d(-100%, -100%, 0);
}
.slide__img {
width: 100%;
height: 100%;
left: 0;
top: 0;
background-size: cover;
background-position: 50% 50%;
position: absolute;
pointer-events: none;
transform: scale3d(1.01, 1.01, 1);
}
.js .slide__img-wrap,
.js .slide__title-wrap,
.js .slide__side {
opacity: 0;
pointer-events: none;
}
.js .slide--current .slide__img-wrap {
opacity: 1;
pointer-events: auto;
}
.slide--visible .slide__img-wrap {
pointer-events: auto;
}
.slide__title-wrap {
justify-self: flex-end;
width: 100%;
position: relative;
z-index: 2;
text-shadow: 1px 0 0 #111;
}
.slide__number {
display: block;
font-size: 1em;
font-weight: 100;
opacity: 0.8;
padding-bottom: 1em;
font-family: 'Open Sans Condensed', sans-serif;
}
.slide__number::before {
content: "☆";
display: inline-block;
margin: 0 1em 0 0;
color: #ff4500;
}
.slide__subtitle {
text-align: left;
}
.slide__title,
.slide__subtitle,
.slide__side {
display: none;
}
.content {
position: fixed;
top: 10vh;
left: 0;
width: 100%;
height: calc(100% - 10vh);
pointer-events: none;
z-index: 1;
}
.content__item {
position: absolute;
top: 0;
right: 0;
width: 100%;
padding: 10vh 7vw 0 30vw;
text-align: justify;
text-shadow: 1px 0 0 #000;
}
.content__item--current,
.content__item--current ~ .content__close {
pointer-events: auto;
}
.content__close {
position: absolute;
top: 0;
left: 39% !important;
background: transparent;
color: currentColor;
border: 0;
margin: 0;
padding: 0;
cursor: pointer;
}
.icon--longarrow {
width: 2em;
transform: rotate(45deg);
}
.content__close:focus {
outline: none;
}
.content__number {
font-weight: normal;
color: rgba(255,248,220,0.5);
}
.content__number::before {
content: "☆";
display: inline-block;
margin: 0 1em 0 0;
color: #ff4500;
}
.content__title {
text-align: left;
margin: 0.5em 0;
font-size: 1.3em;
letter-spacing: 0.1em;
}
.content__subtitle {
margin: 0 0 0.5em;
font-size: 1.2em;
font-weight: normal;
}
.content__subtitle span {
font-size: 0.7em;
}
.content__text {
font-size: 1em;
}
.content__contact span {
margin: 0;
}
.content__contact span:before {
color: rgba(255,99,71,0.6);
content: '\A Contact presse ▾';
white-space: pre;
}
.content__contact span:after {
content: '\A MAKNA PRESSE \A Chloé Lorenzi \A 01 42 77 00 16 \A info@makna-presse.com';
white-space: pre;
}
.right {
float: right;
text-align: right;
}
.left {
float: left;
text-align: left;
}
.js .content__title,
.js .content__subtitle,
.js .content__number,
.js .content__text,
.js .content__contact,
.js .content__close {
opacity: 0;
}
.fa {
background-color: #000;
height: 100vh;
width: 150%;
margin-left: -50%;
}
.fa object {
width: 130% !important;
height: 100vh;
margin-left: 50%;
margin-top: 50%;
transform: translate(-50%, -50%);
}
.dp {
background-color: #000;
height: 100vh;
width: 150%;
margin-left: -55%;
}
.dp object {
width: 100% !important;
height: 50%;
margin-left: 58%;
transform: translateX(-50%);
margin-top: 5vh;
}
.tel {
background-color: #000;
height: 100vh;
width: 150%;
margin-left: -55%;
}
.tel object {
width: 100% !important;
height: 130vh;
margin-left: 58%;
transform: translateX(-50%);
margin-top: -.........完整代码请登录后点击上方下载按钮下载查看
网友评论0