Skip to content

Commit 06c28d1

Browse files
committed
Settings page isn't too ugly now
1 parent b5a02ba commit 06c28d1

File tree

4 files changed

+33
-12
lines changed

4 files changed

+33
-12
lines changed

src/settings-page/settings.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.input-label {
2+
font-size: small;
3+
color: gray;
4+
font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
5+
}
6+
7+
input {
8+
margin-top: 0.5ex;
9+
margin-bottom: 1.5ex;
10+
}
11+
12+
/* Transition borrowed from StackOverflow under CC BY-SA 4.0
13+
* https://stackoverflow.com/a/20910008
14+
*/
15+
.hidden {
16+
visibility: hidden;
17+
opacity: 0;
18+
transition: visibility 0s 2s, opacity 2s ease-in;
19+
}

src/settings-page/settings.html

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>My Test Extension Options</title>
4+
<title>Time Card Autofill Options</title>
5+
<link rel="stylesheet" type="text/css" href="settings.css" />
56
</head>
67
<body>
7-
<div>
8+
<div class="input-label">
89
Project Code (e.g. 103-01-001-10)
9-
<input id="project-code" type="text" style="width: 30em;">
1010
</div>
11-
<div>
11+
<input id="project-code" type="text" style="width: 30em;">
12+
<div class="input-label">
1213
Task (e.g. Default)
13-
<input id="task" type="text" style="width: 15em;">
1414
</div>
15-
<div>
15+
<input id="task" type="text" style="width: 15em;">
16+
<div class="input-label">
1617
Expenditure Type (e.g. Regular - Straight Time)
17-
<input id="expenditure-type" type="text" style="width: 15em;">
1818
</div>
19+
<input id="expenditure-type" type="text" style="width: 15em;">
1920

20-
<div id="status"></div>
21-
<button id="save">Save</button>
21+
<div>
22+
<button id="save">Save</button>
23+
<span id="status"></span>
24+
</div>
2225

2326
<script src="settings.js"></script>
2427
</body>

src/settings-page/settings.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ const saveOptions = () => {
1010
// Update status to let user know options were saved.
1111
const status = document.getElementById('status');
1212
status.textContent = 'Saved.';
13-
setTimeout(() => {
14-
status.textContent = '';
15-
}, 750);
13+
status.classList.add('hidden'); // "hidden" class has a fade out animation
1614
});
1715
};
1816

webpack.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ module.exports = {
2424
{ from: 'src/manifest.json' },
2525
{ from: 'src/icons', to: 'icons' },
2626
{ from: 'src/settings-page/settings.html' },
27+
{ from: 'src/settings-page/settings.css' },
2728
],
2829
}),
2930
],

0 commit comments

Comments
 (0)