Line 6: | Line 6: | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | <meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>XJTLU-CHINA 2017</title> | <title>XJTLU-CHINA 2017</title> | ||
+ | <style> | ||
+ | /* -------------------------------- | ||
+ | |||
+ | Slider | ||
+ | |||
+ | -------------------------------- */ | ||
+ | .cd-slider-wrapper { | ||
+ | position: relative; | ||
+ | height: 100vh; | ||
+ | padding: 10px; | ||
+ | } | ||
+ | @media only screen and (min-width: 900px) { | ||
+ | .cd-slider-wrapper { | ||
+ | padding: 30px; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | .cd-slider { | ||
+ | position: relative; | ||
+ | z-index: 1; | ||
+ | height: 100%; | ||
+ | overflow: hidden; | ||
+ | } | ||
+ | .cd-slider li { | ||
+ | position: absolute; | ||
+ | top: 0; | ||
+ | left: 0; | ||
+ | height: 100%; | ||
+ | width: 100%; | ||
+ | -webkit-transform: translateX(100%); | ||
+ | -moz-transform: translateX(100%); | ||
+ | -ms-transform: translateX(100%); | ||
+ | -o-transform: translateX(100%); | ||
+ | transform: translateX(100%); | ||
+ | -webkit-transition: -webkit-transform 0.6s; | ||
+ | -moz-transition: -moz-transform 0.6s; | ||
+ | transition: transform 0.6s; | ||
+ | } | ||
+ | .cd-slider li.is-visible { | ||
+ | -webkit-transform: translateX(0); | ||
+ | -moz-transform: translateX(0); | ||
+ | -ms-transform: translateX(0); | ||
+ | -o-transform: translateX(0); | ||
+ | transform: translateX(0); | ||
+ | } | ||
+ | .cd-slider .cd-half-block { | ||
+ | height: 50%; | ||
+ | background-position: center center; | ||
+ | background-repeat: no-repeat; | ||
+ | } | ||
+ | .cd-slider li:first-of-type .image { | ||
+ | background-image: url(../img/img-1.jpg); | ||
+ | } | ||
+ | .cd-slider li:nth-of-type(2) .image { | ||
+ | background-image: url(../img/img-2.jpg); | ||
+ | } | ||
+ | .cd-slider li:nth-of-type(3) .image { | ||
+ | background-image: url(../img/img-3.jpg); | ||
+ | } | ||
+ | .cd-slider li:nth-of-type(4) .image { | ||
+ | background-image: url(../img/img-4.jpg); | ||
+ | } | ||
+ | .cd-slider .image { | ||
+ | background-size: cover; | ||
+ | } | ||
+ | .cd-slider .content { | ||
+ | padding: 30px; | ||
+ | color: #ffffff; | ||
+ | background-color: #767070; | ||
+ | -webkit-font-smoothing: antialiased; | ||
+ | -moz-osx-font-smoothing: grayscale; | ||
+ | } | ||
+ | .cd-slider .light-bg { | ||
+ | color: rgba(0, 0, 0, 0.6); | ||
+ | } | ||
+ | .cd-slider .btn { | ||
+ | display: inline-block; | ||
+ | background: rgba(0, 0, 0, 0.2); | ||
+ | padding: 1em 1.6em; | ||
+ | margin-top: 1em; | ||
+ | font-size: 1.3rem; | ||
+ | color: #ffffff; | ||
+ | border-radius: 50em; | ||
+ | -webkit-transition: background 0.3s; | ||
+ | -moz-transition: background 0.3s; | ||
+ | transition: background 0.3s; | ||
+ | } | ||
+ | .no-touch .cd-slider .btn:hover { | ||
+ | background: rgba(0, 0, 0, 0.6); | ||
+ | } | ||
+ | .cd-slider li:nth-of-type(2) .content { | ||
+ | background-color: #ccd0c1; | ||
+ | } | ||
+ | .cd-slider li:nth-of-type(3) .content { | ||
+ | background-color: #f3b96c; | ||
+ | } | ||
+ | .cd-slider li:nth-of-type(4) .content { | ||
+ | background-color: #f46c6a; | ||
+ | } | ||
+ | .cd-slider h2 { | ||
+ | font-size: 2.2rem; | ||
+ | margin-bottom: .4em; | ||
+ | } | ||
+ | .cd-slider p { | ||
+ | font-size: 1.4rem; | ||
+ | } | ||
+ | .cd-slider h2, .cd-slider p { | ||
+ | line-height: 1.4; | ||
+ | } | ||
+ | @media only screen and (min-width: 900px) { | ||
+ | .cd-slider li { | ||
+ | pointer-events: none; | ||
+ | z-index: 1; | ||
+ | -webkit-transform: translateX(0); | ||
+ | -moz-transform: translateX(0); | ||
+ | -ms-transform: translateX(0); | ||
+ | -o-transform: translateX(0); | ||
+ | transform: translateX(0); | ||
+ | -webkit-transition: z-index 0s 0.6s; | ||
+ | -moz-transition: z-index 0s 0.6s; | ||
+ | transition: z-index 0s 0.6s; | ||
+ | } | ||
+ | .cd-slider li.is-visible { | ||
+ | pointer-events: auto; | ||
+ | z-index: 3; | ||
+ | -webkit-transition: z-index 0s 0s; | ||
+ | -moz-transition: z-index 0s 0s; | ||
+ | transition: z-index 0s 0s; | ||
+ | } | ||
+ | .cd-slider li.is-visible.covered { | ||
+ | /* list item still there, but covered by the list item entering the viewport (.is-visible) */ | ||
+ | z-index: 2; | ||
+ | } | ||
+ | .cd-slider .cd-half-block { | ||
+ | height: 100%; | ||
+ | width: 50%; | ||
+ | float: right; | ||
+ | } | ||
+ | .cd-slider .cd-half-block.content { | ||
+ | -webkit-transform: translateX(200%); | ||
+ | -moz-transform: translateX(200%); | ||
+ | -ms-transform: translateX(200%); | ||
+ | -o-transform: translateX(200%); | ||
+ | transform: translateX(200%); | ||
+ | -webkit-transition: -webkit-transform 0.6s 0s ease-in-out; | ||
+ | -moz-transition: -moz-transform 0.6s 0s ease-in-out; | ||
+ | transition: transform 0.6s 0s ease-in-out; | ||
+ | } | ||
+ | .cd-slider .cd-half-block.image { | ||
+ | -webkit-transform: translateX(100%); | ||
+ | -moz-transform: translateX(100%); | ||
+ | -ms-transform: translateX(100%); | ||
+ | -o-transform: translateX(100%); | ||
+ | transform: translateX(100%); | ||
+ | -webkit-transition: -webkit-transform 0s 0.3s; | ||
+ | -moz-transition: -moz-transform 0s 0.3s; | ||
+ | transition: transform 0s 0.3s; | ||
+ | } | ||
+ | .cd-slider li.is-visible .cd-half-block.content, | ||
+ | .cd-slider li.is-visible .cd-half-block.image { | ||
+ | -webkit-transform: translateX(0%); | ||
+ | -moz-transform: translateX(0%); | ||
+ | -ms-transform: translateX(0%); | ||
+ | -o-transform: translateX(0%); | ||
+ | transform: translateX(0%); | ||
+ | } | ||
+ | .cd-slider li.is-visible .cd-half-block.content { | ||
+ | -webkit-transition: -webkit-transform 0.6s 0s ease-in-out; | ||
+ | -moz-transition: -moz-transform 0.6s 0s ease-in-out; | ||
+ | transition: transform 0.6s 0s ease-in-out; | ||
+ | } | ||
+ | .cd-slider .content { | ||
+ | /* vertically align its content */ | ||
+ | display: table; | ||
+ | padding: 0 40px; | ||
+ | } | ||
+ | .cd-slider .content > div { | ||
+ | /* vertically align <div> inside div.content */ | ||
+ | display: table-cell; | ||
+ | vertical-align: middle; | ||
+ | } | ||
+ | .cd-slider .btn { | ||
+ | padding: 1.4em 2em; | ||
+ | font-size: 1.4rem; | ||
+ | } | ||
+ | .cd-slider p { | ||
+ | font-size: 1.6rem; | ||
+ | } | ||
+ | .cd-slider h2 { | ||
+ | font-size: 3.5rem; | ||
+ | margin-bottom: 0; | ||
+ | } | ||
+ | .cd-slider h2, .cd-slider p { | ||
+ | line-height: 2; | ||
+ | } | ||
+ | } | ||
+ | @media only screen and (min-width: 1170px) { | ||
+ | .cd-slider .content { | ||
+ | padding: 0 90px; | ||
+ | } | ||
+ | .cd-slider h2 { | ||
+ | font-weight: 300; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </style> | ||
</head> | </head> | ||
<body> | <body> |
Revision as of 04:34, 1 August 2017