|
|
| Line 2: |
Line 2: |
| <style> | | <style> |
| #charPanel button { | | #charPanel button { |
| | float:left; |
| | padding: 5px 10px; |
| | font-size: 12px; |
| | line-height: 1.5; |
| | border-radius: 3px; |
| | color: #fff; |
| background-color: #b36e14; | | background-color: #b36e14; |
| border: 1px solid #64320d; | | border-color: #9c6011; |
| outline: none; | | margin-bottom: 0; |
| | font-weight: normal; |
| | text-align: center; |
| | vertical-align: middle; |
| | touch-action: manipulation; |
| cursor: pointer; | | cursor: pointer; |
| padding: 0px 10px; | | background-image: none; |
| transition: 0.3s; | | border: 1px solid transparent; |
| display: inline; | | white-space: nowrap; |
| color: white;
| |
| height: 25px;
| |
| }
| |
| #breaker {
| |
| display: block;
| |
| text-align: left;
| |
| font-size: 20px;
| |
| font-weight: bold;
| |
| padding: 5px;
| |
| } | | } |
|
| |
|
| div.charFilter select{
| | |
| border: 1px solid #000;
| |
| color: #fff;
| |
| background: #444;
| |
| position: relative;
| |
| width: 150px;
| |
| float: left;
| |
| height: 25px;
| |
| margin-right: 5px;
| |
| }
| |
| div.charFilter{
| |
| display: inline-block;
| |
| padding-left: 15px;
| |
| padding-right: 15px;
| |
| width: 100%;
| |
| }
| |
| div.filterLeft{
| |
| float: left;
| |
| }
| |
| div.filterRight{
| |
| float: right;
| |
| }
| |
| div.charBox { | | div.charBox { |
| display: inline-block; | | display: inline-block; |
| Line 58: |
Line 38: |
| } | | } |
| div#charPanel { | | div#charPanel { |
| text-align: center;
| | min-height: 100px; |
| | text-align: center; |
| background: rgba(68,68,68,0.2); | | background: rgba(68,68,68,0.2); |
| border-radius: 15px; | | border-radius: 15px; |
| border: 2px solid #8b4513; | | border: 2px solid #8b4513; |
| padding: 10px; | | padding: 10px; |
| | } |
| | |
| | input#filter { |
| | float:right; |
| | width: 200px; |
| | height: 36px; |
| | padding: 6px 12px; |
| | margin-bottom: 8px; |
| | font-size: 14px; |
| | line-height: 1.6; |
| | color: #555555; |
| | background-color: #fff; |
| | background-image: none; |
| | border: 1px solid white; |
| | border-radius: 4px; |
| | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); |
| | -webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; |
| | transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; |
| | } |
| | |
| | input#filter:focus { |
| | border-color: #edad5a; |
| | outline: 0; |
| | box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(237, 173, 90, 0.6); |
| } | | } |
|
| |
|
| Line 99: |
Line 104: |
| } | | } |
|
| |
|
| @media only screen and (max-device-width: 768px) { | | @media screen and (max-device-width: 768px) { |
| | button#nametoggle { |
| | display: none !important; |
| | } |
| | input#filter { |
| | float:none; |
| | } |
| div.charBox img { | | div.charBox img { |
| width:85px; | | width:85px; |
| Line 105: |
Line 116: |
| div.charBox { | | div.charBox { |
| width: calc((85% / 6) - 3px); | | width: calc((85% / 6) - 3px); |
| | filter: opacity(100%); |
| } | | } |
| div.charName { | | div.charName { |
| font-size: 10px; | | font-size: 10px; |
| | display: block; |
| } | | } |
| } | | } |
| </style> | | </style> |
| | | <div id="guide"> |
| | <h3><span class="mw-headline" id="Quick_Reference_Search">Quick Reference Search</span></h3> |
| | <ul><li> Character Names (<a class="link" onclick="filter('Bumbley')">Bumbley</a>)</li> |
| | <li> Player Names (<a class="link" onclick="filter('Justin')">Justin</a>, <a class="link" onclick="filter('Deadbones')">Deadbones</a>)</li> |
| | <li> Races (<a class="link" onclick="filter('Elf')">Elf</a>, <a class="link" onclick="filter('Porc')">Porc</a>)</li> |
| | <li> Classes (<a class="link" onclick="filter('Wizard')">Wizard</a>, <a class="link" onclick="filter('Paladin')">Paladin</a>)</li> |
| | <li> Status/Attribute (<a class="link" onclick="filter('Ageless')">Ageless</a>, <a class="link" onclick="filter('Believer')">Believer</a>)</li> |
| | <li> Type (<a class="link" onclick="filter('Minor')">Minor</a>, <a class="link" onclick="filter('Companion')">Companion</a>)</li> |
| | <li> Campaign (<a class="link" onclick="filter('s1c1-')">Season 1 Campaign 1 - Band of Thieves</a>) |
| | <ul><li> NPC Within Campaign (<a class="link" onclick="filter('s1c1-n')">Band of Thieves NPC</a>)</li> |
| | <li> Players Within Campaign (<a class="link" onclick="filter('s1c1-p')">Band of Thieves Players</a>)</li></ul></li> |
| | </ul> |
| | </div> |
| | <br> |
| <div id="charPanel"> | | <div id="charPanel"> |
| <img id="loading" height="500" src="/images/4/42/Loading.gif"> | | <img id="loading" height="500" src="/images/4/42/Loading.gif"> |
| Line 128: |
Line 154: |
| obj["image"] = "<!--{$data.image}-->"; | | obj["image"] = "<!--{$data.image}-->"; |
| obj["link"] = "<!--{$data.link|escape:'javascript'}-->"; | | obj["link"] = "<!--{$data.link|escape:'javascript'}-->"; |
| obj["campaigns"] = <!--{$data.campaigns}-->; | | obj["keywords"] = <!--{$data.keywords}-->; |
| series1.push(obj); | | series1.push(obj); |
| <!--{/foreach}--> | | <!--{/foreach}--> |
| | var list = []; |
| for(var i = 0; i < series1.length; i++){ | | for(var i = 0; i < series1.length; i++){ |
| var campaigns = ""; | | var keywords = " "; |
| for(var j = 0; j < series1[i].campaigns.length; j++){ | | for(var j = 0; j < series1[i].keywords.length; j++){ |
| campaigns = campaigns + " " + series1[i].campaigns[j];
| | if(list.indexOf(series1[i].keywords[j]) < 0){ |
| | list.push(series1[i].keywords[j]); |
| } | | } |
| campaigns = campaigns.substring(1);
| | keywords = keywords + " " + series1[i].keywords[j]; |
| if(campaigns.indexOf("s1c") > -1){
| |
| $("div#charHolder").append("<div class='charBox' data-campaigns='" + campaigns + "' data-name='" + series1[i].name + "'><a class='charLink' href='" + series1[i].link +"'> <img src='" + series1[i].image + "'> <div class='charName'>" + series1[i].name + "</div></a></div>");
| |
| } | | } |
| | keywords = keywords.substring(1); |
| | $("div#charHolder").append("<div class='charBox' data-keywords='" + keywords + "' data-name='" + series1[i].name + "'><a class='charLink' href='" + series1[i].link +"'> <img src='" + series1[i].image + "'> <div class='charName'>" + series1[i].name + "</div></a></div>"); |
| } | | } |
| $("div#charPanel").prepend("<div class='charFilter'><div class='filterLeft'></div> <div class='filterRight'></div></div>"); | | console.log(list); |
| $("div.filterLeft").append("<select id='mainFilter'><option>Season 1</option><option>Season 2</option><option>Season 3</option>");
| | $("div#charPanel").prepend('<input type="text" id="filter" onkeyup="charFilter()" placeholder="Search..."><br><br>'); |
| $("div.filterRight").append("<select id='seasonFilter-s1'><option>Season 1 Characters</option><option>Band of Thieves</option> <option>Porc Hunters</option> <option>The Jewel of the Dingo Isles</option> <option>The Sunswords</option> <option>The Unseen Rogues</option> <option>Kobold Headhunters</option> <option>Zarlin Catacombs</option> <option>The New Crew</option> <option>Silvermine Mountains</option><option>Guild of Explorers</option><option>Battle of the Bards</option><option>The Blood Snake Queen</option><option>The Death of Virgo</option><option>Player Characters</option><option>NPC Characters</option><option>Minor Characters</option></select> <select id='seasonFilter-s2'><option>Season 2 Characters</option> <option>Woodcarvers</option> <option>Okagnoma Guild Hall</option> <option>Murder Bros</option> <option>The Cobblers</option> <option>The Tower of Ultimate Wizardry: Chapter One</option> <option>Unexpected Discovery</option> <option>Buckeroos</option> <option>Fall of Dundinborough</option> <option>Den of Devils</option> <option>The Skeleton King</option><option>Player Characters</option><option>NPC Characters</option><option>Minor Characters</option></select> <select id='seasonFilter-s3'><option>Season 3 Characters</option><option>The Grand Paladin Order</option><option>The Senate of Deadlantis</option><option>Player Characters</option><option>NPC Characters</option><option>Minor Characters</option></select>");
| | $("#filter").before("<button id='nametoggle' onclick='toggleNames(this)'>Toggle Names</button>"); |
| $("#mainFilter").after("<button id='nametoggle' onclick='toggleNames(this)'>Toggle Names</button>"); | | $("#filter").hide(); |
| $(".charFilter").hide(); | | $("#nametoggle").hide(); |
| /* Default */ | | /* Default */ |
|
| |
| $("div.filterRight select:not(#seasonFilter-s1)").hide();
| |
| $(".charBox:not([data-campaigns*='s1c'])").hide();
| |
| var firstChange = true;
| |
| var allS1;
| |
| var allS2;
| |
| var allS3;
| |
| $("#mainFilter").change(function() {
| |
| if(firstChange){
| |
| loadOther();
| |
| allS1 = $(".charBox[data-campaigns*='s1c']");
| |
| allS2 = $(".charBox[data-campaigns*='s2c']");
| |
| allS3 = $(".charBox[data-campaigns*='s3c']");
| |
| firstChange=false;
| |
| }
| |
| $("div.filterRight select").hide();
| |
| if($("#nametoggle").css("background-color") == "rgb(137, 84, 15)"){
| |
| $("#nametoggle").click();
| |
| }
| |
| if ($(this).val() == "Season 1") {
| |
| $("#seasonFilter-s1").show();
| |
| $('div.filterRight select:not(#seasonFilter-s1)').prop('selectedIndex', 0);
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS1.length; i++){
| |
| $("#charHolder").append(allS1[i]);
| |
| }
| |
| $("div.charBox[data-campaigns*='s1'").show();
| |
| }
| |
| if ($(this).val() == "Season 2") {
| |
| $("#seasonFilter-s2").show();
| |
| $('div.filterRight select:not(#seasonFilter-s2)').prop('selectedIndex', 0);
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS2.length; i++){
| |
| $("#charHolder").append(allS2[i]);
| |
| }
| |
| $("div.charBox[data-campaigns*='s2'").show();
| |
| }
| |
| if ($(this).val() == "Season 3") {
| |
| $("#seasonFilter-s3").show();
| |
| $('div.filterRight select:not(#seasonFilter-s3)').prop('selectedIndex', 0);
| |
| $("#charHolder").empty();
| |
|
| |
| for(var i = 0; i < allS3.length; i++){
| |
| $("#charHolder").append(allS3[i]);
| |
| }
| |
| $("div.charBox[data-campaigns*='s3'").show();
| |
| }
| |
| });
| |
|
| |
| $("#seasonFilter-s1").change(function() {
| |
| $("div.charBox").hide();
| |
| $("span#breaker").remove();
| |
| if ($(this).val() == "Season 1 Characters") {
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS1.length; i++){
| |
| $("#charHolder").append(allS1[i]);
| |
| }
| |
| $("div.charBox[data-campaigns*='s1'").show();}
| |
| if ($(this).val() == "Band of Thieves") {
| |
| $("div.charBox[data-campaigns*='s1c1-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s1c1-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s1c1-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s1c1-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Porc Hunters") {
| |
| $("div.charBox[data-campaigns*='s1c2-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s1c2-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s1c2-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s1c2-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "The Jewel of the Dingo Isles") {
| |
| $("div.charBox[data-campaigns*='s1c3-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s1c3-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s1c3-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s1c3-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "The Sunswords") {
| |
| $("div.charBox[data-campaigns*='s1c5-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s1c5-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s1c5-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s1c5-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "The Unseen Rogues") {
| |
| $("div.charBox[data-campaigns*='s1c6-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s1c6-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s1c6-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s1c6-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Kobold Headhunters") {
| |
| $("div.charBox[data-campaigns*='s1c7-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s1c7-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s1c7-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s1c7-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Zarlin Catacombs") {
| |
| $("div.charBox[data-campaigns*='s1c8-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s1c8-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s1c8-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s1c8-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "The New Crew") {
| |
| $("div.charBox[data-campaigns*='s1c9-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s1c9-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s1c9-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s1c9-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Silvermine Mountains") {
| |
| $("div.charBox[data-campaigns*='s1c10-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s1c10-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s1c10-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s1c10-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Guild of Explorers") {
| |
| $("div.charBox[data-campaigns*='s1c11-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s1c11-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s1c11-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s1c11-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Battle of the Bards") {
| |
| $("div.charBox[data-campaigns*='s1c12-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s1c12-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s1c12-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s1c12-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "The Blood Snake Queen") {
| |
| $("div.charBox[data-campaigns*='s1c13-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s1c13-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s1c13-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s1c13-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "The Death of Virgo") {
| |
| $("div.charBox[data-campaigns*='s1c14-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s1c14-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s1c14-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s1c14-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Player Characters") {
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS1.length; i++){
| |
| $("#charHolder").append(allS1[i]);}
| |
| $("div.charBox").hide();
| |
| for(var i = 1; i <= 14; i++){
| |
| $("div.charBox[data-campaigns*='s1c" + i + "-p']").show();}
| |
| }
| |
| if ($(this).val() == "NPC Characters") {
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS1.length; i++){
| |
| $("#charHolder").append(allS1[i]);}
| |
| $("div.charBox").hide();
| |
| for(var i = 1; i <= 14; i++){
| |
| $("div.charBox[data-campaigns*='s1c" + i + "-n']").show();}
| |
| }
| |
| if ($(this).val() == "Minor Characters") {
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS1.length; i++){
| |
| $("#charHolder").append(allS1[i]);}
| |
| $("div.charBox").hide();
| |
| for(var i = 1; i <= 14; i++){
| |
| $("div.charBox[data-campaigns*='s1c']").show();}
| |
| $("div.charBox a:not([href*='Minor_Characters'])").parent().hide();
| |
| }
| |
| });
| |
|
| |
| $("#seasonFilter-s2").change(function() {
| |
| $("div.charBox").hide();
| |
| $("span#breaker").remove();
| |
|
| |
| if ($(this).val() == "Season 2 Characters") {
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS2.length; i++){
| |
| $("#charHolder").append(allS2[i]);
| |
| }
| |
| $("div.charBox[data-campaigns*='s2'").show();}
| |
| if ($(this).val() == "Woodcarvers") {
| |
| $("div.charBox[data-campaigns*='s2c1-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s2c1-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s2c1-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s2c1-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Okagnoma Guild Hall") {
| |
| $("div.charBox[data-campaigns*='s2c2-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s2c2-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s2c2-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s2c2-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Murder Bros") {
| |
| $("div.charBox[data-campaigns*='s2c3-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s2c3-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s2c3-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s2c3-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "The Cobblers") {
| |
| $("div.charBox[data-campaigns*='s2c4-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s2c4-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s2c4-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s2c4-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "The Tower of Ultimate Wizardry: Chapter One") {
| |
| $("div.charBox[data-campaigns*='s2c5-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s2c5-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s2c5-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s2c5-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Unexpected Discovery") {
| |
| $("div.charBox[data-campaigns*='s2c6-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s2c6-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s2c6-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s2c6-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Buckeroos") {
| |
| $("div.charBox[data-campaigns*='s2c7-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s2c7-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s2c7-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s2c7-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Fall of Dundinborough") {
| |
| $("div.charBox[data-campaigns*='s2c8-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s2c8-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s2c8-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s2c8-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Den of Devils") {
| |
| $("div.charBox[data-campaigns*='s2c9-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s2c9-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s2c9-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s2c9-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "The Skeleton King") {
| |
| $("div.charBox[data-campaigns*='s2c10-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s2c10-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s2c10-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s2c10-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "Player Characters") {
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS2.length; i++){
| |
| $("#charHolder").append(allS2[i]);}
| |
| $("div.charBox").hide();
| |
| for(var i = 1; i <= 10; i++){
| |
| $("div.charBox[data-campaigns*='s2c" + i + "-p']").show();}
| |
| }
| |
| if ($(this).val() == "NPC Characters") {
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS2.length; i++){
| |
| $("#charHolder").append(allS2[i]);}
| |
| $("div.charBox").hide();
| |
| for(var i = 1; i <= 10; i++){
| |
| $("div.charBox[data-campaigns*='s2c" + i + "-n']").show();}
| |
| }
| |
| if ($(this).val() == "Minor Characters") {
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS2.length; i++){
| |
| $("#charHolder").append(allS2[i]);}
| |
| $("div.charBox").hide();
| |
| for(var i = 1; i <= 10; i++){
| |
| $("div.charBox[data-campaigns*='s2c']").show();}
| |
| $("div.charBox a:not([href*='Minor_Characters'])").parent().hide();
| |
| }
| |
|
| |
| });
| |
|
| |
| $("#seasonFilter-s3").change(function() {
| |
| $("div.charBox").hide();
| |
| $("span#breaker").remove();
| |
| if ($(this).val() == "Season 3 Characters") {
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS3.length; i++){
| |
| $("#charHolder").append(allS3[i]);
| |
| }
| |
| $("div.charBox[data-campaigns*='s3'").show();}
| |
| if ($(this).val() == "The Grand Paladin Order") {
| |
| $("div.charBox[data-campaigns*='s3c1-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s3c1-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s3c1-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s3c1-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
| if ($(this).val() == "The Senate of Deadlantis") {
| |
| $("div.charBox[data-campaigns*='s3c2-'").show();
| |
| var box = $(".charBox:visible");
| |
| for(var i = 0; i < box.length; i++){
| |
| if(box[i].getAttribute("data-campaigns").indexOf("s3c2-n") > -1){
| |
| $(".charBox:visible:last").after(box[i]);
| |
| }
| |
| }
| |
| $("div#charHolder").find("[data-campaigns*='s3c2-n']:parent:visible").first().before("<span id='breaker'>NPC Characters</span>");
| |
| $("div#charHolder").find("[data-campaigns*='s3c2-p']:parent:visible").first().before("<span id='breaker'>Player Characters</span>");}
| |
|
| |
|
| |
| if ($(this).val() == "Player Characters") {
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS3.length; i++){
| |
| $("#charHolder").append(allS3[i]);}
| |
| $("div.charBox").hide();
| |
| for(var i = 1; i <= 10; i++){
| |
| $("div.charBox[data-campaigns*='s3c" + i + "-p']").show();}
| |
| }
| |
| if ($(this).val() == "NPC Characters") {
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS3.length; i++){
| |
| $("#charHolder").append(allS3[i]);}
| |
| $("div.charBox").hide();
| |
| for(var i = 1; i <= 10; i++){
| |
| $("div.charBox[data-campaigns*='s3c" + i + "-n']").show();}
| |
| }
| |
| if ($(this).val() == "Minor Characters") {
| |
| $("#charHolder").empty();
| |
| for(var i = 0; i < allS3.length; i++){
| |
| $("#charHolder").append(allS3[i]);}
| |
| $("div.charBox").hide();
| |
| for(var i = 1; i <= 10; i++){
| |
| $("div.charBox[data-campaigns*='s3c']").show();}
| |
| $("div.charBox a:not([href*='Minor_Characters'])").parent().hide();
| |
| }
| |
| });
| |
|
| |
|
| $(window).on("load", function() { | | $(window).on("load", function() { |
| $("#loading").remove(); | | $("#loading").remove(); |
| $("#charHolder").show(); | | $("#charHolder").show(); |
| $(".charFilter").show(); | | $("#filter").show(); |
| $("#nametoggle").click(); | | $("#nametoggle").show(); |
| | |
| }); | | }); |
|
| |
|
| function loadOther(){ | | function filter(search) { |
| for(var i = 0; i < series1.length; i++){
| | $("#filter").val(search); |
| var campaigns = "";
| | charFilter(); |
| for(var j = 0; j < series1[i].campaigns.length; j++){
| |
| campaigns = campaigns + " " + series1[i].campaigns[j];
| |
| }
| |
| campaigns = campaigns.substring(1);
| |
| if(campaigns.indexOf("s1c") == -1){
| |
| $("div#charHolder").append("<div class='charBox' data-campaigns='" + campaigns + "' data-name='" + series1[i].name + "'><a class='charLink' href='" + series1[i].link +"'> <img src='" + series1[i].image + "'> <div class='charName'>" + series1[i].name + "</div></a></div>");
| |
| }
| |
| } | | } |
| | function charFilter() { |
| | var filter = $("#filter").val().trim().toLowerCase(); |
| | $(".charBox").each(function() { |
| | if (filter == '') |
| | $(this).show(); |
| | else if ($(this).attr('data-keywords').toLowerCase().indexOf(" " + filter) >= 0){ |
| | console.log(filter + "|" + $(this).attr('data-keywords').toLowerCase()) |
| | $(this).show();} |
| | else |
| | $(this).hide(); |
| | }); |
| } | | } |
| | |
| function toggleNames(val){ | | function toggleNames(val){ |
| if(val.id = "nametoggle"){ | | if(val.id = "nametoggle"){ |
| Line 589: |
Line 213: |
| } | | } |
| } | | } |
| $("#nametoggle").hide();
| |
| $(".charName").css("display", "block");
| |
| $(".charBox").css('filter', 'opacity(100%)');
| |
| $("#nametoggle").css('background-color', '#89540F');
| |
| } | | } |
|
| |
|
| </script> | | </script> |
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.0.min.js"></script>
<style>
- charPanel button {
float:left;
padding: 5px 10px;
font-size: 12px;
line-height: 1.5;
border-radius: 3px;
color: #fff;
background-color: #b36e14;
border-color: #9c6011;
margin-bottom: 0;
font-weight: normal;
text-align: center;
vertical-align: middle;
touch-action: manipulation;
cursor: pointer;
background-image: none;
border: 1px solid transparent;
white-space: nowrap;
}
div.charBox {
display: inline-block;
padding: 3px;
position: relative;
width: calc((100% / 6) - 3px);
border: 2px solid rgba(0,0,0,0.0);
filter: opacity(70%);
transition: filter .6s;
border-radius:7px;
overflow: hidden;
margin-bottom:-6px;
}
.charBox:hover .charName, .charBox.hovered .charName {
display: block;
}
div#charPanel {
min-height: 100px;
text-align: center;
background: rgba(68,68,68,0.2);
border-radius: 15px;
border: 2px solid #8b4513;
padding: 10px;
}
input#filter {
float:right;
width: 200px;
height: 36px;
padding: 6px 12px;
margin-bottom: 8px;
font-size: 14px;
line-height: 1.6;
color: #555555;
background-color: #fff;
background-image: none;
border: 1px solid white;
border-radius: 4px;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
-webkit-transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;
}
input#filter:focus {
border-color: #edad5a;
outline: 0;
box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(237, 173, 90, 0.6);
}
div.charBox a{
display: block;
height: 100%;
color: #F9E4CA;
}
.charBox.hovered {
filter: opacity(100%);
}
.charBox:hover {
border-color:#F9E4CA;
filter: opacity(100%);
}
div.charName{
position: absolute;
bottom: 0;
left: 0;
right: 0;
text-align: center;
font-weight: bold;
display: none;
background: rgba(15,15,15,0.7);
padding: 3px;
font-family: "Cinzel Decorative";
}
div.charBox img {
width:150px;
}
@media screen and (max-device-width: 768px) {
button#nametoggle {
display: none !important;
}
input#filter {
float:none;
}
div.charBox img {
width:85px;
}
div.charBox {
width: calc((85% / 6) - 3px);
filter: opacity(100%);
}
div.charName {
font-size: 10px;
display: block;
}
}
</style>
Quick Reference Search
- Character Names (<a class="link" onclick="filter('Bumbley')">Bumbley</a>)
- Player Names (<a class="link" onclick="filter('Justin')">Justin</a>, <a class="link" onclick="filter('Deadbones')">Deadbones</a>)
- Races (<a class="link" onclick="filter('Elf')">Elf</a>, <a class="link" onclick="filter('Porc')">Porc</a>)
- Classes (<a class="link" onclick="filter('Wizard')">Wizard</a>, <a class="link" onclick="filter('Paladin')">Paladin</a>)
- Status/Attribute (<a class="link" onclick="filter('Ageless')">Ageless</a>, <a class="link" onclick="filter('Believer')">Believer</a>)
- Type (<a class="link" onclick="filter('Minor')">Minor</a>, <a class="link" onclick="filter('Companion')">Companion</a>)
- Campaign (<a class="link" onclick="filter('s1c1-')">Season 1 Campaign 1 - Band of Thieves</a>)
- NPC Within Campaign (<a class="link" onclick="filter('s1c1-n')">Band of Thieves NPC</a>)
- Players Within Campaign (<a class="link" onclick="filter('s1c1-p')">Band of Thieves Players</a>)
<img id="loading" height="500" src="/images/4/42/Loading.gif">
<script>
$("#charHolder").hide();
var series1 = [];
var obj = {};
obj["name"] = "";
obj["image"] = "";
obj["link"] = "";
obj["keywords"] = ;
series1.push(obj);
var list = [];
for(var i = 0; i < series1.length; i++){
var keywords = " ";
for(var j = 0; j < series1[i].keywords.length; j++){
if(list.indexOf(series1[i].keywords[j]) < 0){
list.push(series1[i].keywords[j]);
}
keywords = keywords + " " + series1[i].keywords[j];
}
keywords = keywords.substring(1);
$("div#charHolder").append("
<a class='charLink' href='" + series1[i].link +"'> <img src='" + series1[i].image + "'>
" + series1[i].name + "
</a>
");
}
console.log(list);
$("div#charPanel").prepend('<input type="text" id="filter" onkeyup="charFilter()" placeholder="Search...">
');
$("#filter").before("<button id='nametoggle' onclick='toggleNames(this)'>Toggle Names</button>");
$("#filter").hide();
$("#nametoggle").hide();
/* Default */
$(window).on("load", function() {
$("#loading").remove();
$("#charHolder").show();
$("#filter").show();
$("#nametoggle").show();
});
function filter(search) {
$("#filter").val(search);
charFilter();
}
function charFilter() {
var filter = $("#filter").val().trim().toLowerCase();
$(".charBox").each(function() {
if (filter == )
$(this).show();
else if ($(this).attr('data-keywords').toLowerCase().indexOf(" " + filter) >= 0){
console.log(filter + "|" + $(this).attr('data-keywords').toLowerCase())
$(this).show();}
else
$(this).hide();
});
}
function toggleNames(val){
if(val.id = "nametoggle"){
if($(val).css("background-color") == "rgb(179, 110, 20)"){
$(".charName").css("display", "block");
$(".charBox").css('filter', 'opacity(100%)');
$("#nametoggle").css('background-color', '#89540F');
} else {
$(".charName").css("display", "");
$(".charBox").css("filter", "");
$("#nametoggle").css('background-color', '#b36e14');
}
}
}
</script>