var text = 'Hello World!';
var div = document.getElementById('rollercoaster');
var tSize = 10;
function addSpanText(){
div.appendChild(document.createElement('span'));
div.lastChild.appendChild(document.createTextNode(text[i]));
div.lastChild.style.fontSize = tSize.toString() + 'px';
};
for (i = 0; i < text.length; i++) {
if (i < (text.length / 2)-1) {
addSpanText();
tSize +=5;
}
else {
addSpanText();
if (tSize > 10) {
tSize -=5;
}
}
}