{"id":28403535,"url":"https://github.com/usablica/lup","last_synced_at":"2025-10-13T16:38:55.963Z","repository":{"id":18357965,"uuid":"21538027","full_name":"usablica/lup","owner":"usablica","description":"Easy to use CSS3 transition manager","archived":false,"fork":false,"pushed_at":"2014-07-06T18:50:59.000Z","size":160,"stargazers_count":40,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-06-02T02:50:48.707Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://usablica.github.io/lup/","language":"JavaScript","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/usablica.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-07-06T10:37:08.000Z","updated_at":"2024-03-10T08:44:15.000Z","dependencies_parsed_at":"2022-07-12T15:14:54.310Z","dependency_job_id":null,"html_url":"https://github.com/usablica/lup","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/usablica/lup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usablica%2Flup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usablica%2Flup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usablica%2Flup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usablica%2Flup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/usablica","download_url":"https://codeload.github.com/usablica/lup/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/usablica%2Flup/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262222442,"owners_count":23277429,"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":"2025-06-01T18:07:44.584Z","updated_at":"2025-10-13T16:38:50.938Z","avatar_url":"https://github.com/usablica.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Lup\n===\n\n\u003e Easy to use CSS3 transition manager\n\n**Lup** is a lightweight and easy to use library to manage and control CSS3 transition. \n\n## Hello world\n\n```javascript\n//take `#test` element, add `green` css class and wait for 2 seconds, then remove all css classes\nlup(\"#test\").add('green').wait(2000).end();\n``` \n\n## API\n\n###lup(targetElement)\n\nTo create lup object.\n\n**Available since**: v0.1.0\n\n**Parameters:**\n - targetElement: String or Object  \n   Can be both css selector or DOM object\n\n**Returns:**\n - lup object.\n\n**Example:**\n```javascript\nlup('#test');\n\nlup(document.querySelector('#test'));\n````\n\n###lup.add(className)\n\nAdds given CSS class name to the target element\n\n**Available since:** v0.1.0\n\n**Parameters:**\n - className: String\n\n**Returns:**\n - lup object.\n\n**Example:**\n```javascript\nlup('#test').add('green').end();\n```\n\n-----\n\n###lup.remove([className])\n\nRemoves given CSS class name from target element \n\n**Available since:** v0.1.0\n\n**Parameters:**\n - className: String (optional)\n\n**Returns:**\n - lup object.\n\n**Example:**\n```javascript\nlup('#test').add('green').remove().end(); /* Removes `green` class */\nlup('#test').add('green').remove('green').end(); /* Same as previous line, removes `green` class */\nlup('#test').add('green').add('red').remove().end(); /* Removes `red` class */\n```\n\n-----\n\n###lup.then([fn])\n\nWait for completing last operation, CSS3 transition for example.\n\n**Available since:** v0.1.0\n\n**Parameters:**\n - fn: Function (optional)\n\n**Returns:**\n - lup object.\n\n**Example:**\n```javascript\nlup('#test').add('green').then().add('red').end(); /* Adds `green` and then after completing `green` class transition, adds `red` class */\nlup('#test').add('green').then(function(){ alert('green completed!') }).end(); /* Adds `green`, shows `alert` after completing transition*/\n```\n\n-----\n\n###lup.wait(milliseconds)\n\nWait and then execute next operation.\n\n**Available since:** v0.1.0\n\n**Parameters:**\n - milliseconds: Number\n\n**Returns:**\n - lup object.\n\n**Example:**\n```javascript\nlup('#test').add('green').wait(1000).add('red').end(); /* Adds `green` and after one second adds `red` class */\n```\n\n-----\n\n###lup.end([fn])\n\nExecute the operations. \n\n**Available since:** v0.1.0\n\n**Parameters:**\n - fn: Number\n\n**Returns:**\n - lup object.\n\n**Example:**\n```javascript\nlup('#test').add('green').end(); /* Adds `green` css class */\n```\n\n-----\n\n###lup.option(option, value)\n\nSet a single option to lup object.\n\n**Available since**: v0.1.0\n\n**Parameters:**\n - option : String\n   Option key name.\n\n - value : String/Number\n   Value of the option.\n\n**Returns:**\n - lup object.\n\n**Example:**\n```javascript\nlup(\"#test\").add('green').option('cleanup', false).end();\n````\n\n----\n\n###lup.options(options)\n\nSet a group of options to the lup object.\n\n**Available since**: v0.1.0\n\n**Parameters:**\n - options : Object\n   Object that contains option keys with values.\n\n**Returns:**\n - lup object.\n\n**Example:**\n```javascript\nlup(\"#test\").add('green').options({ 'cleanup': false }).end();\n````\n\n----\n\n###Options:\n\n - `cleanup`: `Boolean` and `true` by default - Clean all css classes at the end of timeline?\n\n*Note:* You can alter options using `option` and `options` methods.\n\n## Roadmap\n- Support more than one target element\n- Add more examples\n\n## Release History\n\n * **v0.1.0** - 2014-06-06\n   - Initial version\n\n## Author\n**Afshin Mehrabani**\n\n- [Twitter](https://twitter.com/afshinmeh)\n- [Github](https://github.com/afshinm)\n- [Personal page](http://afshinm.name/)\n\n## License\n\u003e Copyright (C) 2014 Afshin Mehrabani (afshin.meh@gmail.com)\n\n    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n    documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n    the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,\n    and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n    The above copyright notice and this permission notice shall be included in all copies or substantial portions\n    of the Software.\n    \n    THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED\n    TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL\n    THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF\n    CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n    IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusablica%2Flup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fusablica%2Flup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fusablica%2Flup/lists"}