16 changed files with 104 additions and 78 deletions
@ -0,0 +1,19 @@ |
|||
html, |
|||
body { |
|||
margin: 0; |
|||
padding: 0; |
|||
height: 100%; |
|||
} |
|||
|
|||
.navbar { |
|||
height: 49px; |
|||
display: flex; |
|||
align-items: center; |
|||
box-shadow: 1px 1px 3px #e4e4e4; |
|||
} |
|||
|
|||
.title{ |
|||
font-size: 1.5em; |
|||
margin-left: 10px; |
|||
color: #333; |
|||
} |
@ -0,0 +1,13 @@ |
|||
if edit |
|||
.row.justify-content-center.mt-5 |
|||
.col-md-6 |
|||
form#loginForm(method="post" action="/api/login" hx-post="/api/login" hx-trigger="submit" hx-target="body" hx-swap="none" hx-on:htmx:afterRequest="if(event.detail.xhr.status===200){window.location='/';}") |
|||
.mb-3 |
|||
label.form-label(for="username") 用户名 |
|||
input.form-control(type="text" id="username" name="username" required) |
|||
.mb-3 |
|||
label.form-label(for="password") 密码 |
|||
input.form-control(type="password" id="password" name="password" required) |
|||
button.btn.btn-primary(type="submit") 登录 |
|||
else |
|||
div sad 404 |
@ -0,0 +1,2 @@ |
|||
nav.navbar |
|||
.title 首页 |
@ -1,38 +0,0 @@ |
|||
extends ./layouts/page.pug |
|||
|
|||
|
|||
block pageRoot |
|||
- var title = '示例页面标题' |
|||
|
|||
block pageContent |
|||
.container.mt-5 |
|||
.row.justify-content-center |
|||
.col-md-8.text-center |
|||
img.rounded-circle.shadow.mb-4(src='https://avatars.githubusercontent.com/u/9919?s=200&v=4', alt='Avatar', width='120', height='120') |
|||
h1.mt-3.mb-1 你的姓名 |
|||
h4.text-muted 你的职位 / 头衔 |
|||
p.lead.mt-3 这里是一段简短的自我介绍,突出你的专业技能、兴趣或座右铭。 |
|||
button(hx-post="/clicked" hx-swap="outerHTML") Click Me |
|||
hr.my-4 |
|||
.d-flex.justify-content-center.gap-4 |
|||
a(href='mailto:your@email.com', target='_blank') |
|||
i.fas.fa-envelope.me-2 |
|||
| 邮箱 |
|||
a(href='https://github.com/your-github', target='_blank') |
|||
i.fab.fa-github.me-2 |
|||
| GitHub |
|||
a(href='https://your-website.com', target='_blank') |
|||
i.fas.fa-globe.me-2 |
|||
| 个人网站 |
|||
|
|||
// 登录表单区域 |
|||
.row.justify-content-center.mt-5 |
|||
.col-md-6 |
|||
form#loginForm(method="post" action="/api/login" hx-post="/api/login" hx-trigger="submit" hx-target="body" hx-swap="none" hx-on:htmx:afterRequest="if(event.detail.xhr.status===200){window.location='/';}") |
|||
.mb-3 |
|||
label.form-label(for="username") 用户名 |
|||
input.form-control(type="text" id="username" name="username" required) |
|||
.mb-3 |
|||
label.form-label(for="password") 密码 |
|||
input.form-control(type="password" id="password" name="password" required) |
|||
button.btn.btn-primary(type="submit") 登录 |
@ -1,12 +1,15 @@ |
|||
block root |
|||
mixin include() |
|||
if block |
|||
block |
|||
|
|||
doctype html |
|||
html(lang="zh-CN") |
|||
head |
|||
title #{title || '默认标题'} |
|||
block head |
|||
title #{title || ''} |
|||
meta(charset="utf-8") |
|||
meta(name="viewport" content="width=device-width, initial-scale=1") |
|||
script(src="https://unpkg.com/htmx.org@2.0.4") |
|||
block head |
|||
body |
|||
block content |
|||
block scripts |
|||
|
@ -0,0 +1,8 @@ |
|||
extends /layouts/page.pug |
|||
|
|||
//- +include() |
|||
//- - var edit = false |
|||
//- include /htmx/login.pug |
|||
|
|||
block pageContent |
|||
div sad |
Loading…
Reference in new issue