Skip to content

Talking Duck 2 #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: 02-talking-duck-02
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions 02-talking-duck/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<title>Talking Duck</title>
</head>
<body>
<div>
<div class="container">
<!-- Header -->
<header>
<img src="images/logo.png" alt="Logo Coding Week" />
Expand All @@ -37,25 +37,25 @@
<textarea placeholder="Write something..."></textarea>

<!-- Controls -->
<div>
<div class="controls">
<button>
<img src="images/play.png" alt="Play Button" />
</button>

<!-- Audio controls -->
<div>
<label>Pitch</label>
<input type="range" />
<div class="pitch-controls">
<label for="pitch-range">Pitch</label>
<input id="pitch-range" min="0.1" max="2" step="0.1" value="1" type="range" />
</div>
</div>

<!-- Duck -->
<figure>
<figure class="duck">
<img src="images/talking-duck-static.png" alt="Static Duck" />
<img src="images/talking-duck-animated.gif" alt="Animated Duck" />
</figure>
</main>

</div>
</body>
</html>
</html>
92 changes: 92 additions & 0 deletions 02-talking-duck/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/* Custom properties */
:root {
--font: Roboto, sans-serif;
--pink: #f71469;
}

/* CSS Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

/* Generic Rules */
html {
height: 100%;
font-family: var(--font);
color: white;
background-image: linear-gradient(to top, var(--pink) -40%, #3535ec 85%);
background-attachment: fixed;
}

img {
max-width: 100%;
}

/* Container */
.container {
display: grid;
width: 90vw;
padding: 16px;
margin: 0 auto;
}

/* Logo */
header img {
width: 56px;
height: auto;
margin-bottom: 32px;
}

/* Text box */
textarea {
border: none;
resize: none;
width: 100%;
height: 120px;
border-radius: 16px;
font-size: 20px;
padding: 24px;
font-family: var(--font);
margin-bottom: 32px;
}

textarea:focus-within {
outline: 1px auto var(--pink);
}

/* Controls */
.controls {
display: grid;
grid-gap: 10px;
grid-template-columns: 1fr 4fr;
}

/* Play button */
button {
border: none;
border-radius: 8px;
width: 64px;
height: 56px;
background-color: var(--pink);
}

button img {
vertical-align: middle;
}

/* Audio controls */
.pitch-controls {
margin-bottom: 32px;
}

label {
display: block;
margin-bottom: 12px;
}

#pitch-range {
width: 100%;
accent-color: white;
}