refacto: look after remanso now
This commit is contained in:
@@ -10,7 +10,7 @@ window.twttr = (function (d, s, id) {
|
||||
|
||||
const js = d.createElement(s)
|
||||
js.id = id
|
||||
js.src = 'https://platform.twitter.com/widgets.js'
|
||||
js.src = "https://platform.twitter.com/widgets.js"
|
||||
fjs.parentNode.insertBefore(js, fjs)
|
||||
|
||||
t._e = []
|
||||
@@ -19,22 +19,22 @@ window.twttr = (function (d, s, id) {
|
||||
}
|
||||
|
||||
return t
|
||||
})(document, 'script', 'twitter-lite-note')
|
||||
})(document, "script", "twitter-remanso")
|
||||
|
||||
export const createTweet = (
|
||||
tweetId: string,
|
||||
theme: 'light' | 'dark' = 'light'
|
||||
theme: "light" | "dark" = "light",
|
||||
) => {
|
||||
window.twttr.ready(() => {
|
||||
window.twttr.widgets.createTweet(
|
||||
tweetId,
|
||||
document.getElementById(`tweet-${tweetId}`, { theme })
|
||||
document.getElementById(`tweet-${tweetId}`, { theme }),
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
export const generateTweets = () => {
|
||||
const elements = document.querySelectorAll('.markdown-tweet')
|
||||
const elements = document.querySelectorAll(".markdown-tweet")
|
||||
|
||||
elements.forEach((element) => {
|
||||
createTweet(element.dataset.tweetId)
|
||||
|
||||
Reference in New Issue
Block a user