網頁桌面的HTML代碼

網頁代碼:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head>
<link rel="shortcut icon" href="http://lyclub.f3322.net:82/web_images/32X32.ico" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>友情鏈接桌面</title>
<style type="text/css">
body{padding:0px; margin:0px;}
#deskbgimg { position:fixed; top:0px; left:0px; right:0px; bottom:0px; }
#deskbgimg img{ width:100%; height:100%; }
#deskbgtm { position:fixed; top:0px; left:0px; right:0px; bottom:0px; filter:alpha(Opacity=40);-moz-opacity:0.4;opacity: 0.4;background:gray;}
#desklogo{height:120px;width:80px;position:absolute;z-index:2;cursor:default;}
#desktbar {position:fixed; left:0px; right:0px; bottom:0px; height:40px;filter:alpha(Opacity=40);-moz-opacity:0.8;opacity: 0.8;background:black; z-index:3;}
.dlgico{ margin:10px; width:60px; height:60px; cursor:default;}
.dlgtit {margin:2px;font-size:14px;font-family:黑體;color:blue;text-align:center;line-height:20px;cursor:default;}

#startmenu{border:1px solid red;background:white;filter:alpha(Opacity=40);-moz-opacity:0.8;opacity: 0.8;z-index:5;position:fixed;width:150px;bottom:40px;left:2px;visibility:hidden;font-weight:bold;}
</style>
<script type="text/javascript">
document.oncontextmenu=new Function("event.returnValue=false");
document.onselectstart=new Function("event.returnValue=false");

function viewList(){
var dw=80;
var dh=120;
//這個你根據需要自己獲取節點的數組
//var arr = document.getElementsByTagName('div');//獲取所有要顯示的圖標
var arr = document.getElementsByName('desklogo');//獲取所有要顯示的圖標
var iconNum = arr.length;//獲取多少個顯示的圖標
var screen_h = document.documentElement.clientHeight;//頁面的高度
var screen_h = screen_h - 50 ;
var colNum = Math.floor(screen_h/dh);//每列顯示多少個
var col = Math.ceil((iconNumdw)/screen_h);//總共能顯示多少列
//document.title = "個數:"+iconNum+",高度:"+screen_h+",列數:"+col;
for(var i=0;i<iconNum;i++){
var x = (Math.floor(i/colNum))
dw+10;
var y = (i%colNum)*dh+10;
arr[i].style.top = y+"px";
arr[i].style.left = x+"px";
}
}

function openapp(appurl)
{
return alert(appurl);
}

//時間數字小於10,則在之前加個“0”補位。
function check(i){
//方法一,用三元運算符
var num;
i<10?num="0"+i:num=i;
return num;

//方法二,if語句判斷
//if(i<10){
//    i="0"+i;
//}
//return i;

}

setInterval(function(){
var date = new Date();
var year = date.getFullYear(); //獲取當前年份
var mon = date.getMonth()+1; //獲取當前月份
var da = date.getDate(); //獲取當前日
var day = date.getDay(); //獲取當前星期幾
var h = date.getHours(); //獲取小時
var m = date.getMinutes(); //獲取分鐘
var s = date.getSeconds(); //獲取秒
if(m==0 && s==0 )
location.reload();
var e = document.getElementById('desktime');
e.innerHTML=year+"年"+check(mon)+"月"+check(da)+"日<br/>"+check(h)+':'+check(m)+'<font class=\"sec\">:'+check(s)+"</font>";
},1000);

