Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- all credits goes to me, AroliS^.
- You are not allowed to publish this as yours,
- however you can use it as you want.
- */
- function createBar( percent )
- {
- let num = parseInt( percent / 10, 10 )
- , slash = '//////////' //progress bar
- , decreasing = slash.length - num // decreasing means the number of percent that it will increased.
- , addslash = ''; //adding slashes
- for( var i = 0; i < num; i++ )
- {
- addslash += '/'; //we're looping the percent that will be added in slashes
- }
- return addslash == '' ? '['+ slash.slice( 0, decreasing ) + ']' : `[\` ${addslash} \``+ slash.slice( 0, decreasing ) + `]`;
- }
Advertisement
Add Comment
Please, Sign In to add comment