Responsive Image Orbit Slider - responsive-design

I have a Foundation 6 orbit slider that on desktop displays 4 columns, each column an image. The user is able to scroll through images 4 thumbnails at a time.
When the screen size hits my 'small' size I want the slider to display 1 thumbnail instead of 4.
You can see the page where this is implemented here: robertrhu.net/vail/tier1.html.
Its the image slider on top of the blue background mountains.
Here's my code for the 4 thumbnail slider:
HTML:
<!--HTML FOR ORBIT THUMB IMAGE SLIDER-->
<!--THUMB IMAGE SLIDER ROW-->
<div
class="row"
id="thumb-slider-container">
<!--THUMB IMAGE SLIDER HEADING-->
<h1>
Lorem Ipsum Dolor
</h1>
<!--END HOME POSTS SLIDER HEADING-->
<!--ORBIT SLIDER WRAPPER-->
<div
class="orbit"
role="region"
aria-label="Thumbnail Image Slider"
data-orbit
data-use-m-u-i="false"
data-option="autoplay:false;">
<!--ORBIT SLIDER CONTAINER-->
<ul
class="orbit-container">
<!--ORBIT SLIDER PREVIOUS ARROW BUTTON-->
<button
class="orbit-previous">
<span
class="show-for-sr prev-slide">
<i
class="icon-chevron-left">
</i>
</span>
</button>
<!--END ORBIT SLIDER PREVIOUS ARROW BUTTON-->
<!--ORBIT SLIDER NEXT ARROW BUTTON-->
<button
class="orbit-next">
<span
class="show-for-sr next-slide">
<i
class="icon-chevron-right">
</i>
</span>
</button>
<!--END ORBIT SLIDER NEXT ARROW BUTTON-->
<!--ORBIT POST SLIDES-->
<!--4 THUMBNAAIL GRID SLIDE FOR ORBIT SLIDER-->
<li
class="is-active orbit-slide">
<!--GRID CLASS-->
<ul
class="row small-up-1 medium-up-4">
<!--IMAGE COLUMN-->
<li
class="column">
<img
src="assets/img/thumb-slider-image-1.jpg"
class="post-thumb-photo" />
</li>
<!--END IMAGE COLUMN-->
<!--IMAGE COLUMN-->
<li
class="column">
<img
src="assets/img/thumb-slider-image-1.jpg"
class="post-thumb-photo" />
</li>
<!--END IMAGE COLUMN-->
<!--IMAGE COLUMN-->
<li
class="column">
<img
src="assets/img/thumb-slider-image-1.jpg"
class="post-thumb-photo" />
</li>
<!--END IMAGE COLUMN-->
<!--IMAGE COLUMN-->
<li
class="column">
<img
src="assets/img/thumb-slider-image-1.jpg"
class="post-thumb-photo" />
</li>
<!--END IMAGE COLUMN-->
</ul>
<!--END GRID CLASS-->
</li>
<!--4 THUMBNAAIL GRID SLIDE FOR ORBIT SLIDER-->
</ul>
<!--END ORBIT SLIDER CONTAINER-->
</div>
<!--END ORBIT SLIDER WRAPPER-->
</div>
<!--END THUMB IMAGE SLIDER ROW-->
SCSS:
#thumb-slider-container {
background-image: url('../img/thumb-image-slider-background.jpg');
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: top left;
padding: 2.5rem 5.313rem 3.125rem 5.313rem;
max-width: 100%;
h1 {
color: white;
}
.orbit {
padding: 0 3.25rem 0px 3.5rem;
.orbit-container {
max-width: 1170px;
margin: 0 auto;
.orbit-slide {
max-width: 1170px;
margin: 0 auto;
ul {
margin-bottom: 0;
li.column {
&:last-child {
padding-right: 0;
}
img {
margin-bottom: 0;
&:last-of-type {
margin-right: 0;
}
}
}
}
}
}
}
}

