block responsive

This commit is contained in:
2018-09-11 02:53:29 +02:00
parent 8913001708
commit dea51a66f2
6 changed files with 87 additions and 57 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
@font-face{font-family:CooperHewitt;src:url(../fonts/CooperHewitt/CooperHewitt-Bold.eot);src:url(../fonts/CooperHewitt/CooperHewitt-Bold.eot?#iefix) format('embedded-opentype'),url(../fonts/CooperHewitt/CooperHewitt-Bold.woff) format('woff'),url(../fonts/CooperHewitt/CooperHewitt-Bold.ttf) format('truetype'),url(../fonts/CooperHewitt/CooperHewitt-Bold.svg#CooperHewitt) format('svg')}@font-face{font-family:CooperHewitt-BoldItalic;src:url(../fonts/CooperHewitt/CooperHewitt-BoldItalic.eot);src:url(../fonts/CooperHewitt/CooperHewitt-BoldItalic.eot?#iefix) format('embedded-opentype'),url(../fonts/CooperHewitt/CooperHewitt-BoldItalic.woff) format('woff'),url(../fonts/CooperHewitt/CooperHewitt-BoldItalic.ttf) format('truetype'),url(../fonts/CooperHewitt/CooperHewitt-BoldItalic.svg#CooperHewitt-BoldItalic) format('svg')}@font-face{font-family:rubik;src:url(../fonts/rubik/Rubik-Light.eot);src:url(../fonts/rubik/Rubik-Light.eot?#iefix) format('embedded-opentype'),url(../fonts/rubik/Rubik-Light.woff) format('woff'),url(../fonts/rubik/Rubik-Light.ttf) format('truetype'),url(../fonts/rubik/Rubik-Light.svg#rubik) format('svg')}@font-face{font-family:Rubik-Bold;src:url(../fonts/rubik/Rubik-Bold.eot);src:url(../fonts/rubik/Rubik-Bold.eot?#iefix) format('embedded-opentype'),url(../fonts/rubik/Rubik-Bold.woff) format('woff'),url(../fonts/rubik/Rubik-Bold.ttf) format('truetype'),url(../fonts/rubik/Rubik-Bold.svg#Rubik-Bold) format('svg')}@font-face{font-family:Rubik-MediumItalic;src:url(../fonts/rubik/Rubik-MediumItalic.eot);src:url(../fonts/rubik/Rubik-MediumItalic.eot?#iefix) format('embedded-opentype'),url(../fonts/rubik/Rubik-MediumItalic.woff) format('woff'),url(../fonts/rubik/Rubik-MediumItalic.ttf) format('truetype'),url(../fonts/rubik/Rubik-MediumItalic.svg#Rubik-MediumItalic) format('svg')}@font-face{font-family:cmu-concrete-ita;src:url(../fonts/Concrete/cmunoti.eot);src:url(../fonts/Concrete/cmunoti.eot?#iefix) format('embedded-opentype'),url(../fonts/Concrete/cmunoti.woff) format('woff'),url(../fonts/Concrete/cmunoti.ttf) format('truetype'),url(../fonts/Concrete/cmunoti.svg#cmu-concrete-ita) format('svg')}*{box-sizing:border-box}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{font:inherit;font-size:16px;margin:0;padding:0;vertical-align:baseline;border:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body,html{height:100%}body{line-height:1}ol,ul{list-style:none}a{text-decoration:none;color:#000}blockquote,q{quotes:none}img{width:100%;height:100%;vertical-align:bottom}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-spacing:0;border-collapse:collapse}p{font-style:normal}p:last-child{margin:0}em{font-style:italic}strong{font-family:Rubik-MediumItalic;font-weight:400}text{font-family:rubik}h1{font-size:1.2rem;line-height:50px}h1 a{font-family:CooperHewitt;font-weight:400}h2{font-family:CooperHewitt-BoldItalic;font-size:1.1rem;line-height:50px}p{font-family:rubik;font-size:1rem;line-height:1.3rem;margin-bottom:12px}p a{font-family:cmu-concrete-ita}.blocs:nth-child(1){color:#fff}.blocs:nth-child(1) a{color:#00f}body{overflow:hidden;background:#e6e6e6}#page{height:100%}#page .navbar{width:100%;height:50px}#page .handler{position:absolute;z-index:999;top:50%;width:50px;height:50px;cursor:-webkit-grab;cursor:grab;border-radius:25px}#page .hand1{left:calc((100%/3) - 25px)}#page .hand2{right:calc((100%/3) - 25px)}#page .mouseDown{cursor:-webkit-grabbing;cursor:grabbing}#page #start{width:100%;height:calc(100% - 50px)}#page #start img{transition:filter .5s;filter:grayscale(100%) contrast(4)}#page #start img:hover{transition:filter .5s;filter:grayscale(0)}#page #start .blocs{position:absolute;overflow-y:auto;width:calc((100% / 3) - 1px);min-width:200px;height:calc((100% / 2 - 25px) - 1px);margin:0}#page #start .blocs:nth-child(1){background:#969696}#page #start .blocs:nth-child(-n+2){padding:0 20px}#page #start .blocs:nth-child(3n+2){left:calc((100% / 3) + 1px);background:#fff}#page #start .blocs:nth-child(3n+3){right:-1px;background:#fff}#page #start .blocs:nth-child(n+4){top:calc((100% / 2 + 25px) + 1px)}#page #start .blocs:nth-of-type(-n+2)>div:nth-child(n+1){margin-bottom:25px}#page #start #links canvas{top:0;left:0}#page #start #links canvas[resize]{width:100vw;height:100vh}#page #start #streetmap>div:nth-of-type(1){height:100%}#page #start #streetmap #mapid{width:100vw;height:100%} @font-face{font-family:CooperHewitt;src:url(../fonts/CooperHewitt/CooperHewitt-Bold.eot);src:url(../fonts/CooperHewitt/CooperHewitt-Bold.eot?#iefix) format('embedded-opentype'),url(../fonts/CooperHewitt/CooperHewitt-Bold.woff) format('woff'),url(../fonts/CooperHewitt/CooperHewitt-Bold.ttf) format('truetype'),url(../fonts/CooperHewitt/CooperHewitt-Bold.svg#CooperHewitt) format('svg')}@font-face{font-family:CooperHewitt-BoldItalic;src:url(../fonts/CooperHewitt/CooperHewitt-BoldItalic.eot);src:url(../fonts/CooperHewitt/CooperHewitt-BoldItalic.eot?#iefix) format('embedded-opentype'),url(../fonts/CooperHewitt/CooperHewitt-BoldItalic.woff) format('woff'),url(../fonts/CooperHewitt/CooperHewitt-BoldItalic.ttf) format('truetype'),url(../fonts/CooperHewitt/CooperHewitt-BoldItalic.svg#CooperHewitt-BoldItalic) format('svg')}@font-face{font-family:rubik;src:url(../fonts/rubik/Rubik-Light.eot);src:url(../fonts/rubik/Rubik-Light.eot?#iefix) format('embedded-opentype'),url(../fonts/rubik/Rubik-Light.woff) format('woff'),url(../fonts/rubik/Rubik-Light.ttf) format('truetype'),url(../fonts/rubik/Rubik-Light.svg#rubik) format('svg')}@font-face{font-family:Rubik-Bold;src:url(../fonts/rubik/Rubik-Bold.eot);src:url(../fonts/rubik/Rubik-Bold.eot?#iefix) format('embedded-opentype'),url(../fonts/rubik/Rubik-Bold.woff) format('woff'),url(../fonts/rubik/Rubik-Bold.ttf) format('truetype'),url(../fonts/rubik/Rubik-Bold.svg#Rubik-Bold) format('svg')}@font-face{font-family:Rubik-MediumItalic;src:url(../fonts/rubik/Rubik-MediumItalic.eot);src:url(../fonts/rubik/Rubik-MediumItalic.eot?#iefix) format('embedded-opentype'),url(../fonts/rubik/Rubik-MediumItalic.woff) format('woff'),url(../fonts/rubik/Rubik-MediumItalic.ttf) format('truetype'),url(../fonts/rubik/Rubik-MediumItalic.svg#Rubik-MediumItalic) format('svg')}@font-face{font-family:cmu-concrete-ita;src:url(../fonts/Concrete/cmunoti.eot);src:url(../fonts/Concrete/cmunoti.eot?#iefix) format('embedded-opentype'),url(../fonts/Concrete/cmunoti.woff) format('woff'),url(../fonts/Concrete/cmunoti.ttf) format('truetype'),url(../fonts/Concrete/cmunoti.svg#cmu-concrete-ita) format('svg')}*{box-sizing:border-box}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{font:inherit;font-size:16px;margin:0;padding:0;vertical-align:baseline;border:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body,html{height:100%}body{line-height:1}ol,ul{list-style:none}a{text-decoration:none;color:#000}blockquote,q{quotes:none}img{width:100%;height:100%;vertical-align:bottom}blockquote:after,blockquote:before,q:after,q:before{content:'';content:none}table{border-spacing:0;border-collapse:collapse}p{font-style:normal}p:last-child{margin:0}em{font-style:italic}strong{font-family:Rubik-MediumItalic;font-weight:400}text{font-family:rubik}h1{font-size:1.2rem;line-height:50px}h1 a{font-family:CooperHewitt;font-weight:400}h2{font-family:CooperHewitt-BoldItalic;font-size:1.1rem;line-height:50px}p{font-family:rubik;font-size:1rem;line-height:1.3rem;margin-bottom:12px}p a{font-family:cmu-concrete-ita}.blocs:nth-child(1){color:#fff}.blocs:nth-child(1) a{color:#00f}body{overflow:hidden;background:#e6e6e6}#page{height:100%}#page .navbar{width:100%;height:50px}#page .handler{position:absolute;z-index:999;top:50%;width:50px;height:50px;cursor:-webkit-grab;cursor:grab;border-radius:25px}#page .hand1{left:calc((100%/3) - 25px)}#page .hand2{right:calc((100%/3) - 25px)}#page .mouseDown{cursor:-webkit-grabbing;cursor:grabbing}#page #start{width:100%;height:calc(100% - 50px)}#page #start img{transition:filter .5s;filter:grayscale(100%) contrast(4)}#page #start img:hover{transition:filter .5s;filter:grayscale(0)}#page #start .blocs{position:absolute;overflow-y:auto;width:calc((100% / 3) - 1px);min-width:200px;height:calc((100% / 2 - 25px) - 1px);margin:0}#page #start .blocs:nth-child(1){background:#969696}#page #start .blocs:nth-child(-n+2){padding:0 20px}#page #start .blocs:nth-child(3n+2){left:calc((100% / 3) + 1px);background:#fff}#page #start .blocs:nth-child(3n+3){right:-1px;background:#fff}#page #start .blocs:nth-child(n+4){top:calc((100% / 2 + 25px) + 1px)}#page #start .blocs:nth-of-type(-n+2)>div:nth-child(n+1){margin-bottom:25px}#page #start #links canvas[resize]{width:100vw;height:100vh}#page #start #streetmap>div:nth-of-type(1){height:100%}#page #start #streetmap #mapid{width:100vw;height:100%}
+82 -45
View File
@@ -17,6 +17,7 @@ function clickhand(){
}; };
function drag() { function drag() {
var $hand1 = $( ".hand1" ); var $hand1 = $( ".hand1" );
var $hand2 = $( ".hand2" ); var $hand2 = $( ".hand2" );
@@ -24,29 +25,49 @@ function drag() {
containment: "#start", containment: "#start",
scroll: false, scroll: false,
drag: function(event, ui){ drag: function(event, ui){
var dragDistanceW = 300;
ui.position.left = Math.min( ui.position.left, ui.helper.next().offset().left + ui.helper.next().width()-dragDistanceW); // var dragDistance = 300;
ui.position.left = Math.max(ui.position.left, ui.helper.prev().offset().left + dragDistanceW); // ui.position.left = Math.min( ui.position.left, ui.helper.next().offset().left + ui.helper.next().width() - dragDistance);
// ui.position.left = Math.max(ui.position.left, ui.helper.prev().offset().left + dragDistance);
//
// // ui.position.top = Math.max( ui.position.top, ui.helper.prev().offset().top + ui.helper.prev().outerHeight() - dragDistance);
// ui.position.top = Math.max(ui.position.top, ui.helper.prev().offset().top + dragDistance);
// General
// origine
var oW = parseFloat($(window).outerWidth(true));
var oH = parseFloat($(window).outerHeight(true));
// pourcent
var p = 100;
// handler // handler
// dimension handler // position
var pos = $hand1.position();
var pos1 = $hand2.position();
// dimension
var $Whand = $(this).outerWidth(true); var $Whand = $(this).outerWidth(true);
var $Hhand = $(this).outerHeight(true); var $Hhand = $(this).outerHeight(true);
// center handler // center
var ajustH = $Hhand / 2;
var ajustW = $Whand / 2; var ajustW = $Whand / 2;
var ajustH = $Hhand / 2;
// position handler // position XY
var offset = $(this).offset(); var xPos = ( p * parseFloat( (pos.left + ajustW ) / oW ) ) + "%";
var xPos = offset.left + ajustW; var yPos = ( p * parseFloat( (pos.top - ajustH ) / oH ) ) + "%" ;
var yPos = offset.top - ajustH;
var xPos2 = xPos + $Whand; var xPos2 = ( p * parseFloat( (pos.left + ajustW ) / oW ) ) + "%";
var yPos2 = yPos + $Hhand; var yPos2 = ( p * parseFloat( (pos.top + ajustH ) / oH ) ) + "%" ;
var xPos3 = ( p * parseFloat( (pos1.left + ajustW) / oW ) ) + "%";
var yPos3 = ( p * parseFloat( (pos1.top + ajustH ) / oH ) ) + "%" ;
//handler2
var $handler2 = $(this).parent().find('.hand2');
// Blocs // Blocs
// find
var $recits = $(this).parent('#page').find('#recits'); var $recits = $(this).parent('#page').find('#recits');
var $itw = $(this).parent('#page').find("#interviews"); var $itw = $(this).parent('#page').find("#interviews");
var $img = $(this).parent('#page').find("#images"); var $img = $(this).parent('#page').find("#images");
@@ -54,44 +75,58 @@ function drag() {
var $rs = $(this).parent('#page').find("#reseaux-sociaux"); var $rs = $(this).parent('#page').find("#reseaux-sociaux");
var $links = $(this).parent('#page').find("#links"); var $links = $(this).parent('#page').find("#links");
//handler2 // dimension en px
var $handler2 = $(this).parent().find('.hand2'); var $Dr = $recits.outerWidth(true);
var $Di = $itw.outerWidth(true);
var $Dimg = $img.outerWidth(true);
var $Dstr = $stmp.outerWidth(true);
var $Drs = $rs.outerWidth(true);
var $Dlinks = $links.outerWidth(true);
// dimension blocs // dimension blocs en %
//windows //windows
var Dw0 = $(window).outerWidth(true); var DoW = ( p * (oW / oW ) ) + "%" ;
var DoH = ( p * (oH / oH ) ) + "%" ;
//blocs //blocs
var Dw1 = $recits.outerWidth(true); // recit
var Dw2 = $itw.outerWidth(true); var DrW = ( p * parseFloat( ($Dr) / oW ) ) + "%" ;
var Dw3 = $img.outerWidth(true); // interviews
var Dw4 = $links.outerWidth(true); var DitwW = ( p * parseFloat( ($Di) / oW ) ) + "%" ;
var Dw5 = $rs.outerWidth(true); // images
var Dw6 = $stmp.outerWidth(true); var DimgW = ( p * parseFloat( ($Dimg) / oW ) ) + "%" ;
// street
var DstmpW = ( p * parseFloat( ($Dstr) / oW ) ) + "%" ;
// reaseaux
var DrsW = ( p * parseFloat( ($Drs) / oW ) ) + "%" ;
// links
var DlinksW = ( p * parseFloat( ($Dlinks) / oW ) ) + "%" ;
var xPos3 = Dw0 - xPos; var PosHand = (parseFloat(xPos3) - parseFloat(xPos)) + "%";
var Bw2 = (Dw0 - (Dw1 + Dw3));
var Bw3 = (Dw0 - (Dw1 + Dw2));
var Bl3 = Dw1 + Dw2;
// app dimension // application dimension
$handler2.css({ $(this).css({
"top": yPos + 25, 'left': xPos,
}); 'top': yPos
})
$hand2.css({
'top': yPos,
})
$recits.css({ $recits.css({
"width":xPos, "width": xPos,
"height": yPos - 2, "height": yPos,
}); });
$itw.css({ $itw.css({
"left":xPos, "left":xPos,
"width": Bw2, "width": PosHand,
"height": yPos - 2, "height": yPos,
}); });
$img.css({ $img.css({
"height": yPos - 2, "height": yPos,
}); });
$stmp.css({ $stmp.css({
@@ -104,7 +139,7 @@ function drag() {
$rs.css({ $rs.css({
"top": yPos2, "top": yPos2,
"left":xPos, "left":xPos,
"width":Bw2, "width":PosHand,
"bottom":0, "bottom":0,
"height": 'auto', "height": 'auto',
}); });
@@ -121,12 +156,14 @@ function drag() {
$hand2.draggable({ $hand2.draggable({
containment: "#start", containment: "#start",
scroll: false, scroll: false,
drag: function(event, ui){
drag: function(event, ui){
var dragDistance = 300; var dragDistance = 300;
ui.position.left = Math.min( ui.position.left, ui.helper.next().offset().left + ui.helper.next().width()-dragDistance); ui.position.left = Math.min( ui.position.left, ui.helper.next().offset().left + ui.helper.next().width()-dragDistance);
ui.position.left = Math.max(ui.position.left, ui.helper.prev().offset().left + dragDistance); ui.position.left = Math.max(ui.position.left, ui.helper.prev().offset().left + dragDistance);
ui.position.top = Math.max(ui.position.top, ui.helper.next().offset().top + dragDistance);
// handler // handler
// dimension handler // dimension handler
var $Whand = $(this).outerWidth(true); var $Whand = $(this).outerWidth(true);
@@ -173,11 +210,11 @@ function drag() {
var Bl3 = Dw1 + Dw2; var Bl3 = Dw1 + Dw2;
// app dimension // app dimension
//
$handler1.css({ // $handler1.css({
"top": yPos + 25, // "top": yPos + 25,
//
}); // });
$recits.css({ $recits.css({
"height": yPos - 2, "height": yPos - 2,
@@ -213,6 +250,7 @@ function drag() {
"height": 'auto', "height": 'auto',
}); });
} }
}); });
}; };
@@ -222,12 +260,11 @@ function dragcanvas() {
var $reseau = $('#reseaux-sociaux svg') var $reseau = $('#reseaux-sociaux svg')
$links.draggable({ $links.draggable({
// containment:".bottom", // containment:"#start",
scroll: false scroll: false
}); });
$reseau.draggable({ $reseau.draggable({
// containment:".bottom",
scroll: false scroll: false
}); });
@@ -250,6 +287,6 @@ $(document).ready(function() {
clickhand(); clickhand();
map(); map();
drag(); drag();
// dragcanvas(); dragcanvas();
// scrollbar(); // scrollbar();
}); });
+1 -7
View File
@@ -21,11 +21,9 @@ body{
.hand1{ .hand1{
left : calc((100%/3) - 25px); left : calc((100%/3) - 25px);
} }
.hand2{ .hand2{
right: calc((100%/3) - 25px); right: calc((100%/3) - 25px);
} }
.mouseDown{ .mouseDown{
cursor: grabbing; cursor: grabbing;
} }
@@ -73,10 +71,6 @@ body{
} }
#links{ #links{
canvas{
top: 0;
left: 0;
}
canvas[resize] { canvas[resize] {
width: 100vw; width: 100vw;
height: 100vh; height: 100vh;
@@ -97,5 +91,5 @@ body{
height: 100%; height: 100%;
} }
} }
} }
} }
-1
View File
@@ -39,4 +39,3 @@
</section> </section>
</section> </section>
{% endblock %} {% endblock %}
@@ -72,9 +72,11 @@
{% endblock %} {% endblock %}
{% block hero %}{% endblock %} {% block hero %}{% endblock %}
<div class="handler hand1"> <div class="handler hand1">
<img src="user/themes/r2c/images/handler.svg" alt=""> <img src="user/themes/r2c/images/handler.svg" alt="">
</div> </div>
<div class="handler hand2"> <div class="handler hand2">
<img src="user/themes/r2c/images/handler.svg" alt=""> <img src="user/themes/r2c/images/handler.svg" alt="">
</div> </div>