CSS百叶窗开关特效

CSS百叶窗开关特效

添加时间:2021-03-16 05:24:54
站长推荐丨赞助论坛,可获取海量资源终身免费下载权限奥!
举报 举报
收藏
预览
附件 附件
  • 模板类型模板类型:遮罩层
  • 模板颜色模板颜色:初级
  • 下载积分下载积分:28 米粒
  • 下载权限下载权限:

    赞助会员

一款CSS百叶窗开关特效,有两个绳索的点击控制,可以分别控制展开或收缩的程度,右下角的一个按钮直接可以打开百叶窗,打开后显示的图片可以任意替换,喜欢的小伙伴们请收下把。

分类:图片代码 > 遮罩层 难易:初级

页面的head部分先远程调用两个CSS样式文件、1个jQuery库和1个JS文件,代码如下:

<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<link type="text/css" rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css'>
<script type="text/javascript" src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js'></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>

接着设置好页面个元素的样式,遮罩显示的图片也在这里设置好,代码较多,所以仅贴出部分代码:

html {
  box-sizing: border-box;
}

*, *::after, *::before {
  box-sizing: inherit;
}

*, *:before, *:after {
  box-sizing: border-box;
  outline: none;
}

body {
  width: 100%;
  height: 100vh;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 16px;
  font-smooth: auto;
  font-weight: 300;
  line-height: 1.5;
  color: #444;
  background-color: black;
  background-image: url("https://jy.tp.yuanmeng.life/jquery/22/2286/demo/image/6.jpg");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: contain;
}
body:before {
  position: absolute;
  content: '';
  width: 100%;
  height: 84.25%;
  box-shadow: inset 0 0 200px 200px black;
  z-index: 1;
}

.string {
  position: absolute;
  top: -200px;
  right: 100px;
  width: 3px;
  height: 500px;
  background-color: white;
  box-shadow: 15px 15px 5px rgba(0, 0, 0, 0.3);
  transition: top 500ms ease;
  cursor: pointer;
  z-index: 100;
}
.string:before, .string:after {
  position: absolute;
  content: '';
  left: -8px;
  width: 18px;
  height: 21px;
  background-color: white;
  border-radius: 10px;
  box-shadow: 15px 15px 5px rgba(0, 0, 0, 0.3);
}
.string:before {
  bottom: -20px;
}
.string:after {
  bottom: -39px;
}

.wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 84.25%;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2);
  transition: height 1000ms ease;
  border-top: 30px solid #3E2723;
  border-right: 30px solid #3E2723;
  border-left: 30px solid #3E2723;
  z-index: 10;
}
.wrapper .guides {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  top: 17px;
  left: 10%;
  width: 2px;
  height: 95.5%;
  transition: height 1000ms ease;
  z-index: 11;
}
.wrapper .guides:nth-of-type(even) {
  left: 90%;
}
.wrapper .guides .guide {
  position: relative;
  width: 2px;
  height: 20px;
  background-color: rgba(255, 255, 255, 0.4);
  transition: all 1000ms ease;
  z-index: 999;
}

页面的body结构不算复杂,3个按钮和一些遮罩用的百叶,代码如下:

<input id='toggle' type='checkbox'>
<label class='toggle' for='toggle'>媚动百叶窗</label>
<input id='height' type='checkbox'>
<label class='height' for='height'></label>
<label class='string' for='toggle'></label>
<div class='wrapper'>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
  <div class='blinds'></div>
</div>
<div class='glares'>
  <div class='glare'></div>
  <div class='glare'></div>
  <div class='glare'></div>
  <div class='glare'></div>
</div>
<div class='ledge'>
  <p>轻触拉绳</p>
</div>
相关内容推荐
资源求助发帖
查看更多发帖

*

回帖描述:

*

链接类型:

*

下载链接:

密码:
发帖规则:回帖内容为会员之间的私信,普通网友无法查看。
免责声明:回帖中提供的链接内容仅供会员之间学习参考使用,获取内容后请在法律法规范围内使用。回帖提供的内容应符合法律法规要求,不得违反法律法律的要求。
站点权责:回帖内容如违反法律法规,站点有权封停账号使用权利。对用户举报的内容,站点有责任及时删除违规内容。
热点内容推荐
标题:CSS百叶窗开关特效

*

描述:
平均回复时间:3-10分钟
规则介绍:悬赏寻求论坛网友分享资源,站点对分享内容的准确性,合法性,版权等没有足够的监管能力。如果您发现资源不正确,无法使用,不符合法律法律等情况,您可以直接举报资源。站长将尽快核实您的举报,并根据情况,采取封号,退换米粒等处理。

*

回帖描述:

*

链接类型:

*

阅读权限:

*

下载链接:

密码:
发帖规则:回帖内容为会员之间的私信,普通网友无法查看。
免责声明:回帖中提供的链接内容仅供会员之间学习参考使用,获取内容后请在法律法规范围内使用。回帖提供的内容应符合法律法规要求,不得违反法律法律的要求。
站点权责:回帖内容如违反法律法规,站点有权封停账号使用权利。对用户举报的内容,站点有责任及时删除违规内容。
  • 背景波浪
  • 背景波浪
  • 波浪
  • 波浪
客服
在线咨询
周一 至 周日 9:00 ~ 22:00
QQ:1326974360
微信:juyoubuluo6688
客服热线
18205485173
工作日 9:00 ~ 18:00
微信扫码咨询
客户服务
欢迎咨询服务
咨询量较多时,请耐心等待
社群

关注公众号

获取更多资讯

扫码进群(QQ)

与更多大牛交流沟通

0.210787s