scrimba
Note at 0:47
Go Pro!Bootcamp

Bootcamp

Study group

Collaborate with peers in your dedicated #study-group channel.

Code reviews

Submit projects for review using the /review command in your #code-reviews channel

Note at 0:47
AboutCommentsNotes
Note at 0:47
Expand for more info
index.js
run
preview
console
// html dom elements 
const body = document.getElementById("body")
const greeting = document.getElementById("greeting")
const christmasBtn = document.getElementById("christmas")
const snowBtn = document.getElementById("snow")
const formContainer = document.getElementById('full-form-container')

// console log messages
const message = `Do it, you know you want to 😏`
const altMessage = `This is a lot of fun, isn't it? 😏`
const themeChangeFailed = `This is the theme already.`
const themeChangeSuccess = 'Theme changed successfully!'

// changes the theme to christmas
const toggleChristmasTheme = () => {
if(body.classList.contains('christmas')) {
console.log(themeChangeFailed)
} else {
body.classList.remove('snow')
body.classList.add('christmas')
greeting.textContent = '🎅 Merry Christmas!'
console.log(themeChangeSuccess)
}
}

// changes the theme to snow
const toggleSnowTheme = () => {
if(body.classList.contains('snow')) {
console.log(themeChangeFailed)
} else {
body.classList.remove('christmas')
body.classList.add('snow')
greeting.textContent = '☃️ Let It Snow!'
console.log(themeChangeSuccess)
}
}

// console logs messsages when hover over buttons
snowBtn.onmouseover = () => {console.log(altMessage)}
christmasBtn.onmouseover = () => {console.log(message)}

// buttons change the theme directly
snowBtn.onclick = () => {toggleSnowTheme()}
christmasBtn.onclick = () => {toggleChristmasTheme()}
Console
"Do it, you know you want to 😏"
,
"This is the theme already."
,
"This is a lot of fun, isn't it? 😏"
,
"Theme changed successfully!"
,
"Do it, you know you want to 😏"
,
"Theme changed successfully!"
,
"This is a lot of fun, isn't it? 😏"
,
"Theme changed successfully!"
,
"Do it, you know you want to 😏"
,
"Do it, you know you want to 😏"
,
"Do it, you know you want to 😏"
,
"Do it, you know you want to 😏"
,
"Theme changed successfully!"
,
"This is a lot of fun, isn't it? 😏"
,
"Theme changed successfully!"
,
"Do it, you know you want to 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"Do it, you know you want to 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"Do it, you know you want to 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"Do it, you know you want to 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"Do it, you know you want to 😏"
,
"Do it, you know you want to 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"Do it, you know you want to 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"Do it, you know you want to 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"Do it, you know you want to 😏"
,
"Theme changed successfully!"
,
"This is a lot of fun, isn't it? 😏"
,
"Theme changed successfully!"
,
"Do it, you know you want to 😏"
,
"Theme changed successfully!"
,
"This is a lot of fun, isn't it? 😏"
,
"Theme changed successfully!"
,
"Do it, you know you want to 😏"
,
"Theme changed successfully!"
,
"Do it, you know you want to 😏"
,
"This is the theme already."
,
"This is a lot of fun, isn't it? 😏"
,
"Theme changed successfully!"
,
"Do it, you know you want to 😏"
,
"Do it, you know you want to 😏"
,
"Theme changed successfully!"
,
"This is a lot of fun, isn't it? 😏"
,
"Theme changed successfully!"
,
"This is a lot of fun, isn't it? 😏"
,
"Do it, you know you want to 😏"
,
"Theme changed successfully!"
,
"This is a lot of fun, isn't it? 😏"
,
"Theme changed successfully!"
,
"Do it, you know you want to 😏"
,
"Do it, you know you want to 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"Do it, you know you want to 😏"
,
"This is a lot of fun, isn't it? 😏"
,
"Do it, you know you want to 😏"
,
"Theme changed successfully!"
,
"This is the theme already."
,
"This is the theme already."
,
"This is the theme already."
,
"This is a lot of fun, isn't it? 😏"
,
"Theme changed successfully!"
,
"This is the theme already."
,
"This is the theme already."
,
"This is the theme already."
,
"This is the theme already."
,
"This is the theme already."
,
"This is the theme already."
,
"This is the theme already."
,
"This is the theme already."
,
/index.html
LIVE