diff --git a/sites/all/modules/figureslibres/clameursmod/clameursmod.js b/sites/all/modules/figureslibres/clameursmod/clameursmod.js index 22104d9a..988b4f89 100644 --- a/sites/all/modules/figureslibres/clameursmod/clameursmod.js +++ b/sites/all/modules/figureslibres/clameursmod/clameursmod.js @@ -3,7 +3,7 @@ Clameurs = function(){ function init(){ - console.log("Clameurs"); + console.log("Clameurs Mod"); initVideoEvents(); } diff --git a/sites/all/modules/figureslibres/clameursmod/clameursmod.module b/sites/all/modules/figureslibres/clameursmod/clameursmod.module index 8356dba5..54e4f7bd 100644 --- a/sites/all/modules/figureslibres/clameursmod/clameursmod.module +++ b/sites/all/modules/figureslibres/clameursmod/clameursmod.module @@ -156,7 +156,7 @@ function _clameursmod_thematiques_anchor_links(){ foreach ($nids as $nid) { $node = node_load($nid); // dsm($node); - $alias = drupal_get_path_alias('node/'.$nid); + $alias = str_replace('/', '-', drupal_get_path_alias('node/'.$nid)); // get the workflow state ID $current_state = workflow_state_load_single($node->workflow); // dsm($current_state, 'current_state'); diff --git a/sites/all/themes/figureslibres/clameurs/css/dist/styles.css b/sites/all/themes/figureslibres/clameurs/css/dist/styles.css index 3e70cbf9..536615b0 100755 --- a/sites/all/themes/figureslibres/clameurs/css/dist/styles.css +++ b/sites/all/themes/figureslibres/clameurs/css/dist/styles.css @@ -40,20 +40,37 @@ input { width: 1024px; margin: 0 auto; } -#header h1 a { - display: block; - height: 335px; - background-image: url(../../images/logo.png); - background-size: contain; - background-position: center; - background-repeat: no-repeat; - text-indent: -2000px; - overflow: hidden; - margin: 0; } +#header { + position: fixed; + width: 100%; + max-height: 400px; + z-index: 20; + background-color: rgba(255, 255, 255, 0.9); } + #header hgroup.logo { + width: 1024px; + margin: 0 auto; + padding: 1em 0; } + #header h1 { + margin: 0; } + #header h1 a { + display: block; + height: 335px; + background-image: url(../../images/logo.png); + background-size: contain; + background-position: center; + background-repeat: no-repeat; + text-indent: -2000px; + overflow: hidden; + margin: 0; } + #header h2 { + text-align: center; + color: #20c498; } -#header h2 { - text-align: center; - color: #20c498; } +#main { + padding-top: 400px; } + #main > .region { + width: 1024px; + margin: 0 auto; } #node-63 { padding: 1em 0; } @@ -267,7 +284,11 @@ body, .node-thematique > h2 { font-size: 3em; font-weight: 400; - padding-left: 0.18em; } + padding-left: 0.18em; + position: relative; } + .node-thematique > h2 span { + position: absolute; + top: -177px; } .node-thematique .content { letter-spacing: -0.25em; } .node-thematique .content .field-name-field-emvideo img { diff --git a/sites/all/themes/figureslibres/clameurs/css/styles.scss b/sites/all/themes/figureslibres/clameurs/css/styles.scss index 64a0a157..9c2b7a7c 100755 --- a/sites/all/themes/figureslibres/clameurs/css/styles.scss +++ b/sites/all/themes/figureslibres/clameurs/css/styles.scss @@ -49,15 +49,30 @@ body{ } +@mixin main_centred(){ + width:1024px; margin:0 auto; +} + #container{ width:1024px; margin:0 auto; // overflow-x: visible; } +$header_height:400px; #header{ + position: fixed; + width:100%; max-height: $header_height; + z-index: 20; + background-color: transparentize(#fff, 0.1); + hgroup.logo{ + @include main_centred(); + padding: 1em 0; + } + h1{margin:0;} h1 a{ display:block; height:335px; + // transition: height 0.1s ease-in-out; background-image: url(../../images/logo.png); background-size: contain; background-position: center; @@ -72,6 +87,13 @@ body{ } } +#main{ + padding-top: $header_height; + >.region{ + @include main_centred(); + } +} + // about #node-63{ // color:$bleu; @@ -268,6 +290,11 @@ body, font-size: 3em; font-weight: 400; padding-left: 0.18em; + position:relative; + span{ + position: absolute; + top:-177px; + } } .content{ diff --git a/sites/all/themes/figureslibres/clameurs/js/dist/script.min.js b/sites/all/themes/figureslibres/clameurs/js/dist/script.min.js index 894cf5f3..ec455115 100755 --- a/sites/all/themes/figureslibres/clameurs/js/dist/script.min.js +++ b/sites/all/themes/figureslibres/clameurs/js/dist/script.min.js @@ -1,3 +1,3 @@ (function($){Drupal.behaviors.init_theme=function(context){$('#messages-and-help > div.messages:not(.processed)').addClass('processed').each(function(){if($('a',this).size()||$(this).is('.error')||$(this).is('.warning')||$(this).text().length>100){$(this).prepend("X");$('span.close',this).click(function(){$(this).parent().slideUp('fast');});} -else{$(this).animate({opacity:1},5000,'linear',function(){$(this).slideUp('fast');});}});};})(jQuery); \ No newline at end of file +else{$(this).animate({opacity:1},5000,'linear',function(){$(this).slideUp('fast');});}});};function init(){console.log('Clameurs Theme');initHeaderAnime();};function initHeaderAnime(){var $header=$('#header a'),header_height=$header.height(),$slogan=$('#header h2'),fontsize=parseInt($slogan.css('font-size')),tmpfs,scrolltop;console.log('font-size',fontsize);$(window).on('scroll',function(event){scrolltop=$(this).scrollTop()*.5;console.log('scrolltop',scrolltop);$header.height(header_height-scrolltop>90?header_height-scrolltop:90);tmpfs=(300-(scrolltop<100?scrolltop:100))/300*fontsize;$slogan.css('font-size',tmpfs+"px");});};init();})(jQuery); \ No newline at end of file diff --git a/sites/all/themes/figureslibres/clameurs/js/script.js b/sites/all/themes/figureslibres/clameurs/js/script.js index 470b22ae..5cda1ccb 100755 --- a/sites/all/themes/figureslibres/clameurs/js/script.js +++ b/sites/all/themes/figureslibres/clameurs/js/script.js @@ -25,5 +25,29 @@ }); }; + function init(){ + console.log('Clameurs Theme'); + initHeaderAnime(); + }; + + function initHeaderAnime(){ + var $header = $('#header a'), + header_height = $header.height(), + $slogan = $('#header h2'), + fontsize = parseInt($slogan.css('font-size')), tmpfs, + scrolltop; + + console.log('font-size', fontsize); + + $(window).on('scroll', function(event) { + scrolltop = $(this).scrollTop() * .5; + console.log('scrolltop', scrolltop); + $header.height(header_height-scrolltop > 90 ? header_height-scrolltop : 90); + tmpfs = (300 - (scrolltop < 100 ? scrolltop : 100)) / 300 * fontsize; + $slogan.css('font-size', tmpfs+"px"); + }); + }; + + init(); })(jQuery); diff --git a/sites/all/themes/figureslibres/clameurs/preprocess/node.pre.php b/sites/all/themes/figureslibres/clameurs/preprocess/node.pre.php index e8119198..6dccf92f 100755 --- a/sites/all/themes/figureslibres/clameurs/preprocess/node.pre.php +++ b/sites/all/themes/figureslibres/clameurs/preprocess/node.pre.php @@ -11,12 +11,13 @@ $vars['print_title'] = !$vars['page']; $alias = str_replace('/', '-', drupal_get_path_alias('node/'.$vars['node']->nid)); +$vars['anchor_target'] = null; if($node->type == "thematique"){ - $vars['id'] = $alias; + // $vars['id'] = $alias; // dsm($node, 'node'); // $current_state = workflow_state_load_single($node->workflow); // dsm($current_state, "state"); - + $vars['anchor_target'] = $alias; }else{ $vars["classes_array"][] = $alias; $vars['id'] = "node-".$node->nid; diff --git a/sites/all/themes/figureslibres/clameurs/templates/html.tpl.php b/sites/all/themes/figureslibres/clameurs/templates/html.tpl.php index 029b8926..e5943f97 100755 --- a/sites/all/themes/figureslibres/clameurs/templates/html.tpl.php +++ b/sites/all/themes/figureslibres/clameurs/templates/html.tpl.php @@ -1,4 +1,4 @@ - - - + <?php print $head_title; ?> - + @@ -73,24 +73,20 @@ - + > -
- - - - -
- + + + - + @@ -100,5 +96,5 @@ - - \ No newline at end of file + + diff --git a/sites/all/themes/figureslibres/clameurs/templates/node.tpl.php b/sites/all/themes/figureslibres/clameurs/templates/node.tpl.php index 201579a7..edf9219c 100644 --- a/sites/all/themes/figureslibres/clameurs/templates/node.tpl.php +++ b/sites/all/themes/figureslibres/clameurs/templates/node.tpl.php @@ -85,7 +85,12 @@ - > + > + + + + +
>