Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
whes1015 authored Oct 14, 2023
1 parent 2524832 commit 717ca2b
Showing 1 changed file with 154 additions and 137 deletions.
291 changes: 154 additions & 137 deletions src/check.html
Original file line number Diff line number Diff line change
@@ -1,137 +1,154 @@
<html lang="zh-Hant">
<head>
<title>ExpTech | 註冊驗證</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="註冊驗證 ExpTech 帳號" />

<!-- Facebook Meta Tags -->
<meta property="og:site_name" content="探索科技 | ExpTech Studio" />
<meta
property="og:url"
content="https://exptech.com.tw/api/v1/file/exptech/register.html"
/>
<meta property="og:type" content="website" />
<meta property="og:title" content="註冊驗證" />
<meta property="og:description" content="註冊驗證 ExpTech 帳號" />
<meta
property="og:image"
content="https://cdn.jsdelivr.net/gh/ExpTechTW/API@master/image/Icon/ExpTech.png"
/>

<!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary" />
<meta property="twitter:domain" content="exptech.com.tw" />
<meta
property="twitter:url"
content="https://exptech.com.tw/api/v1/file/exptech/register.html"
/>
<meta name="twitter:title" content="註冊驗證" />
<meta name="twitter:description" content="註冊驗證 ExpTech 帳號" />
<meta
name="twitter:image"
content="https://cdn.jsdelivr.net/gh/ExpTechTW/API@master/image/Icon/ExpTech.png"
/>

<link id="css-index" rel="stylesheet" href="./stylesheets/components/input.scss" />
</head>

<body>
<main>
<div id="container">
<div class="title">註冊驗證</div>
<div class="description">註冊驗證 ExpTech 帳號</div>
<div id="success-view" class="view">
<svg
class="check-mark"
xmlns="http://www.w3.org/2000/svg"
height="128"
width="128"
viewBox="0 96 960 960"
>
<path
d="M421 744.537 690.537 475l-34.845-34.23L421 675.847 302.539 557.385l-33.846 34.23L421 744.537Zm59.067 211.462q-78.221 0-147.397-29.92-69.176-29.92-120.989-81.71-51.814-51.791-81.747-120.936-29.933-69.146-29.933-147.366 0-78.836 29.92-148.204 29.92-69.369 81.71-120.682 51.791-51.314 120.936-81.247 69.146-29.933 147.366-29.933 78.836 0 148.204 29.92 69.369 29.92 120.682 81.21 51.314 51.291 81.247 120.629 29.933 69.337 29.933 148.173 0 78.221-29.92 147.397-29.92 69.176-81.21 120.989-51.291 51.814-120.629 81.747-69.337 29.933-148.173 29.933ZM480 910.615q139.692 0 237.154-97.769Q814.615 715.077 814.615 576q0-139.692-97.461-237.154Q619.692 241.385 480 241.385q-139.077 0-236.846 97.461Q145.385 436.308 145.385 576q0 139.077 97.769 236.846T480 910.615ZM480 576Z"
/>
</svg>
<div class="success-title title">註冊成功</div>
<div class="success-description">將在五秒後跳轉回登入畫面</div>
</div>
<div id="invaild-view" class="view">
<svg
class="no-entry"
xmlns="http://www.w3.org/2000/svg"
height="128"
width="128"
viewBox="0 0 64 64"
enable-background="new 0 0 64 64"
>
<path
d="M32,2C15.432,2,2,15.432,2,32C1.999,48.568,15.432,62,32,62s30.001-13.432,30-30C62.001,15.432,48.568,2,32,2z M9,38V26h46 v12H9z"
fill="#e53935"
/>
</svg>
<div class="success-title title">無效註冊</div>
<div class="success-description">將在五秒後跳轉回登入畫面</div>
</div>
</div>
<a class="info" href="https://exptech.com.tw/f?v=discord"
>Discord 伺服器</a
>
<a id="login"></a>
</main>

<script>
const success_view = document.getElementById("success-view");
const invaild_view = document.getElementById("invaild-view");

document.getElementById("login").onclick = (e) => {
window.location.href = "./login.html";
};

const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());

fetch(`https://exptech.com.tw/api/v1/et/register?code=${params.code}`, {
method: "GET",
headers: { "Content-Type": "application/json" },
})
.then(async (res) => {
switch (await res.text()) {
case "OK": {
success_view.style.position = "absolute";
success_view.style.display = "block";
setTimeout(() => {
success_view.style.position = "";
success_view.style.opacity = 1;
}, 100);

setTimeout(() => (window.location.href = "./login.html"), 5_000);
break;
}

case "Invaild code!": {
invaild_view.style.position = "absolute";
invaild_view.style.display = "block";
setTimeout(() => {
invaild_view.style.position = "";
invaild_view.style.opacity = 1;
}, 100);

setTimeout(() => (window.location.href = "./login.html"), 5_000);
break;
}

default: {
console.error(res);
break;
}
}
})
.catch((err) => {
console.error(err);
const res = err.request.response;
alert(res);
});
</script>
</body>
</html>
<html lang="zh-Hant">

