mirror of https://github.com/1099438829/macUI.git
提交格式化
This commit is contained in:
parent
618c26018d
commit
f61b4b4cad
|
|
@ -1,39 +1,52 @@
|
|||
;(function(window,undefined){var calendar=document.querySelector('#calendar')
|
||||
var simpleMonth_area=calendar.querySelector('.sidebar')
|
||||
var simpleMonth_title=simpleMonth_area.querySelector('.date')
|
||||
var fullMonth_area=calendar.querySelector('#renderFullYear')
|
||||
var fullMonth_title=fullMonth_area.querySelector('h2')
|
||||
var fullMonth_lunar=fullMonth_area.querySelector('.lunar-year')
|
||||
var detailMonth=calendar.querySelector('#renderMonth')
|
||||
var detailMonth_title=detailMonth.querySelector('.title')
|
||||
var detailMonth_day=detailMonth.querySelector('.day')
|
||||
var tab_num=0
|
||||
var today=new Date()
|
||||
var year=today.getFullYear()
|
||||
var month=today.getMonth()
|
||||
var calendarObj=ChineseCalendar
|
||||
renderTab()
|
||||
initalToday()
|
||||
function renderTab(){var aTab=calendar.querySelector('.header').querySelectorAll('li')
|
||||
var aRender=calendar.querySelectorAll('.render')
|
||||
for(var i=0;i<aTab.length;i++){aTab[i].index=i
|
||||
aTab[i].onclick=function(){for(var j=0;j<aTab.length;j++){aTab[j].className=''
|
||||
aRender[j].className='render'}
|
||||
aTab[this.index].className='cur'
|
||||
aRender[this.index].className='render render-show'
|
||||
tab_num=this.index}}}
|
||||
function initalToday(){simpleMonth_title.innerHTML=year+'年'+(month+1)+'月'
|
||||
fullMonth_title.innerHTML=year+'年'
|
||||
fullMonth_lunar.innerHTML='<i></i>'+calendarObj.year2GanZhe(year)+calendarObj.getAnimal(year)+'年'
|
||||
detailMonth_title.innerHTML=year+'年'+(month+1)+'月'
|
||||
renderFullMonth()
|
||||
tools.renderDetailMonth(detailMonth_day,year,month)
|
||||
dateEvent()}
|
||||
function renderFullMonth(){var sidebar_day=simpleMonth_area.querySelector('.day')
|
||||
var fullYear_month=fullMonth_area.querySelector('.month')
|
||||
var fullMonth_hmtl=``
|
||||
var monthArr=['January','Febuary','March','April','May','June','July','August','September','Octorber','November','December']
|
||||
for(var i=0;i<12;i++){fullMonth_hmtl+=`<li class="item">
|
||||
; (function (window, undefined) {
|
||||
var calendar = document.querySelector('#calendar')
|
||||
var simpleMonth_area = calendar.querySelector('.sidebar')
|
||||
var simpleMonth_title = simpleMonth_area.querySelector('.date')
|
||||
var fullMonth_area = calendar.querySelector('#renderFullYear')
|
||||
var fullMonth_title = fullMonth_area.querySelector('h2')
|
||||
var fullMonth_lunar = fullMonth_area.querySelector('.lunar-year')
|
||||
var detailMonth = calendar.querySelector('#renderMonth')
|
||||
var detailMonth_title = detailMonth.querySelector('.title')
|
||||
var detailMonth_day = detailMonth.querySelector('.day')
|
||||
var tab_num = 0
|
||||
var today = new Date()
|
||||
var year = today.getFullYear()
|
||||
var month = today.getMonth()
|
||||
var calendarObj = ChineseCalendar
|
||||
renderTab()
|
||||
initalToday()
|
||||
function renderTab() {
|
||||
var aTab = calendar.querySelector('.header').querySelectorAll('li')
|
||||
var aRender = calendar.querySelectorAll('.render')
|
||||
for (var i = 0; i < aTab.length; i++) {
|
||||
aTab[i].index = i
|
||||
aTab[i].onclick = function () {
|
||||
for (var j = 0; j < aTab.length; j++) {
|
||||
aTab[j].className = ''
|
||||
aRender[j].className = 'render'
|
||||
}
|
||||
aTab[this.index].className = 'cur'
|
||||
aRender[this.index].className = 'render render-show'
|
||||
tab_num = this.index
|
||||
}
|
||||
}
|
||||
}
|
||||
function initalToday() {
|
||||
simpleMonth_title.innerHTML = year + '年' + (month + 1) + '月'
|
||||
fullMonth_title.innerHTML = year + '年'
|
||||
fullMonth_lunar.innerHTML = '<i></i>' + calendarObj.year2GanZhe(year) + calendarObj.getAnimal(year) + '年'
|
||||
detailMonth_title.innerHTML = year + '年' + (month + 1) + '月'
|
||||
renderFullMonth()
|
||||
tools.renderDetailMonth(detailMonth_day, year, month)
|
||||
dateEvent()
|
||||
}
|
||||
function renderFullMonth() {
|
||||
var sidebar_day = simpleMonth_area.querySelector('.day')
|
||||
var fullYear_month = fullMonth_area.querySelector('.month')
|
||||
var fullMonth_hmtl = ``
|
||||
var monthArr = ['January', 'Febuary', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'Octorber', 'November', 'December']
|
||||
for (var i = 0; i < 12; i++) {
|
||||
fullMonth_hmtl += `<li class="item">
|
||||
<div class="title">${monthArr[i]}</div>
|
||||
<ul class="week">
|
||||
<li>日</li>
|
||||
|
|
@ -44,51 +57,89 @@ for(var i=0;i<12;i++){fullMonth_hmtl+=`<li class="item">
|
|||
<li>五</li>
|
||||
<li>六</li>
|
||||
</ul>
|
||||
<ul class="day">${tools.renderDay(year,i)}</ul>
|
||||
<ul class="day">${tools.renderDay(year, i)}</ul>
|
||||
</li>`}
|
||||
fullYear_month.innerHTML=fullMonth_hmtl
|
||||
sidebar_day.innerHTML=tools.renderDay(year,month)}
|
||||
function dateEvent(){var sidebar_prevBtn=simpleMonth_area.querySelector('.btn-prev')
|
||||
var sidebar_nextBtn=simpleMonth_area.querySelector('.btn-next')
|
||||
var control=calendar.querySelector('#control')
|
||||
var control_btnPrev=control.querySelector('.btn-prev')
|
||||
var control_today=control.querySelector('.today')
|
||||
var control_btnNext=control.querySelector('.btn-next')
|
||||
var sidebar_date=simpleMonth_area.querySelectorAll('.day li')
|
||||
var detail_festival=detailMonth_day.querySelectorAll('.show')
|
||||
var popup=calendar.querySelector('#popup')
|
||||
var container=calendar.querySelector('.container')
|
||||
var dataTime=null
|
||||
var popupPos={lx:0,lr:0,y:0,w:detail_festival[0].offsetWidth,h:detail_festival[0].offsetHeight}
|
||||
sidebar_prevBtn.onclick=function(){if(month==0){year--
|
||||
month=11}else{month--}
|
||||
initalToday()}
|
||||
sidebar_nextBtn.onclick=function(){if(month==11){year++
|
||||
month=0}else{month++}
|
||||
initalToday()}
|
||||
control_today.onclick=function(){year=today.getFullYear()
|
||||
month=today.getMonth()
|
||||
initalToday()}
|
||||
control_btnPrev.onclick=function(){if(tab_num==0){if(month==0){year--
|
||||
month=11}else{month--}
|
||||
tools.renderDetailMonth(detailMonth_day,year,month)}else{year--}
|
||||
initalToday()}
|
||||
control_btnNext.onclick=function(){if(tab_num==0){if(month==11){year++
|
||||
month=0}else{month++}}else{year++}
|
||||
initalToday()}
|
||||
for(var i=0;i<sidebar_date.length;i++){sidebar_date[i].onclick=function(){dataTime=this.dataset.time
|
||||
year=parseInt(dataTime.substr(0,4))
|
||||
month=parseInt(dataTime.substr(4,2))
|
||||
initalToday()}}
|
||||
for(var i=0;i<detail_festival.length;i++){detail_festival[i].onclick=function(ev){var dateStr=this.parentNode.dataset.time
|
||||
popupPos.lx=this.offsetLeft+popupPos.w+20
|
||||
popupPos.lr=this.offsetLeft-280
|
||||
popupPos.y=this.offsetTop-52+popupPos.h/2
|
||||
popup.style.display='block'
|
||||
popup.style.top=popupPos.y+'px'
|
||||
if(container.offsetWidth-this.offsetLeft-this.offsetWidth>=popup.offsetWidth){popup.style.left=popupPos.lx+'px'
|
||||
popup.className='popup-left'}else{popup.style.left=popupPos.lr+'px'
|
||||
popup.className='popup-right'}
|
||||
tools.renderPopup(this,popup,dateStr)
|
||||
ev.stopPropagation()}}
|
||||
document.onclick=function(){popup.style.display='none'}}})(window)
|
||||
fullYear_month.innerHTML = fullMonth_hmtl
|
||||
sidebar_day.innerHTML = tools.renderDay(year, month)
|
||||
}
|
||||
function dateEvent() {
|
||||
var sidebar_prevBtn = simpleMonth_area.querySelector('.btn-prev')
|
||||
var sidebar_nextBtn = simpleMonth_area.querySelector('.btn-next')
|
||||
var control = calendar.querySelector('#control')
|
||||
var control_btnPrev = control.querySelector('.btn-prev')
|
||||
var control_today = control.querySelector('.today')
|
||||
var control_btnNext = control.querySelector('.btn-next')
|
||||
var sidebar_date = simpleMonth_area.querySelectorAll('.day li')
|
||||
var detail_festival = detailMonth_day.querySelectorAll('.show')
|
||||
var popup = calendar.querySelector('#popup')
|
||||
var container = calendar.querySelector('.container')
|
||||
var dataTime = null
|
||||
var popupPos = { lx: 0, lr: 0, y: 0, w: detail_festival[0].offsetWidth, h: detail_festival[0].offsetHeight }
|
||||
sidebar_prevBtn.onclick = function () {
|
||||
if (month == 0) {
|
||||
year--
|
||||
month = 11
|
||||
} else { month-- }
|
||||
initalToday()
|
||||
}
|
||||
sidebar_nextBtn.onclick = function () {
|
||||
if (month == 11) {
|
||||
year++
|
||||
month = 0
|
||||
} else { month++ }
|
||||
initalToday()
|
||||
}
|
||||
control_today.onclick = function () {
|
||||
year = today.getFullYear()
|
||||
month = today.getMonth()
|
||||
initalToday()
|
||||
}
|
||||
control_btnPrev.onclick = function () {
|
||||
if (tab_num == 0) {
|
||||
if (month == 0) {
|
||||
year--
|
||||
month = 11
|
||||
} else { month-- }
|
||||
tools.renderDetailMonth(detailMonth_day, year, month)
|
||||
} else { year-- }
|
||||
initalToday()
|
||||
}
|
||||
control_btnNext.onclick = function () {
|
||||
if (tab_num == 0) {
|
||||
if (month == 11) {
|
||||
year++
|
||||
month = 0
|
||||
} else { month++ }
|
||||
} else { year++ }
|
||||
initalToday()
|
||||
}
|
||||
for (var i = 0; i < sidebar_date.length; i++) {
|
||||
sidebar_date[i].onclick = function () {
|
||||
dataTime = this.dataset.time
|
||||
year = parseInt(dataTime.substr(0, 4))
|
||||
month = parseInt(dataTime.substr(4, 2))
|
||||
initalToday()
|
||||
}
|
||||
}
|
||||
for (var i = 0; i < detail_festival.length; i++) {
|
||||
detail_festival[i].onclick = function (ev) {
|
||||
var dateStr = this.parentNode.dataset.time
|
||||
popupPos.lx = this.offsetLeft + popupPos.w + 20
|
||||
popupPos.lr = this.offsetLeft - 280
|
||||
popupPos.y = this.offsetTop - 52 + popupPos.h / 2
|
||||
popup.style.display = 'block'
|
||||
popup.style.top = popupPos.y + 'px'
|
||||
if (container.offsetWidth - this.offsetLeft - this.offsetWidth >= popup.offsetWidth) {
|
||||
popup.style.left = popupPos.lx + 'px'
|
||||
popup.className = 'popup-left'
|
||||
} else {
|
||||
popup.style.left = popupPos.lr + 'px'
|
||||
popup.className = 'popup-right'
|
||||
}
|
||||
tools.renderPopup(this, popup, dateStr)
|
||||
ev.stopPropagation()
|
||||
}
|
||||
}
|
||||
document.onclick = function () { popup.style.display = 'none' }
|
||||
}
|
||||
})(window)
|
||||
|
|
@ -1,42 +1,49 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<!-- HTTP 1.0 -->
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<!-- Prevent caching at the proxy server -->
|
||||
<meta http-equiv="expires" content="0">
|
||||
<title>MAC-UI最新资讯</title>
|
||||
<style>
|
||||
*{
|
||||
color:gray;
|
||||
font-family: "Microsoft YaHei", 微软雅黑, "MicrosoftJhengHei", 华文细黑, STHeiti, MingLiu
|
||||
}
|
||||
.title{
|
||||
color:orange;
|
||||
}
|
||||
.content *{
|
||||
font-size: 12px;
|
||||
}
|
||||
.content ul{
|
||||
padding-left: 1.5em;
|
||||
}
|
||||
.content li{
|
||||
margin-top: 0.3em;
|
||||
}
|
||||
.red{
|
||||
color:red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h3 class="title">MACUI已出炉</h3>
|
||||
<div class="content">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<!-- HTTP 1.0 -->
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<!-- Prevent caching at the proxy server -->
|
||||
<meta http-equiv="expires" content="0">
|
||||
<title>MAC-UI最新资讯</title>
|
||||
<style>
|
||||
* {
|
||||
color: gray;
|
||||
font-family: "Microsoft YaHei", 微软雅黑, "MicrosoftJhengHei", 华文细黑, STHeiti, MingLiu
|
||||
}
|
||||
|
||||
.title {
|
||||
color: orange;
|
||||
}
|
||||
|
||||
.content * {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.content ul {
|
||||
padding-left: 1.5em;
|
||||
}
|
||||
|
||||
.content li {
|
||||
margin-top: 0.3em;
|
||||
}
|
||||
|
||||
.red {
|
||||
color: red;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h3 class="title">MACUI已出炉</h3>
|
||||
<div class="content">
|
||||
<h4>编辑日期 2018/06/20</h4>
|
||||
<p>MAC-UI华丽上线</p>
|
||||
<p>今后产品动态,疑问解答等内容都会在<a href="http://www.bycodes.net/" target="_blank"><b>码外社区</b></a>内进行,感谢各位一如既往的支持与厚爱。</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
14
child.html
14
child.html
|
|
@ -1,12 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>子页测试</title>
|
||||
<script src="./js/jquery-2.2.4.min.js"></script>
|
||||
<script src="./js/win10.child.js"></script>
|
||||
<script src="./js/win10.child.min.js"></script>
|
||||
<style>
|
||||
.btn{
|
||||
.btn {
|
||||
margin: 20px;
|
||||
width: 160px;
|
||||
height: 40px;
|
||||
|
|
@ -19,25 +20,28 @@
|
|||
cursor: pointer;
|
||||
text-align: center;
|
||||
}
|
||||
.btn:hover{
|
||||
|
||||
.btn:hover {
|
||||
background-color: #256d95;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function f1() {
|
||||
Win10_child.newMsg('子页的问候','这是从iframe页调用APi发送的消息哦');
|
||||
Win10_child.newMsg('子页的问候', '这是从iframe页调用APi发送的消息哦');
|
||||
}
|
||||
function f2() {
|
||||
Win10_child.openUrl('http://win10ui.yuri2.cn','<img class=\'icon\' src=\'./img/icon/win10.png\'/>','Win10-UI官网')
|
||||
Win10_child.openUrl('http://win10ui.yuri2.cn', '<img class=\'icon\' src=\'./img/icon/win10.png\'/>', 'Win10-UI官网')
|
||||
}
|
||||
function f3() {
|
||||
Win10_child.close();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div class="btn" onclick="f1()">子页给父页发消息</div>
|
||||
<div class="btn" onclick="f2()">子页打开子窗口</div>
|
||||
<div class="btn" onclick="f3()">关闭子页</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
<link href="./css/animate.css" rel="stylesheet">
|
||||
<link href="./component/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="./css/index.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="./plugins/shortcut-drawer/shortcut-drawer.css">
|
||||
<link rel="stylesheet" href="./plugins/shortcut-drawer/shortcut-drawer.min.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
<div class="desktop">
|
||||
<div id="win10-shortcuts" class="shortcuts-hidden">
|
||||
<div class="shortcut"
|
||||
onclick="Win10.openUrl('http://mac.apecloud.cn','<img class=\'icon\' src=\'./img/icon/computer.png\'/>','OS官网')">
|
||||
onclick="Win10.openUrl('http://mac.apecloud.cn','<img src=\'./img/icon/computer.png\'/>','OS官网')">
|
||||
<img class="icon" src="./img/icon/computer.png" />
|
||||
<div class="title">OS官网</div>
|
||||
</div>
|
||||
|
|
|
|||
44
js/login.js
44
js/login.js
|
|
@ -1,37 +1,37 @@
|
|||
$(document).ready(function() {
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
var animating = false,
|
||||
submitPhase1 = 1100,
|
||||
submitPhase2 = 400,
|
||||
logoutPhase1 = 800,
|
||||
$login = $(".login"),
|
||||
$app = $(".app");
|
||||
|
||||
submitPhase1 = 1100,
|
||||
submitPhase2 = 400,
|
||||
logoutPhase1 = 800,
|
||||
$login = $(".login"),
|
||||
$app = $(".app");
|
||||
|
||||
function ripple(elem, e) {
|
||||
$(".ripple").remove();
|
||||
var elTop = elem.offset().top,
|
||||
elLeft = elem.offset().left,
|
||||
x = e.pageX - elLeft,
|
||||
y = e.pageY - elTop;
|
||||
elLeft = elem.offset().left,
|
||||
x = e.pageX - elLeft,
|
||||
y = e.pageY - elTop;
|
||||
var $ripple = $("<div class='ripple'></div>");
|
||||
$ripple.css({top: y, left: x});
|
||||
$ripple.css({ top: y, left: x });
|
||||
elem.append($ripple);
|
||||
};
|
||||
|
||||
$(document).on("click", ".login__submit", function(e) {
|
||||
|
||||
$(document).on("click", ".login__submit", function (e) {
|
||||
if (animating) return;
|
||||
animating = true;
|
||||
var that = this;
|
||||
ripple($(that), e);
|
||||
$(that).addClass("processing");
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
$(that).addClass("success");
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
$app.show();
|
||||
$app.css("top");
|
||||
$app.addClass("active");
|
||||
}, submitPhase2 - 70);
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
$login.hide();
|
||||
$login.addClass("inactive");
|
||||
animating = false;
|
||||
|
|
@ -39,24 +39,24 @@ $(document).ready(function() {
|
|||
}, submitPhase2);
|
||||
}, submitPhase1);
|
||||
});
|
||||
|
||||
$(document).on("click", ".app__logout", function(e) {
|
||||
|
||||
$(document).on("click", ".app__logout", function (e) {
|
||||
if (animating) return;
|
||||
$(".ripple").remove();
|
||||
animating = true;
|
||||
var that = this;
|
||||
$(that).addClass("clicked");
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
$app.removeClass("active");
|
||||
$login.show();
|
||||
$login.css("top");
|
||||
$login.removeClass("inactive");
|
||||
}, logoutPhase1 - 120);
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
$app.hide();
|
||||
animating = false;
|
||||
$(that).removeClass("clicked");
|
||||
}, logoutPhase1);
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
|
@ -2,22 +2,22 @@
|
|||
* Created by Yuri2 on 2017/7/31.
|
||||
*/
|
||||
//此处代码适合在子页面使用
|
||||
window.Win10_parent=parent.Win10; //获取父级Win10对象的句柄
|
||||
window.Win10_child={
|
||||
close:function () {
|
||||
window.Win10_parent = parent.Win10; //获取父级Win10对象的句柄
|
||||
window.Win10_child = {
|
||||
close: function () {
|
||||
var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
|
||||
Win10_parent._closeWin(index);
|
||||
},
|
||||
newMsg: function (title, content,handle_click){
|
||||
Win10_parent.newMsg(title, content,handle_click)
|
||||
newMsg: function (title, content, handle_click) {
|
||||
Win10_parent.newMsg(title, content, handle_click)
|
||||
},
|
||||
openUrl: function (url, title,max){
|
||||
var click_lock_name=Math.random();
|
||||
Win10_parent._iframe_click_lock_children[click_lock_name]=true;
|
||||
var index=Win10_parent.openUrl(url, title,max);
|
||||
openUrl: function (url, title, max) {
|
||||
var click_lock_name = Math.random();
|
||||
Win10_parent._iframe_click_lock_children[click_lock_name] = true;
|
||||
var index = Win10_parent.openUrl(url, title, max);
|
||||
setTimeout(function () {
|
||||
delete Win10_parent._iframe_click_lock_children[click_lock_name];
|
||||
},1000);
|
||||
}, 1000);
|
||||
return index;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
70
login.html
70
login.html
|
|
@ -1,41 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
|
||||
<meta name="theme-color" content="#000000">
|
||||
<link rel="shortcut icon" href="./img/favicon.ico">
|
||||
<title>登录</title>
|
||||
<link media="all" href="./css/login.css" type="text/css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root">
|
||||
<div class="layout-desktop">
|
||||
<div class="content">
|
||||
<div class="com-user">
|
||||
<form class="box login-box" action="index.html">
|
||||
<img src="./img/header/1539778103127.jpeg" alt="">
|
||||
<input name="username" value="" type="text">
|
||||
<input name="password" type="password">
|
||||
<button class="login">
|
||||
→
|
||||
</button>
|
||||
<div class="third">
|
||||
<img src="./img/login/github.png"alt="">
|
||||
<img src="./img/login/qq.png"alt="">
|
||||
</div>
|
||||
</form>
|
||||
<button class="cancel">
|
||||
<img src="./img/login/cancel.png"
|
||||
alt="">
|
||||
<span>
|
||||
关闭
|
||||
</span>
|
||||
|
||||
<head>
|
||||
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
|
||||
<meta name="theme-color" content="#000000">
|
||||
<link rel="shortcut icon" href="./img/favicon.ico">
|
||||
<title>登录</title>
|
||||
<link media="all" href="./css/login.min.css" type="text/css" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root">
|
||||
<div class="layout-desktop">
|
||||
<div class="content">
|
||||
<div class="com-user">
|
||||
<form class="box login-box" action="index.html">
|
||||
<img src="./img/header/1539778103127.jpeg" alt="">
|
||||
<input name="username" value="" type="text">
|
||||
<input name="password" type="password">
|
||||
<button class="login">
|
||||
→
|
||||
</button>
|
||||
</div>
|
||||
<div class="third">
|
||||
<img src="./img/login/github.png" alt="">
|
||||
<img src="./img/login/qq.png" alt="">
|
||||
</div>
|
||||
</form>
|
||||
<button class="cancel">
|
||||
<img src="./img/login/cancel.png" alt="">
|
||||
<span>
|
||||
关闭
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
@ -3,60 +3,60 @@ Win10.onReady(function () {
|
|||
//注册打开事件
|
||||
(function () {
|
||||
// 注册事件委派 打开url窗口
|
||||
$('body').on('click', '.shortcut-drawer.win10-open-window', function() {
|
||||
$('body').on('click', '.shortcut-drawer.win10-open-window', function () {
|
||||
//>> 获取当前点击的对象
|
||||
$this = $(this);
|
||||
//>> 判断url地址是否为空 如果为空 不予处理
|
||||
if($this.data('url') !== "") {
|
||||
if ($this.data('url') !== "") {
|
||||
//>> 获取弹窗标题
|
||||
var title = $this.data('title')||'',
|
||||
areaAndOffset,icon;
|
||||
var title = $this.data('title') || '',
|
||||
areaAndOffset, icon;
|
||||
//>> 判断是否有标题图片
|
||||
var bg=$this.data('icon-bg')?$this.data('icon-bg'):'';
|
||||
if($this.data('icon-image')) {
|
||||
var bg = $this.data('icon-bg') ? $this.data('icon-bg') : '';
|
||||
if ($this.data('icon-image')) {
|
||||
//>> 加入到标题中
|
||||
icon = '<img class="icon '+bg+'" src="' + $this.data('icon-image') + '"/>';
|
||||
icon = '<img class="icon ' + bg + '" src="' + $this.data('icon-image') + '"/>';
|
||||
}
|
||||
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();
|
||||
if(!icon){
|
||||
if (!icon) {
|
||||
icon = $this.children('.icon').prop("outerHTML");
|
||||
}
|
||||
}
|
||||
//>> 判断是否需要 设置 区域宽度高度
|
||||
if($this.data('area-offset')) {
|
||||
if ($this.data('area-offset')) {
|
||||
areaAndOffset = $this.data('area-offset');
|
||||
//>> 判断是否有分隔符
|
||||
if(areaAndOffset.indexOf(',')!==-1){
|
||||
if (areaAndOffset.indexOf(',') !== -1) {
|
||||
areaAndOffset = eval(areaAndOsffset);
|
||||
}
|
||||
}
|
||||
//>> 调用win10打开url方法
|
||||
Win10.openUrl($this.data('url'),icon, title, areaAndOffset);
|
||||
Win10.openUrl($this.data('url'), icon, 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%","50%"],
|
||||
closeBtn: 0,
|
||||
title:title,
|
||||
content: content,
|
||||
});
|
||||
var layero=Win10.getLayeroByIndex(index);
|
||||
layero.find('.shortcut-drawer').click(function () {
|
||||
layer.close(index);
|
||||
})
|
||||
})
|
||||
$('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%", "50%"],
|
||||
closeBtn: 0,
|
||||
title: title,
|
||||
content: content,
|
||||
});
|
||||
var layero = Win10.getLayeroByIndex(index);
|
||||
layero.find('.shortcut-drawer').click(function () {
|
||||
layer.close(index);
|
||||
})
|
||||
})
|
||||
});
|
||||
Loading…
Reference in New Issue