纯css模拟日食全过程
代码语言:html
所属分类:动画
代码描述:纯css模拟日食全过程
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> .sun { background-color: #F6C744; height: 50vmin; width: 50vmin; border-radius: 50%; } .sun:before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; -webkit-animation: thats-no-moon 6s infinite, night-and-day 6s infinite; animation: thats-no-moon 6s infinite, night-and-day 6s infinite; background-color: #fff; border-radius: 50%; } @-webkit-keyframes thats-no-moon { from, 5% { -webkit-transform: translateX(100%); transform: translateX(100%); } 30%, 60% { -webkit-transform: none; transform: none; } 95%, to { -webkit-transform: translateX(-100%); transform: translateX(-100%); } } @keyframes thats-no-moon { from, 5% { -webkit-transform: translateX(100%); transform: translateX(100%); } 30%, 60% { -webkit-transform: none; transform: none; } 95%, to { -webkit-transform: translateX(-100%); transform: translateX(-100%); } } body { -webkit-animation: night-and-day 6s infinite; animation: night-and-day 6s infinite; } .eclipse { fill: none; stroke: #F6C744; stroke-width: 2; stroke-dasharray: 308 616; stroke-dashoffset: 308; stroke-linecap: round; -webkit-animation: ec.........完整代码请登录后点击上方下载按钮下载查看
网友评论0