</script>
</head>
<body onload="viewList()" onresize="viewList()">
<div id="deskbgimg" name="deskbgimg"><img src="http://lyclub.f3322.net:82/web_images/LuCaoDiLouYu.jpg" alt="桌面背景圖片層" title="桌面背景圖片層" /></div>
<div id="deskbgtm" name="deskbgtm"></div>
<div id="desktbar" name="desktbar">
<span style="float:left;"><img style="margin:5px;width:30px;height:30px;" src="http://pub.lyclub.f3322.net:82/images/icons/folder.png" title="開始" onclick="javascript:document.getElementById('startmenu').style.visibility='visible';"/></span>
<span id="desktime" name="desktime" style="margin:5px;float:right;font-size:14px;line-height:15px;text-align:center;color:yellow;cursor:default;"></span>
</div>
<div id="desklogo" name="desklogo" title="百度搜索" ondblclick="javascript:window.open('http://www.baidu.com');" ><img class="dlgico" src="https://www.baidu.com/favicon.ico"/><p class="dlgtit">百度搜索</p></div>
<div id="desklogo" name="desklogo" title="搜狗搜索" ondblclick="javascript:window.open('http://www.sogou.com');" ><img class="dlgico" src="https://www.sogou.com/images/logo/new/favicon.ico"/><p class="dlgtit">搜狗搜索</p></div>
<div id="desklogo" name="desklogo" title="本地公共庫" ondblclick="javascript:window.open('http://pub.lyclub.f3322.net:82');" ><img class="dlgico" src="http://lyclub.f3322.net:82/web_images/32X32.ico"/><p class="dlgtit">本地公共庫</p></div>
<div id="desklogo" name="desklogo" title="PUTTY" ondblclick="javascript:window.open('/openapp.php?//10.0.0.5/Public/tools/putty.exe');" ><img class="dlgico" src="http://pub.lyclub.f3322.net:82/images/icons/exe.png"/><p class="dlgtit">PUTTY</p></div>
<div id="desklogo" name="desklogo" title="AnyDesk" ondblclick="javascript:window.open('/openapp.php?//10.0.0.5/Public/tools/AnyDesk.exe');" ><img class="dlgico" src="http://pub.lyclub.f3322.net:82/images/icons/exe.png"/><p class="dlgtit">AnyDesk</p></div>
<div id="desklogo" name="desklogo" title="UltraISO" ondblclick="javascript:window.open('/openapp.php?//10.0.0.5/Public/tools/UltraISO_Lite9.3.exe');" ><img class="dlgico" src="http://pub.lyclub.f3322.net:82/images/icons/exe.png"/><p class="dlgtit">UltraISO</p></div>
<div id="startmenu" name="startmenu">
<ul style="list-style:none;padding:0px;margin:0px;text-align:center;line-height:20px;font-size:12px;">
<li style="margin:5px;border-bottom:1px solid orange" onclick="javascript:window.alert('列表一未開發');document.getElementById('startmenu').style.visibility='hidden';">列表一</li>
<li style="margin:5px;border-bottom:1px solid orange" onclick="javascript:window.open('/lyclub_open.reg');document.getElementById('startmenu').style.visibility='hidden';">註冊打開的文件</li>
<li style="margin:5px;border-bottom:1px solid orange" onclick="javascript:location.reload();">刷新桌面</li>
<li style="margin:5px;border-bottom:1px solid orange" onclick="javascript:window.close();">退出桌面</li>
<li style="margin:5px;" onclick="javascript:document.getElementById('startmenu').style.visibility='hidden';">關閉菜單</li>
</ul>
</div>
</body>
</html>

共享文件夾自定義協議註冊表文件

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\lyclub]
@="lyclub Protocol"
"URL Protocol"=""

[HKEY_CLASSES_ROOT\lyclub\DefaultIcon]
@="C:\windows\system32\cmd.exe"

[HKEY_CLASSES_ROOT\lyclub\shell]
@=""

[HKEY_CLASSES_ROOT\lyclub\shell\open]
@=""

[HKEY_CLASSES_ROOT\lyclub\shell\open\command]
@="cmd /c set m=%1 & call set m=%%m:lyclub://=%% & call %%m%% & exit"

共享文件夾調用網頁

<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<link rel="shortcut icon" href="http://lyclub.f3322.net:82/web_images/32X32.ico" />
<title>打開APP</title>
</head>
<body>
<meta http-equiv="refresh" content="0;url=lyclub://<?php echo $_SERVER["QUERY_STRING"]; ?>" />
</body>
</html>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章