Skip to content

Commit

Permalink
Merge pull request #74 from CodetheChangeFoundation/CH-35
Browse files Browse the repository at this point in the history
CH-35: Projects page carousel and individual project pages
  • Loading branch information
vinielk authored Jun 1, 2019
2 parents 537110b + 7321d8e commit 58cadc7
Show file tree
Hide file tree
Showing 16 changed files with 1,224 additions and 357 deletions.
128 changes: 127 additions & 1 deletion assets/css/climatehub.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ body {
left 0.2s ease-in-out 0.2s;
}

#bs4navbar ul li a.active {
#bs4navbar ul li.active a {
color: var(--white);
background-color: var(--dark);
}
Expand Down Expand Up @@ -199,3 +199,129 @@ body {
background: #125688;
color: white;
}

/* Project Page */
.tabbed-carousel .nav-item.active {
color: inherit !important;
}

.owl-stage-outer {
position: relative;
overflow-y: hidden;
height: 280px;
}

.owl-nav {
-webkit-tap-highlight-color: transparent;
}

.owl-nav [class*='owl-'] {
font-size: 2rem !important;
position: absolute;
padding: 10px !important;
top: 0;
bottom: 0;
}

.owl-nav .owl-prev {
left: 0;
}

.owl-nav .owl-next {
right: 0;
}

.owl-nav [class*='owl-']:focus {
outline: thin dotted;
}

.owl-nav [class*='owl-']:hover {
text-decoration: none;
}

.owl-nav .disabled {
cursor: default;
}

.owl-dots {
position: absolute;
bottom: 0;
width: 100%;
text-align: center;
-webkit-tap-highlight-color: transparent;
}

.owl-dots .owl-dot {
display: inline-block;
padding: 0;
}

.owl-dots .owl-dot:focus {
outline: thin dotted;
}

.owl-dots .owl-dot span {
width: 10px;
height: 10px;
margin: 5px 7px;
background: #7DDA7D;
display: block;
backface-visibility: visible;
-webkit-backface-visibility: visible;
transition: all 200ms ease;
border-radius: 30px;
}

.owl-dots .owl-dot.active span,
.owl-dots .owl-dot:hover span {
background: var(--success);
}

@media (max-width: 576px) {
.owl-item {
display: flex;
justify-content: center;
}
}

.item {
flex-direction: column;
height: 17.5rem;
max-width: 21.5rem;
min-width: 15rem;
}

.item img {
overflow: hidden;
object-fit: cover;
object-position: center center;
}

.fade-line-ending {
position: relative;
max-height: 3.56em;
overflow: hidden;
}

.fade-line-ending:after {
content: "";
text-align: right;
position: absolute;
top: 2.36em;
right: 0;
width: 70%;
height: 1.2em;
background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1) 75%);
}

/* Blog page */
.blog-gutter-image {
max-height: 200px;
}

.full-width-image {
width: 100%;
height: 100%;
object-fit: contain;
object-position: center center;
}
135 changes: 135 additions & 0 deletions assets/css/owl.carousel.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
/**
* Owl Carousel v2.3.4
* Copyright 2013-2018 David Deutsch
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
*/
/*
* Owl Carousel - Core
*/
.owl-carousel {
display: none;
width: 100%;
-webkit-tap-highlight-color: transparent;
/* position relative and z-index fix webkit rendering fonts issue */
position: relative;
z-index: 1; }
.owl-carousel .owl-stage {
position: relative;
-ms-touch-action: pan-Y;
touch-action: manipulation;
-moz-backface-visibility: hidden;
/* fix firefox animation glitch */ }
.owl-carousel .owl-stage:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0; }
.owl-carousel .owl-stage-outer {
position: relative;
overflow: hidden;
/* fix for flashing background */
-webkit-transform: translate3d(0px, 0px, 0px); }
.owl-carousel .owl-wrapper,
.owl-carousel .owl-item {
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-ms-backface-visibility: hidden;
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
-ms-transform: translate3d(0, 0, 0); }
.owl-carousel .owl-item {
position: relative;
min-height: 1px;
float: left;
-webkit-backface-visibility: hidden;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none; }
.owl-carousel .owl-item img {
display: block;
width: 100%; }
.owl-carousel .owl-nav.disabled,
.owl-carousel .owl-dots.disabled {
display: none; }
.owl-carousel .owl-nav .owl-prev,
.owl-carousel .owl-nav .owl-next,
.owl-carousel .owl-dot {
cursor: pointer;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.owl-carousel .owl-nav button.owl-prev,
.owl-carousel .owl-nav button.owl-next,
.owl-carousel button.owl-dot {
background: none;
color: inherit;
border: none;
font: inherit; }
.owl-carousel.owl-loaded {
display: block; }
.owl-carousel.owl-loading {
opacity: 0;
display: block; }
.owl-carousel.owl-hidden {
opacity: 0; }
.owl-carousel.owl-refresh .owl-item {
visibility: hidden; }
.owl-carousel.owl-drag .owl-item {
-ms-touch-action: pan-y;
touch-action: pan-y;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none; }
.owl-carousel.owl-grab {
cursor: move;
cursor: grab; }
.owl-carousel.owl-rtl {
direction: rtl; }
.owl-carousel.owl-rtl .owl-item {
float: right; }

/* No Js */
.no-js .owl-carousel {
display: block; }

/*
* Owl Carousel - Animate Plugin
*/
.owl-carousel .animated {
animation-duration: 1000ms;
animation-fill-mode: both; }

.owl-carousel .owl-animated-in {
z-index: 0; }

.owl-carousel .owl-animated-out {
z-index: 1; }

.owl-carousel .fadeOut {
animation-name: fadeOut; }

@keyframes fadeOut {
0% {
opacity: 1; }
100% {
opacity: 0; } }

/*
* Owl Carousel - Lazy Load Plugin
*/
.owl-carousel .owl-item {
/**
This is introduced due to a bug in IE11 where lazy loading combined with autoheight plugin causes a wrong
calculation of the height of the owl-item that breaks page layouts
*/ }
.owl-carousel .owl-item .owl-lazy {
opacity: 0;
transition: opacity 400ms ease; }
.owl-carousel .owl-item .owl-lazy[src^=""], .owl-carousel .owl-item .owl-lazy:not([src]) {
max-height: 0; }
.owl-carousel .owl-item img.owl-lazy {
transform-style: preserve-3d; }
24 changes: 23 additions & 1 deletion assets/js/climatehub.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,28 @@ $(window).scroll(function () {
}
});

// projects page carousels
$('.owl-carousel').owlCarousel({
loop: false,
margin: 15,
nav: true,
navText: ['⟨','⟩'],
responsive: {
0: {
items: 1
},
576: {
items: 2
},
992: {
items: 3
},
1200: {
items: 4
}
}
})

// engagements page
$('.partner-image').on('click', function() {
$('.collapse.show').collapse('toggle');
Expand Down Expand Up @@ -88,4 +110,4 @@ if ($('.acf-map').length) {
});
});
})(jQuery);
}
}
7 changes: 7 additions & 0 deletions assets/js/owl.carousel.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit 58cadc7

Please sign in to comment.