diff --git a/_includes/projects.html b/_includes/projects.html index 262f0aa09..3d6290a08 100644 --- a/_includes/projects.html +++ b/_includes/projects.html @@ -7,7 +7,6 @@ - {% for repo in sorted_repos %}
diff --git a/assets/js/min/projects.min.js b/assets/js/min/projects.min.js index c8366360c..8a47e8349 100644 --- a/assets/js/min/projects.min.js +++ b/assets/js/min/projects.min.js @@ -1 +1 @@ -function toggleForked(){var e=document.querySelector(".fork-switch"),t=document.querySelector("div[id=forked]");e.checked?t.classList.remove("hidden"):t.classList.add("hidden")}document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".geopattern").forEach((e=>{var t=GeoPattern.generate(e.dataset.patternId).toDataUrl();e.style.backgroundImage=t}))})); \ No newline at end of file +function toggleForked(){var e=document.querySelector(".fork-switch"),t=document.querySelector("div[id=forked]");e.checked?t.classList.remove("hidden"):t.classList.add("hidden")}document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".geopattern").forEach((e=>{var t=GeoPattern.generate(e.dataset.patternId).toDataUrl();e.style.backgroundImage=t})),toggleForked()})); \ No newline at end of file diff --git a/assets/js/normal/projects.js b/assets/js/normal/projects.js index a00eedf04..7c5b63408 100644 --- a/assets/js/normal/projects.js +++ b/assets/js/normal/projects.js @@ -1,10 +1,3 @@ -document.addEventListener('DOMContentLoaded', () => { - document.querySelectorAll('.geopattern').forEach(el => { - var pattern = GeoPattern.generate(el.dataset.patternId).toDataUrl(); - el.style.backgroundImage = pattern; - }) -}) - function toggleForked() { var forkSwitch = document.querySelector('.fork-switch'), forked = document.querySelector('div[id=forked]'); @@ -14,4 +7,12 @@ function toggleForked() { } else { forked.classList.add('hidden'); } -} \ No newline at end of file +} + +document.addEventListener('DOMContentLoaded', () => { + document.querySelectorAll('.geopattern').forEach(el => { + var pattern = GeoPattern.generate(el.dataset.patternId).toDataUrl(); + el.style.backgroundImage = pattern; + }); + toggleForked(); +}) \ No newline at end of file diff --git a/minify.cmd b/minify.cmd index 9f85160c7..11129f753 100644 --- a/minify.cmd +++ b/minify.cmd @@ -1,2 +1,3 @@ :: 用于 Windows 命令行下缩减所有 js 代码 +:: 需要系统预先安装 terser (npm install -g terser) @ for /r assets\js\normal %%i in (*) do @terser %%i -mc -o assets\js\min\%%~ni.min.js