add blocks
This commit is contained in:
9
static/blocks/pages/userSlava/new/content.md
Normal file
9
static/blocks/pages/userSlava/new/content.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Регистрация
|
||||
|
||||
user:<br>
|
||||
<input id="reg_user" placeholder="Username"><br>
|
||||
password:<br>
|
||||
<input id="reg_pass" placeholder="password" type="password"><button class="toggle-pass" type="button">👁</button><br><br>
|
||||
<button id="btn_reg">Register</button>
|
||||
|
||||
<div class="blockTest">ТестТестТест</div>
|
||||
16
static/blocks/pages/userSlava/new/script.js
Normal file
16
static/blocks/pages/userSlava/new/script.js
Normal file
@@ -0,0 +1,16 @@
|
||||
async function UserReg() {
|
||||
const u = reg_user.value,
|
||||
p = reg_pass.value;
|
||||
|
||||
const r = await fetch("/api/users/register", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/json" },
|
||||
body: JSON.stringify({ username: u, password: p })
|
||||
});
|
||||
|
||||
if (!r.ok) return alert("Ошибка");
|
||||
alert("ok");
|
||||
reg_user.value = "",
|
||||
reg_pass.value = "";
|
||||
};
|
||||
btn_reg.onclick = UserReg;
|
||||
1
static/blocks/pages/userSlava/new/style.css
Normal file
1
static/blocks/pages/userSlava/new/style.css
Normal file
@@ -0,0 +1 @@
|
||||
.blockTest { color: red; }
|
||||
Reference in New Issue
Block a user