Skip to content

Instantly share code, notes, and snippets.

@NoxArt
Created February 25, 2018 13:15
Show Gist options
  • Save NoxArt/59c5be36b01d6fcde21247c3a9f4ef48 to your computer and use it in GitHub Desktop.
Save NoxArt/59c5be36b01d6fcde21247c3a9f4ef48 to your computer and use it in GitHub Desktop.
KanColle Kc3Kai Ship lock show levels sciptlet
javascript:(function(){ $(".lship").each(function(){ var self = $(this); if( self.find(".ship-level").length ) { return; } var title = self.attr("title"); var level = parseInt(title ? title.match(/Lv\.(\d+)/)[1] : "0"); if( level == 0 ) { var levelSubelement = self.find(".ship_lv"); if( levelSubelement.length ) { level = parseInt(levelSubelement.text()); } } var levelElement = $("<div class='ship-level'/>").text(level); self.append(levelElement); }); if( $("#shipLevelStyles").length ) { return; } var styles = ".lship { overflow: visible !important; position: relative } " + ".ship-level { " + "content: attr(data-ship-level); padding: 1px 3px 0; color: white; background-color: rgb(180,40,0); border-radius: 4px; opacity: 0.8; " + "bottom: -3px; left: 50%; margin-left: -16px; position: absolute; " + "text-align: center; line-height: 1; text-shadow: 1px 1px 0 rgba(0,0,0,0.5); z-index: 1000; font-size: 65% " + "}"; var style = $("<style id='shipLevelStyles' />").text(styles); $("body").append(style); }())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment