Set up basic dropdown exercise
This commit is contained in:
parent
1771e1d86e
commit
f883283308
10 changed files with 183 additions and 0 deletions
7
animation/02-drop-down/README.md
Normal file
7
animation/02-drop-down/README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Dropdown
|
||||
|
||||
## Desired Outcome
|
||||
|
||||
![outcome](./desired-outcome.gif)
|
||||
|
||||
### Self Check
|
22
animation/02-drop-down/index.html
Normal file
22
animation/02-drop-down/index.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Dropdown</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="dropdown-container">
|
||||
<div class="dropdown-menu">
|
||||
<button class="dropdown-button">Dropdown</button>
|
||||
<div class="dropdown-content">
|
||||
<a href="#">Link 1</a>
|
||||
<a href="#">Link 2</a>
|
||||
<a href="#">Link 3</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
58
animation/02-drop-down/solution/solution.css
Normal file
58
animation/02-drop-down/solution/solution.css
Normal file
|
@ -0,0 +1,58 @@
|
|||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.dropdown-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdown-button {
|
||||
background-color: rgb(108, 238, 255);
|
||||
padding: 16px;
|
||||
font-size: 16px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dropdown-content {
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
left: -25%;
|
||||
background-color: rgb(189, 188, 188);
|
||||
width: 160px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* max-height: 0; */
|
||||
/* transition: max-height 0.25s ease-out; */
|
||||
}
|
||||
|
||||
a {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.dropdown-menu:hover .dropdown-content {
|
||||
visibility: visible;
|
||||
/* max-height: 500px;
|
||||
transition: max-height 0.25s ease-out; */
|
||||
}
|
||||
|
||||
.dropdown-menu:hover .dropdown-button {
|
||||
cursor: pointer;
|
||||
background-color: rgb(59, 232, 255);
|
||||
}
|
||||
|
||||
.dropdown-content a:hover {
|
||||
background-color: #ddd;
|
||||
}
|
22
animation/02-drop-down/solution/solution.html
Normal file
22
animation/02-drop-down/solution/solution.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Dropdown</title>
|
||||
<link rel="stylesheet" href="solution.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div class="dropdown-container">
|
||||
<div class="dropdown-menu">
|
||||
<button class="dropdown-button">Dropdown</button>
|
||||
<div class="dropdown-content">
|
||||
<a href="#">Link 1</a>
|
||||
<a href="#">Link 2</a>
|
||||
<a href="#">Link 3</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
41
animation/02-drop-down/style.css
Normal file
41
animation/02-drop-down/style.css
Normal file
|
@ -0,0 +1,41 @@
|
|||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.dropdown-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.dropdown-menu {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dropdown-button {
|
||||
background-color: rgb(108, 238, 255);
|
||||
padding: 16px;
|
||||
font-size: 16px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dropdown-content {
|
||||
visibility: hidden;
|
||||
position: absolute;
|
||||
left: -25%;
|
||||
background-color: rgb(189, 188, 188);
|
||||
width: 160px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
a {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
color: black;
|
||||
padding: 12px 16px;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
}
|
7
animation/03-pop-up/README.md
Normal file
7
animation/03-pop-up/README.md
Normal file
|
@ -0,0 +1,7 @@
|
|||
# Popup
|
||||
|
||||
## Desired Outcome
|
||||
|
||||
![outcome](./desired-outcome.gif)
|
||||
|
||||
### Self Check
|
13
animation/03-pop-up/index.html
Normal file
13
animation/03-pop-up/index.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Popup</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="popup-container"></div>
|
||||
</body>
|
||||
</html>
|
0
animation/03-pop-up/solution/solution.css
Normal file
0
animation/03-pop-up/solution/solution.css
Normal file
13
animation/03-pop-up/solution/solution.html
Normal file
13
animation/03-pop-up/solution/solution.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Popup</title>
|
||||
<link rel="stylesheet" href="style.css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="popup-container"></div>
|
||||
</body>
|
||||
</html>
|
0
animation/03-pop-up/style.css
Normal file
0
animation/03-pop-up/style.css
Normal file
Loading…
Reference in a new issue