Free javascript Hosting


girl.js

Uploaded on Nov 09 2021 11:24 by nmzmfhsvtxteensjxi

/*===================================================

Hi welcome to my crip I'm ht
I mean crib

there's a lot of shit here, most of which
i do not recall doing so if u wanna know how
i did something im not sure i can provide

anyway pls play hades & remember every day is
a fishing day :)

===================================================*/

$(document).ready(function(){
$(".tumblr_preview_marker___").remove();

var root = document.documentElement;

var customize_page = window.location.href.indexOf("/customize") > -1;
var on_main = window.location.href.indexOf("/customize") < 0;

/*----- TELL USER TO READ THE GUIDE -----*/
var ximvs = "data:image/svg+xml;charset=utf8,<svg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' version='1.1' id='Capa_1' x='0px' y='0px' viewBox='0 0 22.88 22.88' style='enable-background:new 0 0 22.88 22.88;' xml:space='preserve'> <path style='fill:black;' d='M0.324,1.909c-0.429-0.429-0.429-1.143,0-1.587c0.444-0.429,1.143-0.429,1.587,0l9.523,9.539 l9.539-9.539c0.429-0.429,1.143-0.429,1.571,0c0.444,0.444,0.444,1.159,0,1.587l-9.523,9.524l9.523,9.539 c0.444,0.429,0.444,1.143,0,1.587c-0.429,0.429-1.143,0.429-1.571,0l-9.539-9.539l-9.523,9.539c-0.444,0.429-1.143,0.429-1.587,0 c-0.429-0.444-0.429-1.159,0-1.587l9.523-9.539L0.324,1.909z'/> </svg>";

document.documentElement.style.setProperty('--ex','url("' + ximvs + '")');

if(customize_page){
$("body").append("<div class='nightmare'></div>");
$(".nightmare").append("<div class='bigcheese'>Please read <a href='https://t.co/L1SP2Y7t4B' title='open this in a new tab!'>this guide</a> to help with editing! <div class='notstonks'>(This message will not appear on your actual blog)</div></div>");
$(".nightmare").append("<div class='exdee'></div>");

$(".exdee").click(function(){
$(".nightmare").slideToggle(420);
setTimeout(function(){
$(".nightmare").remove();
},420);
})
}

/*--------- GLENJAMIN ---------*/
$(".customlink").each(function(){
if($(this).attr("href").indexOf('glenthemes') > -1 && $(this).attr("title").indexOf("glenthemes") > -1){
$(this).addClass("glenjamin");
}

if($(this).attr("href").indexOf("SITE-URL-HERE") > -1){
$(this).attr("href","#");
}
})
$(".glenjamin").append("<div class='merde'>");
$(".glenjamin .merde").append("<div class='couillon'>");

var couillon = "data:image/svg+xml;charset=utf8,<svg xmlns='http://www.w3.org/2000/svg' width='150pt' height='150pt' viewBox='0 0 150 150' preserveAspectRatio='xMidYMid meet'><g transform='translate(0,150) scale(0.1,-0.1)' fill='black' stroke='none'><path d='M635 1320 c-110 -44 -267 -105 -348 -137 -82 -32 -160 -69 -173 -82 l-24 -24 0 -358 c0 -357 0 -358 23 -383 15 -18 103 -58 287 -131 146 -58 272 -105 280 -105 27 0 534 202 554 221 18 17 19 35 17 382 -2 291 0 365 11 373 7 6 36 19 63 29 28 10 75 29 105 42 l55 24 -34 15 c-18 8 -45 14 -59 14 -14 0 -181 -61 -369 -136 l-344 -135 -52 19 c-275 104 -369 145 -353 154 34 19 571 228 586 228 9 0 78 -25 155 -55 147 -58 172 -62 220 -41 l30 14 -35 15 c-122 53 -350 137 -371 137 -13 -1 -114 -36 -224 -80z m-210 -365 c132 -52 249 -95 260 -95 11 0 123 41 248 90 126 50 232 90 238 90 5 0 9 -134 9 -338 l0 -338 -221 -87 c-122 -48 -225 -84 -230 -81 -5 3 -9 81 -9 173 0 147 -2 171 -17 189 -10 10 -66 36 -125 56 l-106 38 -43 -19 -43 -19 121 -43 c67 -24 124 -50 127 -58 3 -8 6 -84 6 -169 0 -117 -3 -154 -12 -154 -7 0 -112 41 -233 89 l-220 89 -3 341 c-1 188 1 341 5 341 5 0 116 -43 248 -95z'></path></g></svg>";

root.style.setProperty('--glenSVG','url("' + couillon + '")');

function chad(){
$("<a class='htangerine' href='//glenthemes.tumblr.com' title='coded by glenthemes'>glenthemes</a>").appendTo("body")[0];

$(".htangerine").css({
"position":"fixed",
"display":"block",
"bottom":0,
"padding-bottom":"18px",
"right":0,
"padding-right":"18px",
"font-family":"rubik",
"text-transform":"uppercase",
"letter-spacing":"1.5px",
"font-size":"9px",
"color":"var(--Character-Profile-MainText-Color)",
"z-index":"97"
});
}

/*----- check whether container should be semitransparent -----*/
var checktrans = $.trim(getComputedStyle(document.documentElement)
.getPropertyValue("--MainBox-SemiTransparent"));

if(checktrans == "yes"){
$(".mainbox").addClass("mb-semitrans")
}

/*----- adjust transparent img location -----*/
$(".the-transparent").each(function(){
var getsize = $(this).attr("size");
$(this).css("width",getsize);
$(this).css("height",getsize);


if($(this).is("[move-to-left]")){
if($(this).attr("move-to-left") !== ""){
var mleft = $(this).attr("move-to-left");
$(this).css("margin-left","calc(18px - " + mleft + ")");
$(this).removeAttr("move-to-left");
}
}

if($(this).is("[move-to-right]")){
if($(this).attr("move-to-right") !== ""){
var mright = $(this).attr("move-to-right");
$(this).css("margin-left","calc(18px - " + mright + ")");
var parsnip = $(this).css("margin-left");
$(this).css("margin-left","calc(0px - " + parsnip + ")");
$(this).removeAttr("move-to-right");
}
}

if($(this).is("[move-downwards]")){
if($(this).attr("move-downwards") !== ""){
var mdown = $(this).attr("move-downwards");
$(this).css("margin-top","calc(0px - " + getsize + " + " + mdown + ")");
$(this).removeAttr("move-downwards");
}
}

if($(this).is("[move-upwards]")){
if($(this).attr("move-upwards") !== ""){
var m_up = $(this).attr("move-upwards");
$(this).css("margin-top","calc(0px - " + getsize + " - " + m_up + ")");
$(this).removeAttr("move-upwards");
}
}


})

/*----- generate glowspikes -----*/
if($(".glowspikes").length){
var $deeznuts = $(".glowspikes");
$deeznuts.append("<div class='ls-cont'></div>");
$deeznuts.find(".ls-cont").append("<div class='ls-1'></div>");
$deeznuts.find(".ls-cont").append("<div class='ls-2'></div>");
$deeznuts.find(".ls-cont").append("<div class='ls-3'></div>");
$deeznuts.find(".ls-cont").append("<div class='ls-4'></div>");
$deeznuts.find(".ls-cont").append("<div class='ls-5'></div>");

$deeznuts.append("<div class='rs-cont'></div>");
$deeznuts.find(".rs-cont").append("<div class='rs-1'></div>");
$deeznuts.find(".rs-cont").append("<div class='rs-2'></div>");
$deeznuts.find(".rs-cont").append("<div class='rs-3'></div>");
$deeznuts.find(".rs-cont").append("<div class='rs-4'></div>");

if($(".glowspikes").is("[gap]")){
var gap = $(".glowspikes").attr("gap");
var gah = parseInt(gap)/2;
if(gah < 0){
gah = -gah;
$(".ls-cont").css("transform","translateX(" + gah + "px)");
$(".rs-cont").css("transform","translateX(-" + gah + "px)");
} else if(gah == 0){
$(".glowspikes").removeAttr('gap')
} else {
$(".ls-cont").css("transform","translateX(-" + gah + "px)");
$(".rs-cont").css("transform","translateX(" + gah + "px)");
}
}

if($(".glowspikes").is("[move-top]")){
var mtop = parseInt($(".glowspikes").attr("move-top"));
if(mtop == 0){
$(".glowspikes").removeAttr("move-top")
} else {
$(".glowspikes").css("transform","translateY(" + -mtop + "px)")
}
}

if($(".glowspikes").is("[move-bottom]")){
var mbot = parseInt($(".glowspikes").attr("move-bottom"));
if(mbot == 0){
$(".glowspikes").removeAttr("move-bottom")
} else {
$(".glowspikes").css("transform","translateY(" + mbot + "px)")
}
}

if($(".glowspikes").is("[move-left]")){
var mleft = parseInt($(".glowspikes").attr("move-left"));
if(mleft == 0){
$(".glowspikes").removeAttr("move-left")
} else {
$(".glowspikes").css("transform","translateX(" + -mleft + "px)")
}
}

if($(".glowspikes").is("[move-right]")){
var mright = parseInt($(".glowspikes").attr("move-right"));
if(mleft == 0){
$(".glowspikes").removeAttr("move-top")
} else {
$(".glowspikes").css("transform","translateX(" + mright + "px)")
}
}
}

/*----- init container -----*/
$(".leftcont").add($(".maincont")).wrapAll("<div id='vertigo-b'></div>");
$("#vertigo-b").wrap("<div id='vertigo-a'></div>");
$("#vertigo-a").wrap("<div id='horizontal-b'></div>");
$("#horizontal-b").wrap("<div id='horizontal-a'></div>");

/*----- init heading decor -----*/
if($(".banner").length){
var $banner = $(".banner");

/*----*/

$banner.prepend("<div class='blt'></div>");
$(".blt").after("<div class='kosm'></div>");

var $kosm = $(".kosm");
$kosm.append("<div class='f69'></div>");
$kosm.append("<div class='g69'></div>");
$kosm.append("<div class='h69'></div>");
$kosm.append("<div class='e-goof'></div>");
$kosm.append("<div class='goof'></div>");

$kosm.after("<div class='dis'></div>");
$(".dis").after("<div class='dit'></div>");
$(".dit").after("<div class='sp-l'></div>");

for(var trois=0; trois < 3; trois++){
$(".sp-l").append("<div class='sp-i'></div>")
}

$(".sp-l").after("<div class='sp-r'></div>");
for(var trois=0; trois < 3; trois++){
$(".sp-r").append("<div class='sp-i'></div>")
}
}

$(".main-heading").each(function(){
$(this).wrap("<div class='boc'></div>");
$(this).parent().prepend("<div class='bork'></div>");
$(this).before("<div class='dorb'></div>");
})

/*---------- TURN HEX TO RGB ----------*/
var mbb = getComputedStyle(document.documentElement)
.getPropertyValue("--MainBox-Background");

var boxBG = getComputedStyle(document.documentElement)
.getPropertyValue("--Menu-Character-Box-Background");

var inshad = getComputedStyle(document.documentElement)
.getPropertyValue("--Character-Profile-Title-Border-Inner");

/* hex -> rgb script: credit to AJFarkas */
/* stackoverflow.com/questions/21646738/28056903#28056903 */
function hexToRGB(hex) {
var r = parseInt(hex.slice(1, 3), 16),
g = parseInt(hex.slice(3, 5), 16),
b = parseInt(hex.slice(5, 7), 16);

return r + "," + g + "," + b;
}

root.style.setProperty('--MainBox-Background-RGB', hexToRGB(mbb));
root.style.setProperty('--Menu-Character-Box-Background-RGB', hexToRGB(boxBG));
root.style.setProperty('--Character-Profile-Title-Border-Inner-RGB', hexToRGB(inshad));


var fishimg = $(".the-transparent").attr("image");
$(".the-transparent").css("background-image","url(" + fishimg + ")");
$(".the-transparent").removeAttr("image");

/*------ if-zag ------*/
if($(".leftside-character").attr("src").indexOf("cdn.discordapp.com/attachments/382037367940448256/814691610038239262/zagrender02_.png") >=0){
$("<div class='zag-grad'>").insertBefore($(".leftside-character"));

var zagGrad = "data:image/svg+xml;charset=utf8,<svg xmlns='http://www.w3.org/2000/svg' width='446.000000pt' height='843.000000pt' viewBox='0 0 446.000000 843.000000' preserveAspectRatio='xMidYMid meet'><g transform='translate(0.000000,843.000000) scale(0.100000,-0.100000)' fill='black' stroke='none'><path d='M505 8388 c-61 -22 -103 -84 -211 -312 -86 -184 -86 -184 -30 -304 43 -92 58 -152 37 -152 -5 0 -24 15 -43 34 -60 60 -163 72 -208 24 -27 -30 -27 -89 1 -114 12 -10 35 -46 51 -79 17 -33 35 -63 40 -66 6 -4 33 -9 60 -12 43 -5 59 -14 107 -59 32 -29 104 -93 161 -143 56 -49 109 -100 117 -112 14 -21 7 -42 -98 -300 -61 -153 -157 -388 -211 -523 -131 -324 -185 -538 -213 -835 -3 -38 -15 -118 -26 -177 -23 -125 -20 -136 50 -217 27 -31 77 -92 112 -136 82 -104 230 -241 394 -367 72 -55 143 -118 159 -141 16 -23 51 -75 78 -114 l48 -73 0 -187 c0 -130 6 -239 21 -353 l20 -165 71 -67 c84 -80 84 -66 1 -273 -58 -146 -143 -405 -143 -440 0 -31 29 -71 130 -180 157 -169 292 -328 306 -362 17 -40 63 -51 136 -34 27 6 54 11 59 11 19 0 8 -20 -21 -35 -16 -8 -34 -24 -40 -36 -20 -36 -71 -331 -77 -442 -6 -100 -5 -109 15 -130 29 -31 42 -70 42 -128 0 -91 109 -992 138 -1144 16 -82 33 -171 36 -197 l7 -48 1356 0 c1286 0 1355 1 1350 17 -7 22 -126 299 -230 535 -21 47 -21 48 -2 184 15 116 17 171 11 353 -4 119 -11 250 -16 291 -4 41 -14 122 -20 180 -9 84 -20 123 -51 194 -43 97 -55 156 -64 321 -3 61 -8 121 -11 135 -6 38 7 50 82 69 120 31 158 62 151 123 -2 19 4 23 41 28 36 6 54 17 113 76 38 38 78 86 89 107 31 59 46 164 33 228 -21 97 -78 244 -148 379 -49 95 -51 121 -20 226 40 137 43 204 11 289 -15 39 -33 109 -41 157 -13 84 -16 90 -70 154 l-56 66 76 79 c42 44 81 91 87 105 11 24 9 29 -15 50 -28 24 -30 24 -257 24 l-228 0 -31 26 c-30 25 -31 29 -31 107 0 45 -4 87 -8 93 -13 21 -85 34 -182 34 -118 0 -139 10 -163 75 -23 64 -39 75 -103 75 l-53 0 -94 113 c-143 171 -147 177 -147 261 0 40 -5 132 -11 205 l-10 133 103 102 c100 98 229 250 257 304 7 14 17 58 22 98 6 57 18 93 53 162 61 118 61 155 0 116 l-25 -17 7 81 c8 90 -10 202 -31 202 -17 0 -22 -14 -30 -93 -7 -65 -7 -65 -31 -55 -23 11 -24 15 -24 117 0 113 -8 181 -20 181 -4 0 -15 -18 -24 -40 -9 -22 -19 -40 -24 -40 -4 0 -23 36 -41 80 -44 107 -76 164 -121 211 -44 47 -59 49 -66 9 -8 -35 -7 -35 -41 -13 -24 16 -26 16 -39 -2 -12 -16 -17 -17 -39 -5 -14 8 -80 66 -147 129 l-121 115 -23 -29 c-13 -17 -24 -33 -24 -37 0 -18 -23 -6 -51 27 -17 19 -35 35 -39 35 -4 0 -12 -33 -17 -72 l-8 -73 -63 -3 c-70 -3 -106 9 -395 127 -81 34 -152 61 -158 61 -20 0 -7 -59 46 -202 30 -82 55 -153 55 -158 0 -18 -29 -10 -35 9 -3 10 -18 21 -33 24 -15 3 -39 9 -53 12 -23 6 -27 3 -33 -25 -3 -18 -6 -49 -6 -69 0 -20 -9 -54 -21 -75 -28 -52 -31 -220 -4 -284 10 -24 15 -45 12 -48 -3 -3 -23 6 -44 20 -50 34 -63 33 -63 -6 0 -40 49 -118 104 -163 l41 -34 -23 -21 c-31 -29 -28 -37 18 -45 39 -7 40 -8 40 -45 0 -118 30 -165 150 -238 65 -39 84 -62 95 -115 3 -16 22 -45 42 -65 l36 -36 -6 -175 c-8 -201 -5 -196 -96 -206 -31 -4 -103 -22 -160 -40 -58 -18 -110 -31 -117 -28 -8 3 -32 35 -55 71 -90 144 -136 178 -269 206 -69 14 -78 18 -120 64 -25 28 -55 55 -67 61 -21 11 -23 19 -23 94 0 45 -7 154 -15 242 -17 183 -19 569 -5 695 5 47 14 134 19 194 5 60 14 113 20 119 6 6 11 23 11 37 0 14 9 42 20 63 43 80 122 294 127 344 5 43 1 64 -21 112 -24 55 -26 64 -16 127 11 80 12 171 1 198 -4 10 -36 33 -72 50 l-64 31 3 81 c5 103 -12 148 -64 170 -24 10 -50 13 -74 9 -25 -4 -41 -2 -45 5 -14 23 -90 50 -139 50 -46 0 -53 -3 -95 -48 -71 -74 -171 -211 -171 -235 0 -12 -4 -28 -9 -36 -8 -13 -12 -13 -27 -1 -14 12 -16 27 -11 95 9 118 23 154 77 185 58 34 70 59 70 152 0 68 -3 79 -22 92 -26 18 -116 20 -163 4z'></path></g></svg>";

$(".zag-grad").get(0).style.setProperty('--zagGrad','url("' + zagGrad + '")');

} else {
$(".leftside-character").each(function(){
var ih = $(this).height();
$(this).prev(".glowspikes").css("margin-top",-ih);

var smalltrans = $(this).prev().prev(".the-transparent");

smalltrans.css("top",0);
var st = smalltrans.css("margin-top");
smalltrans.css("margin-top","calc(" + st + " - " + ih + "px)");

if(ih == 0){
location.reload()
}
})
}

/*------ ADD BOTTOMLEFT TRIANGLE ------*/
$("[menu-character]").each(function(){
$("<div class='corner-triangle'>").prependTo($(this));
});

/*------ DIAMOND STUFF ------*/
$("img[chara-select-image]").each(function(){
$(this).wrap("<div class='diamond'>");
});

$(".diamond").each(function(){
$(this).wrap("<div class='carbonara'>");
var img = $(this).find("img[chara-select-image]");
img.wrap("<div class='dia'>");
$("<div class='uhh'>").insertBefore(img.parent(".dia"));
$("<div class='lastminuteframe'>").insertBefore(img.parent(".dia"));
$("<div class='tabthing'>").insertBefore(img.parent(".dia"));
$("<div class='diaframetop'>").insertBefore(img);
$("<div class='diaframebot'>").insertBefore(img);
});

// initialize diamond svg
var feckinsvg = "data:image/svg+xml;charset=utf8,<svg xmlns='http://www.w3.org/2000/svg' height='1200.000000pt' width='1200.000000pt' viewBox='0 0 1200.000000 1200.000000' preserveAspectRatio='xMidYMid meet'><g transform='translate(0.000000,1200.000000) scale(0.100000,-0.100000)' fill='black' stroke='none'><path d='M2995 9000 l-3000 -3000 3003 -3003 3002 -3002 3002 3002 3003 3003-3000 3000 c-1650 1650 -3002 3000 -3005 3000 -3 0 -1355 -1350 -3005 -3000z'></path></g></svg>";

root.style.setProperty('--DiamondMaskSVG','url("' + feckinsvg + '")');

$(".carbonara").each(function(){
$(this).wrap("<div class='flex'>");
});

$("[menu-character] h1").each(function(){
$(this).wrap("<div class='chara-select-text'>");
});

$("[menu-character] .description").each(function(){
$(this).appendTo($(this).prev(".chara-select-text"))
});

$(".chara-select-text").each(function(){
$(this).appendTo($(this).prev(".flex"))
});

$("img[chara-select-image]").each(function(){
// if user wants to resize the diamond image
if($(this).is("[size]")){
if($(this).attr("size") !== ""){
var size = $(this).attr("size");
var gensize = parseFloat(size) / 100.0;
$(this).width("calc(var(--Menu-Character-Image-Width) * " + gensize + ")");
}
}

// if user wants diamond image to fill
if($(this).is("[fill]")){
if($(this).attr("fill") == ""){
$("<div class='monde'>").insertBefore($(this));

var charaIMG = $(this).attr("src");
$(this).prev().css("background-image","url(" + charaIMG + ")")
$(this).remove();
}
}

if($(this).is("[simple-frame]")){
$(this).parents(".diamond").find(".lastminuteframe").remove();
} else {
$(this).parents(".diamond").find(".uhh").remove();
}
});

/*------ ADD LINEBREAK TO CHARACTER OVERVIEW STATS ------*/
$(".chara-select-text .description label").each(function(){
$("<br>").insertBefore($(this))
});

$(".chara-select-text .description br").each(function(){
if($(this).prev().length == 0){
$(this).remove();
}
});

/*----- LOADING BEHAVIORS -----*/
if(customize_page){
$(".loading-sigil, .shade").remove();
}

if(on_main){
$(".loading-sigil").fadeIn();

$(window).load(function(){
$(".shade").fadeOut();

setTimeout(function(){
$(".loading-sigil").fadeOut();
$("iframe#tumblr_controls, .iframe-controls--desktop").css("visibility","visible").addClass("opac")
},469);
});
}

// ready cursor onload to stop first-click from disappearing
$("*").one("mouseover",function(){
$("body").addClass("one");
setTimeout(function(){
$("body").removeClass("one");
},0)
});

/*------ MAIN HEADING STUFF ------*/
$(".textbar").each(function(){
$(this).wrap("<div class='ok'>")
});

$(".ok").each(function(){
$(this).insertBefore(".wwl");
})

/*------ GET & SET HEIGHT OF CHARACTER LIST ------*/
$(".mainbox").wrapInner("<div class='tempcont'>");
$(".charalist").wrap("<div class='ugh'>");

$(".ugh, .choosetext").wrapAll("<div class='hella'>");
$(".tempcont").wrap("<div class='mb'>");

/* wrapped in a function in case I need to call it again */
function calcHeight(){
var mbo = $(".hella").height() - $(".choosetext").outerHeight() + 12;
$(".charalist").css("max-height",mbo);
}

calcHeight();

/*---- KEYPAD SHORTCUTS -- CHARALIST ----*/
$(document).keydown(function(event){
// scroll to top of HOME is pressed
if(event.keyCode == 36){
$(".charalist").animate({scrollTop:0},420);
return false;
}

// scroll to bottom of END is pressed
if(event.keyCode == 35){
$(".charalist").animate({scrollTop:$(".charalist").prop("scrollHeight")},420);
return false;
}
});

// get bioheight
function res(){
$(".charon").each(function(){
var charon_ = $(this).height();
$(this).next(".text-entry").height(charon_ - 6)
});
}

// bioheight margin-top
function cactus(){
$(".text-entry").each(function(){
var wumpus = $(this).prev().prev("h1[character-name]").height() + 3;
$(this).css("margin-top",wumpus);
});
}

$(window).resize(function(){
res(); // get bioheight
calcHeight(); // get height of character list
});

/*----- DO THINGS WHEN YOU CLICK ON A CHARACTER -----*/
$("[menu-character]").click(function(){
// click a character to show that chara's bio
var getchara = $(this).attr("chara-id");
$(".un-chara").filter("[chara-id*=" + getchara + "]").css("display","table-row");

$(".hella").fadeOut(); // fadeOut charalist
$(".nextpan").fadeIn(); // fadeIn *that* chara's panel

res(); // get bioheight
cactus(); // bioheight margin-top
});

/*----- WRAP CHARACTER PANEL STUFF -----*/
$(".nextpan").wrapInner("<div class='cozy'>");
$(".back-to-characters").wrap("<div class='titwrap'>");

/*----- CLICK TO GO BACK TO CHARALIST -----*/
$(".back-to-characters").click(function(){
$(".nextpan").fadeOut();

setTimeout(function(){
$(".un-chara").hide();
},400);

$(".hella").fadeIn()
});

/*---- REWRAP CHARACTER PANELS ----*/
$(".chara-actual").each(function(){
if($(this).is("[chara-id]")){
if($(this).attr("chara-id") !== ""){
$(this).wrap("<div class='un-chara'>");
var thischar = $(this).attr("chara-id");
$(this).parent(".un-chara").attr("chara-id",thischar);
$(this).removeAttr("chara-id")
}
}
});

/*------ WRAP & GENERATE CHARACTER NAME H1 DECORATIONS ------*/
$(".chara-actual h1[character-name]").each(function(){
$(this).wrapInner("<div class='le-tit'>")
});

$(".le-tit").each(function(){
$(this).wrapInner("<div class='tit-txt'>");
});

$(".tit-txt").each(function(){
$(this).wrap("<div class='uhead'>")
});

$(".le-tit").each(function(){
$("<div class='ribbon'>").appendTo($(this));
});

$(".ribbon").each(function(){
$("<div class='r-dots'>").appendTo($(this));
$("<div class='r-dots'>").appendTo($(this));
$("<div class='r-dots'>").appendTo($(this));
$("<div class='r-dots'>").appendTo($(this));
$("<div class='r-dots'>").appendTo($(this));
$("<div class='r-dots'>").appendTo($(this));

$(this).append("<div class='ribs'>")
});

$(".ribs").each(function(){
$("<div class='rib'>").appendTo($(this));
$("<div class='rib'>").appendTo($(this));
$("<div class='rib'>").appendTo($(this));
$("<div class='rib'>").appendTo($(this));
$("<div class='rib'>").appendTo($(this));
$("<div class='rib'>").appendTo($(this));
});

$("[menu-character]").click(function(){
$(".r-dots").each(function(){
var genheight = $(this).parents(".le-tit").height() / 12;
$(this).height(genheight);
$(this).width(genheight);
$(this).css("margin-top",genheight);

if(!$(this).prev().length){
$(this).css("margin-top",genheight / 2)
}

$(this).parent().css("margin-left",genheight);
$(this).parent().css("margin-right",genheight);
});

$(".rib").each(function(){
var genheight = $(this).parents(".le-tit").height() / 12;
$(this).height(genheight);
$(this).css("margin-top",genheight);

if(!$(this).prev().length){
$(this).css("margin-top",genheight / 2)
}
});
});

var divs = $(".r-dots");
for(var i=0; i<divs.length;) {
i += divs.eq(i).nextUntil(':not(.r-dots)').andSelf().wrapAll('<div class="dotscont">').length;
}

/*--------- LONG IMAGE ---------*/
$("img[image-in-longcolumn]").each(function(){
if($(this).is("[size]")){
if($(this).attr("size") !== ""){
var size = $(this).attr("size");
var gensize = parseFloat(size) / 100.0;
$(this).width("calc(var(--Character-Profile-Image-Width) * " + gensize + ")");
}
}

if($(this).is("[fill]")){
if($(this).attr("fill") == ""){
$("<div class='fillet'>").insertBefore($(this));

var charaIMG = $(this).attr("src");
$(this).prev().css("background-image","url(" + charaIMG + ")")
$(this).remove();
}
}
});

/*------ ADD SPIKES TO LONG IMAGE ------*/
$(".longside").each(function(){
$(this).wrap("<div class='charon'>")
if($(this).find("[no-spikes]").length == 0){
$("<div class='woespikes'>").appendTo($(this));

var spcont = $(this).find(".woespikes");
$("<div class='woe-12'>").appendTo(spcont);
$("<div class='woe-1'>").appendTo(spcont);
$("<div class='woe-2'>").appendTo(spcont);
$("<div class='woe-3'>").appendTo(spcont);
$("<div class='woe-4'>").appendTo(spcont);
$("<div class='woe-5'>").appendTo(spcont);
$("<div class='woe-6'>").appendTo(spcont);
$("<div class='woe-7'>").appendTo(spcont);
$("<div class='woe-10'>").appendTo(spcont);
}
});

/*----- LONG IMAGE: BACKGROUND IMAGE [OR] COLOR -----*/
var longBG = getComputedStyle(document.documentElement)
.getPropertyValue("--Character-Profile-Image-Background-Image");

if(longBG !== "" || longBG !== "none" || longBG !== "NONE"){
root.style.setProperty('--Character-Profile-Image-Background', 'url(' + longBG + ')');
}

if(longBG == "none" || longBG == "NONE" || longBG == ""){
root.style.setProperty('--Character-Profile-Image-Background', 'linear-gradient(var(--Character-Profile-Image-Background), var(--Character-Profile-Image-Background))');
}

// remove bottom gap from last paragraph
// if there's nothing after it
$(".text-entry p").each(function(){
if(!$(this).next().length){
$(this).css("margin-bottom",0)
}
});

// if user wants to adjust image positioning
$("img").each(function(){
if($(this).is("[move-to-left]")){
if($(this).attr("move-to-left") !== ""){
var thisleft = $(this).attr("move-to-left");
$(this).css("margin-right",thisleft)
}
}

if($(this).is("[move-to-right]")){
if($(this).attr("move-to-right") !== ""){
var thisright = $(this).attr("move-to-right");
$(this).css("margin-left",thisright)
}
}

if($(this).is("[move-upwards]")){
if($(this).attr("move-upwards") !== ""){
var thisup = $(this).attr("move-upwards");
$(this).css("margin-bottom",thisup)
}
}

if($(this).is("[move-downwards]")){
if($(this).attr("move-downwards") !== ""){
var thisdown = $(this).attr("move-downwards");
$(this).css("margin-top",thisdown)
}
}
});

/*------ ADD LINEBREAK TO CHARACTER BIO STATS ------*/
$(".chara-actual .text-entry label").each(function(){
$("<br>").insertBefore($(this))
});

$(".chara-actual .text-entry br").each(function(){
if($(this).prev().length == 0){
$(this).remove();
}
});

// tooltips by malihu
$("a[title]").style_my_tooltips({
tip_follows_cursor:true,
tip_delay_time:50,
tip_fade_speed:0,
attribute:"title"
});

// return range of types used
var typnos = $("[menu-character]").map(function(){
return $(this).attr("type");
}).get();

// get highest number in the range
var maxtype = Math.max.apply(null, typnos);

// if types have been used multiple times,
// only return one instance of that type
function onlyUnique(value, index, self) {
return self.indexOf(value) === index;
}

var a = typnos;
var unique = a.filter(onlyUnique);

var difftypes = String(unique); // turn into string
var typesCount = difftypes.split(",").length + 1; // no. of unique types
var commaCount = difftypes.split(",").length; // no. of commas

// allocate type-specific color
for (let i = 1; i <= maxtype; i++) {
$("[menu-character][type='" + i + "'] .corner-triangle").css("border-color","transparent transparent transparent var(--Character-TYPE" + i + "-Color)");
$("[menu-character][type='" + i + "'] .chara-select-text h1").css("color","var(--Character-TYPE" + i + "-Color)");

$("[menu-character][type='" + i + "'] .tabthing").css("background","var(--Character-TYPE" + i + "-Color)");
}

// remove triangle if user doesn't want a triangle
$(".corner-triangle").each(function(){
if($(this).parent().is("[no-triangle]")){
$(this).removeAttr("style")
}
});

// initialize tab svg
var tabby = "data:image/svg+xml;charset=utf8,<svg xmlns='http://www.w3.org/2000/svg' height='199.000000pt' width='199.000000pt' viewBox='0 0 199.000000 199.000000' preserveAspectRatio='xMidYMid meet'><g transform='translate(0.000000,199.000000) scale(0.100000,-0.100000)' fill='black' stroke='none'><path d='M1136 1832 c-3 -5 152 -165 344 -357 l348 -348 -5 69 -6 69 -158 165 c-87 91 -211 217 -276 281 l-118 117 -62 6 c-34 3 -64 2 -67 -2z'></path></g></svg>";

root.style.setProperty('--TabSVG','url("' + tabby + '")');

// customlinks
$(".naav").each(function(){
$(this).prepend("<div class='everbar'>");
});

$(".everbar").each(function(){
$(this).prepend("<div class='everbot-0'>");
$(this).prepend("<div class='everbot-1'>");

$(this).prepend("<div class='evertop-0'>");
$(this).prepend("<div class='evertop-1'>");
});

var barw = getComputedStyle(document.documentElement)
.getPropertyValue("--CustomLinks-Bar-Width");
var carp = parseFloat(barw) / 100.0;

root.style.setProperty('--PARS',carp);

$(".customlink").each(function(){
if($(this).parent().is("[simple-frame]")){
$("<div class='simp'>").prependTo($(this))
} else {
$("<div class='film'>").prependTo($(this))
}
});

var divs = $(".customlink");
for(var i=0; i<divs.length;) {
i += divs.eq(i).nextUntil(':not(.customlink)').andSelf().wrapAll('<div class="coast">').length;
}

if($(".glenjamin").length == 0){
chad()
}
});//end ready

Back to list