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,44 @@
class Utils {
footer() {
var footerArr = [
{ title: '首页', icon: 'icon-home', href: 'index.html' },
{ title: '机构', icon: 'icon-jigou', href: 'mechanism.html' },
{ title: '模特', icon: 'icon-me', href: 'model.html' },
{ title: '我的', icon: 'icon-wo', href: 'my.html' },
];
// 用户当前正在访问的页面地址
// http://localhost:63342/page/mechanism.html
var currentPath = location.href;
$("body").innerHTML += `
<ul class="footer">
${
footerArr.map((v,index) => {
return `
<li class="${currentPath.includes(v.href) ? 'footer_active' : ''}">
<a href="./${v.href}">
<i class="iconfont ${v.icon}"></i>
<p>${v.title}</p>
</a>
</li>
`
}) .toString().replaceAll(",", "")
}
</ul>
`
}
$(className) {
return document.querySelector(className);
}
_(className) {
return document.querySelectorAll(className);
}
}
// 对象的解构赋值
var { footer, $, _ } = new Utils()
// var utils = new Utils()