{"id":13583516,"url":"https://github.com/dvlden/vidage","last_synced_at":"2025-04-06T21:32:14.461Z","repository":{"id":49764277,"uuid":"61346053","full_name":"dvlden/vidage","owner":"dvlden","description":"Your solution to full-screen background video \u0026 image combined.","archived":false,"fork":false,"pushed_at":"2022-10-06T15:08:56.000Z","size":5391,"stargazers_count":1579,"open_issues_count":1,"forks_count":70,"subscribers_count":37,"default_branch":"main","last_synced_at":"2024-05-01T19:09:19.969Z","etag":null,"topics":["background","background-video","hacktoberfest","video"],"latest_commit_sha":null,"homepage":"https://dvlden.github.io/vidage/","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/dvlden.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-17T04:42:11.000Z","updated_at":"2024-03-21T02:01:38.000Z","dependencies_parsed_at":"2022-08-30T14:00:59.858Z","dependency_job_id":null,"html_url":"https://github.com/dvlden/vidage","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvlden%2Fvidage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvlden%2Fvidage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvlden%2Fvidage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvlden%2Fvidage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvlden","download_url":"https://codeload.github.com/dvlden/vidage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247555715,"owners_count":20957827,"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":["background","background-video","hacktoberfest","video"],"created_at":"2024-08-01T15:03:32.429Z","updated_at":"2025-04-06T21:32:14.204Z","avatar_url":"https://github.com/dvlden.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Vidage\n\nThis JS module will treat video as a background. It will determine when to hide/show \u0026 pause/play the video.\nTouch devices and/or smaller devices with width of **34em** will display image provided as fallback.\n\n\n## Installation (pick one)\n\n- `npm i @dvlden/vidage`\n- `pnpm i @dvlden/vidage`\n- `yarn add @dvlden/vidage`\n\n\n## CDN (pick one)\n\n1. [JSDelivr](https://www.jsdelivr.com/package/npm/vidage?path=dist)\n2. [UNPKG](https://unpkg.com/vidage@latest/dist/)\n\n\n## Usage\n\nPreferred way...\n\n\u003e Add base structure and replace video source paths\n\n```html\n\u003cdiv class=\"vidage\"\u003e\n  \u003cvideo id=\"vidage\" class=\"vidage-video\" preload=\"metadata\" loop autoplay muted\u003e\n    \u003csource src=\"videos/bg.webm\" type=\"video/webm\"\u003e\n    \u003csource src=\"videos/bg.mp4\" type=\"video/mp4\"\u003e\n  \u003c/video\u003e\n\u003c/div\u003e\n```\n\n\u003e Setup and import required styles\n\n```scss\n// set the fallback-cover image\n$vdg-fallback-image: url('../images/fallback.jpg');\n\n// import package\n@import '~vidage/src/styles/vidage';\n```\n\n\u003e Import the JS module and create new instance\n\n```js\nimport Vidage from 'vidage'\n\nnew Vidage('#vidage')\n```\n\n---\n\nOld fashioned way...\n\n\u003e Below you will find complete `html` example...\n\n```html\n\u003c!doctype html\u003e\n  \u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003ctitle\u003eDocument\u003c/title\u003e\n\n    \u003clink rel=\"stylesheet\" href=\"dist/vidage.css\"\u003e\n    \u003cstyle\u003e\n      /* Override the cover image. Set the path to the actual image... */\n      .vidage::before {\n        background-image: url('images/fallback.jpg');\n      }\n    \u003c/style\u003e\n  \u003c/head\u003e\n\n  \u003cbody\u003e\n    \u003cdiv class=\"vidage\"\u003e\n      \u003cvideo id=\"vidage\" class=\"vidage-video\" preload=\"metadata\" loop autoplay muted\u003e\n        \u003csource src=\"videos/bg.webm\" type=\"video/webm\"\u003e\n        \u003csource src=\"videos/bg.mp4\" type=\"video/mp4\"\u003e\n      \u003c/video\u003e\n    \u003c/div\u003e\n\n    \u003c!-- START: Rest of your site content --\u003e\n    ...\n    \u003c!-- END: Rest of your site content --\u003e\n\n    \u003cscript src=\"dist/vidage.js\"\u003e\u003c/script\u003e\n    \u003cscript\u003e\n      new Vidage('#vidage')\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## JS Arguments\n\nInstance of Vidage accepts two arguments. First argument is \nthe actual selector of the video, that instance will control.\nSecond argument is the actual object for the options.\n\n| Argument   | Required Type |\n| ---------- | ------------- |\n| `selector` | `string/node` |\n| `options`  | `object`      | \n\n| Key            | Default Value  | Required Type |\n| -------------- | -------------- | ------------- |\n| `helperClass`  | `vidage-ready` | `string`      |\n| `videoRemoval` | `false`        | `bool`        |\n\n\n## SCSS Variables\n\n| Variable              | Default Value                |\n| --------------------- | ---------------------------- |\n| `$vdg-fallback-image` | `url('../images/cover.jpg')` |\n\n\n## Browser Support\n\nYet to be determined. All modern browsers should be alright.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvlden%2Fvidage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvlden%2Fvidage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvlden%2Fvidage/lists"}