Skip to content

Commit

Permalink
fix: nosupport
Browse files Browse the repository at this point in the history
  • Loading branch information
teaSummer committed Aug 24, 2024
1 parent 9033df5 commit 4a2cee8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 4 deletions.
18 changes: 17 additions & 1 deletion assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ div[id]>*:first-child {
font-family: var(--font-family);
}

.noicon::after {
.noicon::after, .nosupport::after {
display: none !important;
}

Expand Down Expand Up @@ -380,6 +380,22 @@ pre {
transition: transform 0.6s linear;
}

.nosupport {
cursor: not-allowed !important;
}

.h-shake {
animation: h-shake 700ms ease-in-out;
}


@keyframes h-shake {
10%, 90% { transform: translate3d(-1px, 0, 0); }
20%, 80% { transform: translate3d(+2px, 0, 0); }
30%, 70% { transform: translate3d(-4px, 0, 0); }
40%, 60% { transform: translate3d(+4px, 0, 0); }
50% { transform: translate3d(-4px, 0, 0); }
}

@media (max-width: 768px) {
#目录 {
Expand Down
2 changes: 1 addition & 1 deletion data/utilityWebsite.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"官方网站 (©Mojang/©微软)": [
["Minecraft", "https://www.minecraft.net", "《我的世界》/《当个创世神》\n着重于让玩家探索、交互并改变一个动态生成1m³大小方块的世界"],
["Minecraft教育版", "https://education.minecraft.net/", "Minecraft特别为教室使用而设计的教学版本(大陆访问可能会出现404)"],
["Minecraft教育版", "https://education.minecraft.net/", "Minecraft Education\nMinecraft特别为教室使用而设计的教学版本(大陆访问可能会出现404)"],
["漏洞追踪器", "https://bugs.mojang.com", "Mojang Jira/Mojira\n用于反馈Bug"],
["基岩版开发者文档", "https://learn.microsoft.com/minecraft/creator/", "了解如何使用附加组件修改 Minecraft。创建皮肤,设计独特的体验,发现最新功能,并发展您作为Minecraft创作者的技能"],
["Feedback", "https://feedback.minecraft.net", ""],
Expand Down
1 change: 1 addition & 0 deletions scripts/init.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 初始化全局变量
let searchKeyword = '', searchableAbbr = '';

let hShake;
let notificationCount = '';
let visibility = true;

Expand Down
9 changes: 7 additions & 2 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -406,20 +406,25 @@ const pre_list = ((e) => {
// 内部链接
content = `<a class="button noicon" href="${url}" onclick="hashChanged();" ${title}</a>`;
// 找不到合适的外部链接
if (url == '#') content = `<a class="button noicon" ${title}</a>`;
if (url == '#') content = `<a class="button nosupport" ${title}</a>`;
} else {
// 外部链接
content = `<a class="button" href="${url}" target="_blank" ${title}</a>`;
if (importantPattern.test(title)) {
content = `<a class="button important" href="${url}" target="_blank" ${title.replace(importantPattern, '<text class="bold">$1</text>')}</a>`;
};
};
dom += template.replace('|DOM|', content);
dom += template.replace('|DOM|', content); // 应用模板
};
dom += '</details><hr>';
};
dom = dom.replace(/<hr>$/, '');
$(e).html(dom);
$('.nosupport').click(function() {
clearTimeout(hShake);
$(this).addClass('h-shake');
hShake = setTimeout(() => $(this).removeClass('h-shake'), 700);
});
});


Expand Down

0 comments on commit 4a2cee8

Please sign in to comment.