太阳系星球运行模拟动画

代码语言:html

所属分类:动画

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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">

<title> Animated atom SVG</title>
<style>
  :root {
  --color-background-body: #333;
  --color-particle-fill: #ababab;
  --color-ring-stroke: #fff;
}

.theme-brad {
  --color-background-body: #f6f5de;
  --color-particle-fill: #be6701;
  --color-ring-stroke: #110000;
}

body {
  background-color: var(--color-background-body);
  overflow: hidden;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background-color 0.5s ease-in-out;
}

.atom {
  width: 200vw;
  height: 200vh;
}

.nucleus {
  fill: var(--color-particle-fill);
  stroke: var(--color-particle-fill);
  transition: all 0.5s ease-in-out;
  -webkit-animation: nucleus-pulse 2s infinite ease-in-out alternate;
          animation: nucleus-pulse 2s infinite ease-in-out alternate;
}

.electron {
  fill: var(--color-particle-fill);
  stroke: var(--color-particle-fill);
  transition: all 0.5s ease-in-out;
  -webkit-animation: rotate 10s infinite linear, electron-pulse 1s infinite ease-in-out alternate;
          animation: rotate 10s infinite linear, electron-pulse 1s infinite ease-in-out alternate;
}

.ring {
  stroke: var(--color-ring-stroke);
  -webkit-animation: ring-width 1s infinite ease-in-out alternate;
          animation: ring-width 1s infinite ease-in-out alternate;
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0