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,45 @@
function query(name) {
const reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
const r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}
function item (arr) {
var html = "";
arr.forEach((v, i) => {
html += `
<a href="./page/info.html?id={v,id}">
<li>
<div class="newest_img">
<a href="./info.html?id=${v.id}">
<!--图片地址-->
<img src="${v.preview || v.img}" alt="${v.title}">
</a>
<span>${v.total}套</span>
</div>
<div class="newest_text">
<a href="./info.html?id=${v.id}">
<p class="t">${v.title}</p>
<p class="source">${v.user}</p>
<p class="source">${ v.source.length > 5 ? '' :`${v.source}`}</p>
</a>
<div class="tags">
${(v.tags.map((item,index)=>{
return `<div class="tags_item">
<a href="./mechanism_info.html?id=${v.id}&amp;type=tags&amp;t=${v.title}">
${item.title}
</a>
</div> `
})).toString().replace(/,/g,"")}
</div>
</div>
</li>
</a>
`
})
return html;
}

View File

@@ -0,0 +1,20 @@
!(function(win, doc) {
function setFontSize() {
var winWidth = window.innerWidth;
doc.documentElement.style.fontSize = (winWidth / 375) * 100 + 'px';
}
var evt = 'onorientationchange' in win ? 'orientationchange' : 'resize';
var timer = null;
win.addEventListener(evt, function() {
clearTimeout(timer);
timer = setTimeout(setFontSize, 300);
}, false);
win.addEventListener("pageshow", function(e) {
if (e.persisted) {
clearTimeout(timer);
timer = setTimeout(setFontSize, 300);
}
}, false);
//初始化
setFontSize();
}(window, document));