Vanilla JS version of FastEllipsis