{"id":16385706,"url":"https://github.com/any86/be-full","last_synced_at":"2025-04-07T10:23:06.020Z","repository":{"id":41044950,"uuid":"221849777","full_name":"any86/be-full","owner":"any86","description":"🛰 浏览器全屏 / full screen","archived":false,"fork":false,"pushed_at":"2022-05-27T08:31:13.000Z","size":126,"stargazers_count":185,"open_issues_count":3,"forks_count":33,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T07:44:03.910Z","etag":null,"topics":["full","javascript","request-full-screen","requestfullscreen","typescript","vue"],"latest_commit_sha":null,"homepage":"https://any86.github.io/be-full/example/","language":"TypeScript","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/any86.png","metadata":{"files":{"readme":"README.CN.md","changelog":"CHANGELOG.md","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":"2019-11-15T05:21:25.000Z","updated_at":"2024-04-10T15:29:18.000Z","dependencies_parsed_at":"2022-07-13T18:21:08.688Z","dependency_job_id":null,"html_url":"https://github.com/any86/be-full","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/any86%2Fbe-full","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/any86%2Fbe-full/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/any86%2Fbe-full/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/any86%2Fbe-full/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/any86","download_url":"https://codeload.github.com/any86/be-full/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247632464,"owners_count":20970164,"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":["full","javascript","request-full-screen","requestfullscreen","typescript","vue"],"created_at":"2024-10-11T04:15:08.106Z","updated_at":"2025-04-07T10:23:05.865Z","avatar_url":"https://github.com/any86.png","language":"TypeScript","readme":"# be-full [![NPM Version][npm-image]][npm-url] [![Size][size-image]][size-url]\n\n[npm-image]: https://badgen.net/npm/v/be-full\n[npm-url]: https://npmjs.org/package/be-full\n[size-image]: https://badgen.net/bundlephobia/minzip/be-full\n[size-url]: https://bundlephobia.com/result?p=be-full\n\n**全屏显示**, 支持PC/移动端, 不到**1kb**. [:rocket:在线演示](https://any86.github.io/be-full/example/)\n\n## 语言\n**中文** | [English](README.md)\n\n## 安装\n\n```shell\nnpm i -S be-full\n```\n\n## ⚡ 快速开始\n\n##### 网页全屏\n```javascript\nimport {beFull} from 'be-full';\nbeFull();\n```\n##### 元素全屏\n```javascript\nconst el = document.getElementById('video');\nbeFull(el);\n```\n\n#### 设置 css 属性\":fullscreen\"\n\n当元素全屏后如果出现\"黑色\"间隙(也可能其他颜色),通过第二个参数可设置成指定颜色.\n```javascript\nconst el = document.getElementById(\"video\");\nbeFull(el, \"#fff\");\n```\n**注意:** 执行\"**exitFull**\"或\"**toggleFull**\"后会自动取消\":fullscreen\"的设置.\n\n## 🔥 API\n\n##### exitFull(退出全屏)\n```javascript\nexitFull();\n```\n\n##### toggleFull(切换全屏/退出)\n使用方法同`beFull`, 只是第二次点击会执行`exitFull`\n```javascript\ntoggleFull();\n\n// 切换指定元素全屏/退出\ntoggleFull(document.getElementById('video'));\n```\n\n##### isFull(元素是否全屏)\n```javascript\nisFull(document.getElementById('video')); // true或者false\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fany86%2Fbe-full","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fany86%2Fbe-full","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fany86%2Fbe-full/lists"}