overleaf/services/web/frontend/js/pages/marketing/homepage.js
Jakob Ackermann 267b7fc17d Merge pull request #4941 from overleaf/jpa-as-homepage-prototype
[web] de-ng homepage prototype

GitOrigin-RevId: 030a5bf0b4f05eac7d69fda928c906f3c9c962f0
2021-09-09 08:03:04 +00:00

30 lines
835 B
JavaScript

import '../../marketing'
function realTimeEditsDemo() {
const frames = [
{ before: '', time: 1000 },
{ before: 'i', time: 100 },
{ before: 'in', time: 200 },
{ before: 'in ', time: 300 },
{ before: 'in r', time: 100 },
{ before: 'in re', time: 200 },
{ before: 'in rea', time: 100 },
{ before: 'in real', time: 200 },
{ before: 'in real ', time: 400 },
{ before: 'in real t', time: 200 },
{ before: 'in real ti', time: 100 },
{ before: 'in real tim', time: 200 },
{ before: 'in real time', time: 2000 },
]
let index = 0
function nextFrame() {
const frame = frames[index]
index = (index + 1) % frames.length
$('.real-time-example').html(frame.before + "<div class='cursor'>|</div>")
setTimeout(nextFrame, frame.time)
}
nextFrame()
}
realTimeEditsDemo()