Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Lichess Isepic-Chess-Font
- // @author ajax333221
- // @description overwrites the chess font images with Isepic-Chess-Font
- // @version 1.1
- // @include https://lichess.org
- // @include https://lichess.org/*
- // ==/UserScript==
- window.onload=function(){
- ownCss=document.createElement("style");
- ownCss.type="text/css";
- var baseImageUrl="https://ajax333221.github.io/isepic-chess-ui/css/images/chess-fonts/isepic";
- var baseCss="background-position: center center;";
- baseCss+="background-size: 70%;";
- baseCss+="background-repeat: no-repeat;";
- var pieces = [
- {className: ".is2d .black.pawn", imageName: "bp.png"},
- {className: ".is2d .black.knight", imageName: "bn.png"},
- {className: ".is2d .black.bishop", imageName: "bb.png"},
- {className: ".is2d .black.rook", imageName: "br.png"},
- {className: ".is2d .black.queen", imageName: "bq.png"},
- {className: ".is2d .black.king", imageName: "bk.png"},
- {className: ".is2d .white.pawn", imageName: "wp.png"},
- {className: ".is2d .white.knight", imageName: "wn.png"},
- {className: ".is2d .white.bishop", imageName: "wb.png"},
- {className: ".is2d .white.rook", imageName: "wr.png"},
- {className: ".is2d .white.queen", imageName: "wq.png"},
- {className: ".is2d .white.king", imageName: "wk.png"}
- ];
- var styleInnerHtml="";
- for(let i=0, len=pieces.length; i<len; i++){
- styleInnerHtml+=pieces[i].className+" {";
- styleInnerHtml+="background-image: url('"+baseImageUrl+"/"+pieces[i].imageName+"');";
- styleInnerHtml+=baseCss;
- styleInnerHtml+="}";
- }
- ownCss.innerHTML=styleInnerHtml;
- document.body.appendChild(ownCss);
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement