html 天气特效,用CSS制作天气特效动画,源码分享

7c03ed3a322af2945769c22bced7efa3.gif

效果图

今天给大家带来的是CSS3动画天气图标代码,简单实用好看!

CSS源码:

html { box-sizing: border-box; }

html *,

html *:before,

html *:after { box-sizing: inherit; }

body {

max-width: 42em;

padding: 2em;

margin: 0 auto;

color: #161616;

font-family: 'Roboto', sans-serif;

text-align: center;

background-color: currentColor;

}

h1 {

margin-bottom: 1.375em;

color: #fff;

font-weight: 100;

font-size: 2em;

text-transform: uppercase;

}

p,

a {

color: rgba(255,255,255,0.3);

font-size: small;

}

p { margin: 1.375rem 0; }

.icon {

position: relative;

display: inline-block;

width: 12em;

height: 10em;

font-size: 1em; /* control icon size here */

}

.cloud {

position: absolute;

z-index: 1;

top: 50%;

left: 50%;

width: 3.6875em;

height: 3.6875em;

margin: -1.84375em;

background: currentColor;

border-radius: 50%;

box-shadow:

-2.1875em 0.6875em 0 -0.6875em,

2.0625em 0.9375em 0 -0.9375em,

0 0 0 0.375em #fff,

-2.1875em 0.6875em 0 -0.3125em #fff,

2.0625em 0.9375em 0 -0.5625em #fff;

}

.cloud:after {

content: '';

position: absolute;

bottom: 0;

left: -0.5em;

display: block;

width: 4.5625em;

height: 1em;

background: currentColor;

box-shadow: 0 0.4375em 0 -0.0625em #fff;

}

.cloud:nth-child(2) {

z-index: 0;

background: #fff;

box-shadow:

-2.1875em 0.6875em 0 -0.6875em #fff,

2.0625em 0.9375em 0 -0.9375em #fff,

0 0 0 0.375em #fff,

-2.1875em 0.6875em 0 -0.3125em #fff,

2.0625em 0.9375em 0 -0.5625em #fff;

opacity: 0.3;

transform: scale(0.5) translate(6em, -3em);

animation: cloud 4s linear infinite;

}

