Skip to content

Commit

Permalink
[hello-dolly] wrap code in a block
Browse files Browse the repository at this point in the history
  • Loading branch information
g-plane committed Aug 26, 2020
1 parent 392d785 commit f2aa09a
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions plugins/hello-dolly/assets/hello-dolly.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const lyrics = `Hello, Dolly
{
const lyrics = `Hello, Dolly
Well, hello, Dolly
It's so nice to have you back where you belong
You're lookin' swell, Dolly
Expand Down Expand Up @@ -27,20 +28,19 @@ Dolly'll never go away
Dolly'll never go away
Dolly'll never go away again`.split('\n')

const length = lyrics.length
const length = lyrics.length

const hitokoto = document.createElement('div')
hitokoto.style.marginTop = '3px'
hitokoto.textContent = lyrics[Math.floor(Math.random() * length)]
const hitokoto = document.createElement('div')
hitokoto.style.marginTop = '3px'
hitokoto.textContent = lyrics[Math.floor(Math.random() * length)]

const container = document.querySelector('.breadcrumb')
if (container) {
container.appendChild(hitokoto)
} else {
const container = document.createElement('div')
container.className = 'breadcrumb'
container.appendChild(hitokoto)
document.querySelector('.content-header')?.appendChild(container)
const container = document.querySelector('.breadcrumb')
if (container) {
container.appendChild(hitokoto)
} else {
const container = document.createElement('div')
container.className = 'breadcrumb'
container.appendChild(hitokoto)
document.querySelector('.content-header')?.appendChild(container)
}
}

export default undefined

0 comments on commit f2aa09a

Please sign in to comment.