mirror of
https://github.com/hyzendust/hyzendust.github.io.git
synced 2026-09-19 02:23:17 +02:00
Compare commits
2 Commits
6cf939a509
...
89e5d4a0f9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89e5d4a0f9 | ||
|
|
1286e3700e |
File diff suppressed because one or more lines are too long
@@ -12,8 +12,9 @@
|
||||
<input class=auth-form__input type=password id=login-password name=password autocomplete=current-password required>
|
||||
<button type=button class=auth-form__eye aria-label="Toggle password visibility" tabindex=-1>
|
||||
<svg class="eye-show" viewBox="0 0 24 24" width="16" height="16" fill="currentColor"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76.0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66.0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>
|
||||
<svg class="eye-hide" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" style="display:none"><path d="M12 7c2.76.0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4.0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55.0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65.0 1.66 1.34 3 3 3 .22.0.44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76.0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg></button></div></div><button type=submit class=auth-form__submit id=login-submit>
|
||||
<svg class="eye-hide" viewBox="0 0 24 24" width="16" height="16" fill="currentColor" style="display:none"><path d="M12 7c2.76.0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4.0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55.0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65.0 1.66 1.34 3 3 3 .22.0.44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76.0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg></button></div></div><div class="auth-form__group auth-form__group--checkbox"><label class=auth-form__checkbox-label><input type=checkbox id=login-remember name=remember>
|
||||
Keep me logged in</label></div><button type=submit class=auth-form__submit id=login-submit>
|
||||
<span class=auth-form__submit-text>Log In</span>
|
||||
<span class=auth-form__submit-loader style=display:none><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="spin"><path d="M12 4V1L8 5l4 4V6c3.31.0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31.0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"/></svg></span></button></form><p class=auth-card__footer id=login-footer>Don't have an account? <a href=/signup/ class=auth-card__link>Sign up</a></p></div></div><script>(function(){var e,t,n,s,i,a="https://backend.freedoms4.org/auth.php";if(localStorage.getItem("f4_username")){document.getElementById("auth-message").textContent="You are already logged in!",document.getElementById("auth-message").className="auth-message auth-message--success is-visible",document.getElementById("login-form").style.display="none",document.getElementById("login-footer").style.display="none";return}(function(){var e,n,s=new URLSearchParams(window.location.search),t=s.get("next");if(t&&t.startsWith("/"))sessionStorage.setItem("f4_login_next",t);else if(!sessionStorage.getItem("f4_login_next")&&document.referrer)try{n=new URL(document.referrer),n.hostname===window.location.hostname&&(e=n.pathname,e!=="/login/"&&e!=="/signup/"&&sessionStorage.setItem("f4_login_next",e))}catch{}})(),i=document.getElementById("login-form"),n=document.getElementById("auth-message"),e=document.getElementById("login-submit"),s=i.querySelector(".auth-form__eye"),t=document.getElementById("login-password"),t=document.getElementById("login-password"),s.addEventListener("click",function(){var e=t.type==="text";t.type=e?"password":"text",s.querySelector(".eye-show").style.display=e?"":"none",s.querySelector(".eye-hide").style.display=e?"none":""});function o(e,t){n.textContent=e,n.className="auth-message auth-message--"+t+" is-visible"}i.addEventListener("submit",function(s){s.preventDefault(),n.className="auth-message";var i=document.getElementById("login-username").value.trim(),r=t.value;if(!i||!r){o("Please fill in all fields.","error");return}e.disabled=!0,e.querySelector(".auth-form__submit-text").style.display="none",e.querySelector(".auth-form__submit-loader").style.display="inline-flex",fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({action:"login",username:i,password:r})}).then(function(e){return e.json()}).then(function(e){e.success?(o("Logged in successfully! Redirecting…","success"),localStorage.setItem("f4_username",i),localStorage.setItem("f4_login_time",Date.now()),setTimeout(function(){var t=sessionStorage.getItem("f4_login_next");sessionStorage.removeItem("f4_login_next"),window.location.href=t&&t.startsWith("/")?t:e.redirect||"/"},1e3)):o(e.message||"Login failed. Please try again.","error")}).catch(function(){o("Network error. Please try again.","error")}).finally(function(){e.disabled=!1,e.querySelector(".auth-form__submit-text").style.display="",e.querySelector(".auth-form__submit-loader").style.display="none"})})})()</script></main><footer class=footer><p class=footer__copyright-notice>© <a href=https://freedoms4.org>freedoms4.org</a>
|
||||
<span class=auth-form__submit-loader style=display:none><svg viewBox="0 0 24 24" width="16" height="16" fill="currentColor" class="spin"><path d="M12 4V1L8 5l4 4V6c3.31.0 6 2.69 6 6 0 1.01-.25 1.97-.7 2.8l1.46 1.46C19.54 15.03 20 13.57 20 12c0-4.42-3.58-8-8-8zm0 14c-3.31.0-6-2.69-6-6 0-1.01.25-1.97.7-2.8L5.24 7.74C4.46 8.97 4 10.43 4 12c0 4.42 3.58 8 8 8v3l4-4-4-4v3z"/></svg></span></button></form><p class=auth-card__footer id=login-footer>Don't have an account? <a href=/signup/ class=auth-card__link>Sign up</a></p></div></div><script>(function(){var e,t,n,s,i,a="https://backend.freedoms4.org/auth.php";if(localStorage.getItem("f4_username")){document.getElementById("auth-message").textContent="You are already logged in!",document.getElementById("auth-message").className="auth-message auth-message--success is-visible",document.getElementById("login-form").style.display="none",document.getElementById("login-footer").style.display="none";return}(function(){var e,n,s=new URLSearchParams(window.location.search),t=s.get("next");if(t&&t.startsWith("/"))sessionStorage.setItem("f4_login_next",t);else if(!sessionStorage.getItem("f4_login_next")&&document.referrer)try{n=new URL(document.referrer),n.hostname===window.location.hostname&&(e=n.pathname,e!=="/login/"&&e!=="/signup/"&&sessionStorage.setItem("f4_login_next",e))}catch{}})(),i=document.getElementById("login-form"),n=document.getElementById("auth-message"),e=document.getElementById("login-submit"),s=i.querySelector(".auth-form__eye"),t=document.getElementById("login-password"),t=document.getElementById("login-password"),s.addEventListener("click",function(){var e=t.type==="text";t.type=e?"password":"text",s.querySelector(".eye-show").style.display=e?"":"none",s.querySelector(".eye-hide").style.display=e?"none":""});function o(e,t){n.textContent=e,n.className="auth-message auth-message--"+t+" is-visible"}i.addEventListener("submit",function(s){s.preventDefault(),n.className="auth-message";var i=document.getElementById("login-username").value.trim(),r=t.value,c=document.getElementById("login-remember").checked;if(!i||!r){o("Please fill in all fields.","error");return}e.disabled=!0,e.querySelector(".auth-form__submit-text").style.display="none",e.querySelector(".auth-form__submit-loader").style.display="inline-flex",fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({action:"login",username:i,password:r,remember:c})}).then(function(e){return e.json()}).then(function(e){e.success?(o("Logged in successfully! Redirecting…","success"),localStorage.setItem("f4_username",i),localStorage.setItem("f4_login_time",Date.now()),setTimeout(function(){var t=sessionStorage.getItem("f4_login_next");sessionStorage.removeItem("f4_login_next"),window.location.href=t&&t.startsWith("/")?t:e.redirect||"/"},1e3)):o(e.message||"Login failed. Please try again.","error")}).catch(function(){o("Network error. Please try again.","error")}).finally(function(){e.disabled=!1,e.querySelector(".auth-form__submit-text").style.display="",e.querySelector(".auth-form__submit-loader").style.display="none"})})})()</script></main><footer class=footer><p class=footer__copyright-notice>© <a href=https://freedoms4.org>freedoms4.org</a>
|
||||
<a href=/terms/>Terms and Conditions</a> <a href=/privacy/>Privacy Policy</a>
|
||||
<a href=/changelog/>Changelog</a></p><p class=footer__theme-info>Built with <a href=https://gohugo.io>Hugo</a> and based on <a href=https://github.com/CyrusYip/hugo-theme-yue>Yue</a> theme</p></footer><script>(function(){document.querySelectorAll(".menu__item").forEach(function(e){var t=e.querySelector("a");t&&t.getAttribute("href")==="/uninotes/"&&e.classList.add("menu__item--uninotes")})})()</script><script>(function(){var e=document.getElementById("theme-toggle");if(!e)return;function t(){var e=localStorage.getItem("theme");return e?e:window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}function n(e){document.documentElement.setAttribute("data-theme",e),localStorage.setItem("theme",e)}n(t()),e.addEventListener("click",function(){var e=document.documentElement.getAttribute("data-theme")||t();n(e==="dark"?"light":"dark")})})()</script><script>(function(){var t="https://backend.freedoms4.org/auth.php",e=localStorage.getItem("f4_username");if(!e)return;function n(e){var t,n,o,i,a,c,r=document.querySelector(".brand__auth");r&&!r.querySelector(".brand__auth-user")&&(r.classList.add("brand__auth--loggedin"),t=document.createElement("div"),t.className="brand__auth-user",n=document.createElement("button"),n.className="brand__auth-user-btn",n.setAttribute("aria-label","Account menu"),c=document.createElement("span"),c.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="12" height="12" fill="currentColor"><path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4h19.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/></svg>',n.appendChild(c.firstChild),n.appendChild(document.createTextNode(" "+e)),o=document.createElement("div"),o.className="brand__auth-user-dropdown",i=document.createElement("button"),i.className="brand__auth-user-logout",i.textContent="Log Out",i.addEventListener("click",s),e==="hyzen"&&(a=document.createElement("a"),a.className="brand__auth-user-admin",a.href="/admin/",a.textContent="User Management",o.appendChild(a)),o.appendChild(i),o.appendChild(i),t.appendChild(n),t.appendChild(o),r.appendChild(t),n.addEventListener("click",function(e){e.stopPropagation(),t.classList.toggle("is-open")}),document.addEventListener("click",function(){t.classList.remove("is-open")}))}function s(){fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({action:"logout"})}).finally(function(){localStorage.removeItem("f4_username"),localStorage.removeItem("f4_login_time"),localStorage.removeItem("f4_session_fails"),window.location.reload()})}n(e)})()</script><script>(function(){var t,e=document.querySelector(".rss-subscribe");if(!e)return;t=e.querySelector(".rss-subscribe__btn"),t.addEventListener("click",function(t){t.stopPropagation(),e.classList.toggle("is-open")}),document.addEventListener("click",function(t){e.contains(t.target)||e.classList.remove("is-open")}),e.querySelectorAll(".rss-subscribe__item").forEach(function(t){t.addEventListener("click",function(n){n.stopPropagation();var s,o=t.getAttribute("data-rss-url"),a=t.textContent;function i(){t.textContent="Copied!",setTimeout(function(){t.textContent=a,e.classList.remove("is-open")},1200)}try{s=document.createElement("textarea"),s.value=o,s.style.cssText="position:fixed;top:0;left:0;opacity:0;pointer-events:none;",document.body.appendChild(s),s.focus(),s.select(),document.execCommand("copy"),document.body.removeChild(s),i()}catch{navigator.clipboard&&navigator.clipboard.writeText(o).then(i).catch(function(){t.textContent=o})}})})})()</script></body></html>
|
||||
@@ -38,6 +38,7 @@ end }} {{ if gt (len $blogPosts) 1 }}
|
||||
(function () {
|
||||
var BACKEND = 'https://backend.freedoms4.org/comments.php';
|
||||
var POST_ID = {{ printf "/blog/%s/" (.File.ContentBaseName | urlize) | jsonify | safeJS }};
|
||||
var POST_URL = {{ printf "https://freedoms4.org%s" .RelPermalink | jsonify | safeJS }};
|
||||
var username = localStorage.getItem('f4_username');
|
||||
var isAdmin = false;
|
||||
|
||||
@@ -162,7 +163,7 @@ end }} {{ if gt (len $blogPosts) 1 }}
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
credentials: 'include',
|
||||
body: JSON.stringify({ action: 'reply', post_id: POST_ID, parent_id: c.id, body: text }),
|
||||
body: JSON.stringify({ action: 'reply', post_id: POST_ID, post_url: POST_URL, parent_id: c.id, body: text }),
|
||||
})
|
||||
.then(function (r) { return r.json(); })
|
||||
.then(function (d) {
|
||||
@@ -235,7 +236,7 @@ end }} {{ if gt (len $blogPosts) 1 }}
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
credentials: 'include',
|
||||
body: JSON.stringify({ action: 'post', post_id: POST_ID, body: text }),
|
||||
body: JSON.stringify({ action: 'post', post_id: POST_ID, post_url: POST_URL, body: text }),
|
||||
})
|
||||
.then(function (r) { return r.json(); })
|
||||
.then(function (d) {
|
||||
|
||||
@@ -63,6 +63,13 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="auth-form__group auth-form__group--checkbox">
|
||||
<label class="auth-form__checkbox-label">
|
||||
<input type="checkbox" id="login-remember" name="remember" />
|
||||
Keep me logged in
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="auth-form__submit" id="login-submit">
|
||||
<span class="auth-form__submit-text">Log In</span>
|
||||
<span class="auth-form__submit-loader" style="display: none">
|
||||
@@ -146,6 +153,7 @@
|
||||
|
||||
var username = document.getElementById('login-username').value.trim();
|
||||
var password = pwdInput.value;
|
||||
var remember = document.getElementById('login-remember').checked;
|
||||
|
||||
if (!username || !password) {
|
||||
showMsg('Please fill in all fields.', 'error');
|
||||
@@ -160,7 +168,12 @@
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
credentials: 'include',
|
||||
body: JSON.stringify({ action: 'login', username: username, password: password }),
|
||||
body: JSON.stringify({
|
||||
action: 'login',
|
||||
username: username,
|
||||
password: password,
|
||||
remember: remember,
|
||||
}),
|
||||
})
|
||||
.then(function (r) {
|
||||
return r.json();
|
||||
|
||||
Reference in New Issue
Block a user