Skip to content

Commit 6db39a1

Browse files
committed
Add JS functions and styling
1 parent 8cfe9f3 commit 6db39a1

File tree

2 files changed

+35
-15
lines changed

2 files changed

+35
-15
lines changed

js/main.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
11
'use strict';
2+
3+
const inputs = document.querySelectorAll('.controls input');
4+
5+
function handleUpdate() {
6+
const suffix = this.dataset.sizing || '';
7+
document.documentElement.style.setProperty(`--${this.name}`, this.value + suffix);
8+
}
9+
10+
inputs.forEach(input => input.addEventListener('change', handleUpdate));
11+
inputs.forEach(input => input.addEventListener('mousemove', handleUpdate));

styles/main.css

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,45 @@
11
:root {
2-
2+
--base: #ffc600;
3+
--spacing: 10px;
4+
--blur: 10px;
35
}
46

57
body {
6-
box-sizing: border-box;
7-
display: flex;
8-
flex-direction: column;
9-
justify-content: center;
10-
align-items: center;
11-
height: 100vh;
12-
background: #000000;
8+
text-align: center;
9+
background: rgb(32, 32, 32);
1310
color: white;
14-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
11+
font-family: 'helvetica neue', sans-serif;
1512
font-weight: 100;
1613
position: relative;
17-
text-align: center;
14+
height: 100vh;
1815
overflow: hidden;
16+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
1917
}
2018

2119
.controls {
22-
margin-bottom: 50px;
23-
background: white;
24-
border-radius: 10px;
20+
padding: 2rem;
21+
background-color: rgba(255, 255, 255, 1);
22+
box-shadow: 1px 1px 1px rgb(194, 194, 194);
2523
color: black;
26-
padding: 1rem;
27-
}
24+
margin-bottom: 50px;
25+
border-radius: 5px;
26+
font-size: 2rem;
27+
}
2828

2929
input {
3030
width: 100px;
3131
}
3232

33+
img {
34+
padding: var(--spacing);
35+
background: var(--base);
36+
filter: blur(var(--blur));
37+
}
38+
39+
.hl {
40+
color: var(--base);
41+
}
42+
3343
details {
3444
font-size: 0.8rem;
3545
position: absolute;

0 commit comments

Comments
 (0)