Widget:CampaignCards: Difference between revisions

From Unforgotten Realms Wiki
Jump to navigationJump to search
imported>Pillowkeeper
No edit summary
imported>Pillowkeeper
No edit summary
Line 53: Line 53:
<style>
<style>


a.tooltip::before {
    content: attr(data-tip) ; 
   
    font-size: 10px;
    position:absolute;
    z-index: 999;
    white-space:nowrap;
    bottom:9999px;
    left: 50%;
    background:#000;
    color:#e0e0e0;
    padding:0px 7px;
    line-height: 24px;
    height: 24px;
   
    opacity: 0; 
    transition:opacity 0.4s ease-out;
    }
   
a.tooltip:hover::before {
    opacity: 1;
    bottom:-35px;
    }
.campaignbox-characters a:hover:after {
.campaignbox-characters a:hover:after {
     border: 1px solid #fc0;
     border: 1px solid #fc0;
     padding: 3px 6px;
     padding: 3px 6px;
     background: #fffea1;
     background: #fffea1;
     content: attr(data-title);
     content: "TOOLTIP";
    position: absolute;
    right: -40px;
    top: -26px;
}
}
.character-portrait {
.character-portrait {

Revision as of 03:32, 30 August 2017

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

<script> var series1 = [];

var obj = {};

 obj["name"] = "";
 obj["image"] = "";
 obj["season"] = "";
 obj["content"] = ;
 obj["key"] = "";
 obj["height"] = "";
 series1.push(obj);

for(var i = 0; i < series1.length; i++){ console.log(series1[0].image);

$(".campaign-holder").append('

<img class="campaignbox-image" src="' + series1[i].image + '">

'+ series1[i].season +'

' + series1[i].name + '

' + series1[i].content + '

');

}

$(".campaignbox-characters a").each(function() { $(this).attr("data-title", $(this).attr("title")); $(this).attr("title", ""); });

function openCard(card){ var id = card.id var height = $(card).attr("data-height"); $("div#" + id + " div:not('.campaignbox-content')").fadeToggle('slow'); if(!$("div#" + id).hasClass("opened")){ $(".campaignbox:not('div#" + id + "')").hide(); $("div#" + id).animate({width:'650px', height: height}, function(){ $(".campaignbox:not('div#" + id + "')").fadeOut(); }); $("div#" + id + " div:not('.campaignbox-content')").hide('slow'); $("div#" + id + " .campaignbox-content").show('slow'); } else { $("div#" + id).animate({width:'200px', height: '184px'}, function(){ $("div#" + id + " .campaignbox-content").hide(); $(".campaignbox:not('div#" + id + "')").show(); $(".campaignbox:not('div#" + id + "')").fadeIn(); }); $("div#" + id + " div:not('.campaignbox-content')").show('slow'); } $("div#" + id).toggleClass("opened"); } </script>

<style>

.campaignbox-characters a:hover:after {

   border: 1px solid #fc0;
   padding: 3px 6px;
   background: #fffea1;
   content: "TOOLTIP";

} .character-portrait {

 object-fit: cover;
 width: 60px;
 height: 125px;
 margin: 3px;

} .campaignbox.opened {

 width: 650px;
 height: 184px;
 border: 3px solid white;
 border-radius: 10px;
 overflow: hidden;
 display: inline-block;
 background: rgb(33, 33, 33);
 margin: 8px;

} .campaignbox {

 width: 200px;
 height: 184px;
 border: 3px solid white;
 border-radius: 10px;
 overflow: hidden;
 display: inline-block;
 background: rgb(33, 33, 33);
 margin: 8px;

} .campaignbox-card {

   cursor: pointer;

} .campaignbox-image {

 width: 100%;
 opacity:0.85;
 margin-bottom: -5px;

} .campaignbox-text {

 padding: 0.01em 5px;
 color: white;
 text-align: center;

} .campaignbox-content {

 display: none;
 color:white;
 padding: 16px;
 }

</style>