-
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.
Added all resources files of working demo
- Loading branch information
1 parent
4df1fe3
commit 3517d61
Showing
10 changed files
with
9,467 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
var btnDraw = document.querySelectorAll(".btn-draw"); | ||
var btnErase = document.querySelectorAll(".btn-erase"); | ||
|
||
// We are only adding and removing the 'active' class, | ||
// the entire animation is defined in the CSS code | ||
function draw(btn) { | ||
btn.parentElement.parentElement.classList.add("active"); | ||
btn.parentElement.parentElement.querySelector("svg").classList.add("active"); | ||
} | ||
|
||
function erase(btn) { | ||
btn.parentElement.parentElement.classList.remove("active"); | ||
btn.parentElement.parentElement | ||
.querySelector("svg") | ||
.classList.remove("active"); | ||
} | ||
|
||
// Add handlers to our buttons | ||
btnDraw.forEach((btn) => { | ||
btn.addEventListener("click", () => draw(btn), false); | ||
}); | ||
|
||
btnErase.forEach((btn) => { | ||
btn.addEventListener("click", () => erase(btn), false); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,95 @@ | ||
* { | ||
padding: 0; | ||
margin: 0; | ||
box-sizing: border-box; | ||
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif; | ||
} | ||
|
||
body { | ||
background-color: #eeeeee; | ||
} | ||
|
||
h1 { | ||
text-align: center; | ||
margin-bottom: 50px; | ||
} | ||
|
||
.container { | ||
max-width: 824px; | ||
margin: 0 auto; | ||
padding: 40px 24px; | ||
} | ||
|
||
.row { | ||
display: flex; | ||
flex-wrap: wrap; | ||
align-items: center; | ||
justify-content: center; | ||
} | ||
|
||
.svg-box { | ||
width: calc(50% - 24px); | ||
padding: 24px 24px 0; | ||
border: 1px solid #eaeaea; | ||
margin: 0 auto 24px; | ||
background-color: #fff; | ||
} | ||
|
||
.btn-draw, | ||
.btn-erase { | ||
background-color: transparent; | ||
border: 0; | ||
outline: none; | ||
font-weight: 500; | ||
text-transform: uppercase; | ||
padding: 16px 24px; | ||
border: 1px solid #e3e3e3; | ||
cursor: pointer; | ||
transition: 0.3s ease; | ||
margin-bottom: 8px; | ||
} | ||
|
||
.btn-draw:hover, | ||
.btn-erase:hover { | ||
border: 1px solid #000000; | ||
} | ||
|
||
.btn-erase { | ||
opacity: 0.5; | ||
cursor: not-allowed; | ||
} | ||
|
||
.active .btn-draw { | ||
opacity: 0.5; | ||
cursor: not-allowed; | ||
} | ||
|
||
.active .btn-erase { | ||
opacity: 1; | ||
cursor: pointer; | ||
} | ||
|
||
.svg-box svg { | ||
width: 100%; | ||
} | ||
|
||
.action { | ||
padding: 24px; | ||
border-top: 1px solid #eaeaea; | ||
border-left: 0; | ||
display: flex; | ||
flex-wrap: wrap; | ||
align-items: center; | ||
justify-content: space-around; | ||
margin-left: -24px; | ||
margin-right: -24px; | ||
} | ||
|
||
@media (max-width: 575.98px) { | ||
h1 { | ||
font-size: 24px; | ||
} | ||
.svg-box { | ||
width: calc(100% - 24px); | ||
} | ||
} |
Oops, something went wrong.