Переглянути джерело

added fonts mixins, started comm between theme and corpus-map (remove all modales on click on map)

Bachir Soussi Chiadmi 7 роки тому
батько
коміт
1e3266f97c

+ 7 - 2
sites/all/modules/figli/edlp_corpus/assets/dist/scripts/corpus.min.js

@@ -335,10 +335,14 @@
         })
         .on('click', function(event) {
           if(event.target.tagName != "A" && event.target.tagName != "INPUT"){
-            console.log("Corpus : click", event);
+            console.log("Corpus : click");
             event.preventDefault();
             if(_node_hover_id != -1){
-              console.log("click on node", _nodes[_node_hover_id]);
+              console.log("corpus : click on node", _nodes[_node_hover_id]);
+              _$canvas.trigger('corpus-cliked-on-node');
+            }else{
+              console.log('corpus : click on map');
+              _$canvas.trigger('corpus-cliked-on-map');
             }
           }
         });
@@ -378,6 +382,7 @@
     function startAnime(){
       _physics.onUpdate(render);
       _physics.play()
+      $('body').trigger('corpus-map-ready');
     };
 
     init();

+ 7 - 2
sites/all/modules/figli/edlp_corpus/assets/scripts/corpus.js

@@ -335,10 +335,14 @@
         })
         .on('click', function(event) {
           if(event.target.tagName != "A" && event.target.tagName != "INPUT"){
-            console.log("Corpus : click", event);
+            console.log("Corpus : click");
             event.preventDefault();
             if(_node_hover_id != -1){
-              console.log("click on node", _nodes[_node_hover_id]);
+              console.log("corpus : click on node", _nodes[_node_hover_id]);
+              _$canvas.trigger('corpus-cliked-on-node');
+            }else{
+              console.log('corpus : click on map');
+              _$canvas.trigger('corpus-cliked-on-map');
             }
           }
         });
@@ -378,6 +382,7 @@
     function startAnime(){
       _physics.onUpdate(render);
       _physics.play()
+      $('body').trigger('corpus-map-ready');
     };
 
     init();

+ 34 - 4
sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js

