{"id":22618590,"url":"https://github.com/legomolina/toasty-for-web","last_synced_at":"2025-04-11T14:15:53.704Z","repository":{"id":48025118,"uuid":"88521236","full_name":"legomolina/Toasty-for-web","owner":"legomolina","description":"Toasty implementation for webs","archived":false,"fork":false,"pushed_at":"2023-01-03T16:05:23.000Z","size":468,"stargazers_count":5,"open_issues_count":5,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-07T19:09:25.327Z","etag":null,"topics":["css","javascript","notifications","toast","website"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/legomolina.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}},"created_at":"2017-04-17T15:21:05.000Z","updated_at":"2023-09-08T17:23:48.000Z","dependencies_parsed_at":"2023-02-01T07:30:28.194Z","dependency_job_id":null,"html_url":"https://github.com/legomolina/Toasty-for-web","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/legomolina%2FToasty-for-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/legomolina%2FToasty-for-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/legomolina%2FToasty-for-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/legomolina%2FToasty-for-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/legomolina","download_url":"https://codeload.github.com/legomolina/Toasty-for-web/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228793258,"owners_count":17973054,"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","javascript","notifications","toast","website"],"created_at":"2024-12-08T21:08:37.392Z","updated_at":"2024-12-08T21:08:38.043Z","avatar_url":"https://github.com/legomolina.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Toasty for Web\n[Toasty](https://github.com/GrenderG/Toasty) implementation for webs.\n\n**Idea was taken from [GrenderG](https://github.com/GrenderG) Toasty repository.**\n\n### Npm installation\n```bash\nnpm install toasty-web\n```\n\nAnd then require it:\n```javascript\nconst ToastyWeb = require('toasty-web');\n```\n\n### Manual installation\n1. Copy 'style.css' located inside 'dist/styles' into your project and link it with ```\u003clink\u003e```\u003csup\u003e2\u003c/sup\u003e.\n2. Copy the JavaScript file 'dist/scripts/ToastyWeb.umd.js' into your project and include it in your header with ```\u003cscript\u003e```. If you are using ES modules you can use the 'dist/scripts/ToastyWeb.esm.js' instead.\n3. Enjoy using Toasts!\n\n### Usage\nTo display an error Toast:\n```javascript\nToastyWeb.error('404 Not found').show();\n```\n\nTo display a success Toast:\n```javascript\nToastyWeb.success('Correct!').show();\n```\n\nTo display an information Toast:\n```javascript\nToastyWeb.info('Should you be informed?').show();\n```\n\nTo display a warning Toast:\n```javascript\nToastyWeb.warning('Careful with radiation').show();\n```\n\nAll methods above supports a second param to show or not the default icon. Default is true.\n```javascript\nToastyWeb.warning('Careful with radiation w/o icon', false).show();\n```\n\nTo display a normal Toast:\n```javascript\nToastyWeb.normal('Curious name, Toast').show()\n```\n\nTo display a normal Toast with icon\u003csup\u003e1\u003c/sup\u003e:\n```javascript\nToastyWeb.normal('Wow, an icon appears!', 'videogame_asset').show();\n```\n\nTo display a totally custom Toast:\n```javascript\nToastyWeb.custom('\u003e echo \\'Custom Toast rules!\\';', '#11FF00', '#000000', 'computer').show();\n```\n\nAlso, show method has two callbacks:\n```javascript\nToastyWeb.success('Correct!').show(function(toastId) {\n    //When the Toast has been created and it gets the toastId\n}, function(toastId) {\n    //When the Toast has been hid\n    //If this function returns false, the toast won't be destroyed, just hid\n});\n```\nIf you want ommit one of them just set it to `function() { return true; }`.\n\n\u003e **(1) Note: all icons must come from [material icons](https://material.io/icons).**\n\n\u003e **(2) Note: if you are using bootstrap is probably that .show class has an !important so you need to uncomment [this](https://github.com/legomolina/Toasty-for-web/blob/master/src/styles/style.scss#L21).**\n\n### Configuration\nYou can set a custom class for Toast:\n```javascript\n    ToastyWeb.customClassName = \"myCustomClass\";\n```\n\nAnd custom timeOut for Toast dissapear (ms) _default: 2000ms_:\n```javascript\n    ToastyWeb.customTimeOut = 5000;\n```\n\n### Screenshots\n\n\u003cimg src=\"https://raw.githubusercontent.com/legomolina/Toasty-for-web/master/art/toast.gif\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/legomolina/Toasty-for-web/master/art/toast_error.png\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/legomolina/Toasty-for-web/master/art/toast_success.png\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/legomolina/Toasty-for-web/master/art/toast_info.png\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/legomolina/Toasty-for-web/master/art/toast_warning.png\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/legomolina/Toasty-for-web/master/art/toast_normal.png\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/legomolina/Toasty-for-web/master/art/toast_icon.png\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/legomolina/Toasty-for-web/master/art/toast_custom.png\"\u003e\n\n### Build\nThe project is made with Typescript and SCSS so if you want to make changes you need to build it with\n```bash\nnpm run build\n```\n\nand generated files will be in `dist/` folder","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flegomolina%2Ftoasty-for-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flegomolina%2Ftoasty-for-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flegomolina%2Ftoasty-for-web/lists"}