first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1 @@
8a7a6e24-8828-486a-93ea-1c0a125b400d

View File

@@ -0,0 +1 @@
98939173-61e0-4322-91ca-073109ff2a57

View File

@@ -0,0 +1,16 @@
/* 专门用来重置浏览器默认样式的 */
body, p,ul,li,h1,h2,h3,h4,h5,h6,input{
margin: 0;
padding: 0;
}
input {
outline: none;
}
li {
list-style: none;
}
a {
text-decoration: none;
}

View File

View File

@@ -0,0 +1,22 @@
/* 存放公共css的 */
.theme_red {
color: blue;
}
.left {
float: left;
}
.right {
float: right;
}
.w-1200 {
width: 1200px;
margin: 0 auto;
}
.center {
text-align: center;
}

View File

@@ -0,0 +1 @@
d02e3137-8828-4908-989b-0027e5a66183

View File

@@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="./css/clear.css">
<link rel="stylesheet" href="./css/public.css">
<link rel="stylesheet" href="./css/index.css">
<style>
ul li {
float: left;
}
img {
width: 280px;
}
</style>
</head>
<body>
<ul>
</ul>
</body>
<script src="js/ajax.js"></script>
<script src="js/utils.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
<script src="js/index.js"></script>
<script>
var ul = document.querySelector("ul");
var page = '';
function getData() {
http({
url: 'http://127.0.0.1:3000/api/list',
method: 'GET',
data: {
page: page
},
success: function (res) {
page = res.data.pcursor
AppendUl(res.data)
}
})
}
function AppendUl(res) {
res.list.forEach((val,index)=>{
ul.innerHTML+= `
<li>
<a href="./play.html?uid=${val.user.id}&vid=${val.id}">
<img src="${val.thumbnailUrl}" alt="">
<p>${val.caption}</p>
</a>
</li>
`
})
}
getData()
$(window).scroll(function () {
var scrollTop = $(this).scrollTop();
var scrollHeight = $(document).height();
var windowHeight = $(this).height();
if (scrollTop + windowHeight == scrollHeight) {
getData()
console.log("到底了,发起请求")
}
});
</script>
</html>

View File

@@ -0,0 +1 @@
7a44bd35-4a96-4dc5-8d1d-4c85b210254a

View File

@@ -0,0 +1,37 @@
/**
*
* @param option
* {
* url: '',
* method: '',
* data: {
* id: 1,
* page: 10
* },
* async: true,
* success: function() {},
* error: function() {},
* }
*/
function http(option) {
var params = [];
if (option.method == "GET") {
for (const key in option.data) {
params.push(`${key}=${option.data[key]}`)
}
option.url = `${option.url}?${params.join("&")}`
}
var http = new XMLHttpRequest();
http.open(option.method,option.url);
http.send()
http.onreadystatechange = function () {
if(http.readyState == 4) {
if (http.status == 200) {
option.success(JSON.parse(http.responseText))
} else {
option.error(http)
}
}
}
}

View File

View File

View File

@@ -0,0 +1,6 @@
function GetQueryString(name) {
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}

View File

@@ -0,0 +1,42 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<link rel="stylesheet" href="./css/clear.css">
<link rel="stylesheet" href="./css/public.css">
<link rel="stylesheet" href="./css/play.css">
<style>
video {
width: 600px;
}
</style>
</head>
<body>
<video controls src=""></video>
</body>
<script src="js/ajax.js"></script>
<script src="js/utils.js"></script>
<script src="js/play.js"></script>
<script>
var video = document.querySelector("video")
http({
url: 'http://127.0.0.1:3000/api/play',
method: 'GET',
data: {
principalId: GetQueryString("uid"),
photoId: GetQueryString("vid")
},
success: function (res) {
console.log(res)
video.src = res.playUrl
video.poster = res.poster
}
})
</script>
</html>