mirror of https://github.com/1099438829/macUI.git
增加launchpad功能
This commit is contained in:
parent
e70fc7205e
commit
ba19348335
134
css/index.css
134
css/index.css
|
|
@ -359,7 +359,7 @@ body {
|
||||||
color: grey;
|
color: grey;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mac #mac-shortcuts {
|
#mac-shortcuts {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
@ -368,9 +368,9 @@ body {
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mac #mac-shortcuts.shortcuts-hidden .shortcut{display: none}
|
#mac-shortcuts .shortcuts-hidden .shortcut{display: none}
|
||||||
|
|
||||||
#mac #mac-shortcuts .shortcut {
|
#mac-shortcuts .shortcut {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
@ -379,11 +379,11 @@ body {
|
||||||
transition: all 0.5s;
|
transition: all 0.5s;
|
||||||
}
|
}
|
||||||
|
|
||||||
#mac #mac-shortcuts .shortcut:hover {
|
#mac-shortcuts .shortcut:hover {
|
||||||
background-color: rgba(255, 255, 255, 0.11);
|
background-color: rgba(255, 255, 255, 0.11);
|
||||||
}
|
}
|
||||||
|
|
||||||
#mac #mac-shortcuts .shortcut>.icon {
|
#mac-shortcuts .shortcut>.icon {
|
||||||
width: 50px;
|
width: 50px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
@ -892,7 +892,7 @@ body {
|
||||||
left: 0;
|
left: 0;
|
||||||
height: 60px;
|
height: 60px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
z-index:1000;
|
z-index:1003;
|
||||||
}
|
}
|
||||||
.dock-container {
|
.dock-container {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
|
|
@ -924,6 +924,128 @@ body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#launchpad {
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
overflow-y:auto;
|
||||||
|
display: block;
|
||||||
|
top: 0;
|
||||||
|
z-index: 1001;
|
||||||
|
}
|
||||||
|
|
||||||
|
#launchpad.hidden {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#launchpad .app-serach-box{
|
||||||
|
position: relative;
|
||||||
|
margin: 3vh auto 20px;
|
||||||
|
height: 1.75rem;
|
||||||
|
width: 16rem;
|
||||||
|
color: var(--d-main);
|
||||||
|
background-color: transparent;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search .serach-box {
|
||||||
|
position: relative;
|
||||||
|
background-color: rgba(229,231,235,0.1);
|
||||||
|
}
|
||||||
|
.search label {
|
||||||
|
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAMAAAAolt3jAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAAALFQTFRFAAAA////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////t5hynAAAADt0Uk5TABqT4f/1u0487ui5zf6bARv6agInexLmEOPqeVS+THTz02JntjPAKkLZHoS18pFzyhXnq9wEW1Ecxze6XPngAAAAhUlEQVR4nE2MWRKCUAwEAw4C+hAEcVcEdxH3/f4HMxCknI+e6lQSItL0Goy6SRLLRqOpHLTc3Dy77QdEHYUwVx1+sdTtGX2uwTCQoxHGTEzKH1NEzFlcaoI5c4Gl6Apr5gbbHZebYl9MU2SH5HgC4rMcXQA419vP79bjqdGrcgn7m/5dfb4TpgmCJFVbRAAAAABJRU5ErkJggg==) no-repeat 0 50%;
|
||||||
|
color: #fff;
|
||||||
|
left: 50%;
|
||||||
|
position: absolute;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
top: 50%;
|
||||||
|
transition: left .4s, transform .4s;
|
||||||
|
padding-left: 1.25em;
|
||||||
|
}
|
||||||
|
.search .input-search {
|
||||||
|
-webkit-appearance: textfield;
|
||||||
|
background-color: rgba(229,231,235,0.1);
|
||||||
|
border-radius: .25em;
|
||||||
|
border-color: rgba(229,231,235,0.3);
|
||||||
|
border-width: 1px;
|
||||||
|
border-style: solid;
|
||||||
|
display: block;
|
||||||
|
padding: .5em 1.75em;
|
||||||
|
width: 100%;
|
||||||
|
outline: none;/*点击之后。不出现边框*/
|
||||||
|
}
|
||||||
|
.search .input-search:focus + label,
|
||||||
|
.search .input-search:valid + label {
|
||||||
|
left: .5em;
|
||||||
|
transform: translate(0, -50%);
|
||||||
|
}
|
||||||
|
.search .input-search:valid + label {
|
||||||
|
text-indent: -9999px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search .input-search :before, :after {
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-width: 0;
|
||||||
|
border-style: solid;
|
||||||
|
border-color: #ebe6e5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search .input-search,.search .input-search:hover {
|
||||||
|
--un-text-opacity: 1;
|
||||||
|
color: rgba(255,255,255,var(--un-text-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
#launchpad .app-shortcuts{
|
||||||
|
display:flex;
|
||||||
|
flex-direction: row;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: flex-start;
|
||||||
|
align-content: stretch;
|
||||||
|
align-items: flex-start;
|
||||||
|
position: fixed;
|
||||||
|
width: calc(100% - 90px);
|
||||||
|
height: 100%;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 45px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#launchpad .shortcut{
|
||||||
|
width: 75px;
|
||||||
|
height: 75px;
|
||||||
|
order: 1;
|
||||||
|
align-self: auto;
|
||||||
|
flex-basis: auto;
|
||||||
|
flex-grow: 0;
|
||||||
|
padding: 0.625rem;
|
||||||
|
flex-shrink: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
#launchpad .shortcut>.icon {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
overflow: hidden;
|
||||||
|
color: white;
|
||||||
|
box-sizing: border-box;
|
||||||
|
margin: 5px auto;
|
||||||
|
text-align: center;
|
||||||
|
-webkit-border-radius: 5px;
|
||||||
|
-moz-border-radius: 5px;
|
||||||
|
border-radius: 5px;
|
||||||
|
display: block;
|
||||||
|
font-size: 37px;
|
||||||
|
line-height: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#launchpad .shortcut .title {
|
||||||
|
color: white;
|
||||||
|
font-size: 12px;
|
||||||
|
text-align: center;
|
||||||
|
line-height: 18px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*各种颜色 具体效果见 https://www.kancloud.cn/qq85569256/xzui/350010*/
|
/*各种颜色 具体效果见 https://www.kancloud.cn/qq85569256/xzui/350010*/
|
||||||
.mac-open-iframe .black-green, #mac .black-green{background:#009688!important;}
|
.mac-open-iframe .black-green, #mac .black-green{background:#009688!important;}
|
||||||
.mac-open-iframe .green,#mac .green{background:#5FB878!important;}
|
.mac-open-iframe .green,#mac .green{background:#5FB878!important;}
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
27
demo.html
27
demo.html
|
|
@ -139,6 +139,7 @@
|
||||||
<div class="dock" id="dock">
|
<div class="dock" id="dock">
|
||||||
<div class="dock-container backgroud_blur">
|
<div class="dock-container backgroud_blur">
|
||||||
<a class="dock-item" onclick="Macui.openUrl('./app/finder','<img class=\'icon\' src=\'./img/icon/finder.png\'/>','finder')"><span>finder</span><img src="./img/icon/finder.png" alt="finder"></a>
|
<a class="dock-item" onclick="Macui.openUrl('./app/finder','<img class=\'icon\' src=\'./img/icon/finder.png\'/>','finder')"><span>finder</span><img src="./img/icon/finder.png" alt="finder"></a>
|
||||||
|
<a class="dock-item launchpad" href="#"><span>launchpad</span><img src="./img/icon/launchpad.png" alt="launchpad" /></a>
|
||||||
<a class="dock-item" onclick="Macui.openUrl('./app/safari','<img class=\'icon\' src=\'./img/icon/safari.png\'/>','safari')"><span>safari</span><img src="./img/icon/safari.png" alt="safari"></a>
|
<a class="dock-item" onclick="Macui.openUrl('./app/safari','<img class=\'icon\' src=\'./img/icon/safari.png\'/>','safari')"><span>safari</span><img src="./img/icon/safari.png" alt="safari"></a>
|
||||||
<a class="dock-item" href="#"><span>appstore</span><img src="./img/icon/appstore.png" alt="appstore" /></a>
|
<a class="dock-item" href="#"><span>appstore</span><img src="./img/icon/appstore.png" alt="appstore" /></a>
|
||||||
<a class="dock-item" href="#"><span>gamecenter</span><img src="./img/icon/gamecenter.png" alt="gamecenter" /></a>
|
<a class="dock-item" href="#"><span>gamecenter</span><img src="./img/icon/gamecenter.png" alt="gamecenter" /></a>
|
||||||
|
|
@ -151,6 +152,32 @@
|
||||||
<a class="dock-item" href="#"><span>trashicon</span><img src="./img/icon/trashicon.png" alt="trashicon" /></a>
|
<a class="dock-item" href="#"><span>trashicon</span><img src="./img/icon/trashicon.png" alt="trashicon" /></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="launchpad" class="backgroud_blur hidden">
|
||||||
|
<div id="app-serach-box" class="app-serach-box">
|
||||||
|
<form action="" class="search">
|
||||||
|
<div class="serach-box">
|
||||||
|
<input type="text" class="input-search" name="input-search" pattern=".{1,}" required>
|
||||||
|
<label>Search</label>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div id="app-shortcuts" class="app-shortcuts">
|
||||||
|
<div class="shortcut"
|
||||||
|
onclick="Macui.openUrl('./index.html','<img class=\'icon\' src=\'./img/icon/computer.png\'/>','UI官网')">
|
||||||
|
<img class="icon" src="./img/icon/computer.png" />
|
||||||
|
<div class="title">UI官网</div>
|
||||||
|
</div>
|
||||||
|
<div class="shortcut" onclick="window.open('./demo.html')">
|
||||||
|
<img class="icon" src="./img/icon/demo.png" />
|
||||||
|
<div class="title">查看DEMO</div>
|
||||||
|
</div>
|
||||||
|
<div class="shortcut"
|
||||||
|
onclick="Macui.openUrl('./index.html','<img class=\'icon\' src=\'./img/icon/computer.png\'/>','UI官网')">
|
||||||
|
<img class="icon" src="./img/icon/computer.png" />
|
||||||
|
<div class="title">UI官网</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script type="text/javascript" src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.2.4/jquery.min.js"></script>
|
<script type="text/javascript" src="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/jquery/2.2.4/jquery.min.js"></script>
|
||||||
|
|
|
||||||
34
index.html
34
index.html
|
|
@ -11,7 +11,7 @@
|
||||||
<link rel='Shortcut Icon' type='image/x-icon' href='./img/favicon.ico'>
|
<link rel='Shortcut Icon' type='image/x-icon' href='./img/favicon.ico'>
|
||||||
<link rel="stylesheet" href="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/animate.css/4.1.1/animate.min.css">
|
<link rel="stylesheet" href="https://lf9-cdn-tos.bytecdntp.com/cdn/expire-1-M/animate.css/4.1.1/animate.min.css">
|
||||||
<link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css">
|
<link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||||
<link rel="stylesheet" href="./css/index.css">
|
<link rel="stylesheet" href="./css/index.min.css">
|
||||||
<link rel="stylesheet" href="./plugins/shortcut-drawer/shortcut-drawer.min.css">
|
<link rel="stylesheet" href="./plugins/shortcut-drawer/shortcut-drawer.min.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
@ -102,9 +102,8 @@
|
||||||
<a class="dock-item"
|
<a class="dock-item"
|
||||||
onclick="Macui.openUrl('./app/finder','<img class=\'icon\' src=\'./img/icon/finder.png\'/>','finder')">
|
onclick="Macui.openUrl('./app/finder','<img class=\'icon\' src=\'./img/icon/finder.png\'/>','finder')">
|
||||||
<span>finder</span><img src="./img/icon/finder.png"></a>
|
<span>finder</span><img src="./img/icon/finder.png"></a>
|
||||||
<a class="dock-item" href="#"
|
<a class="dock-item launchpad" href="#"><span>launchpad</span><img src="./img/icon/launchpad.png"
|
||||||
onclick="Macui.openUrl('http://win10ui.yuri2.cn','<img class=\'icon\' src=\'./img/icon/computer.png\'/>','UI官网')"><span>UI官网</span><img
|
alt="launchpad" /></a>
|
||||||
src="./img/icon/computer.png" alt="UI官网" /></a>
|
|
||||||
<a class="dock-item"
|
<a class="dock-item"
|
||||||
onclick="Macui.openUrl('./app/safari','<img class=\'icon\' src=\'./img/icon/safari.png\'/>','safari')">
|
onclick="Macui.openUrl('./app/safari','<img class=\'icon\' src=\'./img/icon/safari.png\'/>','safari')">
|
||||||
<span>safari</span><img src="./img/icon/safari.png"></a>
|
<span>safari</span><img src="./img/icon/safari.png"></a>
|
||||||
|
|
@ -122,6 +121,33 @@
|
||||||
alt="trashicon" /></a>
|
alt="trashicon" /></a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="launchpad" class="backgroud_blur hidden">
|
||||||
|
<div id="app-serach-box" class="app-serach-box">
|
||||||
|
<form action="" class="search">
|
||||||
|
<div class="serach-box">
|
||||||
|
<input type="text" class="input-search" name="input-search" pattern=".{1,}" required>
|
||||||
|
<label>Search</label>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div id="app-shortcuts" class="app-shortcuts">
|
||||||
|
<div class="shortcut"
|
||||||
|
onclick="Macui.openUrl('./index.html','<img class=\'icon\' src=\'./img/icon/computer.png\'/>','UI官网')">
|
||||||
|
<img class="icon" src="./img/icon/computer.png" />
|
||||||
|
<div class="title">UI官网</div>
|
||||||
|
</div>
|
||||||
|
<div class="shortcut" onclick="window.open('./demo.html')">
|
||||||
|
<img class="icon" src="./img/icon/demo.png" />
|
||||||
|
<div class="title">查看DEMO</div>
|
||||||
|
</div>
|
||||||
|
<div class="shortcut"
|
||||||
|
onclick="Macui.openUrl('./index.html','<img class=\'icon\' src=\'./img/icon/computer.png\'/>','UI官网')">
|
||||||
|
<img class="icon" src="./img/icon/computer.png" />
|
||||||
|
<div class="title">UI官网</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<script type="text/javascript"
|
<script type="text/javascript"
|
||||||
|
|
|
||||||
191
js/index.js
191
js/index.js
|
|
@ -149,13 +149,15 @@ window.Macui = {
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
let classes_length = Macui._animated_classes.length;
|
let classes_length = Macui._animated_classes.length;
|
||||||
let animated_live_ness = Macui._animated_liveness;
|
let animated_live_ness = Macui._animated_liveness;
|
||||||
if (animated_live_ness === 0 || classes_length === 0 || !$("#mac-menu").hasClass('opened')) {
|
if (animated_live_ness === 0 || classes_length === 0 || !$("#mac-menu").hasClass(
|
||||||
|
'opened')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$('#mac-menu>.blocks>.menu_group>.block').each(function() {
|
$('#mac-menu>.blocks>.menu_group>.block').each(function() {
|
||||||
if (!$(this).hasClass('onAnimate') && Math.random() <= animated_live_ness) {
|
if (!$(this).hasClass('onAnimate') && Math.random() <= animated_live_ness) {
|
||||||
let that = $(this);
|
let that = $(this);
|
||||||
let class_animate = Macui._animated_classes[Math.floor((Math.random() * classes_length))];
|
let class_animate = Macui._animated_classes[Math.floor((Math.random() *
|
||||||
|
classes_length))];
|
||||||
that.addClass('onAnimate');
|
that.addClass('onAnimate');
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
that.addClass(class_animate);
|
that.addClass(class_animate);
|
||||||
|
|
@ -198,7 +200,9 @@ window.Macui = {
|
||||||
layero.css('z-index', max_zindex + 1);
|
layero.css('z-index', max_zindex + 1);
|
||||||
},
|
},
|
||||||
_checkTop: function() {
|
_checkTop: function() {
|
||||||
let max_index = 0, max_z = 0, btn = null;
|
let max_index = 0,
|
||||||
|
max_z = 0,
|
||||||
|
btn = null;
|
||||||
$("#mac_btn_group_middle .btn.show").each(function() {
|
$("#mac_btn_group_middle .btn.show").each(function() {
|
||||||
let index = $(this).attr('index');
|
let index = $(this).attr('index');
|
||||||
let layero = Macui.getLayeroByIndex(index);
|
let layero = Macui.getLayeroByIndex(index);
|
||||||
|
|
@ -304,9 +308,11 @@ window.Macui = {
|
||||||
}
|
}
|
||||||
if ($this.data('icon-font')) {
|
if ($this.data('icon-font')) {
|
||||||
//>> 加入到标题中
|
//>> 加入到标题中
|
||||||
icon = '<i class="fa fa-fw fa-' + $this.data('icon-font') + ' icon ' + bg + '"></i>';
|
icon = '<i class="fa fa-fw fa-' + $this.data('icon-font') + ' icon ' + bg +
|
||||||
|
'"></i>';
|
||||||
}
|
}
|
||||||
if (!title && $this.children('.icon').length === 1 && $this.children('.title').length === 1) {
|
if (!title && $this.children('.icon').length === 1 && $this.children('.title')
|
||||||
|
.length === 1) {
|
||||||
title = $this.children('.title').html();
|
title = $this.children('.title').html();
|
||||||
if (!icon) {
|
if (!icon) {
|
||||||
icon = $this.children('.icon').prop("outerHTML");
|
icon = $this.children('.icon').prop("outerHTML");
|
||||||
|
|
@ -350,6 +356,15 @@ window.Macui = {
|
||||||
msg.remove()
|
msg.remove()
|
||||||
}, 500)
|
}, 500)
|
||||||
});
|
});
|
||||||
|
$("#mac .launchpad").click(function() {
|
||||||
|
if ($("#launchpad").hasClass("hidden")) {
|
||||||
|
Macui.renderLaunchpad();
|
||||||
|
Macui.menuClose();
|
||||||
|
Macui.commandCenterClose();
|
||||||
|
} else {
|
||||||
|
Macui.closeLaunchpad();
|
||||||
|
}
|
||||||
|
});
|
||||||
//消息界面切换
|
//消息界面切换
|
||||||
$('#mac_command_center').on('click', ".command-header div", function() {
|
$('#mac_command_center').on('click', ".command-header div", function() {
|
||||||
if (!$(this).hasClass('active')) {
|
if (!$(this).hasClass('active')) {
|
||||||
|
|
@ -423,7 +438,8 @@ window.Macui = {
|
||||||
$('#mac-menu .list').on('click', '.item', function() {
|
$('#mac-menu .list').on('click', '.item', function() {
|
||||||
let e = $(this);
|
let e = $(this);
|
||||||
if (e.hasClass('has-sub-down')) {
|
if (e.hasClass('has-sub-down')) {
|
||||||
$('#mac-menu .list .item.has-sub-up').toggleClass('has-sub-down').toggleClass('has-sub-up');
|
$('#mac-menu .list .item.has-sub-up').toggleClass('has-sub-down').toggleClass(
|
||||||
|
'has-sub-up');
|
||||||
$("#mac-menu .list .sub-item").slideUp();
|
$("#mac-menu .list .sub-item").slideUp();
|
||||||
}
|
}
|
||||||
if (e.next().hasClass('sub-item')) {
|
if (e.next().hasClass('sub-item')) {
|
||||||
|
|
@ -463,7 +479,10 @@ window.Macui = {
|
||||||
});
|
});
|
||||||
//打广告
|
//打广告
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
console.log(Macui.lang('本页由Mac-UI强力驱动\n更多信息:https://mac.apecloud.cn \nMac-UI,轻松打造别具一格的后台界面 ', 'The page is strongly driven by Mac-UI.\nFor more info: https://mac.apecloud.cn.\n Mac-UI, easy to create a unique background interface.'))
|
console.log(Macui.lang(
|
||||||
|
'本页由Mac-UI强力驱动\n更多信息:https://mac.apecloud.cn \nMac-UI,轻松打造别具一格的后台界面 ',
|
||||||
|
'The page is strongly driven by Mac-UI.\nFor more info: https://mac.apecloud.cn.\n Mac-UI, easy to create a unique background interface.'
|
||||||
|
))
|
||||||
}, 2000);
|
}, 2000);
|
||||||
//点击清空右键菜单
|
//点击清空右键菜单
|
||||||
$(document).click(function(event) {
|
$(document).click(function(event) {
|
||||||
|
|
@ -483,42 +502,58 @@ window.Macui = {
|
||||||
let title = document.title;
|
let title = document.title;
|
||||||
let ua = navigator.userAgent.toLowerCase();
|
let ua = navigator.userAgent.toLowerCase();
|
||||||
if (ua.indexOf("360se") > -1) {
|
if (ua.indexOf("360se") > -1) {
|
||||||
layer.alert(Macui.lang('您的浏览器不支持,请按 Ctrl+D 手动收藏!', 'Your browser does not support, please press Ctrl+D to manual collection!'));
|
layer.alert(Macui.lang('您的浏览器不支持,请按 Ctrl+D 手动收藏!',
|
||||||
|
'Your browser does not support, please press Ctrl+D to manual collection!'
|
||||||
|
));
|
||||||
} else if (ua.indexOf("msie 8") > -1) {
|
} else if (ua.indexOf("msie 8") > -1) {
|
||||||
window.external.AddToFavoritesBar(url, title); //IE8
|
window.external.AddToFavoritesBar(url, title); //IE8
|
||||||
} else if (document.all) {
|
} else if (document.all) {
|
||||||
try {
|
try {
|
||||||
window.external.addFavorite(url, title);
|
window.external.addFavorite(url, title);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
layer.alert(Macui.lang('您的浏览器不支持,请按 Ctrl+D 手动收藏!', 'Your browser does not support, please press Ctrl+D to manual collection!'));
|
layer.alert(Macui.lang('您的浏览器不支持,请按 Ctrl+D 手动收藏!',
|
||||||
|
'Your browser does not support, please press Ctrl+D to manual collection!'
|
||||||
|
));
|
||||||
}
|
}
|
||||||
} else if (window.sidebar) {
|
} else if (window.sidebar) {
|
||||||
window.sidebar.addPanel(title, url, "");
|
window.sidebar.addPanel(title, url, "");
|
||||||
} else {
|
} else {
|
||||||
layer.alert(Macui.lang('您的浏览器不支持,请按 Ctrl+D 手动收藏!', 'Your browser does not support, please press Ctrl+D to manual collection!'));
|
layer.alert(Macui.lang('您的浏览器不支持,请按 Ctrl+D 手动收藏!',
|
||||||
|
'Your browser does not support, please press Ctrl+D to manual collection!'
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
['<i class="fa fa-fw fa-window-maximize"></i> ' + Macui.lang('进入全屏', 'Enable Full Screen'), function () {
|
['<i class="fa fa-fw fa-window-maximize"></i> ' + Macui.lang('进入全屏', 'Enable Full Screen'),
|
||||||
|
function() {
|
||||||
Macui.enableFullScreen()
|
Macui.enableFullScreen()
|
||||||
}],
|
}
|
||||||
['<i class="fa fa-fw fa-window-restore"></i> ' + Macui.lang('退出全屏', 'Disable Full Screen'), function () {
|
],
|
||||||
|
['<i class="fa fa-fw fa-window-restore"></i> ' + Macui.lang('退出全屏', 'Disable Full Screen'),
|
||||||
|
function() {
|
||||||
Macui.disableFullScreen()
|
Macui.disableFullScreen()
|
||||||
}],
|
}
|
||||||
|
],
|
||||||
'|',
|
'|',
|
||||||
['<i class="fa fa-fw fa-info-circle"></i> ' + Macui.lang('关于', 'About Us'), function() {
|
['<i class="fa fa-fw fa-info-circle"></i> ' + Macui.lang('关于', 'About Us'), function() {
|
||||||
Macui.aboutUs()
|
Macui.aboutUs()
|
||||||
}],
|
}],
|
||||||
]);
|
]);
|
||||||
Macui.setContextMenu('#mac_btn_group_middle', [
|
Macui.setContextMenu('#mac_btn_group_middle', [
|
||||||
['<i class="fa fa-fw fa-window-maximize"></i> ' + Macui.lang('全部显示', 'Show All Windows'), function () {
|
['<i class="fa fa-fw fa-window-maximize"></i> ' + Macui.lang('全部显示', 'Show All Windows'),
|
||||||
|
function() {
|
||||||
Macui.showWins()
|
Macui.showWins()
|
||||||
}],
|
}
|
||||||
['<i class="fa fa-fw fa-window-minimize"></i> ' + Macui.lang('全部隐藏', 'Hide All Windows'), function () {
|
],
|
||||||
|
['<i class="fa fa-fw fa-window-minimize"></i> ' + Macui.lang('全部隐藏', 'Hide All Windows'),
|
||||||
|
function() {
|
||||||
Macui.hideWins()
|
Macui.hideWins()
|
||||||
}],
|
}
|
||||||
['<i class="fa fa-fw fa-window-close"></i> ' + Macui.lang('全部关闭', 'Close All Windows'), function () {
|
],
|
||||||
|
['<i class="fa fa-fw fa-window-close"></i> ' + Macui.lang('全部关闭', 'Close All Windows'),
|
||||||
|
function() {
|
||||||
Macui.closeAll()
|
Macui.closeAll()
|
||||||
}],
|
}
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//处理消息图标闪烁
|
//处理消息图标闪烁
|
||||||
|
|
@ -548,6 +583,24 @@ window.Macui = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//launchpad 搜索功能
|
||||||
|
$("#launchpad .input-search").on("input propertychange", function() {
|
||||||
|
//在输入框中打印输入的值
|
||||||
|
var searchName = $(this).val();
|
||||||
|
if (searchName == "") {
|
||||||
|
$("#app-shortcuts .shortcut").show();
|
||||||
|
} else {
|
||||||
|
$("#app-shortcuts .shortcut").each(function() {
|
||||||
|
var appName = $(this).children(".title").text().toLowerCase();
|
||||||
|
if (appName.indexOf(searchName.toLowerCase()) != -1){
|
||||||
|
$(this).show();
|
||||||
|
} else {
|
||||||
|
$(this).hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WIN10-UI v1.1.2.2 桌面舞台支持补丁
|
* WIN10-UI v1.1.2.2 桌面舞台支持补丁
|
||||||
* WIN10-UI v1.1.2.2之后的版本不需要此补丁
|
* WIN10-UI v1.1.2.2之后的版本不需要此补丁
|
||||||
|
|
@ -561,7 +614,9 @@ window.Macui = {
|
||||||
top: 30,
|
top: 30,
|
||||||
'z-index': 100,
|
'z-index': 100,
|
||||||
});
|
});
|
||||||
$("#mac .desktop").append("<div id='mac-desktop-scene' style='width: 100%;height: 100%;position: absolute;left: 0;top: 0; z-index: 0;background-color: transparent;'></div>")
|
$("#mac .desktop").append(
|
||||||
|
"<div id='mac-desktop-scene' style='width: 100%;height: 100%;position: absolute;left: 0;top: 0; z-index: 0;background-color: transparent;'></div>"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
//属性绑定
|
//属性绑定
|
||||||
|
|
@ -582,21 +637,36 @@ window.Macui = {
|
||||||
},
|
},
|
||||||
getLunarObj: function() {
|
getLunarObj: function() {
|
||||||
//农历年信息
|
//农历年信息
|
||||||
let lunarInfo = [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2,
|
let lunarInfo = [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0,
|
||||||
0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977,
|
0x09ad0, 0x055d2,
|
||||||
0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970,
|
0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0,
|
||||||
0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950,
|
0x14977,
|
||||||
0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557,
|
0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2,
|
||||||
0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5d0, 0x14573, 0x052d0, 0x0a9a8, 0x0e950, 0x06aa0,
|
0x04970,
|
||||||
0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0,
|
0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7,
|
||||||
0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b5a0, 0x195a6,
|
0x0c950,
|
||||||
0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570,
|
0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950,
|
||||||
0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0,
|
0x0b557,
|
||||||
0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5,
|
0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5d0, 0x14573, 0x052d0, 0x0a9a8, 0x0e950,
|
||||||
0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930,
|
0x06aa0,
|
||||||
0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530,
|
0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57,
|
||||||
0x05aa0, 0x076a3, 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45,
|
0x056a0,
|
||||||
0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0];
|
0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b5a0,
|
||||||
|
0x195a6,
|
||||||
|
0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60,
|
||||||
|
0x09570,
|
||||||
|
0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5,
|
||||||
|
0x092e0,
|
||||||
|
0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0,
|
||||||
|
0x0cab5,
|
||||||
|
0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0,
|
||||||
|
0x0a930,
|
||||||
|
0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65,
|
||||||
|
0x0d530,
|
||||||
|
0x05aa0, 0x076a3, 0x096d0, 0x04bd7, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520,
|
||||||
|
0x0dd45,
|
||||||
|
0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0
|
||||||
|
];
|
||||||
let Animals = ["鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"];
|
let Animals = ["鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"];
|
||||||
let Gan = ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"];
|
let Gan = ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"];
|
||||||
let Zhi = ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"];
|
let Zhi = ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"];
|
||||||
|
|
@ -629,7 +699,8 @@ window.Macui = {
|
||||||
//==== 算出农历, 传入日期物件, 传回农历日期物件
|
//==== 算出农历, 传入日期物件, 传回农历日期物件
|
||||||
// 该物件属性有 .year .month .day .isLeap .yearCyl .dayCyl .monCyl
|
// 该物件属性有 .year .month .day .isLeap .yearCyl .dayCyl .monCyl
|
||||||
function Lunar(objDate) {
|
function Lunar(objDate) {
|
||||||
let i, leap = 0, temp = 0
|
let i, leap = 0,
|
||||||
|
temp = 0
|
||||||
let baseDate = new Date(1900, 0, 31)
|
let baseDate = new Date(1900, 0, 31)
|
||||||
let offset = (objDate - baseDate) / 86400000
|
let offset = (objDate - baseDate) / 86400000
|
||||||
|
|
||||||
|
|
@ -803,6 +874,16 @@ window.Macui = {
|
||||||
|
|
||||||
return viewdate;
|
return viewdate;
|
||||||
},
|
},
|
||||||
|
//launchpad渲染
|
||||||
|
renderLaunchpad: function() {
|
||||||
|
$("#launchpad").removeClass("hidden").addClass("show").show();
|
||||||
|
$("#mac-shortcuts").addClass('shortcuts-hidden'); //隐藏图标
|
||||||
|
this.renderDocks(); //渲染DOCK
|
||||||
|
},
|
||||||
|
//close Launchpad
|
||||||
|
closeLaunchpad: function() {
|
||||||
|
$("#launchpad").removeClass("show").addClass("hidden").hide();
|
||||||
|
},
|
||||||
//消息中心渲染
|
//消息中心渲染
|
||||||
renderCommand: function(todayHtml = null) {
|
renderCommand: function(todayHtml = null) {
|
||||||
let active = $("#mac_command_center .command-body.today").hasClass('active');
|
let active = $("#mac_command_center .command-body.today").hasClass('active');
|
||||||
|
|
@ -810,8 +891,10 @@ window.Macui = {
|
||||||
if (!todayHtml) {
|
if (!todayHtml) {
|
||||||
let lunarDate = Macui.getLunarObj();
|
let lunarDate = Macui.getLunarObj();
|
||||||
todayHtml = '<div class="command-body-calendar">\n' +
|
todayHtml = '<div class="command-body-calendar">\n' +
|
||||||
' <div class="command-body-calendar-date normal-date">' + lunarDate.month + '月' + lunarDate.day + '日 \n' + lunarDate.week + '</div>\n' +
|
' <div class="command-body-calendar-date normal-date">' + lunarDate.month + '月' +
|
||||||
' <div class="command-body-calendar-date lunar-date">' + lunarDate.ganzhi + '年' + lunarDate.lunarmonth + lunarDate.lunarday + '</div>\n' +
|
lunarDate.day + '日 \n' + lunarDate.week + '</div>\n' +
|
||||||
|
' <div class="command-body-calendar-date lunar-date">' + lunarDate.ganzhi + '年' +
|
||||||
|
lunarDate.lunarmonth + lunarDate.lunarday + '</div>\n' +
|
||||||
'</div>\n' +
|
'</div>\n' +
|
||||||
'<div class="notice">' +
|
'<div class="notice">' +
|
||||||
' <div class="notice-header">' +
|
' <div class="notice-header">' +
|
||||||
|
|
@ -914,7 +997,9 @@ window.Macui = {
|
||||||
halign: 'center'
|
halign: 'center'
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
$('.dock-container').css({'width': width});
|
$('.dock-container').css({
|
||||||
|
'width': width
|
||||||
|
});
|
||||||
for (let i = 0; i < max_num; i++) {
|
for (let i = 0; i < max_num; i++) {
|
||||||
|
|
||||||
docks.on('mouseover', function(e) {
|
docks.on('mouseover', function(e) {
|
||||||
|
|
@ -926,7 +1011,9 @@ window.Macui = {
|
||||||
docks.on('click', function(e) {
|
docks.on('click', function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
docks.unbind("mouseover").unbind('mouseout').unbind('click').css({"width": cell_width});
|
docks.unbind("mouseover").unbind('mouseout').unbind('click').css({
|
||||||
|
"width": cell_width
|
||||||
|
});
|
||||||
if (i === 0) {
|
if (i === 0) {
|
||||||
docks.eq(i).css("margin-left", 0);
|
docks.eq(i).css("margin-left", 0);
|
||||||
}
|
}
|
||||||
|
|
@ -940,7 +1027,8 @@ window.Macui = {
|
||||||
this.commandCenterClose();
|
this.commandCenterClose();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
newMsg: function (title, content, handle_click, app_name = '提示消息', app_icon = '<img src="./img/icon/weather.png" class="notice-header-icon-img" />', is_del = true) {
|
newMsg: function(title, content, handle_click, app_name = '提示消息', app_icon =
|
||||||
|
'<img src="./img/icon/weather.png" class="notice-header-icon-img" />', is_del = true) {
|
||||||
let msg = '<div class="notice">' +
|
let msg = '<div class="notice">' +
|
||||||
'<div class="notice-header">' +
|
'<div class="notice-header">' +
|
||||||
'<span class="notice-header-icon">' + app_icon + '</span>' +
|
'<span class="notice-header-icon">' + app_icon + '</span>' +
|
||||||
|
|
@ -1053,7 +1141,8 @@ window.Macui = {
|
||||||
topset = (topset - (topset * 0.8)) / 2 - 31;
|
topset = (topset - (topset * 0.8)) / 2 - 31;
|
||||||
leftset = parseInt($(window).width());
|
leftset = parseInt($(window).width());
|
||||||
leftset = (leftset - (leftset * 0.8)) / 2 - 120;
|
leftset = (leftset - (leftset * 0.8)) / 2 - 120;
|
||||||
offset = [Math.round((this._countTask % 10 * 20) + topset) + 'px', Math.round((this._countTask % 10 * 20 + 100) + leftset) + 'px'];
|
offset = [Math.round((this._countTask % 10 * 20) + topset) + 'px', Math.round((this
|
||||||
|
._countTask % 10 * 20 + 100) + leftset) + 'px'];
|
||||||
}
|
}
|
||||||
let index = layer.open({
|
let index = layer.open({
|
||||||
type: 2,
|
type: 2,
|
||||||
|
|
@ -1084,12 +1173,14 @@ window.Macui = {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
$('#mac_btn_group_middle .btn.active').removeClass('active');
|
$('#mac_btn_group_middle .btn.active').removeClass('active');
|
||||||
let btn = $('<div id="mac_' + index + '" index="' + index + '" class="btn show active"><div class="btn_title">' + icon + '</div></div>');
|
let btn = $('<div id="mac_' + index + '" index="' + index +
|
||||||
|
'" class="btn show active"><div class="btn_title">' + icon + '</div></div>');
|
||||||
let layero_opened = Macui.getLayeroByIndex(index);
|
let layero_opened = Macui.getLayeroByIndex(index);
|
||||||
layero_opened.css('z-index', Macui._countTask + 813);
|
layero_opened.css('z-index', Macui._countTask + 813);
|
||||||
Macui._settop(layero_opened);
|
Macui._settop(layero_opened);
|
||||||
//重新定义菜单布局
|
//重新定义菜单布局
|
||||||
layero_opened.find('.layui-layer-setwin').prepend('<a class="mac-btn-refresh" index="' + index + '" href="#"></a>');
|
layero_opened.find('.layui-layer-setwin').prepend('<a class="mac-btn-refresh" index="' + index +
|
||||||
|
'" href="#"></a>');
|
||||||
//菜单排列倒序
|
//菜单排列倒序
|
||||||
layero_opened.find(".layui-layer-setwin>a").each(function() {
|
layero_opened.find(".layui-layer-setwin>a").each(function() {
|
||||||
$(this).prependTo(layero_opened.find(".layui-layer-setwin"));
|
$(this).prependTo(layero_opened.find(".layui-layer-setwin"));
|
||||||
|
|
@ -1100,8 +1191,10 @@ window.Macui = {
|
||||||
height = parseInt(height.replace('px', ''));
|
height = parseInt(height.replace('px', ''));
|
||||||
if (height >= document.body.clientHeight) {
|
if (height >= document.body.clientHeight) {
|
||||||
layero_opened.css('height', height - 25);
|
layero_opened.css('height', height - 25);
|
||||||
layero_opened.find('.layui-layer-content').css('height', height - 55);
|
layero_opened.find('.layui-layer-content').css('height', height -
|
||||||
layero_opened.find('.layui-layer-content iframe').css('height', height - 55);
|
55);
|
||||||
|
layero_opened.find('.layui-layer-content iframe').css('height',
|
||||||
|
height - 55);
|
||||||
}
|
}
|
||||||
}, 300);
|
}, 300);
|
||||||
|
|
||||||
|
|
@ -1155,6 +1248,7 @@ window.Macui = {
|
||||||
|
|
||||||
this.menuClose();
|
this.menuClose();
|
||||||
this.commandCenterClose();
|
this.commandCenterClose();
|
||||||
|
this.closeLaunchpad();
|
||||||
return index;
|
return index;
|
||||||
},
|
},
|
||||||
closeAll: function() {
|
closeAll: function() {
|
||||||
|
|
@ -1172,8 +1266,7 @@ window.Macui = {
|
||||||
icon: 3,
|
icon: 3,
|
||||||
title: Macui.lang('提示', 'Prompt')
|
title: Macui.lang('提示', 'Prompt')
|
||||||
}, function(index) {
|
}, function(index) {
|
||||||
document.body.onbeforeunload = function () {
|
document.body.onbeforeunload = function() {};
|
||||||
};
|
|
||||||
window.location.href = "about:blank";
|
window.location.href = "about:blank";
|
||||||
window.close();
|
window.close();
|
||||||
layer.close(index);
|
layer.close(index);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue