css实现视频卡片悬浮视觉差异效果代码

代码语言:html

所属分类:视觉差异

代码描述:css实现视频卡片悬浮视觉差异效果代码,视频播放,悬浮出现边框并根据鼠标位置实现视觉差异立体倾斜效果。

代码标签: css 视频 卡片 悬浮 视觉差异

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

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

<head>
  <meta charset="UTF-8">

  
  
  
<style>
@import url("https://fonts.googleapis.com/css2?family=Lora:ital,wght@1,700&family=Montserrat:wght@200&family=Radley&display=swap");
body {
  width: 100vw;
  height: 100vh;
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #aae5ee, #66d0e1);
  background-repeat: no-repeat;
}
body .container {
  display: flex;
  perspective: 600px;
}
body .container .card {
  width: 170px;
  height: 300px;
  background-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  background-image: linear-gradient(to bottom, transparent, rgba(38, 167, 186, 0.4));
  background-size: cover;
  background-position: 50% 50%;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  border: 1px solid white;
  position: relative;
  transform-style: preserve-3d;
  transform-origin: 50% 50% -50px;
}
body .container .card:before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 100%;
  height: 100%;
  border: 1px solid white;
  border-radius: 8px;
  transform-origin: center;
  transition: 0.2s ease;
}
body .container .card:hover {
  cursor: pointer;
}
body .container .card:hover:before {
  transform: scale(0.94, 0.96);
  border-radius: 2px;
}
body .container .card:hover .headline {
  transform: translateZ(20px);
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}
body .container .card .video-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
}
body .container .card .video-container video {
  position: relative;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 100%;
  width: auto;
  z-index: -1;

}
body .container .card .headline {
  text-shadow:.........完整代码请登录后点击上方下载按钮下载查看

网友评论0