Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mlp backend #138

Merged
merged 147 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
225a318
Add basic eslint config and packages
jakeisnt Jan 31, 2021
a5d41d0
Incorporate eslint autofixes
jakeisnt Jan 31, 2021
8e54194
Reformat core json files
jakeisnt Jan 31, 2021
0a284e4
Add prettier linting
jakeisnt Jan 31, 2021
29ec5c0
Autofix with prettier
jakeisnt Jan 31, 2021
b159168
Add linting rule to package.json
jakeisnt Jan 31, 2021
87463c5
ignore serviceWorker
jakeisnt Jan 31, 2021
658f9e7
Auto lint a-eye
jakeisnt Feb 4, 2021
f27a88e
Fix all linting problems
jakeisnt Feb 4, 2021
f13fb0a
Fix lots of minor errors after conversion
jakeisnt Feb 4, 2021
3c0746b
Add eslint-disable to keep better formatting
jakeisnt Feb 4, 2021
5673a60
Fix kmeans step example lazily
jakeisnt Feb 6, 2021
fe8157d
Fix image selector component
jakeisnt Feb 6, 2021
f05286c
Resolve all eslint warnings
jakeisnt Feb 6, 2021
25a99f3
Merge pull request #100 from sandboxnu/eslint
jakeisnt Feb 7, 2021
cf7f2c9
candidate for smallest ticket of all time or I'm sorely mistaken
dankrasno Feb 12, 2021
04adbfc
Import profiles for jake and stanley developer
stanleykywu Feb 13, 2021
dc18b8b
small renaming issue jpg and png
stanleykywu Feb 14, 2021
026d933
Implement self image upload for image selector in computer vision
stanleykywu Feb 20, 2021
65a1f9f
Merge pull request #126 from sandboxnu/image-selector-upload
maxpinheiro Feb 21, 2021
bc8561d
Added clustering error label in kmeans step example
stanleykywu Feb 21, 2021
e2b0cc2
use absolute path for favicon
jakeisnt Mar 1, 2021
6eff257
add graph protocol metadata
jakeisnt Mar 1, 2021
f188c5e
Add twitter metadata
jakeisnt Mar 1, 2021
8495a0f
fix get cover image style issue
jakeisnt Mar 2, 2021
debe83c
Add 'active' field to modules and main page
jakeisnt Mar 2, 2021
c12ac9a
hide inactive modules from dropdown
jakeisnt Mar 2, 2021
04a5549
don't link module at all if not available
jakeisnt Mar 2, 2021
304c520
finish about section with all members
stanleykywu Mar 3, 2021
87da8e9
Separate k-means error into each cluster
stanleykywu Mar 7, 2021
5b79c92
Merge pull request #133 from sandboxnu/hide-unpublished-modules
jakeisnt Mar 7, 2021
da72e58
Add website description
jakeisnt Mar 7, 2021
91736e6
fix manifest
jakeisnt Mar 7, 2021
e334a43
mlp started, not updating connected component properly
dankrasno Mar 2, 2021
8474a51
add layer neuron
jakeisnt Mar 7, 2021
3eca3b3
fix neuron line positions
jakeisnt Mar 7, 2021
55fb75b
refactor mlp neuron structure
jakeisnt Mar 7, 2021
97b4ccf
allow parameter changes on perceptron
jakeisnt Mar 7, 2021
f67c946
fix resetting weights
jakeisnt Mar 7, 2021
04a4112
Bump react-dev-utils from 11.0.2 to 11.0.4
dependabot[bot] Mar 12, 2021
51e0473
Merge pull request #137 from sandboxnu/kmeans-error
stanleykywu Mar 16, 2021
4fcfd7e
Merge pull request #135 from sandboxnu/about-page-new-members
stanleykywu Mar 16, 2021
a1736f5
unsaved changes
dankrasno Mar 18, 2021
b452866
create neuron with graph module
jakeisnt Mar 19, 2021
4f4b21f
fix bug reversing mlp demo graph
jakeisnt Mar 19, 2021
49d4870
establish neuron abstract format
jakeisnt Mar 19, 2021
78f841a
generate neurons from json config
jakeisnt Mar 20, 2021
0e7b6e2
change neuron with selected point on graph
jakeisnt Mar 20, 2021
dea40dd
add note w problems to fix
jakeisnt Mar 20, 2021
e171ee8
state updating, one infinite loop tho
dankrasno Mar 21, 2021
d0914e9
calculate neuron output at top level
jakeisnt Mar 21, 2021
a6520c3
finish fixing
jakeisnt Mar 22, 2021
4c24054
fix bug not factoring in number of neuron inputs
jakeisnt Mar 22, 2021
15894d4
fixed bug using same input for both
jakeisnt Mar 22, 2021
2813111
fix calc bug
jakeisnt Mar 22, 2021
cc20b59
small ergonomic improvements & functional style
jakeisnt Mar 22, 2021
af45da2
fix naming of greaterThan
jakeisnt Mar 23, 2021
02dc121
fix flipped neuron bug
jakeisnt Mar 23, 2021
9363cbd
allow for adding points with correct colors
jakeisnt Mar 23, 2021
e32bc08
change point colors with neuron
jakeisnt Mar 23, 2021
dabe3cf
add todo
jakeisnt Mar 23, 2021
ea7b6b7
fixed rerendering, new points not updating
jakeisnt Mar 27, 2021
a0806dc
adding points in correct color
dankrasno Mar 28, 2021
9e0b70c
greaterThan
dankrasno Mar 28, 2021
212100c
basic gradient grapg
jakeisnt Apr 4, 2021
05c44cb
points displaying at ok scale
jakeisnt Apr 4, 2021
4fa930d
fix nice labels on graph
jakeisnt Apr 4, 2021
868c7c7
almost got clicking working properly
jakeisnt Apr 4, 2021
e906911
handle some basic code cleanup
jakeisnt Apr 4, 2021
5cb3726
grid lines and axes:
dankrasno Apr 4, 2021
7493981
point position
dankrasno Apr 4, 2021
187ac35
small stff
dankrasno Apr 4, 2021
dc9927d
change RblattInput type
jakeisnt Apr 4, 2021
60f723a
orientations and stuff
dankrasno Apr 4, 2021
bd495f3
forgot changeS
dankrasno Apr 7, 2021
4e90ef8
added line calculation
jakeisnt Apr 7, 2021
0d648b7
actually added line calculation
jakeisnt Apr 7, 2021
f99d85d
we are god programmers
dankrasno Apr 9, 2021
d3376ca
Clean up lots of ugly code
jakeisnt Apr 14, 2021
b34ca15
reformatted mp neuron
jakeisnt Apr 15, 2021
4df4b7e
punched in bias
jakeisnt Apr 15, 2021
717aad8
fix padding on the neuron!!
jakeisnt Apr 15, 2021
9e35c55
remove the layer neuron!
jakeisnt Apr 15, 2021
ce1cf7b
all neurons now use the same config
jakeisnt Apr 15, 2021
1c0421f
simplified rblatt neuron!
jakeisnt Apr 15, 2021
d4e8968
remove unused code!
jakeisnt Apr 15, 2021
a75d4f3
fix some minor display bugs
jakeisnt Apr 15, 2021
d3ec5ab
share more code between components
jakeisnt Apr 15, 2021
cad093c
fix direction changing bug
jakeisnt Apr 15, 2021
43e7ca9
finish coloring and fix deps
jakeisnt Apr 15, 2021
241985f
fix bug adding invalid point colors
jakeisnt Apr 15, 2021
5b70f2e
add comment reminder to update visx on next release
jakeisnt Apr 15, 2021
90ea10c
replace polygon with visx Polygon
jakeisnt Apr 15, 2021
044609c
change background color of blue points
jakeisnt Apr 18, 2021
dbc060c
Bump ssri from 6.0.1 to 6.0.2
dependabot[bot] Apr 20, 2021
e9a3437
Bump hosted-git-info from 2.8.8 to 2.8.9
dependabot[bot] May 11, 2021
9f8415c
Bump chart.js from 2.9.3 to 2.9.4
dependabot[bot] May 12, 2021
aa0a84c
Bump postcss from 8.1.13 to 8.2.10
dependabot[bot] May 12, 2021
bc2f16d
Bump dns-packet from 1.3.1 to 1.3.4
dependabot[bot] May 28, 2021
7029d1b
Bump path-parse from 1.0.6 to 1.0.7
dependabot[bot] Aug 12, 2021
ecd69ee
remove numbers from module titles
maxpinheiro Sep 14, 2021
7af75d5
Merge pull request #148 from sandboxnu/remove-module-numbers
maxpinheiro Sep 15, 2021
41f49fb
Bump tmpl from 1.0.4 to 1.0.5
dependabot[bot] Sep 22, 2021
2cee278
temporary titles for mlp sections
maxpinheiro Oct 3, 2021
11d6a84
Merge branch 'mlp-backend' into visx-graph
maxpinheiro Oct 3, 2021
43233b5
Merge pull request #140 from sandboxnu/visx-graph
maxpinheiro Oct 3, 2021
a92e7e3
Updated member pictures to include last names. Added new members. Sep…
Jake-Duffy855 Oct 3, 2021
377f2d6
"updated current members"
Jake-Duffy855 Oct 3, 2021
74c19c6
removed team description tag
Jake-Duffy855 Oct 3, 2021
9239395
Merge pull request #152 from sandboxnu/new-members-about
jciolfi Oct 3, 2021
24301d4
fix modules dropdown on about page
connorlbark Oct 5, 2021
336aeac
Merge pull request #155 from sandboxnu/fix-about-modules
connorlbark Oct 5, 2021
be93d38
Fix mobile navbar
connorlbark Oct 5, 2021
eaca375
Merge pull request #158 from sandboxnu/fix-mobile-navbar
Jake-Duffy855 Oct 5, 2021
70aa129
Bump url-parse from 1.4.7 to 1.5.3
dependabot[bot] Oct 6, 2021
344c91b
Merge pull request #139 from sandboxnu/dependabot/npm_and_yarn/react-…
maxpinheiro Oct 7, 2021
0218161
Merge pull request #141 from sandboxnu/dependabot/npm_and_yarn/ssri-6…
maxpinheiro Oct 7, 2021
caab127
Merge pull request #143 from sandboxnu/dependabot/npm_and_yarn/hosted…
maxpinheiro Oct 7, 2021
3de5af2
Merge pull request #144 from sandboxnu/dependabot/npm_and_yarn/chart.…
maxpinheiro Oct 7, 2021
17a3da3
Merge pull request #145 from sandboxnu/dependabot/npm_and_yarn/postcs…
maxpinheiro Oct 7, 2021
f1497cc
Merge pull request #146 from sandboxnu/dependabot/npm_and_yarn/dns-pa…
maxpinheiro Oct 7, 2021
ac8e5a3
Merge pull request #147 from sandboxnu/dependabot/npm_and_yarn/path-p…
maxpinheiro Oct 7, 2021
9d5da14
Merge pull request #149 from sandboxnu/dependabot/npm_and_yarn/tmpl-1…
maxpinheiro Oct 7, 2021
5496029
Merge pull request #159 from sandboxnu/dependabot/npm_and_yarn/url-pa…
maxpinheiro Oct 7, 2021
b184269
Merge pull request #131 from sandboxnu/fix-favicon
maxpinheiro Oct 7, 2021
7923b8d
clarify text pt.1
connorlbark Oct 12, 2021
470f5c6
clarify text pt.2
connorlbark Oct 13, 2021
cb9053f
clarify text pt.3
connorlbark Oct 17, 2021
29f8b94
clarify text pt.4
connorlbark Oct 18, 2021
c79cabe
Merge pull request #164 from sandboxnu/clarify-texts
connorlbark Oct 24, 2021
b96a861
begin separating modules
maxpinheiro Oct 28, 2021
54ea909
added sobel filter demo
Jake-Duffy855 Oct 28, 2021
a76d6ba
Merge branch 'sobel-filter' of https://github.com/sandboxnu/a-eye int…
Jake-Duffy855 Oct 28, 2021
c71bd1e
fixed sobel filter demo issues
Jake-Duffy855 Oct 28, 2021
eda3ec5
added jimp
Jake-Duffy855 Oct 28, 2021
73bc898
Merge pull request #165 from sandboxnu/sobel-filter
Jake-Duffy855 Oct 28, 2021
9a6f120
Merge branch 'master' into separate-cv-modules to include sobel filter
maxpinheiro Oct 29, 2021
9afad1d
separate cv module routes, sobel filter page
maxpinheiro Oct 31, 2021
1749f95
responsive width image selector
maxpinheiro Oct 31, 2021
400d82f
revise sobel filter text
maxpinheiro Nov 2, 2021
b29caae
cleanup module descriptions, images for modules, bold capability in json
maxpinheiro Nov 2, 2021
2b08d97
clean style on gabor filter page
maxpinheiro Nov 2, 2021
956df48
merge lots of master commits to make mlp components compatible
maxpinheiro Nov 3, 2021
1ae35ed
Merge pull request #166 from sandboxnu/separate-cv-modules
maxpinheiro Nov 3, 2021
8801ba6
merge master
maxpinheiro Nov 3, 2021
e9cb0d1
remove mlp demos from page
maxpinheiro Nov 3, 2021
bf01d25
resolve prettier & typescript errors
maxpinheiro Nov 3, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SKIP_PREFLIGHT_CHECK=true
32 changes: 32 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
extends: ['airbnb-typescript', 'eslint-config-prettier'],
parserOptions: {
project: './tsconfig.eslint.json',
},
plugins: ['prettier'],
rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
printWidth: 80,
arrowParens: 'avoid',
trailingComma: 'all',
endOfLine: 'auto',
},
],
// incompatible with prettier
'react/jsx-curly-newline': 'off',
'react/jsx-indent': 'off',
'react/jsx-wrap-multilines': 'off',
'react/jsx-closing-tag-location': 'off',
'react/no-array-index-key': 'warn',
'@typescript-eslint/indent': 'off',

