130 lines
4.7 KiB
HTML
130 lines
4.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>诗歌生成器-首页</title>
|
|
<link rel="stylesheet" href="/static/css/common.css">
|
|
<link rel="stylesheet" href="/static/css/index.css">
|
|
</head>
|
|
|
|
<body>
|
|
<!-- 导航栏 -->
|
|
<nav class="navbar navbar-default">
|
|
<div class="container-fluid">
|
|
<!-- Brand and toggle get grouped for better mobile display -->
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
|
|
data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
|
|
<span class="sr-only">Toggle navigation</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<!-- <a class="navbar-brand" href="#">Brand</a> -->
|
|
</div>
|
|
|
|
<!-- Collect the nav links, forms, and other content for toggling -->
|
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
|
<ul class="nav navbar-nav">
|
|
<!-- <li class="active"><a href="#">Link <span class="sr-only">(current)</span></a></li> -->
|
|
<li><a href="/square">广场</a></li>
|
|
<li class="dropdown">
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
|
|
aria-expanded="false">主题 <span class="caret"></span></a>
|
|
<ul class="dropdown-menu">
|
|
<li><a href="#">爱情</a></li>
|
|
<li><a href="#">家国</a></li>
|
|
<li><a href="#">田园</a></li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
|
|
<ul class="nav navbar-nav navbar-right">
|
|
<li>
|
|
<form class="navbar-form navbar-left" action="{{ url_for('to_square') }}" method="get">
|
|
<div class="form-group">
|
|
<input type="text" class="form-control" name="query" placeholder="搜索">
|
|
</div>
|
|
<button type="submit" class="btn btn-default">
|
|
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
|
|
</button>
|
|
</form>
|
|
</li>
|
|
</ul>
|
|
</div><!-- /.navbar-collapse -->
|
|
</div><!-- /.container-fluid -->
|
|
</nav>
|
|
|
|
<!-- 主题部分 -->
|
|
<div class="main">
|
|
<!-- 标题 -->
|
|
<div class="title">
|
|
<h2>诗歌生成器</h2>
|
|
<p class="lead">创造一首诗歌</p>
|
|
<h3>请输入本诗首句</h3>
|
|
</div>
|
|
|
|
<!-- 提示词,输出框 -->
|
|
<div class="put">
|
|
<div class="pointout">
|
|
<span>想不到意象提示?试试生成一个</span>
|
|
<samp id="promote"></samp>
|
|
<div class="btn-group" role="group" aria-label="...">
|
|
<button type="button" class="btn btn-default" id="generate-btn">随机意象</button>
|
|
</div>
|
|
</div>
|
|
<!-- 输入框 -->
|
|
<div class="poem-input row">
|
|
<div class="col-md-3"></div>
|
|
<div class="col-lg-6">
|
|
<form method="post" action="/predict">
|
|
<div class="input-group">
|
|
<input type="text" class="form-control" placeholder="请输入" name="words">
|
|
<span class="input-group-btn">
|
|
<input class="btn btn" type="submit" name="action" value="生成诗词">
|
|
<input class="btn btn-warning" type="submit" name="action" value="生成藏头诗">
|
|
</span>
|
|
</div><!-- /input-group -->
|
|
</form>
|
|
</div><!-- /.col-lg-6 -->
|
|
<div class="col-md-3"></div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script src="/static/js/jquery.js"></script>
|
|
<script src="/static/bootstrap-3.4.1-dist/js/bootstrap.min.js"></script>
|
|
<script>
|
|
$('.dropdown-toggle').dropdown()
|
|
|
|
</script>
|
|
|
|
|
|
<script>
|
|
$(function () {
|
|
$('#generate-btn').click(function () {
|
|
$.ajax({
|
|
url: '/promote',
|
|
type: 'GET',
|
|
dataType: 'json',
|
|
success: function (data) {
|
|
$('#promote').text("提示词:" + data['promote']);
|
|
},
|
|
error: function (xhr, status, error) {
|
|
alert('出现错误:' + error);
|
|
}
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|