{"id":24929916,"url":"https://github.com/hgnim/websimpletoast","last_synced_at":"2026-04-14T06:32:43.500Z","repository":{"id":272002348,"uuid":"915146482","full_name":"Hgnim/WebSimpleToast","owner":"Hgnim","description":"A simple toast frame for the web (用于web的简易吐司框)","archived":false,"fork":false,"pushed_at":"2025-01-13T13:35:05.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T13:52:18.194Z","etag":null,"topics":["css","html","javascript","js","toast","toast-message","toastr","web"],"latest_commit_sha":null,"homepage":"https://hgnim.github.io/WebSimpleToast/demo","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/Hgnim.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-11T04:56:52.000Z","updated_at":"2025-01-13T13:35:09.000Z","dependencies_parsed_at":"2025-01-11T11:35:44.446Z","dependency_job_id":"9a3898f9-fadd-4d14-b4ab-9baf6785e579","html_url":"https://github.com/Hgnim/WebSimpleToast","commit_stats":null,"previous_names":["hgnim/websimpletoast"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hgnim%2FWebSimpleToast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hgnim%2FWebSimpleToast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hgnim%2FWebSimpleToast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Hgnim%2FWebSimpleToast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Hgnim","download_url":"https://codeload.github.com/Hgnim/WebSimpleToast/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246039621,"owners_count":20713823,"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":["css","html","javascript","js","toast","toast-message","toastr","web"],"created_at":"2025-02-02T13:52:21.882Z","updated_at":"2026-04-14T06:32:43.493Z","avatar_url":"https://github.com/Hgnim.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebSimpleToast\n\n[English](readme/README-English.md)\n\nWebSimpleToast是一个用于web中的轻量吐司框库。\\\n使用简单，可扩展样式。\n\u003e *只需**5分钟**即可完成部署*\n\n![image](readme/img/image-1.png)\n\n## 引入\n\n可以使用以下几种方法引入该库：\n\n- 从jsDelivr中引入\n\n  ``` html\n  \u003clink rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/gh/hgnim/WebSimpleToast@1.0.0/dist/css/toast.min.css\" type=\"text/css\"\u003e\n  \u003cscript src=\"https://cdn.jsdelivr.net/gh/hgnim/WebSimpleToast@1.0.0/dist/js/toast.min.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n  ```\n\n  - jsDelivr在大陆地区的CDN服务被污染，可使用替代域名(fastly.jsdelivr.net):\n\n    ``` html\n    \u003clink rel=\"stylesheet\" href=\"https://fastly.jsdelivr.net/gh/hgnim/WebSimpleToast@1.0.0/dist/css/toast.min.css\" type=\"text/css\"\u003e\n    \u003cscript src=\"https://fastly.jsdelivr.net/gh/hgnim/WebSimpleToast@1.0.0/dist/js/toast.min.js\" type=\"text/javascript\"\u003e\u003c/script\u003e\n    ```\n\n- 使用npm从github安装\n\n  ```sh\n  npm install hgnim/WebSimpleToast\n  ```\n\n  或\n\n  ```sh\n  npm install hgnim/WebSimpleToast#1.1.1\n  ```\n\n- 克隆此仓库\n\n## 使用\n\n### 函数定义\n\n``` javascript\nasync function showToast(message,duration = 3000,toast_class = \"\",toastContent_class = \"\",parentId = null,finish=()=\u003e{})\n```\n\n- `message`: 要在吐司框内显示的文本内容\n- `duration`: 吐司框持续显示的时间\n- `toast_class`: 吐司框需要额外添加的css类\n- `toastContent_class`: 吐司框内容需要额外添加的css类\n- `parentId`: 需要将吐司框添加至的父容器ID\n  - 如果值为`null`(默认)，则添加至`\u003cbody\u003e`\n- `finish`: 在吐司框消失后，将会调用此回调函数。\n\n### 示例\n\n``` javascript\n//弹出一个内容为\"hello\"，持续时间为5秒，class包含\"test_style test2_style\"，父容器为\"test_div\"的吐司框。\nshowToast(\"hello\", 5000, \"test_style test2_style\", undefined, \"test_div\");\n```\n\n## 演示\n\n[演示文件](https://github.com/Hgnim/WebSimpleToast/tree/gh-pages/demo)\\\n[演示页面](https://hgnim.github.io/WebSimpleToast/demo/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhgnim%2Fwebsimpletoast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhgnim%2Fwebsimpletoast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhgnim%2Fwebsimpletoast/lists"}