大概页面布局完成,api确认没问题,接下来就要上传内容了
This commit is contained in:
@@ -46,6 +46,8 @@
|
||||
<br>
|
||||
目前firefox是有问题的,但是我个人并不在windows使用firefox,故而不考虑适配
|
||||
<br>
|
||||
还差一个图片导览暂,做好之后再重定向
|
||||
<br>
|
||||
<br>
|
||||
随机绿坝娘网站
|
||||
<br>
|
||||
|
||||
22
var/templates/image/home.html
Normal file
22
var/templates/image/home.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>选择不同版本的小绿</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>选择不同版本的小绿<a href="/image">__>重新刷新</h2>
|
||||
<div id="list"></div>
|
||||
</body>
|
||||
</html>
|
||||
<script>
|
||||
fetch('https://greendam.ww3.tw/api/image/list/')
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
data.forEach(item => {
|
||||
console.log('ID', item.id);
|
||||
console.log('Name', item.filename);
|
||||
console.log('URL', item.url_path);
|
||||
|
||||
document.getElementById('list').innerHTML += `<a href="/image/${item.filename}"><b>${item.filename}</b></a>___`
|
||||
})
|
||||
})
|
||||
</script>
|
||||
24
var/templates/image/test.html
Normal file
24
var/templates/image/test.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ name }}</title>
|
||||
</head>
|
||||
<body>
|
||||
<h2>图片预览_{{ name }}<a href="../">返回上级../</a></h2>
|
||||
<div id="content"></div>
|
||||
</body>
|
||||
<script>
|
||||
fetch('https://greendam.ww3.tw/api/image/list/{{ name }}/')
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
data.forEach(item => {
|
||||
console.log("ID", item.id)
|
||||
console.log("Name", item.filename)
|
||||
console.log("Url", item.url_path)
|
||||
|
||||
let content_Document = `<img src="${item.url_path}" alt="${item.filename}" style="width: 10%;" loading="lazy">${item.id}`
|
||||
document.getElementById('content').innerHTML += content_Document
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
</html>
|
||||
@@ -11,6 +11,10 @@
|
||||
<div id="content">
|
||||
</div>
|
||||
<hr>
|
||||
<br>
|
||||
以下还可以预览小绿的图片(本来想做预览图的,结果能力有限,现在正在努力学习javascript)
|
||||
<br>
|
||||
<a href="/image">图片导览</a>_<a href="/video">视频导览</a>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>绿坝娘资源小站 (仮) | {{ name }}</title>
|
||||
<link rel="icon" type="image/png" sizes="128x128" href="/static/src/img/logo.png">
|
||||
</head>
|
||||
<body>
|
||||
<a href="/resources">返回上级</a>
|
||||
|
||||
25
var/templates/video/home.html
Normal file
25
var/templates/video/home.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>绿坝娘资源小站 (仮) | {{ title }}</title>
|
||||
<link rel="icon" type="image/png" sizes="128x128" href="/static/src/img/logo.png">
|
||||
</head>
|
||||
<body>
|
||||
<h2>视频导览<a href="/resources">../返回上级</a></h2>
|
||||
<br>
|
||||
<div id="list"></div>
|
||||
</body>
|
||||
<script>
|
||||
fetch('https://greendam.ww3.tw/api/video/list/')
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
data.forEach(item => {
|
||||
console.log("ID", item.id)
|
||||
console.log("Name", item.filename)
|
||||
console.log("Url", item.url_path)
|
||||
|
||||
let list_Document = `<a href="./${item.filename}">${item.filename}</a>__`
|
||||
document.getElementById('list').innerHTML += list_Document
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
24
var/templates/video/test.html
Normal file
24
var/templates/video/test.html
Normal file
@@ -0,0 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>绿坝娘资源小站 (仮) | {{ name }}</title>
|
||||
<link rel="icon" type="image/png" sizes="128x128" href="/static/src/img/logo.png">
|
||||
</head>
|
||||
<body>
|
||||
{{ name }}
|
||||
<div id="content"></div>
|
||||
</body>
|
||||
<script>
|
||||
fetch('https://greendam.ww3.tw/api/video/list/{{ name }}/')
|
||||
.then(res => res.json())
|
||||
.then(data => {
|
||||
data.forEach(itme => {
|
||||
console.log("ID", itme.id)
|
||||
console.log("Name", itme.filename)
|
||||
console.log("Url", itme.url_path)
|
||||
|
||||
let video_Document = `<br><br><b>${itme.filename}</b><br><br><hr><video width="25%" controls><source src=${itme.url_path} type="video/mp4"></video><br>`
|
||||
document.getElementById('content').innerHTML += video_Document
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user