i've been checking the page, but there is a video in the hero-area, no slider? Do I miss something, have you changed anything?
But I'd recommend to use owl carousel 2 as it has tons of options (like the option to set the number of slides for each breakpoint) and supports foundation (so every slide can hold f6 markup for complex layouts inside the slider).
http://www.owlcarousel.owlgraphic.com/
In F5 orbit was deprecated and just for prototyping. I never found an information about orbit in F6 (so i wouldn't recommend to use it on a production site imho).
Maybe this helps you anyway.
all the best

Related

Why my video stretching on Firefox but not on Chrome?

I try to make a banner video that will stretch always at 100% of the width. It works great on Firefox, but not Chrome. Why? See https://www.gustdive.com for example. I tried to use the code snippet, however, there are too much compatibility issues and it doesn't work fine. The only way that I can provide a concrete example is with my link itself.
Thanks #Mav for providing the visual example! Please see
Firefox
Chrome
Here is my code:
<!-- Main Layout Content -->
<md-content md-colors="accent">
<!-- Tabs Layout -->
<md-tabs md-selected="ctrl.tabSelected" md-stretch-tabs="always" class="md-primary" md-dynamic-height md-border-bottom>
<!-- Home Tab -->
<md-tab>
<!-- Home Tab Label -->
<md-tab-label>
<h2>
<md-icon md-svg-src="media/image/icon/home.svg"></md-icon>
<span hide show-gt-sm>
Home
</span>
</h2>
</md-tab-label>
<!-- Home Tab Body -->
<md-tab-body>
<!-- Home Tab Banner -->
<div layout="column" layout-align="start center" style="overflow-y: hidden; max-height: 275px; text-align: center; background-color: #000;">
<div id="banner-title" style="position: absolute;">
<img src="media/image/icon/logo-white-192x192.png" alt="GustDive Logo" />
<span hide show-gt-xs>
<br />
<h1 style="font-size: 50px; color: white; text-shadow: 0 0 10px white; letter-spacing: 15px;" flex>
GustDive
</h1>
</span>
</div>
<video loop muted autoplay style="width: 100%;">
<source src="media/video/underwater-720p.mp4" type="video/mp4">
<source src="media/video/underwater-360p.mp4" media="(max-width: 640px)" type="video/mp4">
</video>
</div>
<!-- Home Tab Content -->
<md-content layout="row" layout-xs="column" layout-wrap>
</md-content>
</md-tab-body>
</md-tab>
</md-tabs>
<!-- Website Footer -->
<div md-colors="{background: 'grey-A200'}" layout-padding>
<div layout="row" layout-align="end center">
<a target="_blank" href="https://www.padi.com" aria-label="Padi">
<img src="media/image/icon/padi.png" alt="Padi" />
</a>
<a target="_blank" href="https://www.tripadvisor.com/Attraction_Review-g150793-d11888983-Reviews-GustDive-Puerto_Vallarta.html" aria-label="Trip Advisor">
<img src="media/image/icon/trip-advisor.png" alt="Trip Advisor" />
</a>
</div>
<div layout-align="center end" style="font-size: 12px; text-align: center;">Copyright © Jonathan-Gagne.com 2018</div>
</div>
</md-content>
Use object-fit: fill to make the width 100% on Chrome. This will not work for IE11 though (see caniuse).

md-tooltip not working with marquee

I am using md-tooltip in md-button and using marquee to display scrolling label of button. But md-tooltip just shows for a second and then disappears when I move mouse over the md-button. I have noticed that when I remove the marquee code md-tooltip is getting displayed properly. Tried using md-z-index, md-visible as well but no help. All the controls are added in section.
<section layout="row" layout-sm="column" layout-align="center center" layout-wrap>
<div ng-repeat="mybutton in allbuttons">
<md-button class="md-fab">
<div >
<md-tooltip md-direction="top" md-visible="true">{{mybutton.buttontooltip}}</md-tooltip>
<img ng-src={{mybutton.imagesource}} style="width:50px" />
</div>
</md-button>
<div class="buttonLabel">
<marquee scrollamount="1" style="float:left; font-size: 12px; width:70px; color: white; padding-right: 5em">
<div>
{{buttonlabel}}
</div>
</marquee>
</div>
</div>
</section>
my css for class buttonLabel is as below.
.buttonLabel {
background-color: #080808;
color:#EEE5E5;
bottom: 2px;
left: 520px;
margin: 10px;
}
Plucker link is below. If you remove marquee it will work fine.
https://codepen.io/naddy1/pen/eKbGVN
Please let me know if I am doing it the correct way?

Override webpage centered

I am using Angular Drywall to build my website. The default alignment of this is in the center. However, the template I want to render, requires to occupy 100% of the body width.
I used in css,
body{
width:100%;
margin-left:0;
padding-left: 0;
background-color: yellow;
}
This does render yellow to the entire viewing area. But the content in my template is still rendered to the center.
How do I override that ?
Thank you.
EDIT:
I do not have a lot of code. I have attached two picture of how it looks and how I want it to look.
<h1>Work Bench </h1>
<div class="col-lg-3 left">
<div class="input-group resize">
<input type="text" class="form-control" placeholder="Search Element"/>
<span class="input-group-addon">
<i class="fa fa-search"></i>
</span>
</div>
</div>
Bootstrap solution:
Close the container or container-fluid div and reopen it after placing your content betweeen.
<div class="container">
<!-- navigation bar stuff -->
</div>
your elements here
<div class="container">
<!-- footer stuff -->
</div>
Bootply example

How to destroy Charts in chartJS

I have an angular + Ionic app in which I am using chartJS to show some data. Now charts are implemented on a slider.
Link1 Link2 and there are similar linked issues.
The solution that I came across. from many of the post is that I would have to destroy the existing chart and recreate in my window. Because whenever I change options via a drop drow the view blows up, all slides instead of coming next to each other laterally, Start showing up vertically and when I change the device mode. It actually re renders the page and I can view it normally.
I have tried it using ng-if also but it doesn't work. So how do I destroy a chart in my angular App and then recreate it
Some HTML code as to how am I doing it.
<div ng-if="metricArray">
<ion-slide-box on-slide-changed="slideHasChanged($index)" style="height:50%">
<ion-slide ng-repeat="metric in metricArray">
<div style="text-align:center; margin-top:10px; color:#eee;">
{{metric.startDate}} {{metric.endDate}}
</div>
<canvas id="myCanvas" tc-chartjs-bar chart-options="options" chart-data="metric.data" auto-legend></canvas>
<div class="row" style="margin-top:30px;">
<div style="width:33%; text-align:center">
<h6 style="color:#eee">MAX</h6>
<div class="circleBase type1 " style="padding:15px; margin-left: auto; margin-right: auto;">
<h6 style="color:#eee">{{metric.max}}</h6>
<p style="color:#eee">{{metricUnit}}</p>
</div>
</div>
<div style="width:33%; text-align:center">
<h6 style="color:#eee">MIN</h6>
<div class="circleBase type1 " style="padding:15px; margin-left: auto; margin-right: auto;">
<h6 style="color:#eee">{{metric.min}}</h6>
<p style="color:#eee">{{metricUnit}}</p>
</div>
</div>
<div style="width:33%; text-align:center">
<h6 style="color:#eee">AVG</h6>
<div class="circleBase type1 " style="padding:15px; margin-left: auto; margin-right: auto;">
<h6 style="color:#eee">{{metric.avg}}</h6>
<p style="color:#eee">{{metricUnit}}</p>
</div>
</div>
</div>
</ion-slide>
</ion-slide-box>
</div>

How to slide up and slide down in AngularJS?

I am trying to make a simple toggle example in AngularJS. I am facing one issue I need to show and hide with some animation like slide up and slide down. I have search button on header on click I show search div it is working in my plunker. My issue is to do animation...
Secondly I need to add z-index because it generates new layer. When I click search button "my name " come down when search bar is open. Why?
<ion-view>
<ion-header-bar align-title="" class="bar-positive">
<div class="buttons">
<i style="font-size:25px!important" class="icon-right ion-android-radio-button-off" ng-click="showsearch()"></i>
</div>
<h1 class="title">Title!</h1>
<a class="button icon-right ion-chevron-right button-calm"></a>
</ion-header-bar>
<div class="list list-inset searchclass" ng-show="isdiplay">
<label class="item item-input">
<img src="https://dl.dropboxusercontent.com/s/n2s5u9eifp3y2rz/search_icon.png?dl=0">
<input type="text" placeholder="Search">
</label>
</div>
<ion-contend>
<div style="margin-top:50px">
my name
</div>
</ion-contend>
</ion-view>
When using Angular you still have the opportunity to use plain old CSS transitions. However, there are many ways to animate elements. In my solution here I use ng-class instead of ng-show. I toggle the class active when ever you click on the trigger. Finally the class changes the state of the element which results in the animation you would like to achieve.
You could simply change ng-show to ng-class="{'active':isdiplay}" and add the following CSS:
.searchclass {
border: 1px solid red;
margin: 0 !important;
position: relative;
top: 44px;
z-index: 9999;
-webkit-transition: height .3s ease-in-out;
transition: all .3s ease-in-out;
height: 0;
opacity: 0;
}
.searchclass.active {
height: 49px;
opacity: 1;
}
You can however, as I said before, also use ng-show with the module ngAnimate which needs to be included in one of your own modules. This will enable animations out of the box, so that elements which can be animated get classes such as .ng-hide-remove, .ng-hide-add and .ng-hide-add-active etc. You could then style those classes on your own.
angular.module('ionicApp', ['ionic']).controller('MyController', function($scope) {
$scope.isdiplay = false;
$scope.showsearch = function() {
$scope.isdiplay = !$scope.isdiplay;
}
})
.searchclass {
border: 1px solid red;
margin: 0 !important;
position: relative;
top: 44px;
z-index: 9999;
-webkit-transition: height .3s ease-in-out;
transition: all .3s ease-in-out;
height: 0;
opacity: 0;
}
.searchclass.active {
height: 49px;
opacity: 1;
}
<link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet" />
<script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
<div ng-app="ionicApp" ng-controller="MyController">
<ion-view>
<ion-header-bar align-title="" class="bar-positive">
<div class="buttons">
<i style="font-size:25px!important" class="icon-right ion-android-radio-button-off" ng-click="showsearch()"></i>
</div>
<h1 class="title">Title!</h1>
<a class="button icon-right ion-chevron-right button-calm"></a>
</ion-header-bar>
<div class="list list-inset searchclass" ng-class="{'active':isdiplay}">
<label class="item item-input">
<img src="https://dl.dropboxusercontent.com/s/n2s5u9eifp3y2rz/search_icon.png?dl=0">
<input type="text" placeholder="Search">
</label>
</div>
<ion-contend>
<div style="margin-top:50px">
my name
</div>
</ion-contend>
</ion-view>
</div>

Resources