-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4863706
commit 5d91dd3
Showing
6 changed files
with
356 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
--- | ||
import nameGen from "@/scripts/name-gen"; | ||
let slug = Astro.url.pathname.replace(/^\/|\/$/g, ""); | ||
--- | ||
|
||
<form | ||
action="https://qiao.xinshijiededa.men/api/handle/form" | ||
method="post" | ||
class="comment-form" | ||
> | ||
<div class="form-group"> | ||
<label for="fields[name]">昵称 *</label> | ||
<input type="text" name="fields[name]" placeholder={nameGen()} required /> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="fields[email]">Email *</label> | ||
<input | ||
type="text" | ||
name="fields[email]" | ||
placeholder="不会公开显示" | ||
required | ||
/> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<label for="fields[message]">留言 *</label> | ||
<textarea | ||
name="fields[message]" | ||
id="message" | ||
cols="30" | ||
rows="10" | ||
placeholder="请洒潘江,各倾陆海云尔……" | ||
required></textarea> | ||
</div> | ||
|
||
<div class="form-group hidden"> | ||
<!-- <label for="options[captcha]">验证码,别勾选我!</label> --> | ||
<!-- <input type="checkbox" name="fields[captcha]" /> --> | ||
<label for="options[slug]">Slug</label> | ||
<input type="text" name="options[slug]" value={slug} /> | ||
</div> | ||
|
||
<button type="submit" class="form-button">发送</button> | ||
</form> | ||
|
||
<style lang="less"> | ||
.comment-form { | ||
font-family: Arial, sans-serif; | ||
font-size: 115%; | ||
max-width: 100%; | ||
margin: 0 auto; | ||
padding: 20px; | ||
} | ||
|
||
.form-group { | ||
margin-bottom: 20px; | ||
label { | ||
display: block; | ||
margin-bottom: 5px; | ||
font-weight: bold; | ||
user-select: none; | ||
} | ||
input, | ||
textarea { | ||
width: 100%; | ||
padding: 8px 10px; | ||
border: 2px solid #e1e1e1; | ||
border-radius: 2px; | ||
font-size: 16px; | ||
box-sizing: border-box; | ||
|
||
&:focus { | ||
outline: none; | ||
border: 2px solid #737373; | ||
} | ||
} | ||
textarea { | ||
resize: vertical; | ||
min-height: 200px; | ||
max-height: 600px; | ||
} | ||
} | ||
|
||
.form-button { | ||
background-color: #3498db; | ||
color: #ffffff; | ||
padding: 10px 15px; | ||
border: none; | ||
border-radius: 3px; | ||
cursor: pointer; | ||
font-size: 16px; | ||
transition: background-color 0.3s; | ||
&:hover { | ||
background-color: #2980b9; | ||
} | ||
} | ||
|
||
.hidden { | ||
display: none; | ||
user-select: none; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,232 @@ | ||
import { pick } from "./serendipity"; | ||
|
||
const el1 = [ | ||
"废墟", | ||
"深海", | ||
"反应堆", | ||
"学园", | ||
"腐烂", | ||
"东京", | ||
"三维", | ||
"深刻", | ||
"四次元", | ||
"流星", | ||
"闪光", | ||
"内存", | ||
"南极", | ||
"消极", | ||
"幽浮", | ||
"网路", | ||
"暗狱", | ||
"离子态", | ||
"液态", | ||
"黑色", | ||
"抱抱", | ||
"社会", | ||
"原味", | ||
"毛茸茸", | ||
"香香", | ||
"逻辑门", | ||
"霹雳", | ||
"午夜", | ||
"美工刀", | ||
"爆浆", | ||
"机关枪", | ||
"无响应", | ||
"手术台", | ||
"东欧", | ||
"北欧", | ||
"世界", | ||
"麻风病", | ||
"虚拟", | ||
"可穿戴", | ||
"速冻", | ||
"智能", | ||
"2000", | ||
"甜味", | ||
"华丽", | ||
"玛利亚", | ||
"无", | ||
"梦之", | ||
"星系", | ||
"断桥", | ||
"无尽", | ||
"星尘", | ||
"蔷薇", | ||
"无政府", | ||
"酷酷", | ||
"西伯利亚", | ||
"人造", | ||
"法外", | ||
"女子", | ||
"微型", | ||
"男子", | ||
"超", | ||
"毁灭", | ||
"大型", | ||
"绝望", | ||
"阴间", | ||
"死亡", | ||
"坟场", | ||
"可执行", | ||
"高科技", | ||
"奇妙", | ||
"地雷", | ||
"魔法", | ||
"极限", | ||
"无聊", | ||
"满洲", | ||
"奉天", | ||
]; | ||
const el2 = [ | ||
"小丑", | ||
"仿生", | ||
"纳米", | ||
"原子", | ||
"丧", | ||
"电子", | ||
"十字架", | ||
"咩咩", | ||
"赛博", | ||
"野猪", | ||
"外星", | ||
"窒息", | ||
"变态", | ||
"触手", | ||
"小众", | ||
"悲情", | ||
"飞行", | ||
"绿色", | ||
"电动", | ||
"铁锈", | ||
"碎尸", | ||
"电音", | ||
"蠕动", | ||
"酸甜", | ||
"虚构", | ||
"乱码", | ||
"碳水", | ||
"内脏", | ||
"含糖", | ||
"脑浆", | ||
"血管", | ||
"逃课", | ||
"绷带", | ||
"不合格", | ||
"光滑", | ||
"酸性", | ||
"碱性", | ||
"404", | ||
"变身", | ||
"反常", | ||
"碳基", | ||
"矫情", | ||
"病娇", | ||
"进化", | ||
"潮湿", | ||
"砂糖", | ||
"阴暗", | ||
"变异", | ||
"复合盐", | ||
"伏特加", | ||
"抑郁", | ||
"睡觉", | ||
"自闭", | ||
"暴躁", | ||
"沉默", | ||
"不爱说话", | ||
"废物", | ||
"失败", | ||
"幻想型", | ||
"社恐", | ||
"粘液", | ||
"苦涩", | ||
"浓厚", | ||
"快乐", | ||
"强制", | ||
"中二病", | ||
"恶魔", | ||
"emo", | ||
"激光", | ||
"高科技", | ||
"发射", | ||
"限量版", | ||
"迷因", | ||
"堕落", | ||
"放射性", | ||
]; | ||
const el3 = [ | ||
"天使", | ||
"精灵", | ||
"女孩", | ||
"男孩", | ||
"宝贝", | ||
"小妈咪", | ||
"菇", | ||
"虫", | ||
"公主", | ||
"少女", | ||
"少年", | ||
"1号机", | ||
"子", | ||
"恐龙", | ||
"食人鱼", | ||
"小飞船", | ||
"舞女", | ||
"酱", | ||
"史莱姆", | ||
"废料", | ||
"生物", | ||
"物质", | ||
"奶茶", | ||
"搅拌机", | ||
"液", | ||
"火锅", | ||
"祭司", | ||
"体", | ||
"头子", | ||
"实验品", | ||
"试验体", | ||
"小猫咪", | ||
"猫", | ||
"样本", | ||
"颗粒", | ||
"血块", | ||
"汽水", | ||
"蛙", | ||
"软体", | ||
"机器人", | ||
"人质", | ||
"小熊", | ||
"圣母", | ||
"胶囊", | ||
"乙女", | ||
"主义者", | ||
"屑", | ||
"垢", | ||
"污渍", | ||
"废人", | ||
"毛血旺", | ||
"怪人", | ||
"肉", | ||
"河豚", | ||
"豚", | ||
"藻类", | ||
"唾沫", | ||
"咒语", | ||
"建筑", | ||
"球", | ||
"小狗", | ||
"碳", | ||
"元素", | ||
"巴图鲁", | ||
"木桶饭", | ||
"猫头鹰", | ||
"火焰鸟", | ||
"团子", | ||
"精", | ||
]; | ||
|
||
export default function nameGen() { | ||
return pick(el1) + pick(el2) + pick(el3); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const pick = (arr: any[]) => arr[Math.floor(Math.random() * arr.length)]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.