Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
std-microblock authored Apr 3, 2022
1 parent 98f136b commit 457b02d
Show file tree
Hide file tree
Showing 12 changed files with 3,116 additions and 0 deletions.
7 changes: 7 additions & 0 deletions addons/addons.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"name":"cssLoader",
"file":"cssLoader.js",
"devMode":true
}
]
25 changes: 25 additions & 0 deletions addons/cssLoader.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
var cssLoaderLiveReload={}
fetch("https://music.163.com/betterncm_api/read_file?stylesheets/all.json")
.then(function(resp){return resp.json()})
.then(function(resp){
for(var x=0;x<resp.length;x++){
var style=resp[x];
var link=document.createElement("link");
link.rel="stylesheet";
link.href="https://music.163.com/betterncm_api/read_file?stylesheets/"+style.file;
document.head.appendChild(link);
if(style.devMode){

setInterval(function(){
fetch("https://music.163.com/betterncm_api/read_file?stylesheets/"+style.file)
.then(function(resp){return resp.text()})
.then(function(resp){
if(!cssLoaderLiveReload[style.file])
cssLoaderLiveReload[style.file]=resp

if(resp!=cssLoaderLiveReload[style.file])document.location.reload()
})
},1000);
}
}
})
6 changes: 6 additions & 0 deletions addons/stylesheets/all.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"file":"block.css",
"devMode":true
}
]
4 changes: 4 additions & 0 deletions addons/stylesheets/block.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
div{
border-radius: 0px !important;
/* box-shadow: 2px 3px 6px rgba(0, 0, 0, 0.404); */
}
Loading

0 comments on commit 457b02d

Please sign in to comment.