纯css布局绘制一个月亮效果
代码语言:html
所属分类:布局界面
代码描述:纯css布局绘制一个月亮效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { display: flex; justify-content: center; background: linear-gradient(to top, #283e51 0%, #0a2342 40%, #111 100%); background-repeat: no-repeat; background-attachment: fixed; } .moon { position: relative; top: 200px; width: 320px; height: 320px; border-radius: 50%; background-image: radial-gradient(circle at 60% 60%, transparent 50%, white 120%), radial-gradient(circle at 40% 40%, transparent 50%, black 110%), radial-gradient(circle at top left, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.75) 100%), radial-gradient(circle at bottom, rgba(10, 35, 66, 0.4) 30%, transparent 70%), radial-gradient(circle at bottom, rgba(40, 62, 81, 0.15) 0%, rgba(10, 35, 66, 0.2) 100%), radial-gradient(circle at top left, rgba(171, 227, 255, 0.75) 0%, rgba(0, 0, 0, 0.5) 90%), linear-gradient(to left, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.1) 100%); background-size: 180%, 100%, 100%, 100%, 100%, 100%, 100%; background-position: 50%, 50%, 50%, 50%, 50%, 50%, 50%; } .moon::after { display: block; content: ''; background-image: radial-gradient(circle at 48% 48%, rgba(163, 249, 255, 0.2) 22%, rgba(133, 237, 255, 0.08) 32%, transparent 50%); z-index: -1; width: 240%; height: 240%; border-radius: 50%; position: absolute; left: 50%; top: 50%; transition: 2s ease-in-out; transform-origin: 50%; animation: glow 4s infinite; } .moon::before { display: block; content: ''; position: absolute; z-index: 0; width: 100%; height: 100%; border-radius: 50%; opacity: 0.18; background-image: radial-gradient(rgba(0, 0, 0, 0.1) 32%, rgba(0, 0, 0, 0.25) 50%, transparent 0%), radial-gradient(rgba(0, 0, 0, 0.1) 32%, rgba(0, 0, 0, 0.25) 50%, transparent 0%), radial-gradient(rgba(0, 0, 0, 0.1) 32%, rgba(0, 0, 0, 0.25) 50%, transparent 0%), radial-gradient(rgba(0, 0, 0, 0.1) 32%, rgba(0, 0, 0, 0.25) 50%, transparent 0%), radial-gradient(rgba(0, 0, 0, 0.1.........完整代码请登录后点击上方下载按钮下载查看
网友评论0