Ver código fonte

teaser will end automaticly on 2016-07-02T18:30

Bachir Soussi Chiadmi 9 anos atrás
pai
commit
3c721780a6

+ 1 - 1
www/public_html/css/dist/styles.min.css

@@ -1 +1 @@
-#timelaps,body,html{position:relative;overflow:hidden}#root,#timelaps,body,html{width:100%;height:100%}#mapin,#mapout{width:23.5%;height:10%;background-color:rgba(255,255,255,.6)}#mapin,#mapout,#timeline{position:absolute;z-index:9;bottom:0;border-radius:2px}#header,body.teasing #mapin,body.teasing #mapout,body.teasing #timelaps{display:none}body,html{margin:0;padding:0;background-color:#000}#root{position:relative}#header{position:absolute;z-index:10;top:0;left:0}#timelaps{z-index:5}#timelaps video#timelapsvid{position:absolute;top:0;left:0;width:100%;height:100%}@media (min-aspect-ratio:16 / 9){#timelaps video#timelapsvid{height:200%;top:-50%}}@media (max-aspect-ratio:16 / 9){#timelaps video#timelapsvid{width:200%;left:-50%}}#mapout{left:0;margin:1% .5% 1% 1%}#mapin{left:25%;margin:1% .5%}#timeline{right:0;width:48%;margin:1% 1% 1% .5%;padding:.5%;height:8.3%;background-color:rgba(15,15,15,.8)}#teaser,#teaser .layer{width:100%;height:100%;top:0;left:0;position:absolute}#timeline .vis-background,#timeline .vis-background.vis-horizontal,#timeline .vis-background.vis-vertical,#timeline .vis-panel.vis-bottom,#timeline .vis-panel.vis-center,#timeline .vis-panel.vis-top,#timeline .vis-time-axis,#timeline .vis-timeline{border:none}#timeline .vis-text{color:#827f7f}#timeline .vis-custom-time.videotime{background-color:#2781cc}#teaser{z-index:50;background-color:#000;background-image:url(../assets/lagare.png);background-size:cover;background-repeat:no-repeat}#teaser .layer{background-color:rgba(0,0,0,.7)}#teaser .popup{position:absolute;background-color:rgba(0,0,0,.8);width:20%;left:50%;top:45%;margin-left:-10%;border-radius:4px}#teaser .popup h1{color:#fff;text-align:center;font-family:monospace}
+#timelaps,body,html{position:relative;overflow:hidden}#root,#timelaps,body,html{width:100%;height:100%}#mapin,#mapout{width:23.5%;height:10%;background-color:rgba(255,255,255,.6)}#mapin,#mapout,#timeline{position:absolute;z-index:9;bottom:0;border-radius:2px}body,html{margin:0;padding:0;background-color:#000}#root{position:relative}#header{position:absolute;z-index:10;top:0;left:0;display:none}#timelaps{z-index:5}#timelaps video#timelapsvid{position:absolute;top:0;left:0;width:100%;height:100%}@media (min-aspect-ratio:16 / 9){#timelaps video#timelapsvid{height:200%;top:-50%}}@media (max-aspect-ratio:16 / 9){#timelaps video#timelapsvid{width:200%;left:-50%}}#mapout{left:0;margin:1% .5% 1% 1%}#mapin{left:25%;margin:1% .5%}#timeline{right:0;width:48%;margin:1% 1% 1% .5%;padding:.5%;height:8.3%;background-color:rgba(15,15,15,.8)}#teaser,#teaser .layer{width:100%;height:100%;top:0;left:0;position:absolute}#timeline .vis-background,#timeline .vis-background.vis-horizontal,#timeline .vis-background.vis-vertical,#timeline .vis-panel.vis-bottom,#timeline .vis-panel.vis-center,#timeline .vis-panel.vis-top,#timeline .vis-time-axis,#timeline .vis-timeline{border:none}#timeline .vis-text{color:#827f7f}#timeline .vis-custom-time.videotime{background-color:#2781cc}#teaser{display:none;z-index:50;background-color:#000;background-image:url(../assets/lagare.png);background-size:cover;background-repeat:no-repeat}#teaser .layer{background-color:rgba(0,0,0,.7)}#teaser .popup{position:absolute;background-color:rgba(0,0,0,.8);width:20%;left:50%;top:45%;margin-left:-10%;border-radius:4px}#teaser .popup h1{color:#fff;text-align:center;font-family:monospace}body.teasing #teaser{display:block}body.teasing #mapin,body.teasing #mapout,body.teasing #timelaps,body.teasing #timeline{display:none}

+ 5 - 1
www/public_html/css/styles.css

@@ -85,6 +85,7 @@ html, body {
     background-color: #2781cc; }
 
 #teaser {
+  display: none;
   position: absolute;
   z-index: 50;
   top: 0;
@@ -115,5 +116,8 @@ html, body {
       text-align: center;
       font-family: monospace; }
 
-body.teasing #timelaps, body.teasing #mapin, body.teasing #mapout {
+body.teasing #teaser {
+  display: block; }
+
+body.teasing #timelaps, body.teasing #timeline, body.teasing #mapin, body.teasing #mapout {
   display: none; }

+ 2 - 2
www/public_html/index.php

