图片/图形

Frosted Panel 炫酷毛玻璃面板CSS3特效

阿里云


Frosted Panel 是一款使用 js 编写的炫酷毛玻璃特效插件。您通过简单的配置,既可以生成非常炫酷的半透明模糊的毛玻璃效果。

使用方法

HTML 文件中引入。

也想出现在这里?联系我们
创客主机
  1. <script type="text/javascript" src="path/to/app.js"></script>

HTML 结构

创建 HTML 结构并使用下面的属性来配置毛玻璃效果。

  1. <div class="frosted-panel" panel-dimensions="80% 60%" breakpoint-type="min-width" breakpoints="600px 80% 80%, 1200px 60% 500px">
  2.   <svg>
  3.     <filter id="blurMe" filterRes="1200" color-interpolation-filters="sRGB">
  4.       <feGaussianBlur in="SourceGraphic" stdDeviation="7" />
  5.     </filter>
  6.     <image xlink:href="bg.jpg" x="0" y="0" width="2880" height="1620" filter="url(#blurMe)" />
  7.   </svg>
  8.   <div class="content" content-margin="5px">
  9.     ALL PANEL CONTENT GOES HERE
  10.   </div>
  11. </div>
  • panel-dimensions:宽度和高度。
  • breakpoint-type:min-width 或 max-width。
  • breakpoints:响应式断点。
  • stdDeviation:模糊的数量。
  • content-margin:为面板添加一个 margin。

示例

看一个小例子,下面的 HTML 通过初始化之后,相对于生成后面的 CSS 样式。

  1. <div class="frosted-panel"
  2.   panel-dimensions="auto auto"
  3.   breakpoint-type="min-width"
  4.   breakpoints="600px 70% 300px, 1200px 60% 500px">
  1. .frosted-panel {
  2.   width: auto;
  3.   height: auto;
  4. }
  5. @media only screen and (min-width: 600px) {
  6.   .frosted-panel {
  7.     width: 70%;
  8.     height: 300px;
  9.   }
  10. }
  11.  
  12. @media only screen and (min-width: 1200px) {
  13.   .frosted-panel {
  14.     width: 60%;
  15.     height: 500px;
  16.   }
  17. }
  18. /* When breakpoint-type is changed from min-width to max-width, the CSS equivalent would now be this:*/
  19.  
  20. .frosted-panel {
  21.   width: auto;
  22.   height: auto;
  23. }
  24.  
  25. @media only screen and (max-width: 1200px) {
  26.   .frosted-panel {
  27.     width: 60%;
  28.     height: 500px;
  29.   }
  30. }
  31.  
  32. @media only screen and (max-width: 600px) {
  33.   .frosted-panel {
  34.     width: 70%;
  35.     height: 300px;
  36.   }
  37. }

Github 网址:https://github.com/cryptodescriptor/frosted-panel

Frosted Panel 炫酷毛玻璃面板 CSS3 特效

已有 458 人购买
  • 5gqe
查看演示升级 VIP立刻购买

演示地址 下载地址
收藏
(0)

发表回复

热销模板

Ashade - 作品展示摄影相册WordPress汉化主题
LensNews

本站承接 WordPress / PbootCMS / DedeCMS 等
系统建站、仿站、开发、定制等业务!