off canvas menu in container with bootstrap - angularjs

I'm trying to build an "off canvas menu" like that on www.bikepacking.com,
but I'm struggling with using this in a container.
I use Bootstrap with QuantumUI and without jQuery.
My approach is something like this:
<div class="container wrapper">
<rw-navigation>
</rw-navigation>
<div class="brandbar">
<input type="checkbox" id="nav-trigger" class="nav-trigger"/>
<label for="nav-trigger"></label>
</div>
<div class="content">
<header>
</header>
<div ui-view=""></div>
<footer>
<p>© 2015 {{'footer.copyright' | translate}}</p>
</footer>
</div>
</div>
With some styles like this:
div.container.wrapper{
position: relative;
overflow: hidden;
.navigation{
position: absolute;
top: 0;
bottom: 0;
height: 100%;
left: 0;
width: 256px;
#include transition(left, 0.5s, ease);
background: #111;
color: white;
}
.brandbar{
position:absolute;
top: 50px;
left:0;
#include transition(left, 0.5s, ease);
}
.content {
overflow: hidden;
position: relative;
width: auto;
bottom: 100%;
left: 0;
}
}
The .navigation class is applied in the template of the rwNavigation directive with replace: true.
It doesn't work and I don't know why.

OK,
Now I got some tima at work for that problem.
THX# Sitepoint for this tutorial which gave me the right direction:
http://www.sitepoint.com/pure-css-off-screen-navigation-menu/
BUt I had to change form position:fixed to position:absolute, because position:fixed only refer to the window and position:absolute refer to prant position:relative element (or windows if there isnt a parent postion:relative element)
And here is a plnkr with the solution for a boxed off canvas menu
http://plnkr.co/edit/OdkXXkhGzKLd0qi2RZ4h?p=preview

Related

How to adjust the overlay card same size and position as its bottom card in React?

I want to make a hover animation effect in scss. The idea is when cursor hover on the card, another hidden card appear on top of the hovered card.
But now I got stuck on making the hidden card scss: I am not sure how to make the card the same size and the same position as the bottom card(dark blue card). It is for the className "card-hover"
Below is the code for js:
<div className="gallery">
{data.map((item)=>
<div className="card-holder" key={item.id}>
<div className="card-head">
<img className="card-img" src={item.image} alt="project item" />
</div>
<div className="card-body">
<h2 className="item-name">{item.title}</h2>
<div className="item-date">{item.year}</div>
</div>
<div className="card-hover">
<div className="item-role">{item.role}</div>
<div className="item-type">{item.type}</div>
<div className="item-decs">{item.desc}</div>
</div>
</div>
)}
</div>
Code for scss:
.gallery{
margin-left: 10rem;
margin-right: 10rem;
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 8px;
justify-content: center;
}
.card-holder{
border-radius: 4px;
margin-top: 1rem;
background-color: $darkBlue;
box-shadow: 0px 8px 56px rgb(15 80 100 / 16%);
}
.card-hover {
position: absolute;
background-color: #D62839;
display: inline;
width: 100%;
height: 100%;
}
The current result:
enter image description here
I have looked through tutorial videos of how to make this kind of hover effect, but all solutions so far were to set
width:100%;
height:100%
or
top:0;
bottom:0;
left:0;
right:0;
However, when I tried them the result is like the screenshot above. Can someone help me with this? Thank you

PrimeNg (7.x) / P-TREE / Filter / Double scroll bar

When I add the filter property on a PrimeNg (7.x) p-tree it works as expected but I have a double scroll bar.
The implementation is not special
<div class="row" *ngIf="formControls.wantThemes.value">
<div class="col-4 app-notif-edit-label"></div>
<div class="col-4 app-notif-edit-content">
<h4>Themes</h4>
<p-tree
[filter]="true"
class="app-notif-p-tree"
[value]="cmtyThemesTreeNodes"
[(selection)]="selectedCmtyThemesTreeNodes"
selectionMode="checkbox"
(onNodeSelect)="nodeSelectThemes($event)"
(onNodeUnselect)="nodeSelectThemes($event)"
>
</p-tree>
</div>
</div>
I have applied the following css to limit the size of the box
.app-notif-p-tree .ui-tree {
color: $sinapseBlue;
display: block;
font-size: medium;
height: 100%;
margin: 2% auto;
max-height: 250px;
min-height: 250px;
overflow: auto;
white-space: nowrap;
width: 97%; }
If I change the overflow to hidden, I don't see the last element of my list.
Any idea why? Thanks
I have added .app-notif-p-tree .ui-tree .ui-tree-container { height: 80%; }

