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 1: Line 1:
<div onClick="clickCard(this)" class="campaignbox" id="test">
<div onClick="openCard(this)" class="campaignbox" id="test">


  <div class="campaignbox-card">
  <div class="campaignbox-card">
Line 15: Line 15:
   </div>
   </div>
</div>
</div>


<script>
<script>
function clickCard(card){
function openCard(card){
var id = card.id
var height = $(card).height();
$("div#" + id + "div:not('.campaignbox-content')").fadeToggle('slow');
console.log(card.id)
if(!$("div#" + id).hasClass("opened")){
$("div#test div:not('.campaignbox-content')").fadeToggle('slow');
$("div#" + id).animate({width: '100%', height:'300px'});
if(!$("div#test").hasClass("opened")){
$("div#" + id + " .campaignbox-content").show('slow');
$("div#test").animate({width: '100%', height:'300px'});
$("div#" + id + " div:not('.campaignbox-content')").hide('slow');
$("div#test .campaignbox-content").show('slow');
$("div#test div:not('.campaignbox-content')").hide('slow');
} else {
} else {
$("div#" + id + ").animate({width: '200px', height: '184px'});
$("div#test").animate({width: '200px', height: '184px'});
$("div#" + id + " .campaignbox-content").hide('slow');
$("div#test .campaignbox-content").hide('slow');
$("div#" + id + " div:not('.campaignbox-content')").show('slow');
$("div#test div:not('.campaignbox-content')").show('slow');
}
}
$("div#" + id + ").toggleClass("opened");
$("div#test").toggleClass("opened");
}
}
</script>
</script>

Revision as of 20:28, 29 August 2017

 <img class="campaignbox-image" src="https://stream.urealms.com/img/watch/s1c1.jpg" >

Season 1

Band of Thieves

Band of Thieves

<script> function openCard(card){ var height = $(card).height(); console.log(card.id) $("div#test div:not('.campaignbox-content')").fadeToggle('slow'); if(!$("div#test").hasClass("opened")){ $("div#test").animate({width: '100%', height:'300px'}); $("div#test .campaignbox-content").show('slow'); $("div#test div:not('.campaignbox-content')").hide('slow'); } else { $("div#test").animate({width: '200px', height: '184px'}); $("div#test .campaignbox-content").hide('slow'); $("div#test div:not('.campaignbox-content')").show('slow'); } $("div#test").toggleClass("opened"); } </script>

<style> .campaignbox {

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

} .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;
 }


</style>