Skip to content

Commit bb2d3e4

Browse files
committed
Slight UI tweaking to make life easier on people
1 parent 22687bd commit bb2d3e4

File tree

4 files changed

+91
-17
lines changed

4 files changed

+91
-17
lines changed

resources/scripts/components/App.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Provider } from 'react-redux';
1111
import { SiteSettings } from '@/state/settings';
1212
import ProgressBar from '@/components/elements/ProgressBar';
1313
import NotFound from '@/components/screens/NotFound';
14-
import tw from 'twin.macro';
14+
import tw, { GlobalStyles as TailwindGlobalStyles } from 'twin.macro';
1515
import GlobalStylesheet from '@/assets/css/GlobalStylesheet';
1616
import { createBrowserHistory } from 'history';
1717
import { setupInterceptors } from '@/api/interceptors';
@@ -74,6 +74,7 @@ const App = () => {
7474
return (
7575
<>
7676
<GlobalStylesheet/>
77+
<TailwindGlobalStyles/>
7778
<StoreProvider store={store}>
7879
<Provider store={store}>
7980
<ProgressBar/>

resources/scripts/components/elements/Input.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,28 +38,28 @@ const inputStyle = css<Props>`
3838
// Reset to normal styling.
3939
resize: none;
4040
${tw`appearance-none outline-none w-full min-w-0`};
41-
${tw`p-3 border rounded text-sm transition-all duration-150`};
41+
${tw`p-3 border-2 rounded text-sm transition-all duration-150`};
4242
${tw`bg-neutral-600 border-neutral-500 hover:border-neutral-400 text-neutral-200 shadow-none`};
4343
4444
& + .input-help {
4545
${tw`mt-1 text-xs`};
46-
${props => props.hasError ? tw`text-red-400` : tw`text-neutral-400`};
46+
${props => props.hasError ? tw`text-red-200` : tw`text-neutral-200`};
4747
}
4848
4949
&:required, &:invalid {
5050
${tw`shadow-none`};
5151
}
5252
5353
&:not(:disabled):not(:read-only):focus {
54-
${tw`shadow-md border-primary-400`};
54+
${tw`shadow-md border-primary-300 ring-2 ring-primary-400 ring-opacity-50`};
5555
}
5656
5757
&:disabled {
5858
${tw`opacity-75`};
5959
}
6060
6161
${props => props.isLight && light};
62-
${props => props.hasError && tw`text-red-600 border-red-500 hover:border-red-600`};
62+
${props => props.hasError && tw`text-red-100 border-red-400 hover:border-red-300 focus:border-red-300! focus:ring-red-200!`};
6363
`;
6464

6565
const Input = styled.input<Props>`

resources/scripts/components/server/Console.tsx

+12-3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ const TerminalDiv = styled.div`
5656
}
5757
`;
5858

59+
const CommandInput = styled.input`
60+
${tw`text-sm transition-colors duration-150 px-2 bg-transparent border-0 border-b-2 border-transparent text-neutral-100 p-2 pl-0 w-full focus:ring-0`}
61+
&:focus {
62+
${tw`border-cyan-700`};
63+
}
64+
`;
65+
5966
export default () => {
6067
const TERMINAL_PRELUDE = '\u001b[1m\u001b[33mcontainer@pterodactyl~ \u001b[0m';
6168
const ref = useRef<HTMLDivElement>(null);
@@ -209,13 +216,15 @@ export default () => {
209216
<TerminalDiv id={'terminal'} ref={ref}/>
210217
</div>
211218
{canSendCommands &&
212-
<div css={tw`rounded-b bg-neutral-900 text-neutral-100 flex`}>
219+
<div css={tw`rounded-b bg-neutral-900 text-neutral-100 flex items-baseline`}>
213220
<div css={tw`flex-shrink-0 p-2 font-bold`}>$</div>
214221
<div css={tw`w-full`}>
215-
<input
222+
<CommandInput
216223
type={'text'}
224+
placeholder={'Type a command...'}
225+
aria-label={'Console command input.'}
226+
aria-description={'Type a command and press enter to send to server.'}
217227
disabled={!instance || !connected}
218-
css={tw`bg-transparent text-neutral-100 p-2 pl-0 w-full`}
219228
onKeyDown={handleCommandKeyDown}
220229
/>
221230
</div>

tailwind.config.js

+73-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
const colors = require('tailwindcss/colors');
2-
31
module.exports = {
42
theme: {
53
fontFamily: {
@@ -10,13 +8,79 @@ module.exports = {
108
colors: {
119
transparent: 'transparent',
1210
black: 'hsl(210, 27%, 10%)',
13-
white: '#fff',
14-
primary: colors.blue,
15-
neutral: colors.coolGray,
16-
cyan: colors.cyan,
17-
green: colors.green,
18-
yellow: colors.amber,
19-
red: colors.red,
11+
white: '#ffffff',
12+
primary: {
13+
50: 'hsl(202, 100%, 95%)', // lightest
14+
100: 'hsl(204, 100%, 86%)', // lighter
15+
200: 'hsl(206, 93%, 73%)',
16+
300: 'hsl(208, 88%, 62%)',
17+
400: 'hsl(210, 83%, 53%)', // light
18+
500: 'hsl(212, 92%, 43%)', // base
19+
600: 'hsl(214, 95%, 36%)', // dark
20+
700: 'hsl(215, 96%, 32%)',
21+
800: 'hsl(216, 98%, 25%)', // darker
22+
900: 'hsl(218, 100%, 17%)', // darkest
23+
},
24+
neutral: {
25+
50: 'hsl(216, 33%, 97%)',
26+
100: 'hsl(214, 15%, 91%)',
27+
200: 'hsl(210, 16%, 82%)',
28+
300: 'hsl(211, 13%, 65%)',
29+
400: 'hsl(211, 10%, 53%)',
30+
500: 'hsl(211, 12%, 43%)',
31+
600: 'hsl(209, 14%, 37%)',
32+
700: 'hsl(209, 18%, 30%)',
33+
800: 'hsl(209, 20%, 25%)',
34+
900: 'hsl(210, 24%, 16%)',
35+
},
36+
red: {
37+
50: 'hsl(360, 100%, 95%)',
38+
100: 'hsl(360, 100%, 87%)',
39+
200: 'hsl(360, 100%, 80%)',
40+
300: 'hsl(360, 91%, 69%)',
41+
400: 'hsl(360, 83%, 62%)',
42+
500: 'hsl(356, 75%, 53%)',
43+
600: 'hsl(354, 85%, 44%)',
44+
700: 'hsl(352, 90%, 35%)',
45+
800: 'hsl(350, 94%, 28%)',
46+
900: 'hsl(348, 94%, 20%)',
47+
},
48+
yellow: {
49+
50: 'hsl(49, 100%, 96%)',
50+
100: 'hsl(48, 100%, 88%)',
51+
200: 'hsl(48, 95%, 76%)',
52+
300: 'hsl(48, 94%, 68%)',
53+
400: 'hsl(44, 92%, 63%)',
54+
500: 'hsl(42, 87%, 55%)',
55+
600: 'hsl(36, 77%, 49%)',
56+
700: 'hsl(29, 80%, 44%)',
57+
800: 'hsl(22, 82%, 39%)',
58+
900: 'hsl(15, 86%, 30%)',
59+
},
60+
cyan: {
61+
50: 'hsl(171, 82%, 94%)',
62+
100: 'hsl(172, 97%, 88%)',
63+
200: 'hsl(174, 96%, 78%)',
64+
300: 'hsl(176, 87%, 67%)',
65+
400: 'hsl(178, 78%, 57%)',
66+
500: 'hsl(180, 77%, 47%)',
67+
600: 'hsl(182, 85%, 39%)',
68+
700: 'hsl(184, 90%, 34%)',
69+
800: 'hsl(186, 91%, 29%)',
70+
900: 'hsl(188, 91%, 23%)',
71+
},
72+
green: {
73+
50: 'hsl(125, 65%, 93%)',
74+
100: 'hsl(127, 65%, 85%)',
75+
200: 'hsl(124, 63%, 74%)',
76+
300: 'hsl(123, 53%, 55%)',
77+
400: 'hsl(123, 57%, 45%)',
78+
500: 'hsl(122, 73%, 35%)',
79+
600: 'hsl(122, 80%, 29%)',
80+
700: 'hsl(125, 79%, 26%)',
81+
800: 'hsl(125, 86%, 20%)',
82+
900: 'hsl(125, 97%, 14%)',
83+
},
2084
},
2185
extend: {
2286
fontSize: {

0 commit comments

Comments
 (0)