ez-site/includes/account.php
2024-10-19 21:33:47 +08:00

67 lines
2.5 KiB
PHP

<?php if (isset($_SESSION['user_id'])): ?>
<script>window.location.href = '/';</script>
<?php else: ?>
<div class="container right-panel-active">
<!-- Sign In -->
<div class="container__form container--signin">
<form method="POST" action="/?api=account" class="form" id="form1">
<h2 class="form__title">登录</h2>
<input type="text" placeholder="账号" class="input" name="login_username" id="login_username" require />
<input type="password" placeholder="密码" class="input" name="login_password" id="login_password" require />
<p><button type="submit" class="btn">登录</button></p>
<a href="?page=findpass" class="link">忘记密码?</a>
</form>
</div>
<!-- Sign Up -->
<div class="container__form container--signup">
<form method="POST" action="/?api=account" class="form" id="form2">
<input type="hidden" id="g-recaptcha-response" name="g-recaptcha-response" />
<h2 class="form__title">注册</h2>
<input type="text" placeholder="账号" class="input" name="username" id="username" require />
<input type="password" placeholder="密码" class="input" name="password" id="password" require />
<input type="text" placeholder="留下任意联系方式以便于账号出现问题时联系您" class="input" name="contact" id="contact" require />
<button type="submit" class="btn">注册</button>
</form>
</div>
<!-- Overlay -->
<div class="container__overlay">
<div class="overlay">
<div class="overlay__panel overlay--left">
<p>已经有帐号了?</p>
<button class="btn" id="signIn">登录</button>
</div>
<div class="overlay__panel overlay--right">
<button class="btn" id="signUp">注册</button>
</div>
</div>
</div>
</div>
<script>
const signInBtn = document.getElementById("signIn");
const signUpBtn = document.getElementById("signUp");
const fistForm = document.getElementById("form1");
const secondForm = document.getElementById("form2");
const container = document.querySelector(".container");
signInBtn.addEventListener("click", () => {
container.classList.remove("right-panel-active");
});
signUpBtn.addEventListener("click", () => {
container.classList.add("right-panel-active");
});
fistForm.addEventListener("submit", (e) => {
});
secondForm.addEventListener("submit", (e) => {
});
</script>
<p class="copyright">&copy;
<?php echo date("Y") . ' mei&emsp;&emsp;&emsp;&emsp;<span class="iconfont icon-git-fenzhi-tianchong" style="font-size:15px"></span>' . $git_commits; ?>
</p>
</body>
<?php endif; ?>