Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var sTag = document.scripts[document.scripts.length-1];
- var parentTag = sTag.parentNode;
- function genSupport(s){
- this.supports = (s.supports ? s.supports : [])
- this.styleDef = {
- scale: (s.scale ? s.scale : "1"),
- radius: (s.radius ? s.radius : "0px"),
- spacing: (s.spacing ? s.spacing : "5px"),
- overlay: (s.overlay ? s.overlay : "#000"),
- opacity: (s.opacity ? s.opacity : "0"),
- color: (s.color ? s.color : "#fff"),
- font: (s.font ? s.font : "Poiret One")
- }
- this.CSSStyle = `
- <style>
- #fpic{
- width: 100%;
- height: 100%;
- font-family: '`+this.styleDef.font+`';
- color: `+this.styleDef.color+`;
- text-alin: center;
- background: `+this.styleDef.overlay+`;
- border-radius: `+this.styleDef.radius+`;
- opacity: 0;
- transition: opacity .4s ease-in;
- -moz-transition: opacity .4s ease-in;
- -webkit-transition: opacity .4s ease-in;
- -o-transition: opacity .4s ease-in;
- cursor: context-menu;
- }
- #fpic:hover{
- opacity: `+this.styleDef.opacity+`;
- transition: opacity .4s ease-in;
- -moz-transition: opacity .4s ease-in;
- -webkit-transition: opacity .4s ease-in;
- -o-transition: opacity .4s ease-in;
- }
- </style>`;
- this.template = ``;
- this.supports .forEach(function(val, index, arr){
- this.style = "background-size: cover; background-repeat: no-repeat; background-image: url(http://www.imvu.com/catalog/web_av_pic.php?av="+val+"); width: calc(160px * "+this.styleDef.scale+"); height: calc(220px * "+this.styleDef.scale+"); border-radius: "+this.styleDef.radius+"; margin-left: "+this.styleDef.spacing+"; margin-bottom: "+this.styleDef.spacing+"; float: left";
- this.template = this.template + `
- <div style="`+this.style+`">
- <div id="fpic">
- <div style="position: relative; top: calc(50% - 15px);">`+val+`</div>
- </div>
- </div>`
- });
- $(parentTag).append(this.CSSStyle + this.template);
- return this.CSSStyle + this.template
- }
Add Comment
Please, Sign In to add comment