<head>
<title>ExpTech | 註冊驗證</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="註冊驗證 ExpTech 帳號" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap">

<style>
body {
font-family: 'Roboto', sans-serif;
background-color: #1a1a1a;
color: #eaeaea;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}

#container {
background: #2a2a2a;
border-radius: 15px;
padding: 30px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
text-align: center;
}

.title {
font-size: 28px;
margin-bottom: 10px;
}

.description {
font-size: 20px;
margin-bottom: 30px;
}

.view {
display: none;
opacity: 0;
transition: opacity 0.3s;
}

.info {
display: block;
margin-top: 20px;
text-align: center;
text-decoration: none;
color: #2196F3;
}

.info:hover {
text-decoration: underline;
}

svg {
margin-bottom: 20px;
}

a#login {
display: none;
}

</style>
</head>

<body>
<main>
<div id="container">
<div class="title">註冊驗證</div>
<div class="description">註冊驗證 ExpTech 帳號</div>
<div id="success-view" class="view">
<svg class="check-mark" xmlns="http://www.w3.org/2000/svg" height="128" width="128"
viewBox="0 96 960 960">
<path
d="M421 744.537 690.537 475l-34.845-34.23L421 675.847 302.539 557.385l-33.846 34.23L421 744.537Zm59.067 211.462q-78.221 0-147.397-29.92-69.176-29.92-120.989-81.71-51.814-51.791-81.747-120.936-29.933-69.146-29.933-147.366 0-78.836 29.92-148.204 29.92-69.369 81.71-120.682 51.791-51.314 120.936-81.247 69.146-29.933 147.366-29.933 78.836 0 148.204 29.92 69.369 29.92 120.682 81.21 51.314 51.291 81.247 120.629 29.933 69.337 29.933 148.173 0 78.221-29.92 147.397-29.92 69.176-81.21 120.989-51.291 51.814-120.629 81.747-69.337 29.933-148.173 29.933ZM480 910.615q139.692 0 237.154-97.769Q814.615 715.077 814.615 576q0-139.692-97.461-237.154Q619.692 241.385 480 241.385q-139.077 0-236.846 97.461Q145.385 436.308 145.385 576q0 139.077 97.769 236.846T480 910.615ZM480 576Z" />
</svg>
<div class="success-title title">註冊成功</div>
<div class="success-description">將在五秒後跳轉回登入畫面</div>
</div>
<div id="invaild-view" class="view">
<svg class="no-entry" xmlns="http://www.w3.org/2000/svg" height="128" width="128" viewBox="0 0 64 64"
enable-background="new 0 0 64 64">
<path
d="M32,2C15.432,2,2,15.432,2,32C1.999,48.568,15.432,62,32,62s30.001-13.432,30-30C62.001,15.432,48.568,2,32,2z M9,38V26h46 v12H9z"
fill="#e53935" />
</svg>
<div class="success-title title">無效註冊</div>
<div class="success-description">將在五秒後跳轉回登入畫面</div>
</div>
</div>
</div>
<a class="info" href="https://exptech.com.tw/f?v=discord">Discord 伺服器</a>
<a id="login"></a>
</main>

<script>
const success_view = document.getElementById("success-view");
const invaild_view = document.getElementById("invaild-view");

document.getElementById("login").onclick = (e) => {
window.location.href = "./login.html";
};

const urlSearchParams = new URLSearchParams(window.location.search);
const params = Object.fromEntries(urlSearchParams.entries());

fetch(`https://exptech.com.tw/api/v1/et/register?code=${params.code}`, {
method: "GET",
headers: { "Content-Type": "application/json" },
})
.then(async (res) => {
switch (await res.text()) {
case "OK": {
success_view.style.position = "absolute";
success_view.style.display = "block";
setTimeout(() => {
success_view.style.position = "";
success_view.style.opacity = 1;
}, 100);

setTimeout(() => (window.location.href = "./login.html"), 5_000);
break;
}

case "Invaild code!": {
invaild_view.style.position = "absolute";
invaild_view.style.display = "block";
setTimeout(() => {
invaild_view.style.position = "";
invaild_view.style.opacity = 1;
}, 100);

setTimeout(() => (window.location.href = "./login.html"), 5_000);
break;
}

default: {
console.error(res);
break;
}
}
})
.catch((err) => {
console.error(err);
const res = err.request.response;
alert(res);
});
</script>
</body>

</html>

0 comments on commit 717ca2b

Please sign in to comment.