LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code



close

{{selected[0].item.name}}

Lorem ipsum dolor

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Maxime laborum perferendis, ullam minus. Illo ad aliquid ab magni, enim nesciunt at consequuntur dolores explicabo nisi. Dolor, reiciendis suscipit alias nemo.

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Repellendus consequatur, sit saepe reprehenderit nisi dolorem, voluptates amet quos ab assumenda non id accusamus, dicta soluta laboriosam voluptas fuga sint deleniti. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magnam officiis minus tenetur ex molestias qui possimus sit facilis dolorum suscipit. Cumque, aperiam inventore nobis? Veniam voluptatibus sapiente ea, voluptate dolores?

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tenetur dicta ducimus ratione reiciendis officia odit omnis distinctio, eveniet et modi fuga nisi voluptatem nihil aliquam ex pariatur possimus repudiandae vero?

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Corporis, quos ducimus nobis. Necessitatibus provident impedit, neque quia dolores? Quas, architecto id. Iure distinctio, illum eaque at quia assumenda modi saepe. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Libero soluta quisquam autem quasi ut ex ab modi. Sit soluta dicta incidunt quaerat tenetur fugiat, natus perspiciatis illo. Totam, quo, minus.

CSS
@-webkit-keyframes up-in {
  from {
    opacity: 0;
    bottom: 0%;
  }
  to {
    opacity: 1;
    bottom: 50%;
  }
}
@keyframes up-in {
  from {
    opacity: 0;
    bottom: 0%;
  }
  to {
    opacity: 1;
    bottom: 50%;
  }
}
.fill {
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
}
body,
html {
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: 'Raleway', sans-serif;
}
.flex-row {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
      -ms-flex-direction: row;
          flex-direction: row;
  -ms-flex-wrap: wrap;
      flex-wrap: wrap;
  -ms-flex-pack: distribute;
      justify-content: space-around;
}
.container {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
      -ms-flex-direction: row;
          flex-direction: row;
  -ms-flex-wrap: wrap;
      flex-wrap: wrap;
  -ms-flex-pack: distribute;
      justify-content: space-around;
  width: 100%;
  min-height: 100%;
  height: 100%;
  overflow: auto;
  background-color: white;
  position: relative;
}
.container.no-scroll {
  overflow: hidden;
}
.page {
  width: 80%;
  padding: 10px;
  background-color: white;
}
@media (max-width: 600px) {
  .page {
    width: 90%;
  }
}
.grid {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
      -ms-flex-direction: row;
          flex-direction: row;
  -ms-flex-wrap: wrap;
      flex-wrap: wrap;
  -ms-flex-pack: distribute;
      justify-content: space-around;
}
.grid .grid-item {
  width: 33%;
  position: relative;
}
.grid .grid-item:after {
  content: '';
  display: block;
  margin-top: 100%;
}
@media (max-width: 600px) {
  .grid .grid-item {
    width: 50%;
  }
}
.box {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 10px;
  right: 10px;
  background-color: white;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center top;
  overflow: hidden;
  cursor: pointer;
}
.box img {
  width: 100%;
  -webkit-transition: -webkit-transform 0.6s ease;
  transition: -webkit-transform 0.6s ease;
  transition: transform 0.6s ease;
  transition: transform 0.6s ease, -webkit-transform 0.6s ease;
}
.box.selected {
  opacity: 0;
}
.box.on-top {
  cursor: default;
  -webkit-transition: all 0.4s ease;
  transition: all 0.4s ease;
  box-shadow: 2px 2px 19px -2px rgba(0, 0, 0, 0.44);
}
.box.image-out img {
  -webkit-transform: translateY(-100%);
          transform: translateY(-100%);
}
.content {
  position: absolute;
  padding: 20px 40px;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0;
  -webkit-transition: opacity 0.5s ease;
  transition: opacity 0.5s ease;
}
.show .content {
  opacity: 1;
}
@media (max-width: 600px) {
  .content {
    padding: 10px 20px;
  }
}
.scroller {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow-y: auto;
}
.scroller h1 {
  color: white;
  width: 100%;
  margin-bottom: 30px;
  position: absolute;
  bottom: 50%;
  text-align: center;
  -webkit-animation: up-in 1s ease;
          animation: up-in 1s ease;
}
.top-up.ng-hide-add,
.top-up.ng-hide-remove {
  -webkit-transition: 0s ease top;
  transition: 0s ease top;
}
.top-up.ng-hide-add-active,
.top-up.ng-hide-remove-active {
  -webkit-transition: 0.6s ease top;
  transition: 0.6s ease top;
}
.top-up.ng-hide-add {
  top: 0;
}
.top-up.ng-hide-add.ng-hide-add-active {
  top: 100%;
}
.top-up.ng-hide-remove {
  top: 100%;
}
.top-up.ng-hide-remove.ng-hide-remove-active {
  top: 0;
}
.fullscreen-background {
  overflow-y: auto;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-color: #333;
  -webkit-transition: top 0.5s ease;
  transition: top 0.5s ease;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
}
.fullscreen-background.show {
  top: 0;
}
.close-button {
  position: fixed;
  top: 20px;
  right: 20px;
  color: white;
  cursor: pointer;
}
.close-button i {
  font-size: 35px;
}
.close-button:hover {
  color: #ddd;
}
JS
var app = angular.module('app', ['ngAnimate'])

