Giter Site home page Giter Site logo

respre's Introduction

Respre

=====

In-browser previewing for static responsive web design comps. No code required.

Respre works by automatically reading and displaying the contents of its preview directory. preview contains a collection of static image comps, each named with their minimum resolution (ie. 1024.jpg), corresponding to a responsive breakpoint.

demo gif

See the demo here – adjust your browser's viewport size to preview different static comps.

Getting Started

  1. Clone or download this repo. Move the folder to a PHP webserver, either online or local on your machine.

  2. Replace the boilerplate image files in preview with your own static comps. Give each file a numeric filename that corresponds to its target breakpoint.

  3. Visit /index.php in your browser to preview the comps. Adjust your browser's viewport size, or visit the page from a mobile device or tablet, to preview your comps at different resolutions.

There are no restrictions on file formats (any browser-safe formats work), and no restrictions on the number of comps/breakpoints that it will display.

Pages

You can add pages to your preview by creating folders within the preview directory. A navigation menu will appear when a subfolder is present. Set the subfolder name as the name of the page. Within the subfolder, include a collection of comp images named by resolution – just like the home page – to preview.

See the Inverse Colors folder inside the preview boilerplate as an example.

Good-to-knows

Your image files do not need to match the resoltion which they are named. For instance, to show a Retina-quality preview at 1024px (1024.jpg), your static file should be 2048px wide (at least; 1024px is the min-width).

The boilerplate breakpoints represent specific common devices:

  • 1.jpg – All mobile devices smaller than an iPhone 6+
  • 414.jpg – iPhone 6+
  • 768.jpg – iPad, portrait
  • 1024.jpg – iPad, landscape / Small Desktop
  • 1200.jpg – Average Desktop
  • 1440.jpg – Large Destop

This tool relies on PHP's scandir() function. Some servers may have this function disabled. Also, Respre requires that your preview directory is readable. If you're having problems getting the files to appear, try CHMOD-ing your preview directory to 755.

Troubleshooting

Webserver configuration got you down? Try MAMP. It's is a dead-simple tool for running a compatible server locally on your machine. Install it and point the Web Server's Document Root at the downloaded Respre directory you downloaded. Then visit http://localhost:8888/.

Some images not showing up? Be sure that none of your images are named for the resolution 0 (ie. 0.jpg). And make sure the image file names contain only numbers and one extension. Avoid names like 1024.final.png or 768alt.jpg. Also, ensure your preview directory permissions are configured as world readable (755 or rwx r-x r-x).

Contribute

Respre is licensed under the MIT License. See LICENSE for details. But, it basically says: go for it. I welcome collaboration, let's work together and make it work better for everyone.

Background

I'm Aaron Grando. I'm the Tech Lead at RTO+P; Respre was built with RTO+P's design process firmly in mind. I've also jotted a handful of thoughts on technology on my personal site.

respre's People

Contributors

aarongrando avatar

Stargazers

Drew Albinson avatar Antoine Plu avatar Jonathan Simcoe avatar Wilson Miner avatar Bharat Mandava avatar Mario Sommer avatar Jitendra Vyas avatar Alex Singh avatar Yury Vetrov avatar Jerome Lachaud avatar  avatar ace avatar Ahmad Shadeed avatar Chuck Erickson avatar Cristian Yáñez avatar Daniel Lewandowski avatar  avatar Haroon Abbasi avatar Shehbaaz avatar Damiano Plebani avatar Ani avatar Benoit Deziel avatar Ghislaine Guerin avatar Leandro Camargo avatar Matt Thomas avatar Qa'id Jacobs avatar Eran Jalink avatar Graham Murdoch avatar Phil Keys avatar  avatar  avatar Moritz Heeb avatar Kernel Jackson avatar pugson avatar Klaus avatar Kevin Rabinovich avatar Luke Clark avatar Cindy Chen avatar Ken Seals avatar  avatar  avatar Tyson avatar netop://ウエハ avatar Tierney Cyren avatar Daniel Fosco avatar Ryan avatar dshakti avatar Phil Rose avatar Benoit Pontbriand avatar Kevin W. Hoffman avatar Hofstede avatar

Watchers

 avatar James Cloos avatar pugson avatar

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.