When moving a div with ngAnimate, how can I move adjacent divs smoothly?

I have two divs side-by-side (inline block). Using Angular's ngAnimate, I want the left div to slide off the screen and the right div to slide over and take it's place.
Right now what happens is the left div slides away, and once that animation completes, the right div jumps over to take it's spot. How do I make it slide over smoothly at the same time?
Here's a Plunker which demonstrates it a lot better than I can explain it:
https://plnkr.co/edit/ZrtPPkXlttih15ISgEhk
Here's the css/html:
Css:
.well{
overflow-x: hidden;
overflow-y: hidden;
}
.column{
display: inline-block;
width: 100px;
vertical-align: top;
transition: all linear 1.0s;
left: 0px;
position: relative;
opacity: 1;
}
.column.ng-hide{
left: -200px;
opacity: 0;
}
Html:
<div>
<button ng-click="hide = !hide">Toggle</button>
</div>
<div class="well">
<div ng-hide="hide" class="column" style="background-color: lightblue; height: 150px;">
</div>
<div class="column">
This column does not move smothly as the column to the left slides offscreen.
</div>
</div>
Here's that Plunker again, in case you scrolled to the bottom looking for the Plunker link :)
https://plnkr.co/edit/ZrtPPkXlttih15ISgEhk
You simply need to change the width of the column in your transition:
PLUNKR
.well{
overflow-x: hidden;
overflow-y: hidden;
}
.column{
display: inline-block;
width: 100px;
vertical-align: top;
transition: all ease-in-out 1.0s;
left: 0px;
position: relative;
opacity: 1;
}
.column.ng-hide{
width: 0;
left: -200px;
opacity: 0;
}
The reason it wasn't working for you, is due to the fact that the width is remaining the same until the div becomes hidden. This prevents the right column from sliding over as the left column slides out of view. By setting the transition to adjust the width, you can give it that "sliding" effect along the right-edge.
I also changed the animation from linear to ease-in-out to give it a nicer transition

AngularJS an Bootstrap tooltip with span

I have an Angular1.0.7 web application. I´m adding a Twitter Bootstrap 2 tooltip to an span tag, but the tooltip is displayed very narrow. This is not happening with many other tooltips I have in the application.
<span style="line-height: 45px" ng-show="controlSkipperType || createBoatPoliciesForm.skipperType.$error.validateSkipperType" class="text-error" ng-switch="skipperTypeError">
<span ng-switch-when="OPTIONAL_ERROR" style="position: relative; top: -15px; margin-left: 10px" class="pull-left">{{'SKIPPER_TYPE_OPTIONAL_ERROR' | translate}}.</span>
<span ng-switch="skipperTypeError" style="position: relative; top: -15px; margin-left: 10px">
<i ng-switch-when="OPTIONAL_ERROR" class="fa-icon-question-sign" tooltip="Text to show in the tooltip"></i>
See the picture:
Something like this:
div > div .popover-content {
min-width: 620px !important;
}

Responsive content div only

Okay so simply I have this layout consisting of two elements, a navigation ("left") and the actual site content ("right").
Now what I want is that the "left" div just stays like it is, but when downsizing the screen to a certain size, I would like the content div's width to decrease with it.
However, I have no idea on how to start. When I look up responsive web design I can only find skeletons for entire layouts with loads of divs and percentages but I just want this for one div only and I'm totally confused.
This is what I have right now:
.right {
width: 750px;
margin: 40px 0 40px 50px;
float: left;
position: relative;
}
.left {
margin: 40px 0px 40px 40px;
width: 210px;
float: left;
position: relative;
}
Hopefully this http://jsbin.com/uquzaw/1/ isn't too overwhelming.
Essentially, you need percentages in your css and a meta tag in your html to get the effect you are looking for.
What you're asking for isn't exactly responsive design. If I understand you correctly, you are going to need percentage widths.
HTML:
<div id="left">
Nav1 <br>
Nav2 <br>
Nav3 <br>
Nav4 <br>
</div>
<div id="right">
This is where the main content will go.
</div>
CSS:
body { margin: 0; padding: 0; }
#left {
width: 20%;
height: 100%;
background: red;
float: left;
text-align: center;
}
#right {
width: 80%;
height: 100%;
background: blue;
float: left;
text-align: center;
}

Resources