-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
progressChar String to graphic elements #2
Comments
Also the width is not responsive, would it possible make it refresh the width when resize the browser width? |
Interesting question! What exactly are you trying to do? Under the hood, Termynal currently takes the If you want to use a custom character that's not an emoji or other unicode character, the simplest solution would be to use an icon font, e.g. FontAwesome or an entirely custom one built with a tool like IcoMoon (which even lets you upload your own SVGs). Then use the character that's mapped to your icon in the font as the Here's a little CodePen demo with examples: https://codepen.io/ines/pen/c799d3780bf0b7c1a9ccb0ccd47bfdca Alternatively, you could also edit async progress(line) {
const progressLength = line.getAttribute(`${this.pfx}-progressLength`) || this.progressLength;
const progressChar = line.getAttribute(`${this.pfx}-progressChar`) || this.progressChar;
line.innerHTML = ''; // use innerHTML instead of textContent
this.container.appendChild(line);
for (let i = 1; i < progressLength + 1; i++) { // iterate projectLength times
await this._wait(this.typeDelay);
const percent = Math.round(i / chars.length * 100);
// use innerHTML and n times the character (i.e. the HTML string)
line.innerHTML = `${progressChar * i} ${percent}%`;
}
} This will take whatever you set as the Edit: Just saw your question about the width – do you have an example of the responsiveness problem? By default, the |
cool and if you could change to write I would try some texts or create some graphics as And for the responsive width thing, I find out I can add anyway, this is a great JS, thanks for response so quick. |
Other question is, does it come with any thanks! |
Any updates on the |
Here to 1+ events |
Is any ways to make the
progressChar: string
be graphic elements? LikeprogressChar: '<span class='graphic'></div>'
thanks,
Wei
The text was updated successfully, but these errors were encountered: