Widget:TestTabs

From Unforgotten Realms Wiki
Revision as of 08:30, 3 August 2017 by imported>Pillowkeeper
Jump to navigationJump to search

<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.2.0.min.js"></script> <style>

  1. charPanel button {
       background-color: #b36e14;
       border: 1px solid #64320d;
       outline: none;
       cursor: pointer;
       padding: 0px 10px;
       transition: 0.3s;
       display: inline;
       color: white;
       height: 25px;
   }


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 {

   text-align: center;
 background: rgba(68,68,68,0.2);
 border-radius: 15px;
 border: 2px solid #8b4513;
 padding: 10px;

}

input#filter {

   display: block;
   width: 200px;
   height: 36px;
   padding: 6px 12px;
   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;

}

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 only screen and (max-device-width: 768px) { div.charBox img { width:85px; } div.charBox { width: calc((85% / 6) - 3px); } div.charName { font-size: 10px; } } </style>

<a class="link" onclick="filter('s1c1-')">S1C1</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);

for(var i = 0; i < series1.length; i++){ var keywords = ""; for(var j = 0; j < series1[i].keywords.length; 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>

");

} $("div#charPanel").prepend('<input type="text" id="filter" onkeyup="charFilter()" placeholder="Search...">

'); $("#filter").hide(); /* Default */

$(window).on("load", function() { $("#loading").remove(); $("#charHolder").show(); $("#filter").show(); });

function filter(search) { $("#filter").val(search); charFilter(); } function charFilter() { var filter = $("#filter").val().trim().toLowerCase(); console.log(filter); $(".charBox").each(function() { if (filter == ) $(this).show(); else if ($(this).attr('data-keywords').toLowerCase().indexOf(filter) >= 0) $(this).show(); else $(this).hide(); }); }

function loadOther(){ for(var i = 0; i < series1.length; i++){ var campaigns = ""; 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("

<a class='charLink' href='" + series1[i].link +"'> <img src='" + series1[i].image + "'>
" + series1[i].name + "
</a>

");

} } }



</script>