.cloud:nth-child(2):after { background: #fff; }

.sun {

position: absolute;

top: 50%;

left: 50%;

width: 2.5em;

height: 2.5em;

margin: -1.25em;

background: currentColor;

border-radius: 50%;

box-shadow: 0 0 0 0.375em #fff;

animation: spin 12s infinite linear;

}

.rays {

position: absolute;

top: -2em;

left: 50%;

display: block;

width: 0.375em;

height: 1.125em;

margin-left: -0.1875em;

background: #fff;

border-radius: 0.25em;

box-shadow: 0 5.375em #fff;

}

.rays:before,

.rays:after {

content: '';

position: absolute;

top: 0em;

left: 0em;

display: block;

width: 0.375em;

height: 1.125em;

transform: rotate(60deg);

transform-origin: 50% 3.25em;

background: #fff;

border-radius: 0.25em;

box-shadow: 0 5.375em #fff;

}

.rays:before {

transform: rotate(120deg);

}

.cloud + .sun {

margin: -2em 1em;

}

.rain,

.lightning,

.snow {

position: absolute;

z-index: 2;

top: 50%;

left: 50%;

width: 3.75em;

height: 3.75em;

margin: 0.375em 0 0 -2em;

background: currentColor;

}

.rain:after {

content: '';

position: absolute;

z-index: 2;

top: 50%;

left: 50%;

width: 1.125em;

height: 1.125em;

margin: -1em 0 0 -0.25em;

background: #0cf;

border-radius: 100% 0 60% 50% / 60% 0 100% 50%;

box-shadow:

0.625em 0.875em 0 -0.125em rgba(255,255,255,0.2),

-0.875em 1.125em 0 -0.125em rgba(255,255,255,0.2),

-1.375em -0.125em 0 rgba(255,255,255,0.2);

transform: rotate(-28deg);

animation: rain 3s linear infinite;

}

.bolt {

position: absolute;

top: 50%;

left: 50%;

margin: -0.25em 0 0 -0.125em;

color: #fff;

opacity: 0.3;

animation: lightning 2s linear infinite;

}

.bolt:nth-child(2) {

width: 0.5em;

height: 0.25em;

margin: -1.75em 0 0 -1.875em;

transform: translate(2.5em, 2.25em);

opacity: 0.2;

animation: lightning 1.5s linear infinite;

}

.bolt:before,

.bolt:after {

content: '';

position: absolute;

z-index: 2;

top: 50%;

left: 50%;

margin: -1.625em 0 0 -1.0125em;

border-top: 1.25em solid transparent;

border-right: 0.75em solid;

border-bottom: 0.75em solid;

border-left: 0.5em solid transparent;

transform: skewX(-10deg);

}

.bolt:after {

margin: -0.25em 0 0 -0.25em;

border-top: 0.75em solid;

border-right: 0.5em solid transparent;

border-bottom: 1.25em solid transparent;

border-left: 0.75em solid;

transform: skewX(-10deg);

}

.bolt:nth-child(2):before {

margin: -0.75em 0 0 -0.5em;

border-top: 0.625em solid transparent;

border-right: 0.375em solid;

border-bottom: 0.375em solid;

border-left: 0.25em solid transparent;

}

.bolt:nth-child(2):after {

margin: -0.125em 0 0 -0.125em;

border-top: 0.375em solid;

border-right: 0.25em solid transparent;

border-bottom: 0.625em solid transparent;

border-left: 0.375em solid;

}

.flake:before,

.flake:after {

content: '¼4';

position: absolute;

top: 50%;

left: 50%;

margin: -1.025em 0 0 -1.0125em;

color: #fff;

list-height: 1em;

opacity: 0.2;

animation: spin 8s linear infinite reverse;

}

.flake:after {

margin: 0.125em 0 0 -1em;

font-size: 1.5em;

opacity: 0.4;

animation: spin 14s linear infinite;

}

.flake:nth-child(2):before {

margin: -0.5em 0 0 0.25em;

font-size: 1.25em;

opacity: 0.2;

animation: spin 10s linear infinite;

}

.flake:nth-child(2):after {

margin: 0.375em 0 0 0.125em;

font-size: 2em;

opacity: 0.4;

animation: spin 16s linear infinite reverse;

}

/* Animations */

@keyframes spin {

100% { transform: rotate(360deg); }

}

@keyframes cloud {

0% { opacity: 0; }

50% { opacity: 0.3; }

100% {

opacity: 0;

transform: scale(0.5) translate(-200%, -3em);

}

}

@keyframes rain {

0% {

background: #0cf;

box-shadow:

0.625em 0.875em 0 -0.125em rgba(255,255,255,0.2),

-0.875em 1.125em 0 -0.125em rgba(255,255,255,0.2),

-1.375em -0.125em 0 #0cf;

}

25% {

box-shadow:

0.625em 0.875em 0 -0.125em rgba(255,255,255,0.2),

-0.875em 1.125em 0 -0.125em #0cf,

-1.375em -0.125em 0 rgba(255,255,255,0.2);

}

50% {

background: rgba(255,255,255,0.3);

box-shadow:

0.625em 0.875em 0 -0.125em #0cf,

-0.875em 1.125em 0 -0.125em rgba(255,255,255,0.2),

-1.375em -0.125em 0 rgba(255,255,255,0.2);

}

100% {

box-shadow:

0.625em 0.875em 0 -0.125em rgba(255,255,255,0.2),

-0.875em 1.125em 0 -0.125em rgba(255,255,255,0.2),

-1.375em -0.125em 0 #0cf;

}

}

@keyframes lightning {

45% {

color: #fff;

background: #fff;

opacity: 0.2;

}

50% {

color: #0cf;

background: #0cf;

opacity: 1;

}

55% {

color: #fff;

background: #fff;

opacity: 0.2;

}

}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/367929.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

做折线图坐标轴数字_Excel折线图表的另类表达制作?牛闪君使用了双线表达法来完成...

牛闪闪办公第846个原创技巧Zloffice社群的小伙伴还是很爱学习的,这不,有一位小伙伴看到“特殊”图表表达,想知道是怎么做出来的。这种学习的思路非常好,看到好的表达就想学习,这是非常好的收集习惯,能够积累…

Spring MVC控制器的单元测试:“普通”控制器

本教程的第一部分描述了如何配置使用Spring MVC Test框架的单元测试 。 现在是时候动手做,学习如何为“常规”控制器编写单元测试了。 显而易见的下一个问题是: 什么是普通控制器? 好吧,一个普通的控制器(在此博客文…

回溯法

一、概念&#xff1a;回溯法也是一种枚举&#xff0c;但是回溯法将枚举(生成&#xff09;和检查有机结合起来&#xff0c;从而减少了不必要的枚举。。 二、经典八皇后问题。 #include<iostream> #include<cmath> using namespace std;int vis[100]; int store[100]…

【Spring】入门HelloWorld

参考&#xff1a;https://www.yiibai.com/spring/spring-tutorial-for-beginners.html 一、创建项目 1.利用IntelliJ创建Maven项目2.配置pom.xml,引入Spring <?xml version"1.0" encoding"UTF-8"?> 4.0.0 <groupId>com.jh</groupId> &…

html属性可以用来定义内联样式,18年6月考试《网页设计与制作》期末大作业.doc...

...(单选题) 1: 以下HTML代码&#xff0c;判断正确的是( )。 A: 错了B: “button”双引号错了(应为单引号)C: 第2、3行应加入…….D: 没有错误正确答案:(单选题) 2: 数据库的基本操作是( )。A: 增&#xff0c;删&#xff0c;改&#xff0c;查B: 增&#xff0c;删&#xff0c;加…

DIV CSS初学者需重视的10个简单问题与技巧

DIVCSS初学者往往感觉自己遇到很多莫明其妙的问题&#xff0c;其实只是一些小细节没有引起重视&#xff0c;下面罗列了10个问题与技巧&#xff0c;温故而知新。 一、检查HTML元素是否有拼写错误、是否忘记结束标记即使是老手也经常会弄错div的嵌套关系。可以用dreamweaver的验…

Spring MVC:表单处理卷。 5 –选择,选项,选项标签

下拉列表是Web表单中最常见的元素之一。 在HTML中&#xff0c;可以使用适当的标签创建此类控件&#xff1a; <form&#xff1a;select> –下拉列表的父标签和<form&#xff1a;option> – <form&#xff1a;select>标签的子标签。 Spring MVC标签库为下拉列表…

06.linux平台下运行go文件

1.获取linux位数 getconf LONG_BIT 2.下载地址&#xff1a; https://studygolang.com/dl 3.解压安装包 sudo tar -xzf go1.9.2.linux-amd64.tar.gz -C /usr/local 4.设置环境变量 sudo vi /etc/profile export GOROOT/usr/local/go export GOBIN$GOROOT/bin export GOPATH/h…

python3读取ini文件_python3配置文件ini读取方法

1.最常用的Plain text形式的配置文件 1.1首选 .init 文件 标准库 configparser 1.2次选 csv文件 与 Unix/Linux 下常用的 xx xxx形式的配置文件 分别是标准库csv 与 shlex 2.最常用的二进制级配置文件 2.1持久化数据首选shelve 标准库 shelve 2.2shelve的对于一些项目我们需要…

Python的看门狗实现自动化实时对服务器、Windows或Linux文件夹的实时监控

众所周知&#xff0c;在运维过程中&#xff0c;实时获取目标文件夹至关重要&#xff0c;Python的watchdog是用程序来监视文件系统事件Python库&#xff0c;所以用该库可以实现对文件夹的实时监控&#xff0c;filenotify.py代码如下&#xff1a; # -*- coding: utf-8 -*- #!/usr…

在html中样式表的三种类型,css样式有哪几种类型?

CSS样式可以写在哪些地方呢&#xff1f;从CSS 样式代码插入的形式来看基本可以分为以下3种&#xff1a;内联式、嵌入式和外部式三种。下面本篇文章就来给大家介绍一下CSS样式的类型&#xff0c;希望对大家有所帮助。内联式样式内联式css样式表就是把css代码直接写在现有的HTML标…

DIV CSS浏览器的兼容性

1. 文字本身的大小不兼容。同样是font-size:14px的宋体文字&#xff0c;在不同浏览器下占的空间是不一样的&#xff0c;ie下实际占高16px&#xff0c;下留白3px&#xff0c;ff 下实际占高17px&#xff0c;上留白1px&#xff0c;下留白3px&#xff0c;opera下就更不一样了。解决…

记录合规性–关于TCK,规格和测试

使用软件规格非常困难。 不论在哪个地方提出&#xff1b; 您最终遇到了一个大问题&#xff1a;是否已实施并测试了所有指定的内容&#xff1f; 在瀑布驱动的方法学时代&#xff0c;这一直是一个问题&#xff0c;即使在撰写本文的今天&#xff0c;敏捷性和用户故事仍然不能保证您…

arcgis已试图对空几何执行该操作_ArcGIS中地理配准与空间校正的不同

ArcGIS中地理配准与空间校正都是用于数据坐标变换的目的&#xff0c;他们之间有什么区别呢&#xff1f;1、处理对象不同&#xff1a;地理配准针对栅格数据&#xff0c;而空间校正针对矢量数据。因此空间校正需要建立在矢量数据编辑的基础上&#xff0c;空间校正之前应开始编辑。…

【计算机视觉】深度学习视觉领域常用数据集汇总

本文结合笔者在研究生学习、科研期间使用过以及阅读文献了解到的深度学习视觉领域常用的开源数据集&#xff0c;进行介绍和汇总。MNIST深度学习领域的“Hello World!”&#xff0c;入门必备&#xff01;MNIST是一个手写数字数据库&#xff0c;它有60000个训练样本集和10000个测…

CSS Hack 汇总速查一览

由于浏览器之间存在兼容性问题&#xff0c;在制作网页的时候&#xff0c;为了使页面能在不同浏览器中显示相对一致或者其他原因&#xff0c;网页制作人员总结了种种 Hack 方法&#xff1b;在解 决兼容性问题之前&#xff0c;这些方法还经常会用到。接下来&#xff0c;大前端将给…

玩游戏4g计算机的内存不足,玩游戏时出现存储空间不足, 无法完成此操作, 到底是何原因?...

游戏是Just Cause 2(即《正当防卫2》, 对不&#xff1f;这款游戏需要很高的硬件配置&#xff0c;显卡必须在DirectX10以上才行;你的是什么显卡&#xff1f;请确保安装了最新的.NET和DX10&#xff1b;另我搜索到下面的解决方法&#xff0c;仅供参考&#xff1a;解决方法&#xf…

win10安装opcenum_Win10提示Windows无法安装到GPT分区形式磁盘

Win10系统提示Windows无法安装到GPT分区形式磁盘该怎么办&#xff1f;最近有用户反映说在安装Win10原版系统的时候&#xff0c;采用的是U盘安装Win10的方法&#xff0c;到磁盘选择这一项的时候&#xff0c;选中C盘不能安装&#xff0c;提示&#xff1a;Windows无法安装到这个磁…

JPA 2 | EntityManagers,事务及其周围的一切

介绍 对我来说&#xff0c;最令人困惑和不清楚的事情之一是&#xff0c;作为Java开发人员&#xff0c;一直是围绕事务管理的谜团&#xff0c;尤其是JPA如何处理事务管理。 事务什么时候开始&#xff0c;什么时候结束&#xff0c;实体的持久化方式&#xff0c;持久性上下文等等。…

JavaScript高级特征之面向对象笔记

Javascript面向对象&#xff1a;函数&#xff1a; * Arguments对象&#xff1a; * Arguments对象是数组对象 * Arguments对象的length属性可以获取参数的个数 * 利用Arguments对象模拟函数的重载效果&#xff08;javascript中不存在函…