diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2017-03-24 17:12:23 +0100 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2017-03-24 17:12:23 +0100 |
| commit | 54b8482223288a4d5df41267f3c9235bab06c15e (patch) | |
| tree | 2df9f4e43168ab4fcda02e67740bf9772985eb5a /minionlivesmatter/templates/assets/js/hipster-cards.js | |
| parent | a2d5335f18e053c14e8f88efa5f97368777341be (diff) | |
| download | meta-54b8482223288a4d5df41267f3c9235bab06c15e.tar.gz meta-54b8482223288a4d5df41267f3c9235bab06c15e.zip | |
add minionlivesmatter
Diffstat (limited to 'minionlivesmatter/templates/assets/js/hipster-cards.js')
| -rw-r--r-- | minionlivesmatter/templates/assets/js/hipster-cards.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/minionlivesmatter/templates/assets/js/hipster-cards.js b/minionlivesmatter/templates/assets/js/hipster-cards.js new file mode 100644 index 0000000..f74de6b --- /dev/null +++ b/minionlivesmatter/templates/assets/js/hipster-cards.js @@ -0,0 +1,49 @@ +$(document).ready(function(){ + window_width = $(window).width(); + + // Make the images from the card fill the hole space + hipster_cards.fitBackgroundForCards(); + +}); + +hipster_cards = { + misc:{ + navbar_menu_visible: 0 + }, + + fitBackgroundForCards: function(){ + $('[data-background="image"]').each(function(){ + $this = $(this); + + background_src = $this.data("src"); + + if(background_src != "undefined"){ + new_css = { + "background-image": "url('" + background_src + "')", + "background-position": "center center", + "background-size": "cover" + }; + + $this.css(new_css); + } + }); + + $('.card .header img').each(function(){ + $card = $(this).parent().parent(); + $header = $(this).parent(); + + background_src = $(this).attr("src"); + + if(background_src != "undefined"){ + new_css = { + "background-image": "url('" + background_src + "')", + "background-position": "center center", + "background-size": "cover" + }; + + $header.css(new_css); + } + }); + + }, +}
\ No newline at end of file |
