svg+js实现天气预报卡片滑动调节参数效果代码

代码语言:html

所属分类:布局界面

代码描述:svg+js实现天气预报卡片滑动调节参数效果代码

代码标签: svg js 天气预报 卡片 滑动 调节 参数

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

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

<head>
  <meta charset="UTF-8">
  

  
  
<style>
@import url("https://fonts.googleapis.com/css?family=Montserrat:400,400i,700");
body {
  margin: 0px;
  font-family: Montserrat, sans-serif;
  background-color: #F4FFFF;
}

#container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.weather-widget__wrapper {
  width: 500px;
}

.weather-widget {
  position: relative;
  z-index: 2;
  color: whitesmoke;
  height: 100px;
  width: 100%;
  background: #1d95fc;
  background: linear-gradient(90deg, #1d95fc 0%, #5cb7ff 100%);
  border-radius: 15px;
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  box-shadow: 0px 4px 4px 0px rgba(120, 142, 154, 0.2);
}
.weather-widget p {
  margin: 0;
}

.weather-widget.weather-widget--thunder {
  background: linear-gradient(90deg, #fc9f1d 0%, #ffbb5c 100%);
}

.weather-widget.weather-widget--snow {
  background: linear-gradient(90deg, #1dd6fc 0%, #5ce4ff 100%);
}

.weather-widget.weather-widget--danger {
  background: linear-gradient(90deg, #fc1d1d 0%, #ff5c5c 100%);
}

.weather-widget__info {
  display: flex;
  padding: 10px 10px 10px 25px;
  user-select: none;
  align-items: center;
}
.weather-widget__info .weather-widget__main-info {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 130px;
}
.weather-widget__info .weather-widget__main-info:after {
  content: "";
  position: absolute;
  width: 1px;
  height: 50%;
  top: 50%;
  transform: translatey(-50%);
  right: 0;
}
.weather-widget__info .weather-widget__main-info #weather-label {
  font-size: 12px;
  font-weight: bolder;
}
.weather-widget__info .weather-widget__main-info #weather-temperature {
  font-size: 40px;
  flex: 1;
  display: flex;
  align-items: center;
  transform: scale(1, 1.5);
}

.weather-widget__secondary-info {
  white-space: nowrap;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.vertical-spacer {
  margin-left: 10px;
  height: 100%;
  width: 10px;
  position: relative;
  overflow: hidden;
}

.vertical-spacer:before {
  content: "";
  display: block;
  margin-left: -20px;
  width: 20px;
  height: 100%;
  border-radius: 12px/125px;
  box-shadow: 0 0 8px #00000030;
}

.weather-widget__svg #weather-svg {
  height: 200%;
  width: 200%;
  transform: translate(-10%, -30%);
}
.weather-widget__svg #weather-svg svg {
  height: 100%;
  width: 100%;
}

.weather-widget__config {
  position: relative;
  z-index: 1;
  background-color: #FFF;
  box-shadow: 0px 4px 4px 0px rgba(120, 142, 154, 0.2);
  margin-top: -10px;
  padding: 15px 10px 5px 10px;
  border-radius: 0 0 10px 10px;
}
.weather-widget__config .weather-range {
  display: flex;
  flex-direction: column;
  font.........完整代码请登录后点击上方下载按钮下载查看

网友评论0