svg+js实现云朵晴天与阴天拖拽变动效果代码
代码语言:html
所属分类:布局界面
代码描述:svg+js实现云朵晴天与阴天拖拽变动效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
body {
width: 100vw;
height: 100vh;
overflow: hidden;
margin: 0;
padding: 0;
}
.sky-background {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background: linear-gradient(0deg, #62a0d8 0%, #2178d1 50%, #085cb3 100%);
z-index: -1;
transition: filter 0.3s ease;
}
svg {
width: 0;
height: 0;
position: absolute;
}
.cloud-container {
width: 100vw;
height: 100vh;
position: fixed;
top: 0;
left: 0;
filter: url(#filter);
}
.cloud {
anchor-name: --cloud;
width: 680px;
height: 280px;
background: #fff;
border-radius: 50%;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
cursor: grab;
will-change: transform;
touch-action: none;
border: none;
outline: none;
}
.cloud:active {
cursor: grabbing;
}
textarea::-webkit-resizer {
display: none;
}
textarea::-moz-resizer {
display: none;
}
.resize-handle {
position: absolute;
position-anchor: --cloud;
top: anchor(bottom);
left: anchor(right);
transform: translate(-100%, -100%);
pointer-events: none;
opacity: 0;
transition: opacity 0.2s;
font-size: 42px;
color: white;
}
.cloud-container:has(.cloud:hover) ~ .resize-handle.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0