Skip to content

Commit 70fe500

Browse files
authored
New colours + status bar (#34)
1 parent 22c126e commit 70fe500

File tree

11 files changed

+96
-90
lines changed

11 files changed

+96
-90
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"scripts": {
99
"lint": "prettier --write .",
1010
"prebuild": "rm -Rf ./build/*",
11-
"tailwind": "tailwindcss -i ./tailwind.css -o ./public/static/css/tailwind.css",
12-
"prestart": "npm run tailwind",
11+
"tw": "tailwindcss -i ./tailwind.css -o ./public/static/css/tailwind.css",
12+
"prestart": "npm run tw",
1313
"start": "webpack serve --mode development",
1414
"build": "webpack --mode production",
1515
"postbuild": "npm run tailwind && cp -R ./public/* ./build"

src/_shared/react/VSCode/NavBar.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919

2020
.csss-nav-app-drawer > *:hover {
21-
background-color: #334155; /* one of the TW slate colours */
21+
background-color: #3f3f46; /* zinc-700 */
2222
cursor: pointer;
2323
}
2424

src/_shared/react/VSCode/NavBar.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
22
import { Link } from 'react-router-dom';
33

44
import * as Flex from '../Flex';
5-
import { Arrow, Cross, CSSS, Folder, File, Film, Hamburger } from '../Icon';
5+
import * as Icon from '../Icon';
66

77
import './NavBar.css'; // csss-nav-app-drawer, csss-nav-mobile-menu
88

@@ -31,8 +31,7 @@ export const NavBar = ({
3131
const navBar = (
3232
<div
3333
className={
34-
'flex w-full h-full flex-row items-stretch overflow-x-hidden bg-slate-900 ' +
35-
(isMobileDevice ? 'border-r border-slate-700 ' : '') +
34+
'flex w-full h-full flex-row items-stretch overflow-x-hidden bg-zinc-950 border-r border-zinc-900 ' +
3635
className
3736
}
3837
style={style}
@@ -43,15 +42,16 @@ export const NavBar = ({
4342
I chose to define the app drawer's styles in this CSS file as
4443
Tailwind is finicky for what I want to do; raw CSS is easier.
4544
*/}
46-
<div className="csss-nav-app-drawer border-slate-700 border-r">
45+
<div className="csss-nav-app-drawer border-zinc-800 border-r">
46+
<Icon.CSSS style={{ '--csss-icon-color': 'white' }} />
4747
{apps}
4848
</div>
4949
{/* navigation drawer */}
5050
<div className="h-full flex flex-col grow gap-px overflow-y-scroll">
5151
<div className="flex flex-row p-3 h-10 w-full align-center justify-between">
52-
<h2 className="text-slate-400">{title}</h2>
52+
<h2 className="text-zinc-400">{title}</h2>
5353
{!isMobileDevice && (
54-
<p className="text-slate-400">&#183;&#183;&#183;</p>
54+
<p className="text-zinc-400">&#183;&#183;&#183;</p>
5555
)}
5656
</div>
5757
{/* folders and items */}
@@ -63,10 +63,10 @@ export const NavBar = ({
6363
if (isMobileDevice) {
6464
return (
6565
<>
66-
<div className="flex flex-row p-3 h-full w-full align-center justify-between bg-slate-800 border-b border-slate-600">
67-
<h2 className="block text-slate-400 leading-10 text-lg">{title}</h2>
66+
<div className="flex flex-row p-3 h-full w-full align-center justify-between bg-zinc-950 border-b border-zinc-900">
67+
<h2 className="block text-zinc-400 leading-10 text-lg">{title}</h2>
6868
<button
69-
className="rounded bg-slate-800 hover:bg-slate-600 font-bold text-lg text-slate-400 w-10 h-10 border border-slate-600"
69+
className="rounded bg-zinc-950 hover:bg-zinc-900 font-bold text-lg text-zinc-400 w-10 h-10 border border-zinc-700"
7070
onClick={toggleMenu}
7171
>
7272
{/* looks like [...] */}
@@ -78,7 +78,9 @@ export const NavBar = ({
7878
csss-nav-mobile-menu in ./NavBar.css. Ditto ^^.
7979
*/}
8080
<div className={'csss-nav-mobile-menu ' + (isOpen ? '' : 'hidden')}>
81-
<div className="navbar">{navBar}</div>
81+
<div className="navbar" onClick={toggleMenu}>
82+
{navBar}
83+
</div>
8284
<div className="exit" onClick={toggleMenu} />
8385
</div>
8486
</>

src/_shared/react/VSCode/NavFolder.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,15 @@ export const NavFolder = ({ text, children }) => {
1111
};
1212

1313
const arrowStyle = {
14-
'--csss-icon-color': '#94a3b8', // slate-400
14+
'--csss-icon-color': '#a1a1aa', // zinc-400
1515
'--csss-icon-stroke-width': '3px'
1616
};
1717

18-
/*
19-
const folderStyle = {
20-
'--csss-icon-color': '#64748b' // slate-500
21-
};
22-
*/
23-
2418
return (
2519
<>
2620
<button
2721
onClick={toggleOpen}
28-
className="block bg-slate-900 hover:bg-slate-800 mx-1 py-1 px-2 text-md text-slate-500 flex items-center gap-2 rounded-sm"
22+
className="block bg-zinc-950 hover:bg-zinc-800 mx-1 py-1 px-2 text-md text-zinc-500 flex items-center gap-2 rounded-sm"
2923
style={{
3024
// width is set using a calc as buttons don't stretch in a flex-box
3125
width: 'calc(100% - 8px)' // 24px = 2 * mx-1
@@ -36,7 +30,6 @@ export const NavFolder = ({ text, children }) => {
3630
) : (
3731
<Arrow style={{ transform: 'rotate(-90deg)', ...arrowStyle }} />
3832
)}
39-
{/*<Folder style={folderStyle} />*/}
4033
{text}
4134
</button>
4235
{isOpen ? children : []}

src/_shared/react/VSCode/NavItem.js

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,40 @@
11
import React from 'react';
22
import { useLocation, Link } from 'react-router-dom';
33

4-
import { File } from '../Icon';
4+
import * as Icon from '../Icon';
55

6-
export const NavItem = ({ text, to, isInFolder }) => {
7-
const fileStyle = {
8-
'--csss-icon-color': '#94a3b8', // slate-400
6+
export const NavItem = ({ text, to, href, isInFolder, icon }) => {
7+
const iconStyle = {
8+
'--csss-icon-color': '#a1a1aa', // zinc-400
99
'--csss-icon-stroke-width': '3px'
1010
};
1111

1212
const location = useLocation();
13+
let _icon = icon;
14+
15+
if (_icon === undefined) {
16+
_icon =
17+
to !== undefined ? (
18+
<Icon.File style={iconStyle} />
19+
) : (
20+
<Icon.Link style={iconStyle} />
21+
);
22+
}
23+
24+
const _href = href !== undefined ? href : `/#${to.substr(1)}`;
1325

1426
return (
1527
<a
1628
className={
17-
'mx-1 py-1 px-2 text-md flex items-center gap-2 rounded-sm ' +
18-
(isInFolder ? 'pl-8 text-white ' : 'text-white ') +
29+
'mx-1 py-1 px-2 text-md flex items-center gap-2 rounded-sm text-white ' +
30+
(isInFolder ? 'pl-8 ' : '') +
1931
(location.pathname === to
20-
? 'bg-slate-800 hover:bg-slate-700'
21-
: 'bg-slate-900 hover:bg-slate-700')
32+
? 'bg-zinc-800 hover:bg-zinc-800'
33+
: 'bg-zinc-950 hover:bg-zinc-800')
2234
}
23-
href={'/#' + to.substr(1)}
35+
href={_href}
2436
>
25-
<File style={fileStyle} />
37+
{_icon}
2638
{text}
2739
</a>
2840
);

src/_shared/react/VSCode/NavLink.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

src/_shared/react/VSCode/Page.js

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import React, { useCallback, useEffect, useState } from 'react';
2+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3+
import { faCodeBranch } from '@fortawesome/free-solid-svg-icons';
24

35
import * as helpers from '../../js';
46
import * as Flex from '../Flex';
@@ -32,13 +34,13 @@ export const Page = (props) => {
3234
? '1fr' // one column
3335
: '320px 1fr' // two columns
3436
}
35-
rows={isMobileDevice ? '64px 1fr' : '1fr'}
37+
rows={isMobileDevice ? '64px 1fr 32px' : '1fr 32px'}
3638
areas={
3739
isMobileDevice
38-
? ['navbar', 'content'] // two rows
39-
: ['navbar content'] // one row
40+
? ['.', '.', 'bottom-bar'] // three rows
41+
: ['. .', 'bottom-bar bottom-bar'] // two rows
4042
}
41-
className="bg-slate-800"
43+
className="bg-zinc-900"
4244
style={{
4345
margin: 'auto',
4446
width: '100vw',
@@ -51,26 +53,42 @@ export const Page = (props) => {
5153
</NavBar>
5254
{isMobileDevice ? (
5355
<Grid.Item
54-
area="content"
5556
className="overflow-y-scroll text-white"
5657
style={{
5758
maxWidth: '768px',
5859
width: '100%',
59-
height: '100vh',
60+
height: '100%',
6061
margin: 'auto'
6162
}}
6263
>
6364
{children}
6465
</Grid.Item>
6566
) : (
6667
<Grid.Item
67-
area="content"
6868
className="overflow-y-scroll text-white"
69-
style={{ height: '100vh' }}
69+
style={{ height: '100%' }}
7070
>
7171
{children}
7272
</Grid.Item>
7373
)}
74+
<div
75+
className="bg-zinc-950 border-t border-zinc-800 flex flex-row"
76+
style={{
77+
'grid-area': 'bottom-bar'
78+
}}
79+
>
80+
<p
81+
className="bg-blue-500 text-white text-sm"
82+
style={{
83+
height: '100%',
84+
padding: '0 8px',
85+
lineHeight: '32px'
86+
}}
87+
>
88+
<FontAwesomeIcon icon={faCodeBranch} />
89+
&nbsp;main
90+
</p>
91+
</div>
7492
</Grid.Container>
7593
);
7694
};

src/_shared/react/VSCode/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export * from './NavBar.js';
22
export * from './NavFolder.js';
33
export * from './NavItem.js';
4-
export * from './NavLink.js';
54
export * from './Page.js';

src/main/components/Footer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { faEnvelope } from '@fortawesome/free-solid-svg-icons';
1010

1111
const Footer = () => {
1212
return (
13-
<footer className="bg-[#0f172a] text-white py-8 mt-8">
13+
<footer className="bg-zinc-950 text-white py-8 mt-8">
1414
<div className="max-w-4xl mx-auto px-4">
1515
<div className="flex flex-col md:flex-row justify-between items-center">
1616
<div className="mb-4 md:mb-0 text-center md:text-left">

src/main/components/Page.js

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import React, { useEffect, useState } from 'react';
2+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
3+
import { faCodeBranch } from '@fortawesome/free-solid-svg-icons';
24

35
import { Icon, Flex, Grid, VSCode } from '../../_shared/react';
46
import * as helpers from '../../_shared/js';
@@ -7,17 +9,16 @@ import * as helpers from '../../_shared/js';
79
export const Page = ({ children }) => {
810
const apps = (
911
<>
10-
<Icon.CSSS style={{ '--csss-icon-color': 'white' }} />
1112
<Icon.Folder
1213
style={{
13-
'--csss-icon-color': '#64748b' // slate-500
14+
'--csss-icon-color': '#a1a1aa' // zinc-400
1415
}}
1516
/>
1617
<a style={{ marginTop: 'auto' }} href="#profile">
1718
<Icon.Profile
1819
style={{
1920
width: '100%',
20-
'--csss-icon-color': '#64748b', // slate-500
21+
'--csss-icon-color': '#a1a1aa', // zinc-400
2122
'--csss-icon-stroke-width': '1px'
2223
}}
2324
/>
@@ -28,35 +29,41 @@ export const Page = ({ children }) => {
2829
const files = (
2930
<>
3031
<VSCode.NavItem text="README.md" to="/" />
31-
<VSCode.NavItem text="login.txt" to="/profile" />
32+
<VSCode.NavFolder text="The CSSS">
33+
<VSCode.NavItem isInFolder={true} text="About.md" to="/about" />
34+
<VSCode.NavItem
35+
isInFolder={true}
36+
text="Common Rooms.md"
37+
to="/common_rooms"
38+
/>
39+
<VSCode.NavItem isInFolder={true} text="Officers.md" to="/officers" />
40+
<VSCode.NavItem isInFolder={true} text="Documents.md" to="/documents" />
41+
</VSCode.NavFolder>
3242
<VSCode.NavFolder text="Events">
33-
<VSCode.NavLink
43+
<VSCode.NavItem isInFolder={true} text="About Events.md" to="/events" />
44+
<VSCode.NavItem
3445
isInFolder={true}
35-
text="mountain_madness.html"
46+
text="Mountain Madness"
3647
href="/mountain_madness"
3748
/>
38-
<VSCode.NavLink
49+
<VSCode.NavItem
3950
isInFolder={true}
40-
text="fall_hacks.html"
51+
text="Fall Hacks"
4152
href="/fall_hacks"
4253
/>
43-
<VSCode.NavLink
54+
<VSCode.NavItem isInFolder={true} text="Tech Fair" href="/tech_fair" />
55+
</VSCode.NavFolder>
56+
<VSCode.NavFolder text="Committees">
57+
<VSCode.NavItem
4458
isInFolder={true}
45-
text="tech_fair.html"
46-
href="/tech_fair"
59+
text="Our Committees.md"
60+
to="/committees"
4761
/>
48-
</VSCode.NavFolder>
49-
<VSCode.NavFolder text="Links">
50-
<VSCode.NavLink
62+
<VSCode.NavItem
5163
isInFolder={true}
5264
text="Discord"
5365
href="https://discord.gg/sfucsss"
5466
/>
55-
<VSCode.NavLink
56-
isInFolder={true}
57-
text="GitHub"
58-
href="https://github.com/CSSS"
59-
/>
6067
</VSCode.NavFolder>
6168
</>
6269
);

0 commit comments

Comments
 (0)