Need someone who can tweak code of "Insert at cursor position plugin" and add a small tweak

Hi, I need someone who can tweak the code of this plugin:

I just want to add a typewriter animation on it:
Right now all it does is just insert text without animation

Here is the plugin code below:

function(properties, context) {
//Original from Tim Down
var texttoinsert = properties.insert
function pasteHtmlAtCaret(html) {
var sel, range;
if (window.getSelection) {
// IE9 and non-IE
sel = window.getSelection();
if (sel.getRangeAt && sel.rangeCount) {
range = sel.getRangeAt(0);
range.deleteContents();

        // Range.createContextualFragment() would be useful here but is
        // non-standard and not supported in all browsers (IE9, for one)
        var el = document.createElement("div");
        el.innerHTML = html;
        var frag = document.createDocumentFragment(), node, lastNode;
        while ( (node = el.firstChild) ) {
            lastNode = frag.appendChild(node);
        }
        range.insertNode(frag);

console.log(frag)
// Preserve the selection
if (lastNode) {
range = range.cloneRange();
range.setStartAfter(lastNode);
range.collapse(true);
sel.removeAllRanges();
sel.addRange(range);
}
}
} else if (document.selection && document.selection.type != “Control”) {
// IE < 9
document.selection.createRange().pasteHTML(html);
}
}

pasteHtmlAtCaret(texttoinsert)

}

2 Likes

Do you have any example of typewriter animation?

2 Likes

this is the typewriter effect

How about this:)

Hugo
Developer @ Nalfe

60+ Bubble Templates
10+ Bubble Plugins
Bubble Component Library & Extension
No-code Development Subscriptions
No-code Podcast

2 Likes

This is awesome! I saw it on the plugin marketplace!
Can you also make it work for the richtext editor?
I sent you a DM

2 Likes