-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
148 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,97 @@ | ||
body, | ||
h1, | ||
h1, | ||
p, | ||
ul, | ||
li, | ||
a, | ||
ul, | ||
li, | ||
select, | ||
option, | ||
div { | ||
margin: 0; | ||
padding: 0; | ||
list-style: none; | ||
} | ||
|
||
body { | ||
font-size: 0.85rem; | ||
font-family: "Montserrat", Helvetica, sans-serif; | ||
} | ||
|
||
h1 { | ||
margin-bottom: 15px; | ||
} | ||
|
||
p { | ||
padding: 0 25px; | ||
font-size: 1rem; | ||
line-height: 1.5; | ||
font-weight: 300; | ||
} | ||
|
||
.container { | ||
display: flex; | ||
flex-wrap: wrap; | ||
max-width: 1080px; | ||
flex-direction: column; | ||
margin: 0 auto; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.container-columns { | ||
display: flex; | ||
flex-wrap: wrap; | ||
padding: 1rem 2rem; | ||
margin: 0 0 1rem 0; | ||
text-align: center; | ||
align-items: center; | ||
} | ||
|
||
header { | ||
.header { | ||
margin: 25px 0; | ||
text-align: center; | ||
} | ||
|
||
.types { | ||
margin: 7px; | ||
padding: 10px; | ||
} | ||
|
||
.types li { | ||
padding: 9.5px 0; | ||
} | ||
|
||
.house { | ||
margin: 5px; | ||
padding: 10px; | ||
border: 1px solid #dee2e6; | ||
border-radius: 0.25rem; | ||
} | ||
|
||
select { | ||
width: 100%; | ||
padding: 0.375rem 0.75rem; | ||
margin: 2px 0 3px 0; | ||
font-family: inherit; | ||
font-size: inherit; | ||
font-weight: 400; | ||
line-height: 1.5; | ||
color: #212529; | ||
background-color: #fff; | ||
border: 1px solid #ced4da; | ||
border-radius: 0.25rem; | ||
cursor: pointer; | ||
} | ||
|
||
.clues { | ||
display: flex; | ||
line-height: 1.5; | ||
} | ||
|
||
.clues ul { | ||
margin: 0 auto; | ||
column-count: 2; | ||
padding: 0 2rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,44 @@ | ||
function change(list) { | ||
var optionValue = list.options[list.selectedIndex].value | ||
var house = document.querySelector(".house") | ||
house.style.background = optionValue | ||
} | ||
function selectColor(list) { | ||
const houses = document.querySelectorAll(".house"); | ||
const optionValue = list.options[list.selectedIndex].value | ||
|
||
|
||
function change(item) { | ||
[].forEach.call(houses, house => { | ||
if (house.className === optionValue) { | ||
house.classList.toggle(optionValue) | ||
} | ||
}) | ||
item.classList.toggle(optionValue); | ||
} | ||
|
||
[].forEach.call(houses, house => { | ||
house.addEventListener("change", function () { | ||
change(this, optionValue) | ||
}) | ||
}) | ||
} | ||
|
||
|
||
|
||
|
||
// if (optionValue == "yellow") { | ||
// house.classList.add('yellow') | ||
|
||
// for (var i = 0; i < house.length; ++i) { | ||
// var item = house[i] | ||
// item.style.background = optionValue | ||
// } | ||
|
||
// house.style.background = optionValue | ||
|
||
// function change(listColors) { | ||
// var optionValue = listColors.options[listColors.selectedIndex].value | ||
// var house = document.querySelectorAll(".house") | ||
// for (var i = 0; i < house.length; ++i) { | ||
// var item = house[i] | ||
// item.style.background = optionValue | ||
// } | ||
|
||
// } | ||
|