@@ -14,7 +14,7 @@ header("Pragma: no-cache");
     <link href="bower_components/leaflet/dist/leaflet.css" rel="stylesheet" type="text/css" />
     <link rel="stylesheet" href="css/styles.css" media="screen" charset="utf-8">
   </head>
-  <body class="teasing">
+  <body>
     <div id="root">
       <header id="header">
         <h1>hehe, Exo Planete</h1>
@@ -50,7 +50,7 @@ header("Pragma: no-cache");
       <section id="teaser">
         <div class="layer"></div>
         <div class="popup">
-          <h1>Centiped</h1>
+          <h1>Centipede</h1>
         </div>
       </section>
 

+ 1 - 1
www/public_html/js/dist/script.min.js

@@ -1,5 +1,5 @@
 
-$(document).ready(function(){var _frames;var _$timelaps=$('#timelaps'),_$video=$("#timelapsvid"),_video=document.getElementById('timelapsvid'),_fps=12,_vid_current_time;var _timeline,_timeline_container=document.getElementById('timeline'),_tl_data_ar=[],_tl_items,_tl_start,_tl_end;var _mapout,_mapout_zoom=7,_mapout_pin,_mapout_provider="CartoDB.DarkMatter";var _mapin,_mapin_zoom=15,_mapin_pin,_mapin_provider="CartoDB.DarkMatter";var _map_pin_coordinates;var _mapicon=L.icon({iconUrl:'assets/icon.svg',iconSize:[20,20],iconAnchor:[10,10]});function init(){console.log("Init");tease();};function tease(){};function loadData(){console.log('loadData');$.ajax({dataType:"json",url:'metadata/frames.json',cache:false,success:setUpData});console.log('getMetaData END');};function setUpData(d){console.log("setUpData");_frames=d.frames;for(i in _frames){_frames[i].gps=_frames[i].gps.split(',').map(function(a){return parseFloat(a);});}
+$(document).ready(function(){var _frames;var _$timelaps=$('#timelaps'),_$video=$("#timelapsvid"),_video=document.getElementById('timelapsvid'),_fps=12,_vid_current_time;var _timeline,_timeline_container=document.getElementById('timeline'),_tl_data_ar=[],_tl_items,_tl_start,_tl_end;var _mapout,_mapout_zoom=7,_mapout_pin,_mapout_provider="CartoDB.DarkMatter";var _mapin,_mapin_zoom=15,_mapin_pin,_mapin_provider="CartoDB.DarkMatter";var _map_pin_coordinates;var _mapicon=L.icon({iconUrl:'assets/icon.svg',iconSize:[20,20],iconAnchor:[10,10]});function init(){console.log("Init");var now=Date.now();var opening=new Date("2016-07-02T18:30");if(window.location.hostname=="centipede.hehe.org"&&now<opening.getTime()){$('body').addClass('teasing');setTimeout(function(){window.location.reload();},1000*60);}else{loadData();}};function loadData(){console.log('loadData');$.ajax({dataType:"json",url:'metadata/frames.json',cache:false,success:setUpData});console.log('getMetaData END');};function setUpData(d){console.log("setUpData");_frames=d.frames;for(i in _frames){_frames[i].gps=_frames[i].gps.split(',').map(function(a){return parseFloat(a);});}
 _tl_start=new Date(_frames[0].datetime);_tl_end=new Date(_frames[_frames.length-1].datetime);_map_pin_coordinates=_frames[0].gps;console.log(_map_pin_coordinates);initDataReady();};function initDataReady(){console.log("initDataReady");setupTimeline();setupMap();setupVideoEvents();play();setTimeout(function(){_video.play();},2000);}
 function setupTimeline(){_timeline=new vis.Timeline(_timeline_container,[],{showCurrentTime:false,start:_tl_start,end:_tl_end,stack:false});_timeline.addCustomTime(_tl_start,"videotime");_timeline.on('click',onClickTimeline)}
 function onClickTimeline(props){console.log("onClickTimeline",props.time);};function moveTimelineCursor(date){_timeline.setCustomTime(date,"videotime",{animation:false});_timeline.moveTo(date,{animation:false});}

+ 14 - 4
www/public_html/js/script.js

@@ -22,14 +22,24 @@ $(document).ready(function() {
 
   function init(){
     console.log("Init");
-    tease();
-    // loadData();
-  };
 
-  function tease(){
+    // teasing
+    var now = Date.now();
+    var opening = new Date("2016-07-02T18:30");
+    // console.log(now);
+    // console.log(limit.getTime());
+    if( window.location.hostname == "centipede.hehe.org" && now < opening.getTime()){
+      $('body').addClass('teasing');
+      setTimeout(function(){
+        window.location.reload();
+      },1000*60);
+    }else{
+      loadData();
+    }
 
   };
 
+
   function loadData(){
     console.log('loadData');
     // $.getJSON('metadata/frame.json',function(data){

+ 3 - 1
www/public_html/scss/styles.scss

@@ -84,6 +84,7 @@ html, body{
 }
 
 #teaser{
+  display:none;
   position:absolute; z-index: 50;
   top:0; left:0; width:100%; height:100%;
   background-color: #000;
@@ -110,5 +111,6 @@ html, body{
 }
 
 body.teasing{
-  #timelaps, #mapin, #mapout{display: none;}
+  #teaser{display:block;}
+  #timelaps, #timeline, #mapin, #mapout{display: none;}
 }