<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="//code.jquery.com/jquery-1.11.1.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html><html class=''>
<head><script src='//production-assets.codepen.io/assets/editor/live/console_runner-079c09a0e3b9ff743e39ee2d5637b9216b3545af0de366d4b9aad9dc87e26bfd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/events_runner-73716630c22bbc8cff4bd0f07b135f00a0bdc5d14629260c3ec49e5606f98fdd.js'></script><script src='//production-assets.codepen.io/assets/editor/live/css_live_reload_init-2c0dc5167d60a5af3ee189d570b1835129687ea2a61bee3513dee3a50c115a77.js'></script><meta charset='UTF-8'><meta name="robots" content="noindex"><link rel="shortcut icon" type="image/x-icon" href="//production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico" /><link rel="mask-icon" type="" href="//production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111" /><link rel="canonical" href="https://codepen.io/loringdodge/pen/YXvGjX?depth=everything&order=popularity&page=4&q=ionic&show_forks=false" />
<style class="cp-pen-styles">/* Background */
.background-grey {
background-color: #455A64 !important;
}
.background-lightgrey {
background-color: #B0BEC5;
}
/* Top */
.menu-top {
height: 40%;
}
/* Middle */
.menu-middle {
height: 40%;
}
/* Bottom */
.menu-bottom {
position:relative;
height: 20%;
background-color: #37474F;
-webkit-transform: translateY(100%);
transform: translateY(100%);
-webkit-transition: all 0.2s ease;
transition: all 0.2s ease;
}
/* Components */
.col.col-center{
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row
flex-direction: row;
-webkit-align-items: center;
align-items: center;
-webkit-justify-content: center;
justify-content: center;
}
/* Profile Image */
.profile-image {
width: 140px;
height: 140px;
border-radius: 50%;
border: 10px solid #546E7A;
-webkit-transition: all 0.2s ease-in;
transition: all 0.2s ease-in;
}
.profile-image:hover {
border: 3px solid white;
}
/* Buttons */
.button-circle {
width: 50px;
height: 50px;
color: white;
border-radius: 50%;
background-color: #546E7A;
border: 3px solid #546E7A;
-webkit-transition: all 0.2s ease-in;
transition: all 0.2s ease-in;
}
.button-circle i {
font-size: 1.5em;
color: white;
}
.button-circle:hover {
border: 3px solid white;
background-color: #455A64;
-webkit-transform: scale(1.2) !important;
transform: scale(1.2) !important;
}
.button-circle.rotate-15 {
-webkit-transform: rotate(-15deg);
transform: rotate(-15deg);
}
.button-circle.rotate-15 + h3 {
display:inline-block;
margin-left: 10px;
color: #37474F;
}
.menu-bottom .button-circle {
position: absolute;
left: 50%;
top: -25px;
background-color: #26C6DA;
border: 3px solid #26C6DA;
-webkit-transform: translateX(-50%);
transform: translateX(-50%);
}</style></head><body>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title>Ionic OkCupid Side Menu</title>
<link href="//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
<script src="//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
<script src="https://code.ionicframework.com/collide/0.0.4/collide.js"></script>
<script id="templates/home.html" type="text/ng-template">
<ion-view view-title="Ionic OkCupid Side Menu">
<ion-content class="padding background-lightgrey">
<button class="button-circle rotate-15">
<i class="ion-arrow-up-c"></i>
</button>
<h3>Click on the hamburger</h3>
</ion-content>
</ion-view>
</script>
<script id="templates/side-menu.html" type="text/ng-template">
<ion-side-menus enable-menu-with-back-views="false">
<ion-side-menu-content>
<ion-nav-bar class="bar-stable">
<ion-nav-buttons side="left">
<button class="button button-icon button-clear ion-navicon" menu-toggle="left">
</button>
</ion-nav-buttons>
</ion-nav-bar>
<ion-nav-view name="content"></ion-nav-view>
</ion-side-menu-content>
<ion-side-menu side="left" ng-controller="SideMenuCtrl">
<ion-pane class="background-grey">
<div class="row menu-top">
<div class="col col-center">
<img class="profile-image" ng-src="http://www.loringdodge.com/files/images/cooper-small.jpg" animate-ratio="fadeIn"/>
</div>
</div>
<div class="menu-middle">
<div class="row">
<div class="col col-center">
<button class="button-circle" animate-ratio="fadeIn">
<i class="ion-ios-pulse-strong"></i>
</button>
</div>
<div class="col col-center">
<button class="button-circle" animate-ratio="fadeIn">
<i class="ion-heart"></i>
</button>
</div>
<div class="col col-center">
<button class="button-circle" animate-ratio="fadeIn">
<i class="ion-film-marker"></i>
</button>
</div>
</div>
<div class="row">
<div class="col col-center">
<button class="button-circle" animate-ratio="fadeIn">
<i class="ion-chatbox"></i>
</button>
</div>
<div class="col col-center">
<button class="button-circle" animate-ratio="fadeIn">
<i class="ion-person-stalker"></i>
</button>
</div>
<div class="col col-center">
<button class="button-circle" animate-ratio="fadeIn">
<i class="ion-android-star-half"></i>
</button>
</div>
</div>
</div>
<div class="menu-bottom" animate-ratio="slideUp">
<button class="button-circle">
<i class="ion-erlenmeyer-flask"></i>
</div>
</div>
</ion-pane>
</ion-side-menu>
</ion-side-menus>
</script>
</head>
<body ng-app="starter">
<ion-nav-view></ion-nav-view>
</body>
</html>
<script src='//production-assets.codepen.io/assets/common/stopExecutionOnTimeout-b2a7b3fe212eaa732349046d8416e00a9dec26eb7fd347590fbced3ab38af52e.js'></script>
<script >angular.module('starter', ['ionic', 'ionic.animate.ratio'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
}
if (window.StatusBar) {
StatusBar.styleDefault();
}
});
})
.config(function($stateProvider, $urlRouterProvider) {
$stateProvider
.state('app', {
url: "/app",
abstract: true,
templateUrl: "templates/side-menu.html"
})
.state('app.home', {
url: "/home",
views: {
'content': {
templateUrl: "templates/home.html"
}
}
})
// if none of the above states are matched, use this as the fallback
$urlRouterProvider.otherwise('/app/home');
});
angular.module('ionic.animate.ratio', [])
.directive('animateRatio', function($timeout, $ionicSideMenuDelegate) {
return {
restrict: 'A',
scope: {
animateRatio: '=',
},
link: function (scope, element, attr) {
$timeout(function () {
scope.$watch(function () {
return $ionicSideMenuDelegate.getOpenRatio();
},
function (ratio) {
scope.animateRatio(element[0], ratio);
});
});
}
}
})
.controller('SideMenuCtrl', function($scope, $timeout, $stateParams, $ionicSideMenuDelegate) {
/*!
* Expects number from 0.0 -> 1.0
* Returns absolute value
*
* @param {Number}
* @return {Number}
*/
var transitionIn = function(ratio) {
return Math.abs(ratio);
}
/*!
* Expects number from 0.0 to 1.0
* Returns absolute value in reverse 1.0 -> 0.0
*
* @param {Number}
* @return {Number}
*/
// 1.0 to 0.0
var transitionOut = function(ratio) {
return (1- Math.abs(ratio));
}
/*!
* Expects number from 0.0 to 1.0
* Returns absolute value from number to number
* Ex. 10 -> 20 or 20 -> 10
*
* @param {Number}
* @param {Number}
* @param {Number}
* @return {Number}
*/
// from min to max
var transitionFromTo = function(ratio, from, to) {
return from - (Math.abs(ratio) * (from - to));
}
$scope.fadeIn = function(element, ratio) {
element.style.transform = element.style.webkitTransform = 'scale(' + transitionIn(ratio) + ')';
element.style.opacity = transitionIn(ratio);
}
$scope.slideUp = function(element, ratio) {
element.style.transform = element.style.webkitTransform = 'translateY(' + transitionFromTo(ratio, 100, 0) + '%' + ')';
}
});
//# sourceURL=pen.js
</script>
</body></html>