angular获取当前城市位置天气预报卡片效果代码

代码语言:html

所属分类:其他

代码描述:angular获取当前城市位置天气预报卡片效果代码

代码标签: angular 获取 当前 城市 位置 天气 预报 卡片

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


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

<head>

  <meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/normalize.5.0.css">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/weather-icons.min.css">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/bootstrap.3.3.4.css">
  
<style>
@import url(https://fonts.googleapis.com/css?family=Josefin+Sans:400,600,700);
@import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);
.icon:after, .main-info:before {
  z-index: -1;
  position: absolute;
  content: "";
  bottom: 15px;
  left: 10px;
  width: 50%;
  top: 80%;
  max-width: 300px;
  box-shadow: 0 15px 10px #000;
  transform: rotate(-3deg);
}

* {
  margin: 0;
  padding: 0;
}

body {
  position: relative;
  height: 100vh;
  background-color: #337ab7;
  font-family: "Josefin Sans", sans-serif;
}

.cistern {
  min-width: 540px;
  height: 300px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.main-info {
  background: #333;
  width: 300px;
  height: 100%;
  padding: 25px;
  position: relative;
  color: #fff;
  text-align: center;
  float: left;
}
.main-info .temp {
  font-size: 96px;
  font-family: "Montserrat";
  font-weight: 700;
}
.main-info .temp .unit {
  color: #F16C6C;
  cursor: pointer;
}
.main-info .city {
  font-size: 48px;
}
.main-info .country {
  font-size: 18px;
  font-weight: bold;
}

.icon {
  background-color: #fff;
  width: 240px;
  height: 100%;
  position: relative;
  float: right;
  display: flex;
  justify-content: center;
  align-items: center;
}
.icon:after {
  transform: rotate(3deg);
  left: auto;
  right: 10px;
}
.icon .wi {
  font-size: 150px;
}

@media screen and (max-width: 559px) {
  .cistern {
    min-width: 300px;
    height: 600px;
    border-radius: 0;
  }

  .main-info {
    height: 300px;
    float: none;
    border-radius: 0;
  }
  .main-info:before {
    display: none;
  }
  .main-info .temp {
    margin-top: 0;
  }

  .icon {
    float: none;
    width: 300px;
    height: 300px;
    border-radius: 0;
  }
  .icon:before {
    z-index: -1;
    position: absolute;
    content: "";
    bottom: 15px;
    left: 10px;
    width: 50%;
    top: 80%;
    max-width: 300px;
    box-shadow: 0 15px 10px #000;
    transform: rotate(-3deg);
  }
}
</style>



</head>


  <body ng-app="myApp" ng-controller="MainCtrl">
	<div class="cistern">
		<div class="main-info">
			<div class="temp">{{temp}} &#176;<span class="unit" ng-click="changeUnit()">{.........完整代码请登录后点击上方下载按钮下载查看

网友评论0