{"id":40872378,"url":"https://github.com/wenzi0github/javascript-css-common","last_synced_at":"2026-01-22T00:41:49.663Z","repository":{"id":30152078,"uuid":"33702302","full_name":"wenzi0github/javascript-css-common","owner":"wenzi0github","description":"js和css常用代码片段","archived":false,"fork":false,"pushed_at":"2022-08-25T13:54:47.000Z","size":258,"stargazers_count":46,"open_issues_count":0,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-03-22T05:20:36.683Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"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/wenzi0github.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}},"created_at":"2015-04-10T01:46:42.000Z","updated_at":"2023-11-16T02:09:47.000Z","dependencies_parsed_at":"2022-08-29T09:52:27.372Z","dependency_job_id":null,"html_url":"https://github.com/wenzi0github/javascript-css-common","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wenzi0github/javascript-css-common","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenzi0github%2Fjavascript-css-common","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenzi0github%2Fjavascript-css-common/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenzi0github%2Fjavascript-css-common/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenzi0github%2Fjavascript-css-common/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wenzi0github","download_url":"https://codeload.github.com/wenzi0github/javascript-css-common/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wenzi0github%2Fjavascript-css-common/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28648460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T21:29:11.980Z","status":"ssl_error","status_checked_at":"2026-01-21T21:24:31.872Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-22T00:41:49.609Z","updated_at":"2026-01-22T00:41:49.658Z","avatar_url":"https://github.com/wenzi0github.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# javascript-css-common\n\n\u003e 这里将一些常用的方法总结为了一个npm包，方便下载和复用，欢迎关注和下载：[utils](https://github.com/wenzi0github/utils)\n\n[团队常用的工具方法](https://github.com/wenzi0github/utils)\n\n在工作中经常遇到的基础代码进行总结，主要分为 javascript 和 css 两部分：\n\n## [JavaScript 常用代码总结](./javascript/README.md)\n\n-   [如何获取当前所在周的起始和结束的日期](./javascript#如何获取当前所在周的起始和结束的日期)\n-   [对 cookie 的添加/获取和删除](./javascript#对-cookie-的添加获取和删除)\n-   [js 字符串翻转](./javascript#js-字符串翻转)\n-   [js 产生随机数字](./javascript#js-产生随机数字)\n-   [radio-checkbox-select](./javascript#radio-checkbox-select)\n-   [requestAnimationFrame 的兼容性处理](./javascript#requestAnimationFrame-的兼容性处理)\n-   [获取鼠标移动的方向](./javascript#获取鼠标移动的方向)\n-   [扩展 String 中的 format](./javascript#扩展-String-中的-format)\n-   [js 产生随机字符串](./javascript#js-产生随机字符串)\n-   [解析 url 中的参数](./javascript#解析-url-中的参数)\n-   [时间格式化](./javascript#时间格式化)\n-   [获取当月的第一天和最后一天](./javascript#获取当月的第一天和最后一天)\n-   [截断字符串并添加省略号](./javascript#截断字符串并添加省略号)\n-   [控制使用的 class](./javascript#控制使用的-class)\n-   [iOS 移动端键盘收起防止产生空白](./javascript#iOS-移动端键盘收起防止产生空白)\n-   [页面可见性的检测](./javascript#页面可见性的检测)\n-   [自定义的 react hooks](./javascript#自定义的-react-hooks)\n-   [为 localStorage 添加过期时间](./javascript#为-localStorage-添加过期时间)\n-   [前端生成 uuid](./javascript#前端生成-uuid)\n\n## [CSS 常用代码总结](./css/README.md)\n\n-   CSS 初始化样式 reset.css\n-   去除浮动 clearfix\n-   css 强制换行/自动换行/强制不换行\n-   table 边界的样式\n-   div 上下左右居中\n-   图片上下左右居中\n-   标题两边的小横杠\n\n欢迎大家访问我的网站： [https://www.xiabingbao.com](https://www.xiabingbao.com)。\n\n关注我的公众号：\n\n![蚊子的博客公众号](./img/qrcode.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwenzi0github%2Fjavascript-css-common","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwenzi0github%2Fjavascript-css-common","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwenzi0github%2Fjavascript-css-common/lists"}