diff --git a/css/cloudshell.css b/css/cloudshell.css index 30dd9eb..5eb442b 100644 --- a/css/cloudshell.css +++ b/css/cloudshell.css @@ -1,48 +1,6 @@ -#systemList { - margin-top: 30px; - margin-bottom: 30px; -} - -#forwardPorts { - margin-bottom: 20px; -} - -.system { - cursor: pointer; - margin-bottom: 10px; - overflow: hidden; -} - -.card-img { - transition: transform 0.2s ease-out; -} - -.system:hover .card-img { - transform: scale(1.07); -} - -#shell iframe { - height: 80vh; - width: 100%; - border: 0; -} - -#fullScreenFrame { - height: 100vh; - width: 100%; - position: fixed; - top: 0; - left: 0; - z-index: 100; -} - -.exitFullScreen { - position: fixed; - bottom: 20px; - right: 40px; - z-index: 200; - visibility: hidden; - cursor: pointer; - visibility: visible; - color: white; +iframe { + margin-top: 8px; + position: fixed; + width: 100%; + height: calc(100vh - 58px); } \ No newline at end of file diff --git a/css/favourites.css b/css/favourites.css deleted file mode 100644 index f80ce14..0000000 --- a/css/favourites.css +++ /dev/null @@ -1,79 +0,0 @@ -.card-box { - border: 1px solid whitesmoke; -} - -.card-box .cover { - height: 180px; -} - -.card-box .card-title { - width: 50%; - height: 20px; -} - -.card-box .card-desc { - width: 90%; - height: 20px; -} - -.card-box .card-lang { - width: 30%; - height: 20px; -} - -.card-box .cover, -.card-box .card-title, -.card-box .card-desc, -.card-box .card-lang { - margin-bottom: 20px; - background-color: whitesmoke; - background: linear-gradient(100deg, - rgba(255, 255, 255, 0) 40%, - rgba(255, 255, 255, 0.8) 50%, - rgba(255, 255, 255, 0) 60%) whitesmoke; - background-size: 200% 100%; - background-position-x: 120%; - animation: 1s loading ease-in-out infinite; -} - -@keyframes loading { - to { - background-position-x: -20%; - } -} - -.card:hover { - box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.25); -} - -.card .cover { - height: 180px; - background-size: 100% auto; - background-repeat: no-repeat; - overflow: hidden; -} - -.card .cover a { - display: block; - width: 100%; - background-size: cover; - background-position: center center; - background-repeat: no-repeat; - position: relative; - height: 300px; - transition: transform 0.2s ease-out; -} - -.card:hover a { - transform: scale(1.07); -} - -.card-body .box { - height: 10px; - margin: 10px; - background-color: whitesmoke; -} - -.del { - cursor: pointer; -} \ No newline at end of file diff --git a/css/index.css b/css/index.css index b923902..054606a 100644 --- a/css/index.css +++ b/css/index.css @@ -15,10 +15,6 @@ body { cursor: pointer; } -#content { - flex: 1; -} - #loading { padding-top: 3rem; padding-bottom: 1rem; diff --git a/css/proxyservice.css b/css/webproxy.css similarity index 90% rename from css/proxyservice.css rename to css/webproxy.css index a35614b..a198717 100644 --- a/css/proxyservice.css +++ b/css/webproxy.css @@ -13,7 +13,6 @@ #bg input { height: 45px; - width: calc(100% - 45px); background-color: white; border: 0; border-radius: 50px; @@ -25,4 +24,6 @@ height: 45px; border-radius: 50%; float: right; + position: absolute; + right: -1px; } \ No newline at end of file diff --git a/js/favourites.js b/js/favourites.js deleted file mode 100644 index 943903d..0000000 --- a/js/favourites.js +++ /dev/null @@ -1,81 +0,0 @@ -var favourites = []; - -async function showFavourites() { - - if (!userInfo) { - navigate("home"); - return; - } - - let res = await fetch(`https://storage.conchbrain.club/${userInfo.id}/get?ConchFavourites`); - favourites = await res.json(); - - document.querySelector("#favouriteList").innerHTML = null; - - if (favourites.length == 0) { - document.querySelector("#favouriteList").innerHTML = "