// we're using typescript, so we have prop types
'react/prop-types': 'off',

// personal preference
'react/jsx-props-no-spreading': 'off',
},
};
44 changes: 35 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,55 @@
"dependencies": {
"@material-ui/core": "4.11.0",
"@material-ui/icons": "4.9.1",
"@material-ui/styles": "4.11.3",
"@testing-library/jest-dom": "4.2.4",
"@testing-library/react": "9.3.2",
"@testing-library/user-event": "7.1.2",
"@types/jest": "26.0.13",
"@types/node": "14.14.10",
"@types/react": "16.9.49",
"@types/react-dom": "16.9.8",
"@visx/axis": "^1.7.0",
"@visx/event": "1.7.0",
"@visx/gradient": "1.7.0",
"@visx/grid": "^1.7.0",
"@visx/group": "1.7.0",
"@visx/mock-data": "1.7.0",
"@visx/scale": "1.7.0",
"@visx/shape": "1.8.0",
"@visx/voronoi": "1.7.0",
"autoprefixer": "10.0.2",
"chart.js": "2.9.3",
"chart.js": "2.9.4",
"chartjs-plugin-dragdata": "1.1.3",
"csstype": "3.0.6",
"distance-to-line-segment": "0.2.0",
"filter": "0.1.1",
"flowpoints": "1.0.18",
"gaussian-convolution-kernel": "1.0.0",
"jsxgraph": "1.2.1",
"hog-features": "1.0.0",
"image-js": "0.31.4",
"jimp": "0.16.1",
"mathjs": "^9.3.0",
"ml-dataset-iris": "1.1.1",
"ml-distance-euclidean": "2.0.0",
"ml-kmeans": "5.0.0",
"ml-pca": "4.0.1",
"node-forge": "0.10.0",
"pixelmatch": "5.2.1",
"postcss": "8.0.4",
"postcss": "8.1.3",
"postcss-cli": "7.1.2",
"python-bridge": "1.1.0",
"randomcolor": "0.6.2",
"react": "16.13.1",
"react-chartjs-2": "2.10.0",
"react-dom": "16.13.1",
"react-router": "5.2.0",
"react-router-dom": "5.2.0",
"serialize-javascript": "4.0.0",
"tailwind": "4.0.0",
"tailwindcss": "1.9.6",
"tailwindcss-blend-mode": "1.0.0",
"typeface-open-sans": "0.0.75",
"typeface-roboto": "0.0.75",
"typeface-roboto-mono": "0.0.75",
Expand All @@ -48,30 +67,37 @@
"@testing-library/react": "9.3.2",
"@testing-library/user-event": "7.1.2",
"@types/jest": "26.0.13",
"@types/node": "14.6.4",
"@types/node": "14.14.10",
"@types/randomcolor": "0.5.5",
"@types/react": "16.9.49",
"@types/react-dom": "16.9.8",
"@types/react-router-dom": "5.1.7",
"@visx/tooltip": "^1.7.2",
"@typescript-eslint/eslint-plugin": "4.14.1",
"@typescript-eslint/parser": "4.14.1",
"eslint": "7.19.0",
"eslint-config-airbnb-typescript": "12.0.0",
"eslint-config-prettier": "7.2.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsx-a11y": "6.4.1",
"eslint-plugin-prettier": "3.3.1",
"eslint-plugin-react": "7.22.0",
"eslint-plugin-react-hooks": "4.2.0",
"postcss": "8.1.13",
"postcss-cli": "7.1.2",
"prettier": "2.2.1",
"react-scripts": "4.0.1",
"tailwind": "4.0.0",
"tailwindcss": "1.9.6",
"tailwindcss-blend-mode": "1.0.0",
"typescript": "4.0.2"
},
"scripts": {
"start": "npm run watch:css && react-scripts start",
"build": "npm run build:css && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"lint": "eslint . --fix",
"build:css": "postcss src/assets/tailwind.css -o src/assets/main.css",
"watch:css": "postcss src/assets/tailwind.css -o src/assets/main.css"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
Expand Down
5 changes: 2 additions & 3 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const tailwindcss = require('tailwindcss');

module.exports = {
plugins: [
tailwindcss('./tailwind.config.js')
]
plugins: [tailwindcss('./tailwind.config.js')],
};
44 changes: 14 additions & 30 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,44 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en-us">
<head>
<meta charset="utf-8" />
<!--<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />-->
<link rel="icon" href="./favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<meta name="description" content="A student-developed project to teach students about artificial intelligence techniques using interactive demos"/>
<meta name="keywords" content="a-eye, artificial intelligence, sandbox, northeastern"/>
<meta name="author" content="SandboxNU"/>
<meta property="og:title" content="Your Eye and A-Eye" />
<meta property="og:type" content="website" />
<meta property="og:url" content="https://a-eye.sandboxnu.com" />
<meta property="og:image" content="%PUBLIC_URL%/logo192.png"/>
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<meta name="twitter:card" content="summary"/>
<meta name="twitter:description" content="A student-developed project to teach students about artificial intelligence techniques using interactive demos"/>
<meta name="twitter:title" content="Your Eye and AI"/>
<meta name="twitter:site" content="https://a-eye.sandboxnu.com"/>
<meta name="twitter:image" content="%PUBLIC_URL%/logo192.png"/>
<title>Your Eye and AI</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
6 changes: 4 additions & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "A-Eye",
"name": "Your Eye and A-Eye",
"version": "0.0.1",
"manifest_version": 2,
"icons": [
{
"src": "favicon.ico",
Expand Down
1 change: 1 addition & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
import React from 'react';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import { createMuiTheme } from '@material-ui/core/styles';
Expand Down
51 changes: 51 additions & 0 deletions src/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* eslint-disable */
import React from 'react';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import { createMuiTheme } from '@material-ui/core/styles';
import { ThemeProvider } from '@material-ui/styles';
import Navbar from './Navbar';
import Footer from './footer';

import './index.css';
import AboutPage from './aboutPage/AboutPage';
import LandingPage from './landingPage/LandingPage';
import ModulePage from './modulePage/ModulePage';

// change colors as needed
const THEME = createMuiTheme({
palette: {
primary: {
main: '#394D73', // same as footer color
},
secondary: {
main: '#0FD4C0', // logo teal
},
},
});

function App() {
return (
<BrowserRouter>
<div className="App" id="app">
<ThemeProvider theme={THEME}>
<div className="App-header">
<Navbar />
</div>
<main className="font-mono text-lg font-charcoal">
<Switch>
<Route exact path="/" component={LandingPage} />
<Route path="/home" component={LandingPage} />
<Route path="/modules/:module" component={ModulePage} />
<Route path="/about" component={AboutPage} />
</Switch>
</main>
<div>
<Footer />
</div>
</ThemeProvider>
</div>
</BrowserRouter>
);
}

export default App;
3 changes: 2 additions & 1 deletion src/ModuleDropdown.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
import React from 'react';
import descriptions from './media/modules/module_descriptions.json';

Expand All @@ -20,7 +21,7 @@ export default class ModuleDropdown extends React.Component {
<br/>
{
descriptions.modules.map((module) =>
<div className="py-1 mx-2 text-left">
<div className="py-1 mx-2 text-left" key={module.dropdownTitle}>
<a className="text-xs uppercase font-opensans font-bold text-white hover:text-moduleTeal" href={`/modules/${module.path}`} key={module.number.toString()}>
{module.dropdownTitle}
</a>
Expand Down
48 changes: 48 additions & 0 deletions src/ModuleDropdown.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* eslint-disable */
import React, { useState } from 'react';
import descriptions from './media/modules/module_descriptions.json';

export default function ModuleDropdown() {
const [buttonHover, setButtonHover] = useState(false);
const [dropdownHover, setDropdownHover] = useState(false);

return (
<div className="">
<button
type="button"
onMouseOver={() => setButtonHover(true)}
onFocus={() => setButtonHover(true)}
onMouseOut={() => setButtonHover(false)}
onBlur={() => setButtonHover(false)}
>
<p className="text-xs text-white uppercase font-opensans font-bold">
Modules
</p>
</button>
<div
className={`absolute ${
!(buttonHover || dropdownHover) && 'hidden'
} -mt-1 -ml-10 justify-start rounded-b divide-y divide-moduleDarkBlue bg-navbar`}
onMouseOver={() => setDropdownHover(true)}
onFocus={() => setDropdownHover(true)}
onMouseOut={() => setDropdownHover(false)}
onBlur={() => setDropdownHover(false)}
>
<br />
{descriptions.modules
.filter(({ active }) => active)
.map(module => (
<div className="py-1 mx-2 text-left">
<a
className="text-xs uppercase font-opensans font-bold text-white hover:text-moduleTeal"
href={`/modules/${module.path}`}
key={module.number.toString()}
>
{module.dropdownTitle}
</a>
</div>
))}
</div>
</div>
);
}
29 changes: 0 additions & 29 deletions src/Navbar.js

This file was deleted.

Loading