css实现各种天气状况图标动画效果代码
代码语言:html
所属分类:布局界面
代码描述:css实现各种天气状况图标动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url('https://fonts.googleapis.com/css?family=Work+Sans:200'); :root { --shadow: #fd6f21; --ring: currentColor; --blend1: #fc5830; --blend2: #f98c24; --blend-from: 0%; --blend-to: 100%; --blend-dir: top right; } [icon] { -webkit-box-flex: 0; flex: none; display: none; position: relative; font-size: calc(10em + 1vmin); width: 1em; height: 1em; margin: .3em; border-radius: 100%; box-shadow: 0 0 0 .05em var(--ring) inset, 0 0 .3em -.03em var(--shadow); background: -webkit-gradient( linear, , from(var(--blend1)), to(var(--blend2))); background: linear-gradient( to var(--blend-dir), var(--blend1) var(--blend-from), var(--blend2) var(--blend-to)); /* filter: saturate(0); */ } /* [icon]:hover { filter: saturate(1); } */ [icon]::after { content: attr(data-label); position: absolute; top: calc(100% + 1vmin); left: 50%; -webkit-transform: translateX(-50%); transform: translateX(-50%); font: inherit; font-size: .15em; } [icon='sunny'] { --shadow: #fd6f21; --blend1: #fc5830; --blend2: #f98c24; --blend-to: 65%; } [icon='cloudy'] { --shadow: #1378bb; --blend1: #1b9ce2; --blend2: #1378bb; --shadow: #c9e8de; --blend1: #758595; --blend2: #e0e2e5; --blend1: #1b9ce2; --blend-to: 65%; --blend-to: 90%; } [icon='snowy'] { --shadow: #c9e8de; --blend1: #758595; --blend2: #e0e2e5; --blend-to: 90%; --blend-dir: bottom left; } [icon='stormy'] { --shadow: #34c6d8; --blend1: #4b9cc2; --blend2: #9adbd9; } [icon='supermoon'] { --shadow: #5133a5; --blend1: #4054b2; --blend2: #aa4cba; --blend-to: 65%; --blend-dir: bottom right; } /* SUNNY */ /* --------------------- */ .sun { position: absolute; top: 20%; left: 80%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); width: 40%; height: 40%; border-radius: 100%; background: #ffeb3b; box-shadow: 0 0 0 .02em var(--ring) inset, 0 0 .3em -.03em var(--shadow); -webkit-transform-origin: .1em .1em; transform-origin: .1em .1em; } .sun::after { content: ''; position: absolute; top: .1em; left: 0; will-change: transform; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); width: .1em; height: .1em; border-.........完整代码请登录后点击上方下载按钮下载查看
网友评论0