Library preview | How to use | Contributing | License
With this Library you can display some alerts, with your style, if you want a new feature, open an PR or an Issue! Below you can see some styles that I made. You can test clicking here!
To use the Library it's very simple!
1 - Import the Library
Normal Library file
<!-- Script -->
<script defer src="https://igorvini25.github.io/Custom-alert/files/customAlert.js"></script>
<!-- Css -->
<link rel="stylesheet" href="https://igorvini25.github.io/Custom-alert/files/customAlert.css"/>
Minify Library file
<!-- Script -->
<script defer src="https://igorvini25.github.io/Custom-alert/files/customAlert.min.js"></script>
<!-- Css -->
<link rel="stylesheet" href="https://igorvini25.github.io/Custom-alert/files/customAlert.min.css"/>
2 - configs
// If you dont want custom colors, put false in 'customColors' and ignore
// colors object
// Create Config Object
let alertConfig = {
// If true, the user can't click in page until the alert is closed
blockPage: true,
buttonText: true,
customColors: true,
colors: {
// If you don't want style something you can put 'false' in configs
backgroundColor: /* your color */,
textColor: /* your color */,
buttonColor: /* your color */,
buttonTextColor: /* your color */
}
}
Now you can Use the alert
// Call the function, and all is ready
showAlert('Your Message')
// If you put 'true' in buttonText you can use the alert like below
showAlert('Your Message', 'Button text')
If you want close the Alert without click, you can use the call the function closeAlert()
You can Contribute with new features, features suggestions or translations!
- Fork it (https://github.com/IgorVini25/Custom-alert/fork)
- Create your feature branch (
git checkout -b featureOrTranslation
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin feature
) - Create a new Pull Request
This project License is MIT. See LICENSE File for more details.
Made with ♥ by IgorVini25