Skip to content

Commit 1f3fec3

Browse files
committed
Adjust colors and buttons
1 parent 0040c32 commit 1f3fec3

File tree

5 files changed

+64
-43
lines changed

5 files changed

+64
-43
lines changed

ui/arduino/components/panel_files.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ function PanelFiles(state, emit) {
2323
&& state.selectedDevice === 'serial'
2424
&& state.selectedFile !== null
2525
let upload = Button({
26-
label: 'upload',
26+
label: 'Upload',
2727
icon: 'icons/Copy-Left.svg',
2828
onclick: () => emit('upload'),
2929
disabled: !uploadEnabled
3030
})
3131
let download = Button({
32-
label: 'download',
32+
label: 'Download',
3333
icon: 'icons/Copy-Right.svg',
3434
onclick: () => emit('download'),
3535
disabled: !downloadEnabled
3636
})
3737
let remove = Button({
38-
label: 'remove',
38+
label: 'Remove',
3939
icon: 'icons/Delete.svg',
4040
onclick: () => emit('remove'),
4141
disabled: state.selectedFile === null

ui/arduino/components/toolbar.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
function Toolbar(state, emit) {
22
const connect = Button({
33
icon: state.isConnected ? 'icons/Connect.svg' : 'icons/Disconnect.svg',
4-
label: state.isConnected ? 'Disconnect' : 'Connect',
4+
label: 'Connect',
55
disabled: false,
66
onclick: () => emit('open-port-dialog'),
7-
color: state.isConnected ? 'selected' : 'default'
7+
color: 'default'
88
})
99

1010
const play = Button({
@@ -69,12 +69,15 @@ function Toolbar(state, emit) {
6969
return html`
7070
<div id="toolbar">
7171
${connect}
72+
<div class="toolbar-spacing"></div>
7273
${play}
7374
${stop}
7475
${reset}
76+
<div class="toolbar-spacing"></div>
7577
${newFile}
7678
${openFolder}
7779
${save}
80+
<div class="toolbar-spacing"></div>
7881
${terminal}
7982
${files}
8083
</div>

ui/arduino/components/toolbar_button.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ function Button(param) {
88
selected = false
99
} = param || {}
1010
return html`
11-
<div class="toolbar-button-wrapper">
11+
<div class="toolbar-button-wrapper ${disabled ? 'disabled' : ''} ${selected ? 'selected' : ''}">
1212
<button
13-
class="toolbar-button ${color} ${selected ? 'selected' : ''}"
13+
class="toolbar-button"
1414
onclick=${onclick}
1515
disabled=${disabled}
1616
>

ui/arduino/store.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,10 @@ function store(state, emitter) {
240240
emitter.emit('render')
241241
})
242242

243+
244+
window.addEventListener('resize', () => {
245+
console.log('resize window')
246+
state.cache(AceEditor, 'editor').render()
247+
})
248+
243249
}

ui/arduino/theme.css

Lines changed: 48 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1+
@import url('https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;700&display=swap');
2+
13
:root {
2-
--color-0: #008184;
3-
--color-1: #E67E22;
4-
--color-2: #F39C12;
5-
--color-3: #F4BA00;
6-
--color-4: #ECF1F1;
7-
--white: #FFF;
4+
--teal: #008184;
5+
--white: rgb(255, 255, 255);
6+
--white-faded: rgba(255, 255, 255, 0.8);
87
--black: #000;
9-
font-size: 2vh;
8+
font-size: 2.25vh;
109
}
1110

1211
* {
1312
box-sizing: border-box;
13+
font-family: 'Roboto Mono', monospace;
1414
}
1515

1616
body {
@@ -48,22 +48,35 @@ img {
4848
width: 100%;
4949
display: flex;
5050
flex-direction: row;
51-
background: var(--color-0);
52-
padding: 0.5rem;
51+
background: var(--teal);
52+
padding: 0.5rem 0.5rem 0.75rem 0.5rem;
5353
}
5454

5555
.toolbar-button-wrapper {
5656
display: flex;
5757
flex-direction: column;
5858
justify-content: center;
5959
align-items: center;
60+
margin: 0 0.2rem;
61+
}
62+
63+
.toolbar-button-wrapper.selected .toolbar-button {
64+
background: none;
65+
box-shadow: 0 0 0 0.15rem var(--white);
66+
}
67+
.toolbar-button-wrapper.selected .toolbar-button img {
68+
filter: invert(1);
69+
}
70+
.toolbar-button-wrapper.selected .toolbar-label {
71+
font-weight: bold;
72+
}
73+
.toolbar-button-wrapper.disabled {
74+
opacity: 0.5;
75+
pointer-events: none;
6076
}
6177

6278
.toolbar-button {
6379
border: none;
64-
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),
65-
0 3px 1px -2px rgba(0,0,0,0.12),
66-
0 1px 5px 0 rgba(0,0,0,0.2);
6780
cursor: pointer !important;
6881
align-items: center;
6982
justify-content: center;
@@ -73,37 +86,36 @@ img {
7386
-ms-user-select: none;
7487
user-select: none;
7588
margin: 0.5rem;
76-
padding: 0.25rem;
77-
width: 3.25rem;
78-
height: 3.25rem;
89+
width: 2.5rem;
90+
height: 2.5rem;
7991
border-radius: 100%;
92+
background: var(--white-faded);
8093
}
94+
8195
.toolbar-button[disabled] {
82-
opacity: 0.5;
8396
pointer-events: none;
84-
box-shadow: none;
97+
background: var(--white-faded);
8598
}
99+
.toolbar-button:hover,
86100
.toolbar-button:active {
87-
box-shadow: none;
88-
background: var(--color-2);
89-
}
90-
.toolbar-button.selected {
91-
background: var(--color-2);
101+
background: var(--white);
92102
}
103+
93104
.toolbar-button img {
94-
width: 60%;
95-
height: 60%;
96-
margin-top: 0.2rem;
97-
}
98-
.toolbar-button.primary {
99-
background: var(--color-3)
105+
width: 90%;
106+
height: 90%;
107+
margin-top: 0.1rem;
100108
}
101109

102110
.toolbar-label {
103111
font-size: 0.75rem;
104112
color: var(--white);
105113
}
106114

115+
.toolbar-spacing {
116+
width: 1rem;
117+
}
118+
107119
/* PORT DIALOG */
108120
#backdrop {
109121
display: flex;
@@ -119,7 +131,7 @@ img {
119131
margin: auto;
120132
width: 80%;
121133
height: auto;
122-
background: var(--color-4);
134+
background: var(--white);
123135
padding: 2rem;
124136
font-size: 1.25rem;
125137
box-shadow: 0 2px 2px 0 rgba(0,0,0,0.14),0 3px 1px -2px rgba(0,0,0,0.12),0 1px 5px 0 rgba(0,0,0,0.2);
@@ -129,7 +141,8 @@ img {
129141
cursor: pointer;
130142
}
131143
#dialog ul li:hover {
132-
background: var(--color-3);
144+
background: var(--teal);
145+
color: var(--white);
133146
border-radius: 0.25rem;
134147
}
135148

@@ -143,13 +156,12 @@ img {
143156
display: flex;
144157
flex-direction: row;
145158
align-items: center;
146-
height: 2.5rem;
147159
font-size: 1rem;
148160
background: var(--color-4);
149161
}
150162
.editor-filename img {
151-
max-height: 80%;
152-
margin: 0 0.5rem;
163+
max-height: 100%;
164+
padding: 0.5rem;
153165
}
154166

155167
/* PANEL */
@@ -170,7 +182,7 @@ img {
170182
#files {
171183
width: 100%;
172184
height: 100%;
173-
background: var(--color-0);
185+
background: var(--teal);
174186
display: flex;
175187
flex-direction: row;
176188
padding: 1rem;
@@ -205,11 +217,11 @@ img {
205217
cursor: pointer;
206218
}
207219
#files .file-list ul li.selected {
208-
background: var(--color-2);
220+
background: var(--teal);
209221
color: var(--white);
210222
}
211223
#files .file-list ul li:hover {
212-
background: var(--color-3);
224+
background: var(--teal);
213225
color: var(--white);
214226
}
215227

0 commit comments

Comments
 (0)