{"id":17290023,"url":"https://github.com/undead25/alerty","last_synced_at":"2025-10-24T13:55:09.962Z","repository":{"id":57175584,"uuid":"64868650","full_name":"undead25/alerty","owner":"undead25","description":"A simple, light and pretty pure javascript for developing browser dialogs and notifications which is following Google's Material Design guidelines. Obviously, it is responsive and no need other library","archived":false,"fork":false,"pushed_at":"2022-10-12T08:54:31.000Z","size":97,"stargazers_count":39,"open_issues_count":1,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-10T08:39:47.999Z","etag":null,"topics":["dialog","material-design","notifications","pure-javascript","toast"],"latest_commit_sha":null,"homepage":null,"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/undead25.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":"2016-08-03T18:14:06.000Z","updated_at":"2023-10-24T03:54:23.000Z","dependencies_parsed_at":"2022-09-03T11:01:08.359Z","dependency_job_id":null,"html_url":"https://github.com/undead25/alerty","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/undead25/alerty","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undead25%2Falerty","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undead25%2Falerty/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undead25%2Falerty/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undead25%2Falerty/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/undead25","download_url":"https://codeload.github.com/undead25/alerty/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/undead25%2Falerty/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260599111,"owners_count":23034445,"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":["dialog","material-design","notifications","pure-javascript","toast"],"created_at":"2024-10-15T10:36:45.424Z","updated_at":"2025-10-13T01:44:03.738Z","avatar_url":"https://github.com/undead25.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Alerty [![npm](https://img.shields.io/npm/v/alerty.svg?style=flat-square)](https://www.npmjs.org/package/alerty)\n\nA simple, light and pretty pure javascript for developing browser dialogs and notifications which is following Google's Material Design guidelines. Obviously, it is responsive and no need other library.\n \n## Usage\nyou can install alerty with npm\n```bash\nnpm install alerty\n```\n```js\nvar alerty = require('alerty');\n```\nor with bower\n```bash\nbower install alerty\n```\n\nAlternatively, download the package and reference the JavaScript and CSS files manually:\n\n```html\n\u003cscript src=\"dist/js/alerty.min.js\"\u003e\u003c/script\u003e\n\u003clink rel=\"stylesheet\" type=\"text/css\" href=\"dist/css/alerty.min.css\"\u003e\n```\n\n## Examples\n\nyou can run example local with gulp if node has been installed:\n\n```bash\ncd alerty\nnpm install\ngulp\n```\nor test it on [jsfiddle](https://jsfiddle.net/fzwporfe/)\n\n\n## Usage\n\u003eFor alert dialog\n\n```js\nalerty.alert('Hello, World!');\n```\n\n\u003eFor toasts\n\n```js\nalerty.toasts('Something has been done!');\n```\n\n\u003eFor confirm dialog\n\n```js\nalerty.confirm('Are you sure?', funtion() {\n  console.log('ok callback'); // do something\n}, function(){\n  console.log('cancel callback'); // do something\n})\n```\n\n\u003eFor prompt dialog\n\n```js\nalerty.prompt(\n  'Please write some thing', \n  {\n    inputType: 'email', // input type\n    inputPlaceholder: 'fill the blank'\n  },\n  function(value){\n    alerty.alert('value you typed is: \u003cb\u003e'+value+'\u003c/b\u003e')\n  }\n)\n```\n\n## API\n### alerty.toasts(content[, opts], callback)\n\n|param|type|description|\n|-----|----|-----------|\n|content|string|message to display|\n|opts|object|options, optional|\n|callback|function|callback after alerty closed|\n\n**opts:**\n\n|name|type|default|description|\n|----|----|-------|-----------|\n|place|string|'bottom'|'top' can be choosed|\n|bgColor|string|'#323232'|background color of dialog body|\n|fontColor|string|'#fff'|font color of dialog message|\n|time|number|2000|time delay for dialog auto closed|\n\n----------\n\n### alerty.alert(content[, opts], onOk)\n\n|param|type|description|\n|-----|----|-----------|\n|content|string|message to display|\n|opts|object|options, optional|\n|onOk|function|callback after click ok button|\n\n**opts:**\n\n|name|type|default|description|\n|----|----|-------|-----------|\n|title|string|''|title of dialog|\n|okLabel|string|确定|ok button text|\n\n----------\n\n### alerty.confirm(content[, opts], onOk, onCancel)\n\n|param|type|description|\n|-----|----|-----------|\n|content|string|message to display|\n|opts|object|options|\n|onOk|function|callback after click ok button|\n|onCancel|function|callback after click cancel button|\n\n**opts:**\n\n|name|type|default|description|\n|----|----|-------|-----------|\n|title|string|''|title of dialog|\n|okLabel|string|确定|ok button text|\n|cancelLabel|string|取消|cancel button text|\n\n----------\n\n### alerty.prompt(content[, opts], onOk, onCancel)\n\n|param|type|description|\n|-----|----|-----------|\n|content|string|message to display|\n|opts|object|options|\n|onOk|function|callback after click ok button, argument value, like above example|\n|onCancel|function|callback after click cancel button|\n\n**opts:**\n\n|name|type|default|description|\n|----|----|-------|-----------|\n|title|string|''|title of dialog|\n|okLabel|string|确定|ok button text|\n|cancelLabel|string|取消|cancel button text|\n|inputType|string|'text'|input type, such as 'password', 'email'|\n|inputPlaceholder|'text'|''|input placeholder text|\n|inputValue|'text'|''|default input value|\n\n## Browser support\nAlerty is tested and works in:\n- IE8+\n- Latest Stable: Firefox, Chrome, Safari, Edge\n- Android 4.0 and Latest\n- iOS7 and Latest\n\n## Contributing\nIf you have good ideas or suggestions, please issue or pull request\n\n## License\nAlerty is licensed under [MIT](http://http://opensource.org/licenses/MIT \"MIT\")\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fundead25%2Falerty","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fundead25%2Falerty","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fundead25%2Falerty/lists"}