You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello, i managed to add a small snippet code that will help the main.js ignore the class tags who don't have any contents when creating new paragraphs.
you need to add these directly after the CLEAR and RESTART tags like this:
// CLEAR - removes all existing content.
// RESTART - clears everything and restarts the story from the beginning
else if( tag == "CLEAR" || tag == "RESTART" ) {
removeAll("p");
removeAll("img");
// Comment out this line if you want to leave the header visible when clearing
setVisible(".header", false);
if( tag == "RESTART" ) {
restart();
return;
}
}
}
/* ------------ important part of code ------------ */
// Check if paragraphText is empty
if (paragraphText.trim().length == 0) {
continue; // Skip empty paragraphs
}
this way, each time the script check the details from the story.js, it will simply and ignore and skip all the empty tags
here the results:
this is before the added code:
this is after the added code:
as you can see, you will be able to use your own CSS styling without clashing with the other classes. otherwise, it would use the last class used for css styling. i hope it will help you out!
The text was updated successfully, but these errors were encountered:
hello, i managed to add a small snippet code that will help the main.js ignore the class tags who don't have any contents when creating new paragraphs.
you need to add these directly after the CLEAR and RESTART tags like this:
this way, each time the script check the details from the story.js, it will simply and ignore and skip all the empty tags
here the results:
this is before the added code:
this is after the added code:
as you can see, you will be able to use your own CSS styling without clashing with the other classes. otherwise, it would use the last class used for css styling. i hope it will help you out!
The text was updated successfully, but these errors were encountered: