text 响应电影卡
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 响应电影卡相关的知识,希望对你有一定的参考价值。
<div id="movie-card-list">
<!-- Card 1: Blade Runner -->
<div class="movie-card">
<div class="color-overlay">
<div class="movie-share">
<a class="movie-share__icon" href="#">
<i class="material-icons"></i>
</a>
<a class="movie-share__icon" href="#">
<i class="material-icons"></i>
</a>
<a class="movie-share__icon" href="#">
<i class="material-icons"></i>
</a>
</div>
<div class="movie-content">
<div class="movie-header">
<h1 class="movie-title">Blade Runner</h1>
<h4 class="movie-info">(1982) Sci-Fi, Thriller</h4>
</div>
<p class="movie-desc">A blade runner must pursue and try to terminate four replicants who stole a ship in space and have returned to Earth to find their creator.</p>
<a class="btn btn-outline" href="#">Watch Trailer</a>
</div>
</div>
</div>
<!-- Card 2: Back to the Future -->
<div class="movie-card">
<div class="color-overlay">
<div class="movie-share">
<a class="movie-share__icon" href="#">
<i class="material-icons"></i>
</a>
<a class="movie-share__icon" href="#">
<i class="material-icons"></i>
</a>
<a class="movie-share__icon" href="#">
<i class="material-icons"></i>
</a>
</div>
<div class="movie-content">
<div class="movie-header">
<h1 class="movie-title">Back to the Future</h1>
<h4 class="movie-info">(1985) Adventure, Comedy, Sci-Fi</h4>
</div>
<p class="movie-desc">Marty McFly, a 17-year-old high school student, is accidentally sent 30 years into the past in a time-traveling DeLorean invented by his close friend, the maverick scientist Doc Brown. </p>
<a class="btn btn-outline" href="#">Watch Trailer</a>
</div>
</div>
</div>
<!-- Card 3: Akira -->
<div class="movie-card">
<div class="color-overlay">
<div class="movie-share">
<a class="movie-share__icon" href="#">
<i class="material-icons"></i>
</a>
<a class="movie-share__icon" href="#">
<i class="material-icons"></i>
</a>
<a class="movie-share__icon" href="#">
<i class="material-icons"></i>
</a>
</div>
<div class="movie-content">
<div class="movie-header">
<h1 class="movie-title">Akira</h1>
<h4 class="movie-info">(1988) Animation, Action, Drama </h4>
</div>
<p class="movie-desc">A secret military project endangers Neo-Tokyo when it turns a biker gang member into a rampaging psychic psychopath that only two teenagers and a group of psychics can stop. </p>
<a class="btn btn-outline" href="#">Watch Trailer</a>
</div>
</div>
</div>
</div>
Responsive movie card
---------------------
Responsive movie card
A [Pen](https://codepen.io/ryanparag/pen/oWrLPr) by [Ryan](https://codepen.io/ryanparag) on [CodePen](https://codepen.io).
[License](https://codepen.io/ryanparag/pen/oWrLPr/license).
@import url('https://fonts.googleapis.com/css?family=Montserrat:300,400,700,800');
$primary-color: #cfd6e1;
$bg-color:#dce1e5;
$title-color: #9ac7fa;
$background-image: url(http://digitalspyuk.cdnds.net/15/47/1600x800/landscape-1447754794-harrison-ford-blade-runner.jpg);
$background-image2: url("http://www.blastr.com/sites/blastr/files/back-to-the-future-part-ii-original.jpg");
$background-image3: url("http://www.dvdactive.com/images/reviews/screenshot/2011/5/akirabdcap8_original.jpg");
$font-stack-content: 'Montserrat', helvetica, arial, sans-serif;
$font-stack-header: 'Montserrat', helvetica, arial, sans-serif;
$secondary-color: #2a9fff;
html {
box-sizing:border-box;
}
*,*::before, *::after {
box-sizing:inherit;
}
html,body {
width:100%;
height:100%;
}
body {
background-color: $bg-color;
font-family: $font-stack-content;
font-size: 14px;
color:$primary-color;
line-height: 1.5;
font-weight: 400;
overflow-x: hidden;
}
* {
transition: .4s;
}
a {
text-decoration: none;
}
.movie-card {
background-image: $background-image;
background-size: contain;
background-repeat: no-repeat;
width:75%;
max-width: 800px;
height: 300px;
display: block;
margin: 8vh auto;
border-radius: 8px;
box-shadow: 0px 8px 12px 0px rgba(0,0,0,0.25);
}
.movie-card:nth-child(2) {
background-image: $background-image2;
}
.movie-card:nth-child(3) {
background-image: $background-image3;
}
.color-overlay {
width:100%;
height: 100%;
border-radius: 8px;
background: linear-gradient(to right, rgba(42,159,255,.2) 0%,rgba(33,33,32,1) 60%,rgba(33,33,32,1) 100%);
background-blend-mode: multiply;
}
h1,h2,h3 {
font-family: $font-stack-header;
text-transform: uppercase;
letter-spacing: 2px;
line-height: 1;
font-weight: 400;
}
.movie-content {
width: 40%;
display: block;
position:relative;
float: right;
padding-right: 1em;
& .movie-title {
color: #ffffff;
margin-bottom: .25em;
opacity: .75;
}
& .movie-info {
text-transform: uppercase;
letter-spacing: 2px;
font-size: .8em;
color: $secondary-color;
line-height: 1;
margin: 0;
font-weight: 700;
opacity:.5;
}
& .movie-header {
margin-bottom: 2em;
}
& .movie-desc {
font-weight: 300;
opacity: .84;
margin-bottom: 2em;
}
}
.btn {
padding: .8em 2em;
background-color: rgba(255,255,255,.2);
color: rgba(255,255,255,1);
}
.btn-outline {
background-color: transparent;
border: 3px solid #ffffff;
}
.btn::before {
font-family: 'Material Icons';
content:'\e037';
vertical-align: middle;
font-size: 1.5em;
padding-right:.5em;
}
.btn-outline:hover {
border-color: $secondary-color;
color: $secondary-color;
box-shadow: 0px 1px 8px 0px rgba(245,199,0,.2);
}
.movie-share {
padding: 1em;
display: inline-block;
width: 15%;
}
.movie-share__icon i {
font-size: 1.2em;
margin-left: .5em;
color: #ffffff;
mix-blend-mode: lighten;
opacity: .4;
}
.movie-share__icon i:hover {
opacity:1;
mix-blend-mode: lighten;
}
@media (max-width:1000px) {
.movie-content {
width: 50%;
max-width: 95%;
}
}
@media (max-width:800px) {
.movie-card {
width: 95%;
max-width: 95%;
}
}
@media (max-width:600px) {
.movie-card,.movie-card:nth-child(2),.movie-card:nth-child(3) {
background-position:50% 0%;
background-size: cover;
height: 400px;
}
.color-overlay {
background: linear-gradient(to bottom, rgba(42,159,255,.2) 0%,rgba(33,33,32,1) 60%,rgba(33,33,32,1) 100%);
}
.movie-content {
margin-top: 4.2em;
width: 90%
}
.movie-share {
display: block;
width: 100%;
}
}
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" />
以上是关于text 响应电影卡的主要内容,如果未能解决你的问题,请参考以下文章