summaryrefslogtreecommitdiff
path: root/templates/assets/js/hipster-cards.js
diff options
context:
space:
mode:
authorKapil Viren Ahuja <k.v.ahuja@gmail.com>2017-03-23 15:17:03 +0530
committerKapil Viren Ahuja <k.v.ahuja@gmail.com>2017-03-23 15:17:03 +0530
commit01ef61d8fc3e18fe159e98d36414ef0ba92ff2a7 (patch)
tree3d14b60e737ecd6c3c516798cddf5ca52db24348 /templates/assets/js/hipster-cards.js
parentc9198259402c1d01ad8d943832c20069635963da (diff)
downloadminionlivesmatter-01ef61d8fc3e18fe159e98d36414ef0ba92ff2a7.tar.gz
minionlivesmatter-01ef61d8fc3e18fe159e98d36414ef0ba92ff2a7.zip
adding the new theme
Diffstat (limited to 'templates/assets/js/hipster-cards.js')
-rw-r--r--templates/assets/js/hipster-cards.js49
1 files changed, 49 insertions, 0 deletions
diff --git a/templates/assets/js/hipster-cards.js b/templates/assets/js/hipster-cards.js
new file mode 100644
index 0000000..f74de6b
--- /dev/null
+++ b/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