Skip to content

Commit 0976cc6

Browse files
Ivan SemochkinIvan Semochkin
authored andcommitted
update colors
1 parent 38cdf41 commit 0976cc6

File tree

4 files changed

+40
-43
lines changed

4 files changed

+40
-43
lines changed

src/app.css

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -136,15 +136,26 @@ input[type='search'] {
136136
}
137137

138138
body {
139-
--bg-start: hsl(21, 94%, 62%);
140-
--bg-end: hsl(94, 82%, 60%);
141-
--bg-path: hsla(162, 43%, 48%, 0.8);
142-
--bg-select: hsl(0, 0%, 3%);
143-
--bg-tool-border: hsl(227, 25%, 15%);
144-
--bg-weight-tool: hsla(210, 100%, 72%, 0.7);
145-
--bg-wall-tool: hsl(0, 5%, 75%);
139+
--bg-body: #121210;
140+
--bg-interface: #22192B;
141+
142+
--bg-start: #96E458;
143+
--bg-end: #E3A359;
144+
--bg-visited: #7EA151;
145+
146+
--bg-path: #B651BF;
147+
--bg-wall: #C2444C;
148+
149+
--bg-weight-1: #6143B7;
150+
--bg-weight-2: #6F4ECF;
151+
--bg-weight-3: #8463E3;
152+
153+
--bg-weight-tool: var(--bg-weight-2);
154+
--bg-wall-tool: var(--bg-wall);
155+
146156

147157
--bg-select: hsl(0, 0%, 3%);
158+
--bg-tool-border: hsl(227, 25%, 15%);
148159
--select-active: hsl(215, 80%, 35%);
149160

150161
--color-weight: hsl(218, 13%, 88%);
@@ -153,22 +164,9 @@ body {
153164
}
154165

155166
body.dark {
156-
--bg-body: hsl(229, 26%, 8%);
157-
--bg-player: hsl(240, 10%, 20%);
158-
--bg-not-visited: hsla(220, 9%, 27%, 0.302);
159-
--bg-visited: hsla(359, 94%, 55%, 0.3);
160-
--bg-wall: hsl(0, 5%, 75%);
161-
162-
--bg-nav: hsl(240, 10%, 20%, 1);
167+
--bg-not-visited: #3B2D52;
163168
}
164169

165170
body.light {
166-
--bg-body: hsl(229, 26%, 8%);
167-
--bg-not-visited: hsla(0, 0%, 100%, 1);
168-
--bg-visited: hsla(359, 94%, 55%, 0.3);
169-
--bg-body: hsl(220, 3%, 21%);
170-
--bg-player: hsl(240, 10%, 30%);
171-
--bg-wall: hsla(0, 0%, 55%, 1);
172-
173-
--bg-nav: hsl(240, 10%, 30%, 1);
171+
--bg-not-visited: #E0DCE4;
174172
}

src/lib/Components/Nav.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
top: 0;
3131
left: 0;
3232
height: 63px;
33-
background-color: var(--bg-nav);
33+
background-color: var(--bg-interface);
3434
position: absolute;
3535
width: 100%;
3636
}

src/lib/Components/Node.svelte

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,26 @@
66
export let key: string;
77
export let node: Node;
88
9-
const getWeightOpacity = () => {
10-
let opacity;
9+
const getCurrentWeight = () => {
1110
let currentWeight = $weight.get(key);
11+
console.log('currentWeight', currentWeight);
1212
1313
if (!currentWeight) {
14-
return;
14+
return '';
1515
} else if (currentWeight <= 3) {
16-
opacity = 0.4;
16+
return 'bg-weight-1';
1717
} else if (currentWeight <= 7) {
18-
opacity = 0.5;
18+
return 'bg-weight-2';
1919
} else {
20-
opacity = 0.6;
20+
return 'bg-weight-3';
2121
}
22-
23-
return opacity;
2422
};
2523
</script>
2624

2725
<div
2826
id={key}
2927
data-type="node"
30-
style="--weight-opacity:{$weight.get(key) ? getWeightOpacity() : 0};"
28+
style="--weight-dynamic-bg:{$weight.has(key) ? `var(--${getCurrentWeight()})` : ''}"
3129
class="node"
3230
class:visited={node.visited}
3331
class:startNode={$startNodeKey === key}
@@ -76,6 +74,15 @@
7674
min-height: 30px;
7775
min-width: 30px;
7876
flex-shrink: 0;
77+
78+
font-size: 0.8rem;
79+
font-weight: 700;
80+
display: flex;
81+
justify-content: flex-end;
82+
align-items: flex-end;
83+
padding-right: 5px;
84+
padding-bottom: 2px;
85+
7986
color: var(--color-weight);
8087
background-color: var(--bg-not-visited);
8188
}
@@ -103,16 +110,8 @@
103110
background-color: var(--bg-wall);
104111
}
105112
106-
.weight {
107-
font-size: 0.8rem;
108-
font-weight: 700;
109-
display: flex;
110-
justify-content: flex-end;
111-
align-items: flex-end;
112-
padding-right: 5px;
113-
padding-bottom: 2px;
114-
115-
background-color: hsla(210, 100%, 72%, var(--weight-opacity));
113+
.weight:not(.visited) {
114+
background-color: var(--weight-dynamic-bg);
116115
}
117116
118117
.path {

src/lib/Components/Player.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@
256256
height: var(--height);
257257
min-height: var(--height);
258258
width: 100%;
259-
background-color: var(--bg-player);
259+
background-color: var(--bg-interface);
260260
261261
display: grid;
262262
grid-template-columns: 1fr 1fr;

0 commit comments

Comments
 (0)