diff --git a/img/icon/folder.png b/img/icon/folder.png new file mode 100644 index 0000000..e1961d0 Binary files /dev/null and b/img/icon/folder.png differ diff --git a/plugins/shortcut-drawer/shortcut-drawer.css b/plugins/shortcut-drawer/shortcut-drawer.css new file mode 100644 index 0000000..48f0751 --- /dev/null +++ b/plugins/shortcut-drawer/shortcut-drawer.css @@ -0,0 +1,79 @@ +.win10-drawer-box{ + height:0; + overflow: hidden; +} + +.shortcut-drawer{ + width: 80px; + overflow: hidden; + cursor: pointer; + padding: 0; + transition: all 0.5s; + display: inline-block; +} + +.shortcut-drawer:hover { + background-color: rgba(255, 255, 255, 0.11); +} + +.shortcut-drawer>.icon { + width: 50px; + height: 50px; + overflow: hidden; + margin: 0 auto; + color: white; + box-sizing: border-box; + margin-bottom: 5px; + margin-top: 5px; + text-align: center; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + display: block; + font-size: 37px; + line-height: 50px; +} + +.shortcut-drawer .title { + color: white; + font-size: 12px; + text-align: center; + line-height: 18px; + margin-bottom: 5px; + height: 36px; + overflow:hidden; + text-overflow:ellipsis; + display:-webkit-box; + -webkit-box-orient:vertical; + -webkit-line-clamp:2; +} +.drawer.layui-layer{ + border-radius: 0.5em; + overflow: auto; + background: transparent; +} +.drawer.layui-layer>.layui-layer-title{ + background-color: srgba(250, 250, 250, 0.9); + text-align: center; + padding: 0; + color: #333; + height: 30px; + line-height: 30px; + border-radius: 4px 4px 0px 0px; + border: 0; +} + +.drawer.layui-layer>.layui-layer-content{ + background-color: rgba(255, 255, 255, 0.7); + padding: 1em; +} + + +.drawer .black-green{background:#009688!important;} +.drawer .green{background:#5FB878!important;} +.drawer .black{background:#393D49!important;} +.drawer .blue{background:#1E9FFF!important;} +.drawer .orange{background:#F7B824!important;} +.drawer .red{background:#FF5722!important;} +.drawer .dark{background:#2F4056!important;} +.drawer .purple{background:#b074e6!important;} \ No newline at end of file diff --git a/plugins/shortcut-drawer/shortcut-drawer.js b/plugins/shortcut-drawer/shortcut-drawer.js new file mode 100644 index 0000000..36fd28c --- /dev/null +++ b/plugins/shortcut-drawer/shortcut-drawer.js @@ -0,0 +1,59 @@ +//该插件提供桌面图标二级分类的支持 +Win10.onReady(function () { + //注册打开事件 + (function () { + // 注册事件委派 打开url窗口 + $('body').on('click', '.shortcut-drawer.win10-open-window', function() { + //>> 获取当前点击的对象 + $this = $(this); + //>> 判断url地址是否为空 如果为空 不予处理 + if($this.data('url') !== "") { + //>> 获取弹窗标题 + var title = $this.data('title')||'', + areaAndOffset; + //>> 判断是否有标题图片 + var bg=$this.data('icon-bg')?$this.data('icon-bg'):''; + if($this.data('icon-image')) { + //>> 加入到标题中 + title = '' + title; + } + if($this.data('icon-font')) { + //>> 加入到标题中 + title = '' + title; + } + if(!title && $this.children('.icon').length===1 && $this.children('.title').length===1){ + title = $this.children('.icon').prop("outerHTML")+$this.children('.title').html(); + } + //>> 判断是否需要 设置 区域宽度高度 + if($this.data('area-offset')) { + areaAndOffset = $this.data('area-offset'); + //>> 判断是否有分隔符 + if(areaAndOffset.indexOf(',')!==-1){ + areaAndOffset = eval(areaAndOffset); + } + } + //>> 调用win10打开url方法 + Win10.openUrl($this.data('url'), title, areaAndOffset); + } + }) + })(), + + + $('body').on('click','.win10-drawer',function () { + var content=$(this).find('.win10-drawer-box').html(); + var title=$(this).children('.title').html(); + var index=layer.open({ + type: 1, + shadeClose:true, + skin:'drawer', + area:[Win10.isSmallScreen()?"80%":"60%","80%"], + closeBtn: 0, + title:title, + content: content, + }); + var layero=Win10.getLayeroByIndex(index); + layero.find('.shortcut-drawer').click(function () { + layer.close(index); + }) + }) +}); \ No newline at end of file diff --git a/plugins/shortcut-drawer/shortcut-drawer.min.css b/plugins/shortcut-drawer/shortcut-drawer.min.css new file mode 100644 index 0000000..70a86a7 --- /dev/null +++ b/plugins/shortcut-drawer/shortcut-drawer.min.css @@ -0,0 +1 @@ +.win10-drawer-box{height:0;overflow:hidden}.shortcut-drawer{width:80px;overflow:hidden;cursor:pointer;padding:0;transition:all .5s;display:inline-block}.shortcut-drawer:hover{background-color:rgba(255,255,255,.11)}.shortcut-drawer>.icon{width:50px;height:50px;overflow:hidden;margin:0 auto;color:#fff;box-sizing:border-box;margin-bottom:5px;margin-top:5px;text-align:center;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;display:block;font-size:37px;line-height:50px}.shortcut-drawer .title{color:#fff;font-size:12px;text-align:center;line-height:18px;margin-bottom:5px;height:36px;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.drawer.layui-layer{border-radius:.5em;overflow:auto;background:0 0}.drawer.layui-layer>.layui-layer-title{background-color:rgba(250, 250, 250, 0.9);text-align:center;padding:0;color:#333;border:0;height: 30px;line-height: 30px;border-radius: 4px 4px 0px 0px;}.drawer.layui-layer>.layui-layer-content{background-color:rgba(255,255,255,0.7);padding:1em}.drawer .black-green{background:#009688!important}.drawer .green{background:#5FB878!important}.drawer .black{background:#393D49!important}.drawer .blue{background:#1E9FFF!important}.drawer .orange{background:#F7B824!important}.drawer .red{background:#FF5722!important}.drawer .dark{background:#2F4056!important}.drawer .purple{background:#b074e6!important} \ No newline at end of file diff --git a/plugins/shortcut-drawer/shortcut-drawer.min.js b/plugins/shortcut-drawer/shortcut-drawer.min.js new file mode 100644 index 0000000..59f202b --- /dev/null +++ b/plugins/shortcut-drawer/shortcut-drawer.min.js @@ -0,0 +1 @@ +Win10.onReady(function(){(function(){$("body").on("click",".shortcut-drawer.win10-open-window",function(){$this=$(this);if($this.data("url")!==""){var title=$this.data("title")||"",areaAndOffset;var bg=$this.data("icon-bg")?$this.data("icon-bg"):"";if($this.data("icon-image")){title=''+title}if($this.data("icon-font")){title=''+title}if(!title&&$this.children(".icon").length===1&&$this.children(".title").length===1){title=$this.children(".icon").prop("outerHTML")+$this.children(".title").html()}if($this.data("area-offset")){areaAndOffset=$this.data("area-offset");if(areaAndOffset.indexOf(",")!==-1){areaAndOffset=eval(areaAndOffset)}}Win10.openUrl($this.data("url"),title,areaAndOffset)}})})(),$("body").on("click",".win10-drawer",function(){var content=$(this).find(".win10-drawer-box").html();var title=$(this).children(".title").html();var index=layer.open({type:1,shadeClose:true,skin:"drawer",area:[Win10.isSmallScreen()?"80%":"60%","80%"],closeBtn:0,title:title,content:content,});var layero=Win10.getLayeroByIndex(index);layero.find(".shortcut-drawer").click(function(){layer.close(index)})})}); \ No newline at end of file