css的has实现元素悬浮聚焦其他模糊效果代码

代码语言:html

所属分类:悬停

代码描述:css的has实现元素悬浮聚焦其他模糊效果代码

代码标签: css has 元素 悬浮 聚焦 其他 模糊

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

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

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

  
  
<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.container {
  min-height: 100vh;
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.interactive-container {
  position: relative;
  width: 300px;
  height: 300px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.interactive-container:hover {
  transform: scale(1.05) rotate(1deg);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.3), inset 0 0 20px rgba(255, 255, 255, 0.1);
}

.shape {
  position: absolute;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.shape-1 {
  width: 100px;
  height: 100px;
  background: linear-gradient(45deg, #ff3366, #ff6b6b);
  -webkit-clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
          clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  top: 50px;
  left: 50px;
  mix-blend-mode: screen;
  -webkit-animation: float1 4s infinite ease-in-out;
          animation: float1 4s infinite ease-in-out;
}

.shape-2 {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  -webkit-clip-path: circle(50% at 50% 50%);
          clip-path: circle(50% at 50% 50%);
  bottom: 50px;
  right: 50px;
  mix-blend-mode: screen;
  -webkit-animation: float2 5s infinite ease-in-out;
          animation: float2 5s infinite ease-in-out;
}

.shape-3 {
  width: 80px;
  height: 80px;
  background: linear-gradient(225deg, #ffd86f, #fc6262);
  -webkit-clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
          clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
  top: 100px;
  right: 80px;
  mix-blend-mode: screen;
  -webkit-animation: float3 6s infinite ease-in-out;
          animation: float3 6s infinite ease-in-out;
}

.shape-4 {
  width: 90px;
  height: 90px;
  background: linear-gradient(315deg, #a8edea, #fed6e3);
  -webkit-clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
          clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% .........完整代码请登录后点击上方下载按钮下载查看

网友评论0