GithubHelp home page GithubHelp logo

responsive-images's Introduction

What is this

Responsive design requires responsive images. Images which adapt their size depending upon what device you are using. This app provides this.

Usage

Add RESPONSIVE_IMAGE_RESOLUTIONS to settings with an array of image sizes required as per resolution.

Example:

RESPONSIVE_IMAGE_RESOLUTIONS = [1300, 1200, 1100, 800, 500]

From above values, if the resolution lies between 1300 and 1200, then the image of width 1200 will be shown.

Add this to the head section of your template.

 <script>document.cookie='resolution='+Math.max(window.outerWidth, 0)+'; path=/';</script>

Add this to the start of your template.

{% load responsive_images_tags %}

If you are using a static file.

<img src="{% static_responsive 'img/logo.png' %}" />

Modify your nginx configuration(or related) as below:

Please do a permanent redirect to all the files ending with "___asnf874wthwengsfduy".

This can be done via nginx as follows:

rewrite (___asnf874wthwengsfduy)$ /adapt-image?$request_uri? permanent;

Installations

  • pip install -r requirements.txt
  • add responsive_images to installed apps.

Todo

  • Add Test
  • Add travis build metadata

License

3 clause BSD

responsive-images's People

Contributors

bhaskar234 avatar shabda avatar

Watchers

JT5D avatar James Cloos avatar  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.