$this->headScript()->addWebFont($fonts);
$this->headScript()->addFastclick();
+$this->headScript()->addWOW(); // For reveal on scroll animations
if ($this->acl()->isAllowed('edition')) {
$this->headScript()->addCommonsAdmin();
class Cubedesigners_View_Helper_CasestudiesList extends CubeIT_View_Helper_Abstract {
protected $_datas;
+ protected $_tags;
public function CasestudiesList($datas, $currentStudie = null, $categories = null, $limit = null, $IDs = null) {
} */
// Max display size is 318 but we over-sample the size by 20% because there is a CSS scale effect on hover
- $image = $this->view->imageProcess($s->visuel, $s->titre, 382, 382);
+ $image = $this->view->imageProcess($s->visuel, $s->titre, 512, 'auto');
$url = Cubedesigners_Util::generateAutoUri($s, $this->_datas['seourl_stu']);
$c = '<div class="img-wrapper">';
$c.= $image;
$c.= '</div>';
$c.= '<h2>' . $s->titre . '</h2>';
- $c.='<h3>' . $s->description . '</h3>';
+ //$c.='<h3>' . $s->description . '</h3>';
+
+ $tag_names = [];
// Todo: display names of secondary categories (via join?) using IDs in: $s->tags_secondaires);
+ foreach ($s->tags_secondaires as $categoryID) {
+ $tag_names[] = $this->_getTagName($categoryID);
+ }
+
+ $c.= '<h3>' . implode(' / ', $tag_names) . '</h3>';
+
+ return $this->link($c, $url, array(
+ 'data-cat' => $s->categories,
+ 'class' => 'wow fadeInUp',
+ 'data-wow-delay' => '300ms',
+ )) . ' '; // Space needed between elements for justified alignment
+ }
+ // Get secondary category names
+ protected function _getTagName($catID) {
+
+ // Cache the query data if it's not already done
+ if (!$this->_tags) {
+
+ $db = Zend_Db_Table::getDefaultAdapter();
+ $query = $db->select()->from('tags')->query();
+
+ while ($category = $query->fetch()) {
+ $category = CubeIT_Util_Cms::unserializeRow($category);
+ $this->_tags[$category->id] = CubeIT_Util_Object::toArray($category);
+ }
+ }
- return $this->link($c, $url, array('data-cat' => $s->categories)) . ' '; // Space needed between elements for justified alignment
+ return $this->_tags[$catID]['name'];
}
}
?>
<div class="content">
- <div class="title"><?php echo $this->markupDotclear($this->titre); ?></div>
+ <div class="title text-block mx-auto mb-20 wow fadeInUp"><?php echo $this->markupDotclear($this->titre); ?></div>
- <div id="casestudies-tagslist">
+
+ <div id="casestudies-tagslist" class="wow fadeInUp">
<?php
- echo $this->CategoriesList('casestudies', 'casestudies-list', 382, 13);
+ echo $this->CategoriesList('casestudies', 'casestudies-list', 512, 96);
?>
</div>
function load_commons_once() {
+ new WOW().init(); // Set up wow.js on-scroll animations
+
$('a[href^="mailto:"]').not('[data-event]').each(function () {
var email = $(this).attr('href').split(':');
columnWidth: this.columnWidth,
gutter: this.gutter
},
- animationOptions: {
- duration: 750,
- easing: 'linear',
- queue: false
- }
+ transitionDuration: 0 // Disable isotope animations because they interfere with WOW.js
+ // animationOptions: {
+ // duration: 0,
+ // easing: 'linear',
+ // queue: false
+ // }
// hiddenStyle: {
// opacity: 0,
// transform: 'scale(2)'
// }
});
+ this.container.on('arrangeComplete', function () {
+ // Todo: figure out how to make WOW transitions trigger properly each time isotope finishes rearranging. Note: isotope is called multiple times by resize function so that might cause problems with triggering methods...
+ console.log('Isotope arrangeComplete');
+ $("#casestudies-list a").removeClass('animated').addClass('animated');
+ // $("#casestudies-list a").addClass("wow fadeInUp")
+ // $("#casestudies-list a").attr("style","visibility: visible; animation-name: fadeInUp;");
+ });
+
// Show the container now Isotope is active
this.container.css('display', 'block');
var naturalWidth = this.columnWidth;
var scaleFactor = 1;
- var ww = Math.min($(window).width(), 1048);
+ var ww = Math.min($(window).width(), 1920);
- ww -= 68; // Remove margins
+ ww *= 0.9; // Remove margins (5% each side)
// Handle extra padding that is added for small screens
//if ($('html').hasClass('small')) {
// Resize elements
var a = $(container).find('a');
$(a).css('width', ew);
- var naturalHeight = $(a).find('img').attr('height');
- var imageRatio = naturalWidth / naturalHeight;
- $(a).find('img').css({width: ew, height: ew / imageRatio});
- $(a).find('.img-wrapper').css({width: ew, height: ew / imageRatio});
+ //var naturalHeight = $(a).find('img').attr('height');
+ //var imageRatio = naturalWidth / naturalHeight;
+ //$(a).find('img').css({width: ew, height: ew / imageRatio});
+ //$(a).find('.img-wrapper').css({width: ew, height: ew / imageRatio});
// Reset isotope grid
$(container).isotope({
$('#main').css('overflow-y', 'hidden'); // Stops extra scrollbars appearing
$('ul.tags').taglist();
-}
\ No newline at end of file
+}
@yellow: #f6ae01;\r
\r
@import "01-mixins";\r
+@import "02-utilities";\r
+@import "03-animations";\r
--- /dev/null
+/* Utility CSS classes */
+// Inspiration from tailwindcss.com
+
+.mx-auto {
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.mb-0 {
+ margin-bottom: 0;
+}
+
+.mb-1 {
+ margin-bottom: .25rem;
+}
+
+.mb-2 {
+ margin-bottom: .5rem;
+}
+
+.mb-3 {
+ margin-bottom: .75rem;
+}
+
+.mb-4 {
+ margin-bottom: 1rem;
+}
+
+.mb-6 {
+ margin-bottom: 1.5rem;
+}
+
+.mb-8 {
+ margin-bottom: 2rem;
+}
+
+.mb-12 {
+ margin-bottom: 3rem;
+}
+
+.mb-16 {
+ margin-bottom: 4rem;
+}
+
+.mb-20 {
+ margin-bottom: 5rem;
+}
--- /dev/null
+/* CSS animations */
+
+.animated {
+ animation-duration: 1s;
+ animation-fill-mode: both;
+}
+
+@media (prefers-reduced-motion) {
+ .animated {
+ animation: unset !important;
+ transition: none !important;
+ }
+}
+
+@keyframes fadeInUp {
+ from {
+ opacity: 0;
+ transform: translateY(140px);
+ }
+
+ to {
+ opacity: 1;
+ transform: translateY(0);
+ }
+}
+
+.fadeInUp {
+ animation-name: fadeInUp;
+}
a {
display: inline-block;
- margin-bottom: 4.333333%;
+ margin-bottom: 5%;
+ text-align: center;
.img-wrapper {
overflow: hidden; // Give blurred image hovers a sharp edge by hiding any blur bleed
transition: transform 0.25s ease-out; // Speed of the hover-out animation
}
h2, h3 {
- white-space: nowrap;
- overflow: hidden;
- max-width: 300px;
- text-overflow: ellipsis;
+ //white-space: nowrap;
+ //overflow: hidden;
+ //max-width: 300px;
+ //text-overflow: ellipsis;
}
h2 {
- font-size: 32px;
+ font-size: 50px;
line-height: 1.3em; // 38px/32px
- color: #1b1b1b;
+ color: #000;
+ font-weight: 300;
+ margin-top: 0.7em;
}
h3 {
font-size: 16px;
-webkit-font-smoothing: antialiased;
}
-h1, h2 {
- font-weight: 400;
-}
-
-h3, h4, h5, h6 {
+h1, h2, h3, h4, h5, h6 {
font-weight: 300;
}
}
}
+.text-block {
+ max-width: 54rem; // = 864px or 45% of 1920px
+}
+
.dotclear {
a {
//color: #1b1b1b;
text-decoration: underline;
}
- h3, h4 {
- font-weight: 400;
+ h1, h2 {
+ &:not(:last-child) {
+ margin-bottom: 0.75em;
+ }
}
+
p {
line-height: 1.4;
}