Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
syui committed Oct 15, 2024
1 parent 3d3e976 commit 9d9f50f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
1 change: 0 additions & 1 deletion layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"url": "{{ .Site.BaseURL }}"
}
</script>
<script src="/js/index.js"></script>

{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
Expand Down
3 changes: 2 additions & 1 deletion layouts/partials/star.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<iframe src="https://card.syui.ai/planet?g=sun" allowfullscreen frameborder="0" style="width:95%;height:600px;"></iframe>
<iframe src="https://card.syui.ai/planet" allowfullscreen frameborder="0" style="width:95%;height:600px;" id="planet"></iframe>
<script src="/js/index.js"></script>
26 changes: 26 additions & 0 deletions static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,29 @@ function blog_list_open() {
}
}

function replace() {
const link = document.getElementById('planet');
const date = new Date();
const durl = 'https://card.syui.ai/planet';
let url;
let u = date.getSeconds().toString().substr(-1);
console.log(u);
switch (u) {
case '0':
url = durl + "?g=sun";
break;
case '1':
url = durl + "?g=galaxy";
break;
case '2':
url = durl + "?g=neutron";
break;
case '3':
url = durl + "?g=earth";
break;
default:
url = durl + "?g=moon";
}
link.setAttribute('src', url);
}
replace();

0 comments on commit 9d9f50f

Please sign in to comment.