这里什么也没有

"; - return; - } - - for (var i = favourites.length - 1; i >= 0; i--) { - - let id = guid(); - let favourite = JSON.parse(favourites[i]); - - let html = ` -
-
-
- -
-
-
- ${favourite.link.replace("https://github.com/", "")} -
- - - - -
-
-

${favourite.desc}

-

语言:${favourite.language}

-
-
-
- `; - - document.querySelector("#favouriteList").innerHTML += html; - } -} - -function delFavourite(favourite, id) { - - favourite = decodeURI(favourite); - - if (favourites.indexOf(favourite) >= 0) - favourites.splice(favourites.indexOf(decodeURI(favourite)), 1); - - toast("收藏", "删除中,请稍候......"); - - // 保存个人数据 - fetch(`https://storage.conchbrain.club/${userInfo.id}/set`, { - method: "PUT", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify({ - "key": "ConchFavourites", - "value": favourites - }) - }).then((res) => { - if (res.status == 200) { - document.getElementById(id).remove(); - toast("收藏", "删除成功。"); - } - else - toast("收藏", "删除失败,请重试。"); - }); -} - -showFavourites(); \ No newline at end of file diff --git a/js/index.js b/js/index.js index b2fccf1..57d4f53 100644 --- a/js/index.js +++ b/js/index.js @@ -14,31 +14,31 @@ function logout() { location.reload(); } -async function getUser() { - - let access_token = localStorage.getItem("access_token"); - - if (!access_token) { - document.querySelector("#userName").onclick = login; - return; - } - - let res = await fetch("https://api.github.com/user", { - headers: { - accept: 'application/json', - Authorization: `token ${localStorage.getItem("access_token")}` - } - }); - - if (res.status == 200) { - userInfo = await res.json(); - showInfo(); - } - else { - alert("登陆失败,请重新登录"); - logout(); - } -} +// async function getUser() { + +// let access_token = localStorage.getItem("access_token"); + +// if (!access_token) { +// document.querySelector("#userName").onclick = login; +// return; +// } + +// let res = await fetch("https://api.github.com/user", { +// headers: { +// accept: 'application/json', +// Authorization: `token ${localStorage.getItem("access_token")}` +// } +// }); + +// if (res.status == 200) { +// userInfo = await res.json(); +// showInfo(); +// } +// else { +// alert("登陆失败,请重新登录"); +// logout(); +// } +// } function showInfo() { document.querySelector("#userName").setAttribute("data-toggle", "dropdown"); @@ -200,17 +200,17 @@ async function init() { } //获取当前用户 - getUser(); + // getUser(); //获取当前地址 let href = window.location.href; //判断是否授权登陆 - if (href.includes("#login")) { - let access_token = location.href.substring(location.href.indexOf("?") + 1); - localStorage.setItem("access_token", access_token); - window.location.href = "/"; - } + // if (href.includes("#login")) { + // let access_token = location.href.substring(location.href.indexOf("?") + 1); + // localStorage.setItem("access_token", access_token); + // window.location.href = "/"; + // } //导航到指定页面 if (href.includes("#")) { diff --git a/js/proxyservice.js b/js/webproxy.js similarity index 95% rename from js/proxyservice.js rename to js/webproxy.js index 087d0f4..402ac38 100644 --- a/js/proxyservice.js +++ b/js/webproxy.js @@ -15,7 +15,6 @@ function search() { function setBackground(bgHref) { document.querySelector("#bg").style.backgroundImage = `url("${bgHref}")`; - document.querySelector("#bg h1").style.color = "white"; } function initBackground() { diff --git a/view/cloudshell.html b/view/cloudshell.html index 10d61db..7a17045 100644 --- a/view/cloudshell.html +++ b/view/cloudshell.html @@ -1,4 +1,6 @@ - + + + + +
-

ConchBrain WebProxy

+ + + + + + + + + + + + + + + + + + + +