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.........完整代码请登录后点击上方下载按钮下载查看

网友评论0