1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-02-15 03:51:51 +00:00
openmptcprouter-feeds/luci-theme-design/htdocs/luci-static/design/js/style.js
Ycarus (Yannick Chabanois) 94f19376e9 Add luci-theme-design
2024-04-11 11:10:17 +02:00

28 lines
No EOL
1.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(function ($) {
// 修复某些插件导致在https下env(safe-area-inset-bottom)为0的情况
var url = self.location.href;
if ((/(iPhone|iPad|iPod|iOS|Mac|Macintosh)/i.test(navigator.userAgent)) && url.indexOf("openclash") != -1 ) {
var oMeta = document.createElement('meta');
oMeta.content = 'width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0,viewport-fit=cover';
oMeta.name = 'viewport';
document.getElementsByTagName('head')[0].appendChild(oMeta);
}
// 设置indicators图标(放在menu script执行之前passwall某些代码错误中断导致失败)
document.getElementById("indicators").addEventListener('DOMSubtreeModified', function () {
var child = document.getElementById("indicators");
if (child.firstElementChild.getAttribute("data-indicator") != "uci-changes") {
child.firstElementChild.textContent = eval("'\ue6b9'")
}
}, false);
// 监听窗口大小动态设置header box阴影长度
$(window).resize( function () {
if (window.innerWidth <= 992) {
$("header").css("box-shadow", "0 2px 4px rgb(0 0 0 / 8%)")
} else {
$("header").css("box-shadow", "17rem 2px 4px rgb(0 0 0 / 8%)")
}
});
})(jQuery);