css实现电影卡片悬浮聚焦动画效果代码

代码语言:html

所属分类:悬停

代码描述:css实现电影卡片悬浮聚焦动画效果代码

代码标签: 卡片 悬浮 聚焦 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  <link href='https://fonts.googleapis.com/css?family=Raleway' rel='stylesheet' type='text/css'>


  
  
<style>
*, *:before, *:after {
  box-sizing: border-box;
  position: relative;
}

html, body {
  overflow: hidden;
  height: 100%;
}

body {
  font-family: 'Raleway', sans-serif;
  color: white;
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
          align-items: center;
  -webkit-box-pack: center;
          justify-content: center;
  background: url("//repo.bfw.wiki/bfwrepo/image/5fc1a6cf89551.png");
  background-size: cover;
}
body:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: -webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.25)), to(rgba(0, 0, 0, 0)));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0));
}

.background-image {
  z-index: 1;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  -webkit-filter: blur(7px);
          filter: blur(7px);
  background: url("//repo.bfw.wiki/bfwrepo/image/5fc1a6cf89551.png");
  background-size: cover;
  -webkit-transition: 0.3s ease-out;
  transition: 0.3s ease-out;
}
.background-image:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: -webkit-gradient(linear, left bottom, left top, from(rgba(0, 0, 0, 0.25)), to(rgba(0, 0, 0, 0)));
  background: linear-gradient(to top, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0));
}

.tv-film__bg {
  box-shadow: 0 5px 5px -5px rgba(0, 0, 0, 0.25);
  width: 250px;
  height: 250px;
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
          align-items: center;
  -webkit-box-pack: center;
          justify-content: center;
  cursor: pointer;
  background: url("//repo.bfw.wiki/bfwrepo/image/5fc1a70592d7a.png");
  background-size: cover;
  border-radius: 20px;
  -webkit-clip-path: polygon(20px 0, calc(100% - 20px) 0, 100% 20px, 100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px), 0 20px);
          clip-path: polygon(20px 0, calc(100% - 20px) 0, 100% 20px, 100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px), 0 20px);
}
.tv-film__bg:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0);
  -webkit-transition: background-color 0.3s ease-out;
  transition: background-color 0.3s ease-out;
}

.tv-film__content {
  z-index: 100;
  width: 50%;
  border-radius: 50%;
  text-align: center;
  position: relative;
  background: rgba(29, 210, 175, 0.9);
  padding: 0.5em;
  color: white;
  -webkit-transition: -webkit-transform 0.3s ease-out;
  transition: -webkit-transform 0.3s ease-out;
  transition: transform 0.3s ease-out;
  transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out;
}
.tv-film__content:before {
  display: block;
  content: "";
  width: 100%;
  padding-top: 100%;
}
.tv-film__content > * {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.tv-film__title {
  disp.........完整代码请登录后点击上方下载按钮下载查看

网友评论0