gsap实现猫咪睡在窗台日夜交替效果代码
代码语言:html
所属分类:动画
代码描述:gsap实现猫咪睡在窗台日夜交替效果代码,点击猫咪有惊喜哦
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
@import url("https://fonts.googleapis.com/css2?family=Ubuntu:wght@400;500&display=swap");
html {
margin: 0;
padding: 0;
width: 100%;
height: 100%;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
font-family: "Ubuntu", sans-serif;
}
// html[data-theme='dark'] {
// }
body {
background: #d7edee;
width: 800px;
.box {
width: 80%;
margin: 0 auto;
text-align: center;
}
h1 {
font-size: 3vw;
color: #556f80;
}
p {
color: #98aebe;
font-size: 2vw;
line-height: 1.8em;
margin-top: 10px;
}
svg #window {
cursor: pointer;
}
}
</style>
</head>
<body >
<div class="box">
<h1>点击猫咪发现惊喜</h1>
<p></p>
<svg viewBox="0 0 800 600" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="1.5">
<g id="window">
<path id="window__frame__outside" fill="#556f80" d="M297.762 168.842h204.444v235.735H297.762z" />
<path id="outside__bg" fill="#d7edee" d="M314.593 179.677h172.094v211.138H314.593z" />
<clipPath id="_clip1">
<path d="M314.593 179.677h172.094v211.138H314.593z" />
</clipPath>
<g clip-path="url(#_clip1)">
<g id="sunMoon">
<path id="sunMoon__base" d="M400.34 182.186c120.805-.166 219.018 97.778 219.183 218.583.166 120.805-97.778 219.018-218.583 219.183-120.805.166-219.018-97.778-219.183-218.583-.166-120.805 97.778-219.017 218.583-219.183z" fill="none" />
<path id="sun" d="M444.497 194.968c18.422-.025 33.399 14.911 33.425 33.334.025 18.422-14.911 33.399-33.334 33.425-18.422.025-33.399-14.911-33.424-33.334-.026-18.422 14.91-33.399 33.333-33.425z" fill="#f3a683" />
<path id="moon" d="M260.414 257.684c-1.492 3.793-2.309 7.923-2.303 12.243.026 18.423 15.003 33.359 33.425 33.334 3.209-.005 6.313-.463 9.25-1.314-4.869 12.381-16.928 21.162-31.031 21.182-18.422.025-33.399-14.911-33.424-33.334-.021-15.213 10.161-28.077 24.083-32.111z" fill="#ffffff" />
</g>
<g id="window__frame" fill="#556f80">
<path d="M311.283 281.864h178.714v6.764H311.283z" />
<path.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0