jquery+css实现圆形天气预报组件效果代码

代码语言:html

所属分类:其他

代码描述:jquery+css实现圆形天气预报组件效果代码

代码标签: jquery css 圆形 天气 预报 组件

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

 
<meta charset="UTF-8">
 
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/weather-icons.min.css">
 
<style>
@import url(https://fonts.googleapis.com/css?family=Lato:400,300,700);

* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html, body {
  height: 100%;
}

body {
  overflow-x: hidden;
  font-family: "Lato", sans-serif;
  padding-top: 80px;
  color: #fff;
  background: #333;
}

.row {
  display: flex;
}

.column {
  display: flex;
  flex-direction: column;
}

.center {
  justify-content: center;
}

.column-center {
  align-items: center;
}

.split {
  justify-content: space-between;
}

.split-center {
  justify-content: space-around;
}

@keyframes fadeOne {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
@keyframes fadeTwo {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
.Weather {
  min-width: 350px;
}
.Weather__main {
  background: #71db71;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  border: 4px solid #fff;
  text-align: center;
  padding: 30px 0 15px;
}
@media screen and (min-width: 500px) {
  .Weather__main {
    width: 300px;
    height: 300px;
  }
}
@media screen and (min-width: 880px) {
  .Weather__main {
    width: 350px;
    height: 350px;
  }
}
.Weather h3 {
  font-size: 1.3rem;
  font-weight: 300;
}
@media screen and (min-width: 500px) {
  .Weather h3 {
    font-size: 1.7rem;
  }
}
@media screen and (min-width: 880px) {
  .Weather h3 {
    font-size: 2rem;
  }
}
.Weather h2 {
  font-size: 1.5rem;
  font-weight: 400;
}
@media screen and (min-width: 500px) {
  .Weather h2 {
    font-size: 2rem;
  }
}
@media screen and (min-width: 880px) {
  .Weather h2 {
    font-size: 2.425rem;
  }
}
.Weather #temp {
  font-size: 3rem;
  display: inline-block;
  position: relative;
  animation: fadeOne 0.4s;
}
@media screen and (min-width: 500px) {
  .Weather #temp {
    font-size: 3.4rem;
  }
}
@media screen and (min-width: 880px) {
  .Weather #temp {
    font-size: 4rem;
  }
}
.Weather #temp:after {
  content: "";
  position: absolute;
  top: 11px;
  right: -16px;
  height: 7px;
  width: 7px;
  border: 3px solid #fff;
  border-radius: 50%;
}
@media screen and (min-width: 880px) {
  .Weather #temp:after {
    height: 10px;
    width: 10px;
    top: 16px;
    right: -17px;
  }
}
.Weather #temp.toggle {
  animation: fadeTwo 0.4s;
}
.Weather__main-toggle {
  margin: 0 0 0 16px;
}
.Weather__main-toggle > span {
  font-size: 1.2rem;
  position: relative;
}
@media screen and (min-width: 500px) {
  .Weather__main-toggle > span {
    font-size: 1.5rem;
  }
}
@media screen and (min-width: 880px) {
  .Weather__main-toggle > span {
    font-size: 1.7rem;
  }
}
.Weather__main-toggle > span:before {
  content: "";
  position: absolute;
  left: -10px;
  top: 6px;
  height: 3px;
  width: 3px;
  border: 2px solid #fff;
  border-radius: 50%;
}
@media screen and (min-width: 880px) {
  .Weather__main-toggle > span:before {
    width: 4px;
    height: 4px;
    top: 7px;
  }
}
.Weather__main-toggle > span:last-child {
  margin-left: 11px;
}
.Weather__main-toggle button {
  background: #6bbf6b;
  border: none;
  border-radius: 30px;
  outline: none;
  width: 45px;
  height: 20px;
  margin: 5px 5px 0;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}
@media screen and (min-width: 500px) {
  .Weather__main-toggle button {
    height: 25px;
    width: 55px;
  }
}
@media screen and (min-width: 880px) {
  .Weather__main-toggle button {
    height: 30px;
    width: 65px;
  }
}
.Weather__main-toggle button:active {
  background: #67b567;
}
.Weather__main-toggle button #unit-toggle {
  position: absolute;
  display: inline-block;
  left: 3px;
  top: 0.13em;
  width: 15px;
  height: 15px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
}
@media screen and (min-width: 500px) {
  .Weather__main-toggle button #unit-toggle {
    height: 20px;
    width: 20px;
  }
}
@media screen and (min-width: 880px) {
  .Weather__main-toggle button #unit-toggle {
    height: 24px;
    width: 24px;
    top: 3px;
    left: 4px;
  }
}.........完整代码请登录后点击上方下载按钮下载查看

网友评论0