Skip to content

Commit 3765609

Browse files
authored
Update hexo_githubcalendar.js
1 parent 4ebdb81 commit 3765609

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

hexo_githubcalendar.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
(function(){
2+
if(document.getElementById('github_container')){
23
let github_canlendar = (git_user,git_githubapiurl, git_color) => {
34
let git_fixed = 'fixed';
45
let git_px = 'px';
@@ -179,7 +180,6 @@
179180
addlastmonth();
180181
let html = github_main_box(git_monthchange, git_data, git_user, git_color, git_total, git_thisweekdatacore, git_weekdatacore, git_oneyearbeforeday, git_thisday, git_aweekago, git_amonthago);
181182
append_div_gitcalendar(github_container, html);
182-
document.getElementById('github_loading').innerHTML = "";
183183
responsiveChart()
184184
}).catch(function (error) {
185185
console.log(error)
@@ -245,14 +245,10 @@
245245
} else {
246246
parent.appendChild(text)
247247
}
248-
};
249-
let loading_git = (color) => {
250-
loading = '<div id="github_loading" style="width:10%;height:100%;margin:0 auto;display: block"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 50 50" style="enable-background:new 0 0 50 50" xml:space="preserve"><path fill="' + color + '" d="M25.251,6.461c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615V6.461z" transform="rotate(275.098 25 25)"><animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 25 25" to="360 25 25" dur="0.6s" repeatCount="indefinite"></animateTransform></path></svg></div>';
251-
return loading
252248
};
253249
let github_container = document.getElementById('github_container');
254250
let github_loading = document.getElementById('github_loading');
255-
append_div_gitcalendar(github_container, loading_git(git_color[4]));
256-
github_canlendar(git_user,git_githubapiurl, git_color)})()
251+
github_canlendar(git_user,git_githubapiurl, git_color)}
252+
})()
257253

258254

0 commit comments

Comments
 (0)