{"id":21696433,"url":"https://github.com/madetech/unveil-rails","last_synced_at":"2025-04-12T12:07:17.301Z","repository":{"id":22826708,"uuid":"26173750","full_name":"madetech/unveil-rails","owner":"madetech","description":"Lazy loaded images for rails using unveil.js","archived":false,"fork":false,"pushed_at":"2015-10-21T09:47:43.000Z","size":175,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":50,"default_branch":"master","last_synced_at":"2024-04-24T14:58:03.740Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madetech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-04T15:01:21.000Z","updated_at":"2024-04-24T14:58:03.740Z","dependencies_parsed_at":"2022-08-17T17:55:19.600Z","dependency_job_id":null,"html_url":"https://github.com/madetech/unveil-rails","commit_stats":null,"previous_names":["madebymade/unveil-rails"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madetech%2Funveil-rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madetech%2Funveil-rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madetech%2Funveil-rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madetech%2Funveil-rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madetech","download_url":"https://codeload.github.com/madetech/unveil-rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248565062,"owners_count":21125416,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-25T19:19:52.087Z","updated_at":"2025-04-12T12:07:17.279Z","avatar_url":"https://github.com/madetech.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unveil.js for Rails\n\nLazy loaded images on rails. If you want a quick start using\n[unveil.js][unveil-github] with rails there is now a gem for that.\n\nBy loading your images as they appear in the viewport rather than on load you\ncan improve your rails application's page speed.\n\n## Installation\n\nAdd the unveil-rails gem into your `Gemfile`:\n\n``` ruby\ngem 'unveil-rails', '~\u003e 0.2.1'\n```\n\nInstall unveil.js and initializer into your rails app:\n\n```\nbin/rails g unveil:rails:install\n```\n\nInclude the unveil.js initializer in `app/assets/javascripts/application.js`:\n\n``` js\n//= require unveil_init\n```\n\nNow use the helper method where ever you want lazy images:\n\n```erb\n\u003c%= lazy_image_tag('an-image.png') %\u003e\n\u003c%= lazy_image_tag('an-image.png', retina: 'a-retina-image.png') %\u003e\n\u003c%= lazy_image_tag('an-image.png', placeholder: 'placeholder.png') %\u003e\n```\n\n## Configuration\n\nThe installation generator will have added an initializer to your application.\nIn this file there are a couple of settings you can change.\n\n### Threshold\n\n``` ruby\nUnveil::Rails.config.threshold = 200\n```\n\nSetting this variable to an integer will set the unveil threshold setting\nas [documented here][unveil-docs].\n\n### Default placeholder\n\nYou may set an alternative default placeholder image:\n\n``` ruby\nUnveil::Rails.config.default_placeholder = 'default.jpg'\n```\n\nYou can set the placeholder per lazy image by passing in the placeholder option:\n\n``` erb\n\u003c%= lazy_image_tag('an-image.png', placeholder: 'placeholder.png') %\u003e\n```\n\n## Credits\n\n[![made](https://s3-eu-west-1.amazonaws.com/made-assets/googleapps/google-apps.png)][made]\n\nDeveloped and maintained by [Made Tech][made]. Key contributions:\n\n * [Luke Morton](https://github.com/DrPheltRight)\n\nAnd of course [Luís Almeida][luis-github] creator of [unveil.js][unveil-github].\n\n## License\n\nCopyright © 2014 Made Tech Ltd. It is free software, and may be\nredistributed under the terms specified in the [LICENSE][license] file.\n\n[made]: http://www.madetech.co.uk?ref=github\u0026repo=cf-deploy\n[license]: https://github.com/madebymade/cf-deploy/blob/master/LICENSE\n[unveil-github]: https://github.com/luis-almeida/unveil\n[unveil-docs]: http://luis-almeida.github.io/unveil/\n[luis-github]: https://github.com/luis-almeida\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadetech%2Funveil-rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadetech%2Funveil-rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadetech%2Funveil-rails/lists"}