svg+js模拟孕妇怀孕不同时间肚子里孩子的形状大小代码
代码语言:html
所属分类:其他
代码描述:svg+js模拟孕妇怀孕不同时间肚子里孩子的形状大小代码,可拖动滑竿改变时间,还可点击左侧第几周查看孩子大小和形状及位置。
代码标签: svg js 模拟 孕妇 怀孕 不同 时间 肚子 孩子 形状 大小 代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> body { background: rgb(50, 0, 108); font-family: "Roboto", sans-serif; margin: 0, auto; } #babyProgression { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); height: 100%; width: 100%; max-width: 100%; max-height: calc(100% - 250px); min-height: 100px; } .maskLine { transition: d 310ms; } .maskLine:nth-of-type(2) { transition: d 300ms; } .controls { position: absolute; top: 50%; left: 15px; transform: translate(0%, -50%); height: calc(100vh - 6em); max-height: 600px; } .slider { position: absolute; display: block; top: 50%; right: 15px; transform: translate(0%, -50%); width: 50px; height: calc(100vh - 6em); max-height: 600px; } #scaleSlider { position: absolute; width: calc(100vh - 6em); max-width: 600px; cursor: pointer; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-90deg); } .container { display: flex; flex-direction: column; width: 45px; justify-content: space-between; height: 100%; } .container > button { cursor: pointer; color: rgba(255, 255, 255, 0.5); background: none; border: 1px solid rgba(255, 255, 255, 0.5); flex: 1; margin: 0px; padding-top: 4px; padding-bottom: 4px; padding-left: 0px; padding-right: 0px; font-family: "Roboto", sans-serif; font-weight: bold; } .container > button:hover, .container > button:focus, .container > button:active { border: 1px solid #fff; color: #fff; } .container > button > span { font-weight: 100; font-size: 0.8em; } .daysSection { text-align: center; font-family: "Roboto", sans-serif; position: absolute; bottom: 10px; left: 50%; transform: translate(-50%); color: rgba(255, 255, 255, 0.8); } .days { font-size: 1.5em; font-weight: 600; } .dateSection { text-align: center; font-family: "Roboto", sans-serif; position: absolute; top: 10px; left: 50%; transform: translate(-50%); color: rgba(255, 255, 255, 0.8); } input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; cursor: pointer; outline: none; overflow: hidden; border-radius: 25px; } /* Track: webkit browsers */ input[type="range"]::-webkit-slider-runnable-track { height: 25px; background: rgb(50, 0, 108); border-radius: 25px; } /* Track: Mozilla Firefox */ input[type="range"]::-moz-range-track { height: 25px; background: rgb(50, 0, 108); border-radius: 25px; } /* Thumb: webkit */ input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; height: 25px; width: 25px; background-color: #a020f0; border-radius: 50%; border: 1px solid #a020f0; box-shadow: -407px 0 0 400px rgb(100, 0, 180); } /* Thumb: Firefox */ input[type="range"]::-moz-range-thumb { height: 25px; width: 25px; background-color: #a020f0; border-radius: 50%; border: 1px solid #a020f0; box-shadow: -407px 0 0 400px rgb(100, 0, 180); } </style> </head> <body translate="no"> <svg viewBox="0 0 100 100" id="babyProgression"> <path d="M 36 62.8 C 14 94 45 98 59 98 C 79 98 83 77 83 64 C 80 26 63 4 43 4 C 18 4 14 29 28 47 C 34 55 36.6 59.2 36 60.9 Z" /> <g fill="#A020F0" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="0.5"> <path class="umbilical" d=""> <animate attributeName="d" values="M 53.7 50.3 Q 52.2 50.3 50.2 49.7 C 47.6 49 42.9 55.3 36.5 60.9 V 62.8 C 49.1 50.3 50.8 51.5 52 53.1 Q 53.1 55.5 54.7 54.4 C 56.9 52.6 57 49.1 53.7 50.3; M 56 51 Q 53.7 50.8 50.7 53.2 C 48.8 53.3 46.8 53.4 36.5 60.9 V 62.8 C 47.2 55.6 48.5 54.9 52 56 Q 54 57 55.6 55.5 C 58 53 59 51 56 51; M 56 48 Q 53.4 53 54.1 55.7 C 51.4 57 50 53 36.5 60.9 V 62.8 C 50 55 50 58 55 57 Q 55 59 57.6 58.7 C 62 58 59 42 56 48; M 58 47 Q 53.4 53 55.5 57.7 C 51.4 57 51.8 55.7 36.5 60.9 V 62.8 C 50.2.........完整代码请登录后点击上方下载按钮下载查看
网友评论0