app.controller('mainCtrl', function($scope) {
	$scope.boxes = [{
		name: 'Friends',
		image: 'https://source.unsplash.com/uAgLGG1WBd4/900x900'
	},{
		name: 'Free',
		image: 'https://source.unsplash.com/Cp-LUHPRpWM/900x900'
	},{
		name: 'Explore',
		image: 'https://source.unsplash.com/7BjmDICVloE/900x900'
	}, {
		name: 'Vast',
		image: 'https://source.unsplash.com/WLUHO9A_xik/900x900'
	}, {
		name: 'Playful',
		image: 'https://source.unsplash.com/b2-fBVrfx0o/900x900'
	}, {
		name: 'Grand',
		image: 'https://source.unsplash.com/Ixp4YhCKZkI/900x900'
	}, {
		name: 'Mist',
		image: 'https://source.unsplash.com/8BmNurlVR6M/900x900'
	}, {
		name: 'Sea',
		image: 'https://source.unsplash.com/6YqpFWWQsno/900x900'
	}, {
		name: 'Reach',
		image: 'https://source.unsplash.com/zFnk_bTLApo/900x900'
	}, {
		name: 'Awe',
		image: 'https://source.unsplash.com/j4PaE7E2_Ws/900x900'
	}, {
		name: 'Surf',
		image: 'https://source.unsplash.com/uohGiEVhWiQ/900x900'
	}, {
		name: 'Thrill',
		image: 'https://source.unsplash.com/ssrbaKvxaos/900x900'
	}, ];

	$scope.selected = [];
	$scope.selectBox = function(item, position) {
		$scope.selected = [{
			item: item,
			position: position
		}];
		$scope.$apply();
	}
	$scope.clearSelection = function() {
		$scope.selected = [];
	}
})

app.directive('box', function() {
	return {
		restrict: 'E',
		scope: {},
		bindToController: {
			onSelect: "=",
			item: "="
		},
		controllerAs: 'box',
		controller: function() {
			var box = this;

			box.goFullscreen = function(e) {
				box.onSelect(box.item, e.target.getBoundingClientRect())
			}
		},
		link: function(scope, element) {
			element.bind('click', scope.box.goFullscreen)
			element.css({
				'background-image': 'url(' + scope.box.item.image + ')'
			})
		}
	}
})

app.directive('bigBox', function($timeout) {
	return {
		restrict: 'AE',
		scope: {},
		bindToController: {
			position: "=",
			selected: "=",
			onSelect: "="
		},
		controllerAs: 'box',
		controller: function() {
			var box = this;
		},
		link: function(scope, element) {
			var css = {}
			for (var key in scope.box.position) {
				css[key] = scope.box.position[key] + 'px';
			}
			
			element.css(css);

			$timeout(function() {
				element.css({
					top: '50%',
					left: '10%'
				})
				element.addClass('image-out');
			}, 200)

			$timeout(function() {
				element.css({
					width: '80%',
					height: '100%'
				})
			}, 500)
			
			$timeout(function(){
				element.addClass('show');
			}, 800)
		}
	}
})
Host Instantly Drag and Drop Website Builder

 

Description

Seamless transition from thumbnail grid to fullscreen page. Using CSS animations and Angular 1.5.
Term
Mon, 11/27/2017 - 22:07

Related Codes

Pen ID
Pen ID
Pen ID