Trigger twitter button fade on script load

This commit is contained in:
Sam Carlton 2020-11-16 14:03:07 -06:00
parent 3f5f0eb764
commit b12daa87b1

View file

@ -57,13 +57,21 @@ export default {
twitterScript.setAttribute('async','true') twitterScript.setAttribute('async','true')
twitterScript.setAttribute('src','https://platform.twitter.com/widgets.js') twitterScript.setAttribute('src','https://platform.twitter.com/widgets.js')
twitterScript.onload = () => {
// Delay reveal for dom update
setInterval(() => {
this.visible = true
}, 850)
}
document.head.appendChild(twitterScript) document.head.appendChild(twitterScript)
// Reveal after 200ms // Reveal after 200ms
setInterval(() => { // setInterval(() => {
this.visible = true // this.visible = true
}, 750) // }, 750)
} }
} }
} }