@@ -1,6 +1,6 @@
 edlp_vars = {
-  "e_col_130": "rgb(126, 8, 104)",
-  "e_col_121": "rgb(58, 51, 182)",
+  "e_col_130": "rgb(75, 143, 126)",
+  "e_col_121": "rgb(134, 142, 36)",
   "e_col_134": "rgb(43, 143, 47)",
   "e_col_121": "rgb(58, 51, 182)",
   "e_col_125": "rgb(44, 159, 87)",
@@ -21,19 +21,31 @@ edlp_vars = {
   "e_col_126": "rgb(212, 156, 182)",
   "e_col_123": "rgb(73, 119, 21)"
 };
-
 (function($) {
 
-
   EdlpTheme = function(){
 
+    var _is_front = $('body').is('.path-frontpage');
+    var _$corpus_map;
+    var _$content_container = $('.layout-container>main>.layout-content');
 
     function init(){
       console.log("EdlpTheme init()");
+      // if(_is_front) initFront();
+
+      $('body').on('corpus-map-ready', onCorpusMapReady);
+
       initScrollbars();
+
       initAjaxLinks();
     };
 
+
+
+    // function initFront(){
+    //   console.log('theme : initFront');
+    // };
+
     function initScrollbars(){
       $('.os-scroll').overlayScrollbars({
         overflowBehavior:{x:'h',y:'scroll'}
@@ -43,6 +55,7 @@ edlp_vars = {
       // });
     };
 
+    // ajax
     function  initAjaxLinks(){
       console.log('initAjaxLinks');
       $('a', '#block-mainnavigation').on('click', onClickAjaxLink);
@@ -63,6 +76,23 @@ edlp_vars = {
       initScrollbars();
     };
 
+    // corpus
+    function onCorpusMapReady(e){
+      console.log('theme : onCorpusReady');
+      _$corpus_map = $('canvas#edlp-map');
+      _$corpus_map.on('corpus-cliked-on-map', function(e) {
+        console.log('theme : corpus-cliked-on-map');
+        closeAllModals();
+      });
+    }
+
+    //modals
+    function closeAllModals(){
+      console.log('theme : closeAllModals');
+      // TODO: animate the remove 
+      _$content_container.html('');
+    };
+
     init();
   }
 

+ 28 - 8
sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css

@@ -1009,15 +1009,35 @@ main[role="main"] .layout-content {
       pointer-events: all;
       max-height: 100%;
       position: relative; }
-    main[role="main"] .layout-content .row .col > * {
-      border-top: 1px solid red;
-      border-bottom: 1px solid red;
-      background-color: rgba(255, 255, 255, 0.9);
-      max-height: 100%; }
+      main[role="main"] .layout-content .row .col > .wrapper {
+        border-top: 1px solid red;
+        border-bottom: 1px solid red;
+        background-color: rgba(255, 255, 255, 0.95);
+        max-height: 100%;
+        padding: 0 0 1em; }
+        main[role="main"] .layout-content .row .col > .wrapper > * {
+          padding: 0 1em; }
+
+main[role="main"] article.node > h2 {
+  font-size: 0.9em;
+  font-weight: normal;
+  text-transform: uppercase; }
+
+main[role="main"] article.node p {
+  font-size: 0.75em;
+  font-weight: normal; }
+
+main[role="main"] img {
+  max-width: 100%; }
+
+main[role="main"] ul, main[role="main"] li, main[role="main"] ul.inline li:first-child {
+  margin: 0;
+  padding: 0;
+  list-style: none; }
 
 #agenda {
   pointer-events: auto;
-  background-color: rgba(255, 255, 255, 0.9);
+  background-color: rgba(255, 255, 255, 0.95);
   -webkit-box-sizing: border-box;
   box-sizing: border-box;
   border-top: 1px solid red;
@@ -1178,7 +1198,7 @@ footer {
             -ms-hyphens: auto;
             hyphens: auto;
             white-space: normal;
-            background-color: rgba(255, 255, 255, 0.9);
+            background-color: rgba(255, 255, 255, 0.95);
             padding: 0.5em;
             padding-bottom: 0; }
             footer .block-block-edlp-entrees ul li .entree-content .term-description p {
@@ -1277,7 +1297,7 @@ footer {
       bottom: 20px;
       padding: 0.5em;
       padding-bottom: 20px;
-      background-color: rgba(255, 255, 255, 0.9);
+      background-color: rgba(255, 255, 255, 0.95);
       overflow: hidden;
       -webkit-box-sizing: border-box;
       box-sizing: border-box;

+ 32 - 1
sites/all/themes/custom/edlptheme/assets/scripts/main.js

@@ -1,15 +1,28 @@
 (function($) {
 
-
   EdlpTheme = function(){
 
+    var _is_front = $('body').is('.path-frontpage');
+    var _$corpus_map;
+    var _$content_container = $('.layout-container>main>.layout-content');
 
     function init(){
       console.log("EdlpTheme init()");
+      // if(_is_front) initFront();
+
+      $('body').on('corpus-map-ready', onCorpusMapReady);
+
       initScrollbars();
+
       initAjaxLinks();
     };
 
+
+
+    // function initFront(){
+    //   console.log('theme : initFront');
+    // };
+
     function initScrollbars(){
       $('.os-scroll').overlayScrollbars({
         overflowBehavior:{x:'h',y:'scroll'}
@@ -19,6 +32,7 @@
       // });
     };
 
+    // ajax
     function  initAjaxLinks(){
       console.log('initAjaxLinks');
       $('a', '#block-mainnavigation').on('click', onClickAjaxLink);
@@ -39,6 +53,23 @@
       initScrollbars();
     };
 
+    // corpus
+    function onCorpusMapReady(e){
+      console.log('theme : onCorpusReady');
+      _$corpus_map = $('canvas#edlp-map');
+      _$corpus_map.on('corpus-cliked-on-map', function(e) {
+        console.log('theme : corpus-cliked-on-map');
+        closeAllModals();
+      });
+    }
+
+    //modals
+    function closeAllModals(){
+      console.log('theme : closeAllModals');
+      // TODO: animate the remove 
+      _$content_container.html('');
+    };
+
     init();
   }
 

+ 3 - 3
sites/all/themes/custom/edlptheme/assets/scripts/shared_variables.js

@@ -1,6 +1,6 @@
 edlp_vars = {
-  "e_col_130": "rgb(126, 8, 104)",
-  "e_col_121": "rgb(58, 51, 182)",
+  "e_col_130": "rgb(75, 143, 126)",
+  "e_col_121": "rgb(134, 142, 36)",
   "e_col_134": "rgb(43, 143, 47)",
   "e_col_121": "rgb(58, 51, 182)",
   "e_col_125": "rgb(44, 159, 87)",
@@ -20,4 +20,4 @@ edlp_vars = {
   "e_col_131": "rgb(82, 25, 171)",
   "e_col_126": "rgb(212, 156, 182)",
   "e_col_123": "rgb(73, 119, 21)"
-};
+};

+ 24 - 6
sites/all/themes/custom/edlptheme/assets/styles/app.scss

@@ -11,6 +11,7 @@
 @import 'base/shared_variables';
 @import 'base/grid';
 @import 'base/layout';
+@import 'base/fonts';
 
 // header
 
@@ -111,15 +112,32 @@ main[role="main"]{
         pointer-events:all;
         max-height: 100%;
         position: relative;
-      }
-      .col>*{
-        border-top: 1px solid red;
-        border-bottom: 1px solid red;
-        background-color: $transparent-bg;
-        max-height: 100%;
+        &>.wrapper{
+          border-top: 1px solid red;
+          border-bottom: 1px solid red;
+          background-color: $transparent-bg;
+          max-height: 100%;
+          padding:0 0 1em;
+          &>*{
+            padding:0 1em;
+          }
+        }
       }
     }
   }
+  article.node>h2{
+    @include content_titles;
+  }
+  article.node p{
+    @include content_courant;
+  }
+  img{
+    max-width: 100%;
+  }
+  ul, li, ul.inline li:first-child{
+    margin:0; padding:0;
+    list-style: none;
+  }
 }
 #agenda{
   pointer-events: auto;

+ 1 - 1
sites/all/themes/custom/edlptheme/assets/styles/base/_colors.scss

@@ -1 +1 @@
-$transparent-bg: rgba(255,255,255, 0.9);
+$transparent-bg: rgba(255,255,255, 0.95);

+ 9 - 0
sites/all/themes/custom/edlptheme/assets/styles/base/_fonts.scss

@@ -0,0 +1,9 @@
+@mixin content_titles {
+  font-size: 0.9em;
+  font-weight: normal;
+  text-transform: uppercase;
+}
+@mixin content_courant {
+  font-size: 0.75em;
+  font-weight: normal;
+}