Skip to content

medzhidov/angular-src-retina

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Angular "src-retina" module

Adds src-retina directive, for support retina-images.

version license

Installation

NPM

If you want to use this plugin locally, install it by npm command:

npm install angular-src-retina

or

yarn add angular-src-retina

CDN

You can just add a script from CDN:

<script src="https://cdn.rawgit.com/dslpp056193/angular-src-retina/77ae3308/angular-src-retina.js"></script>

Add module

Don't forgot to add this module in your app:

var yourApp = angular.module('yourApp', [ /*...your modules...*/, 'src-retina']);

Usage

You can use src-retina attribute for create retina-ready links.

Example:

<img src-retina="/path/to/img.png">

And if user's screen is retina, this img tag will get attr src with /path/to/img@2x.png.

Note: if /path/to/img@2x.png will not found, plugin will adds /path/to/img.png

But if user's screen is not retina, this img tag will get /path/to/img.png.

src-retina attribute will removed after added src attribute

Configs

Plugin will have configs in future.

TODO

  • Add config with alternative postfix instead of "@2x"

Help with module

I will pleased, if you will send pull-requests with a new functional or with fixes!

License

This work is licensed under The MIT License

Donate

You can help me and support this project with paypal or Bitcoin 33yhTK5BnKj6MZ3wf4GFEQgCtmWtqNwJHU

About

Angular module for add retina-ready plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published