Book Image

RESS Essentials

Book Image

RESS Essentials

Overview of this book

RESS is a new methodology in the world of web design and development. It attempts to solve the problems that accompany the RWD (responsive web design) approach to web design. RESS is still in its infancy, but it is growing at an exponential rate. RESS Essentials shows you how to make server-side applications smarter and more aware of a visitor's environment limitations (device, screen size, and browser). This allows you to create faster and more reliable websites. Through this book, you will build a solid base of knowledge on RESS-related technologies, while the step-by-step tutorials will help you to create your own RESS system. This book is an introduction to RESS alchemy and gives you an incentive to build your own RESS lab. It will give you a broad overview of the multiple techniques used to code responsive websites in responsible ways. Beginning with an overview of RWD, you will learn the steps involved in setting up RWD for client-side development. You will then learn how to scale images using client- and server-side technology. By the end of this book, you will have learned about the implementation of RESS application patterns, browser feature detection, and various RESS architectures. RESS Essentials will also teach you how to use jQuery with some RWD design patterns and how to employ REST API for RWD pages.
Table of Contents (15 chapters)
RESS Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Automated creation of responsive images


We will take a closer look at the script by Matt Wilcox. You can download the recent version from the following website:

http://adaptive-images.com

This script relies on redirecting all requests for files (jpeg/gif/png) to adaptive-images.php. To use it, we need to set up at least three things:

  1. Resolutions in adaptive-images.php—set values in the array as follows:

    $resolutions = array(1200, 800, 480, 320);

    This is the same as your media queries. Actually, you can add more if necessary. As we have media query stops only at 320px and 800px, I added 1200px and 480px, which allows for resizing full-width images to this resolution.

    Another variable in adaptive-images.php worthy of some thought is:

    $cache_path = "ai-cache";

    This sets the path for generating resized images and has to be specified relative to the document root.

  2. As we have images inside the assets directory, we need to either comment it out in the file .htaccess, as shown in the following line of...