{"id":20629185,"url":"https://github.com/dcts/remove-css-animations","last_synced_at":"2025-03-08T17:21:11.963Z","repository":{"id":101464866,"uuid":"217509095","full_name":"dcts/remove-CSS-animations","owner":"dcts","description":"simple script to remove all CSS transformations, transitions and animations. ","archived":false,"fork":false,"pushed_at":"2019-10-25T12:57:10.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T11:13:17.059Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dcts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-25T10:22:21.000Z","updated_at":"2019-10-25T12:57:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"a1ea63a1-11ce-440c-931a-e2c98dce5376","html_url":"https://github.com/dcts/remove-CSS-animations","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcts%2Fremove-CSS-animations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcts%2Fremove-CSS-animations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcts%2Fremove-CSS-animations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcts%2Fremove-CSS-animations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcts","download_url":"https://codeload.github.com/dcts/remove-CSS-animations/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242582608,"owners_count":20153279,"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-16T13:42:02.371Z","updated_at":"2025-03-08T17:21:11.946Z","avatar_url":"https://github.com/dcts.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Remove CSS Animations (for faster scraping)\n\nThis repo is a shortcut to remove css transitions, transformations and animations from a webpage for a faster scraping experience. To recap:\n- **transistions**: transform css properties (width, color etc.)\n- **transformations**: functions like `scale`, `skew`, `rotate` etc..\n- **animations**: keyframe animations etc.\n\n# Usage\n### Chrome Console\nFirst test if this script works locally in your browser (chrome, firefox, etc). Open the page you want to disable animations and css transitions and then execute the following code inside the console:\n```js\nlet filePath = \"https://dl.dropboxusercontent.com/s/ep1nzckmvgjq7jr/remove_transitions_from_page.css\";\nlet html = `\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"${filePath}\"\u003e`;\ndocument.querySelector(\"html \u003e head\").insertAdjacentHTML(\"beforeend\", html);\n```\n\n### Ruby Selenium\nOnce the script successfully runs in your browser, you can try to automate it from within your webscraper. This snipped assumes you have `selenium-webdriver` successfully installed and running and shows you how to remove fancy animations to improve the scraping speed.\n\n**Example Page**: [CSS clock that uses transitions and animations](https://dcts.github.io/javascript30-codingChallenges/days/02/)\n\n```ruby\n# 1. require selenium webdriver gem\nrequire 'selenium-webdriver'\n\n# 2. initialize webdriver\n@driver = Selenium::WebDriver.for :chrome\n\n# 3. go to website with some css animations\n@driver.get(\"https://dcts.github.io/javascript30-codingChallenges/days/02/\")\n\n# 4. disable animations (JAASCRPT ONELINER SAVED AS RUBY STRING)\n@driver.script(\"document.querySelector('html \u003e head').insertAdjacentHTML(\\\"beforeend\\\", \\\"\u003clink rel='stylesheet' type='text/css' href='https://dl.dropboxusercontent.com/s/ep1nzckmvgjq7jr/remove_transitions_from_page.css'\u003e\\\");\");\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcts%2Fremove-css-animations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcts%2Fremove-css-animations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcts%2Fremove-css-animations/lists"}