Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jinenge authored Oct 23, 2023
1 parent e3a8150 commit b52a186
Show file tree
Hide file tree
Showing 92 changed files with 11,681 additions and 0 deletions.
125 changes: 125 additions & 0 deletions AppStore.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<!doctype html>
<html>

<head>
<meta charset="UTF-8">
<meta name="viewport" id="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0">
<link rel="shortcut icon" href="images/AppStore.png" type="image/x-icon">
<link rel="stylesheet" href="mdui-v1.0.1/css/mdui.min.css">
<script src="mdui-v1.0.1/js/mdui.min.js"></script>
<title>应用商店</title>
<style>
html {
transition-property: opacity;
transition: .3s;
animation-name: opacity;
animation-duration: .3s;
}

@keyframes opacity {
from {
opacity: 0;
}

to {
opacity: 1;
}
}

.mdui-theme-layout-dark .mdui-list-item-avatar {
background: #303030 !important;
}

.mdui-list-item:hover .mdui-list-item-avatar {
background: #EBEBEB !important;
}

.mdui-theme-layout-dark .mdui-list-item:hover .mdui-list-item-avatar {
background: #404040 !important;
}

.mdui-list-item-avatar {
transition: .3s cubic-bezier(.4, 0, .2, 1);
}
</style>
</head>

<body class="mdui-theme-primary-indigo mdui-theme-accent-pink mdui-appbar-with-toolbar">
<div class="mdui-appbar mdui-appbar-fixed">
<div class="mdui-toolbar mdui-color-theme">
<a class="mdui-typo-title mdui-text-color-white">应用商店</a>
</div>
</div>
<div style="position: fixed;left: 0;top: 0;width: 100%;height: 100%;z-index: -114514;" class="mdui-valign">
<div style="width: 100%;text-align: center;" id="spinner">
<div class="mdui-spinner"></div>
</div>
</div>
<ul class="mdui-list mdui-center" style="max-width: 640px;" id="appList"></ul>
<script>
//接入 API:执行 JavaScript 脚本
function postScript(script) {
var scriptStr = script.toString();
var postData = {
"type": "JavaScript",
"script": scriptStr
};
window.parent.postMessage(JSON.stringify(postData), "/");
}
//接入 API:添加应用
function addApp(icon, name, url, color1, color2, textColor1, textColor2) {
var postData = {
"type": "addApp",
"icon": icon,
"name": name,
"url": url,
"color1": color1,
"color2": color2,
"textColor1": textColor1,
"textColor2": textColor2
};
window.parent.postMessage(JSON.stringify(postData), "/");
}
//获取深色主题设置
if (localStorage.getItem("darkTheme") == "true") {
document.body.classList.add("mdui-theme-layout-dark");
postScript(function() {
gebi("statusBar").style.background = "#212121";
});
} else {
postScript(function() {
gebi("statusBar").style.background = "#303F9F";
});
}
//事件:页面加载完成
window.onload = function() {
var getAppData = new XMLHttpRequest();
getAppData.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
appData = JSON.parse(this.responseText);
freshAppList();
document.getElementById("spinner").style.display = "none";
}
};
getAppData.open("GET", "https://jinenyy.vip/json/apps.json", true);
getAppData.send();
};
//函数:刷新应用列表
function freshAppList() {
appData.forEach(function(item, index) {
document.getElementById("appList").innerHTML += `<li class="mdui-list-item mdui-ripple">
<div class="mdui-list-item-avatar" style="border-radius: 8px;background: #fff;">
<img src="` + item.icon + `" style="border-radius: 8px;"/>
</div>
<div class="mdui-list-item-content">
<div class="mdui-list-item-title">` + item.name + `</div>
<div class="mdui-list-item-text">` + item.description + `</div>
</div>
<i class="mdui-list-item-icon mdui-icon material-icons" onclick='javascript:addApp("` + item.icon + `", "` + item.name + `", "` + item.url + `", "` + item.color1 + `", "` + item.color2 + `", "` + item.textColor1 + `", "` + item.textColor2 + `");'>add</i>
</li>`;
});
}
</script>
</body>

</html>
Loading

0 comments on commit b52a186

Please sign in to comment.