Giter Club home page Giter Club logo

flexy-pics's Introduction

FlexyPics UI

A fully responsive photo grid that always adapts to fullscreen, no matter the resolution. Each image inside each block slice resizes keeping proportions. Can be used for showing pictures, a graphic menu, a portfolio, or just an original UI combining images, text and links. The main structure is mostly css, it uses just some lines of JS for the smart resizing of the images inside each block.

Play with it. Try resizing the browser and see how it adapts and resizes, from a 1080 screen to smart phone resolution!

  • Template 1 Grid DEMO (plain, without images, to see the layout more clearly).
  • Template 1 FULL DEMO with images.
  • Template 2 Grid DEMO

Usage

###Link Files

  • <link rel="stylesheet" href="css/flexypics.css"/>
  • <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
  • <script type="text/javascript" src="js/jquery.queryloader2.js"></script>
  • <script type="text/javascript" src="js/jquery.flexypics.js"></script>

###The Markup

  • Copy the markup within the #flexyPics div of the template of your choice.
  • Its IMPORTANT to give HEIGHT and WIDTH attributes to the images. Change this attributes in the template to the ones of the images your using!

###Setup the Grid

$(document).ready(function(){
	$("#flexyGrid").queryLoader2({
		onLoadComplete: function () {
			$('.mask img').each(function(){
				flexy(this);
			});
			delay = 0;
			var imagesArray = $.makeArray($('#flexyGrid img'));
			imagesArray.sort(function() { return (Math.round(Math.random())-0.5);});
			$('#loading-mask').fadeOut(900);
			for (i = 0 ; i < imagesArray.length ; i++) {
				$(imagesArray[i]).delay(delay).fadeIn(300);
				delay += 150;
			}
			return;
		}
	});
});
$(window).resize(function() {
	$('.mask img').each(function(){
		flexy(this);
	});
});

####Note:

  • This plugin depends on JQuery library and QueryLoader2 plugin (for the image pre-loading), by Gaya Kessler, and should be linked for its correct use.
  • For its correct use respect the container id and de classes of the internal modules, but you can add whatever content inside the modules with your own particular classes.

####Work in progress! new templates and examples comming soon.

by MPA & JOTAV
Photos by Minileidy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.