Skip to content

Commit

Permalink
more modal and timeline | #1
Browse files Browse the repository at this point in the history
  • Loading branch information
keanecodes committed Apr 14, 2021
1 parent 2cb2c46 commit 36f38d9
Show file tree
Hide file tree
Showing 24 changed files with 529 additions and 214 deletions.
39 changes: 15 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
{
"name": "fyp",
"name": "fyp-1",
"version": "0.1.0",
"private": false,
"homepage": "http://keanecodes.github.io/fyp",
"private": true,
"dependencies": {
"@loaders.gl/core": "^2.3.8",
"@material-ui/core": "^4.11.2",
"@testing-library/jest-dom": "^5.11.6",
"@testing-library/react": "^11.2.2",
"@testing-library/user-event": "^12.6.0",
"@loaders.gl/core": "^2.3.13",
"@material-ui/core": "^4.11.3",
"axios": "^0.21.1",
"d3-request": "^1.0.6",
"d3-scale": "^3.2.3",
"deck.gl": "^8.3.14",
"h3-js": "^3.7.0",
"d3-scale": "^3.2.4",
"deck.gl": "^8.4.13",
"h3-js": "^3.7.1",
"immutable": "^4.0.0-rc.12",
"mapbox-gl": "^2.0.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-icons": "^4.1.0",
"react-map-gl": "^6.1.10",
"mapbox-gl": "^2.2.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-icons": "^4.2.0",
"react-map-gl": "^6.1.12",
"react-responsive": "^8.2.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.1",
"web-vitals": "^0.2.4"
"react-scripts": "4.0.3",
"recoil": "^0.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
Expand All @@ -51,8 +45,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"gh-pages": "^3.1.0"
}
}
66 changes: 66 additions & 0 deletions src/components/CheckBox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
import React from 'react';
import clsx from 'clsx';
import { makeStyles } from '@material-ui/core/styles';
import Checkbox from '@material-ui/core/Checkbox';

// Inspired by blueprintjs
export default function CheckBox(props) {
const classes = useStyles();

return (
<Checkbox
className={classes.root}
disableRipple
color="default"
checkedIcon={<span className={clsx(classes.icon, classes.checkedIcon)} />}
icon={<span className={classes.icon} />}
inputProps={{ 'aria-label': 'decorative checkbox' }}
{...props}
/>
);
}


const useStyles = makeStyles({
root: {
'&:hover': {
backgroundColor: 'transparent',
},
},
icon: {
borderRadius: 3,
width: 16,
height: 16,
boxShadow: 'inset 0 0 0 1px rgba(16,22,26,.2), inset 0 -1px 0 rgba(16,22,26,.1)',
backgroundColor: '#f5f8fa',
backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.8),hsla(0,0%,100%,0))',
'$root.Mui-focusVisible &': {
outline: '2px auto rgba(19,124,189,.6)',
outlineOffset: 2,
},
'input:hover ~ &': {
backgroundColor: '#ebf1f5',
},
'input:disabled ~ &': {
boxShadow: 'none',
background: 'rgba(206,217,224,.5)',
},
},
checkedIcon: {
backgroundColor: '#137cbd',
backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))',
'&:before': {
display: 'block',
width: 16,
height: 16,
backgroundImage:
"url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath" +
" fill-rule='evenodd' clip-rule='evenodd' d='M12 5c-.28 0-.53.11-.71.29L7 9.59l-2.29-2.3a1.003 " +
"1.003 0 00-1.42 1.42l3 3c.18.18.43.29.71.29s.53-.11.71-.29l5-5A1.003 1.003 0 0012 5z' fill='%23fff'/%3E%3C/svg%3E\")",
content: '""',
},
'input:hover ~ &': {
backgroundColor: '#106ba3',
},
},
});
61 changes: 61 additions & 0 deletions src/components/Radio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import React from 'react';
import clsx from 'clsx';
import { makeStyles } from '@material-ui/core/styles';
import Radio from '@material-ui/core/Radio';

const useStyles = makeStyles({
root: {
'&:hover': {
backgroundColor: 'transparent',
},
},
icon: {
borderRadius: '50%',
width: 16,
height: 16,
boxShadow: 'inset 0 0 0 1px rgba(16,22,26,.2), inset 0 -1px 0 rgba(16,22,26,.1)',
backgroundColor: '#f5f8fa',
backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.8),hsla(0,0%,100%,0))',
'$root.Mui-focusVisible &': {
outline: '2px auto rgba(19,124,189,.6)',
outlineOffset: 2,
},
'input:hover ~ &': {
backgroundColor: '#ebf1f5',
},
'input:disabled ~ &': {
boxShadow: 'none',
background: 'rgba(206,217,224,.5)',
},
},
checkedIcon: {
backgroundColor: '#137cbd',
backgroundImage: 'linear-gradient(180deg,hsla(0,0%,100%,.1),hsla(0,0%,100%,0))',
'&:before': {
display: 'block',
width: 16,
height: 16,
backgroundImage: 'radial-gradient(#fff,#fff 28%,transparent 32%)',
content: '""',
},
'input:hover ~ &': {
backgroundColor: '#106ba3',
},
},
});

// Inspired by blueprintjs
export default function RadioButton(props) {
const classes = useStyles();

return (
<Radio
className={classes.root}
disableRipple
color="default"
checkedIcon={<span className={clsx(classes.icon, classes.checkedIcon)} />}
icon={<span className={classes.icon} />}
{...props}
/>
);
}
59 changes: 59 additions & 0 deletions src/components/Slider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { withStyles } from '@material-ui/core/styles';
import Slider from '@material-ui/core/Slider';

const iOSBoxShadow =
'0 3px 1px rgba(0,0,0,0.1),0 4px 8px rgba(0,0,0,0.13),0 0 0 1px rgba(0,0,0,0.02)';

const IOSSlider = withStyles({
root: {
color: '#3880ff',
height: 2,
padding: '15px 0',
marginLeft: 12,
width: '95%',
},
thumb: {
height: 28,
width: 28,
backgroundColor: '#fff',
boxShadow: iOSBoxShadow,
marginTop: -14,
marginLeft: -14,
'&:focus, &:hover, &$active': {
boxShadow: '0 3px 1px rgba(0,0,0,0.1),0 4px 8px rgba(0,0,0,0.3),0 0 0 1px rgba(0,0,0,0.02)',
// Reset on touch devices, it doesn't add specificity
'@media (hover: none)': {
boxShadow: iOSBoxShadow,
},
},
},
active: {},
valueLabel: {
left: 'calc(-50% + 12px)',
top: -15,
'& *': {
background: 'transparent',
color: '#000',
},
},
track: {
height: 1,
},
rail: {
height: 2,
opacity: 0.5,
backgroundColor: '#bfbfbf',
},
mark: {
backgroundColor: '#bfbfbf',
height: 20,
width: 2,
marginTop: -10,
},
markActive: {
opacity: 1,
backgroundColor: 'currentColor',
},
})(Slider);

export default IOSSlider;
39 changes: 39 additions & 0 deletions src/components/Switch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { withStyles } from '@material-ui/core/styles';
import Switch from '@material-ui/core/Switch';

const AntSwitch = withStyles((theme) => ({
root: {
width: 52,
height: 28,
padding: 0,
display: 'flex',
},
switchBase: {
padding: 2,
color: theme.palette.grey[500],
'&$checked': {
transform: 'translateX(22px)',
color: theme.palette.common.white,
'& + $track': {
opacity: 1,
backgroundColor: "#05BDD9",
borderColor: "#05BDD9",
},
},
},
thumb: {
width: 22,
height: 22,
margin: 2,
boxShadow: 'none',
},
track: {
border: `1px solid ${theme.palette.grey[500]}`,
borderRadius: 28 / 2,
opacity: 1,
backgroundColor: theme.palette.common.white,
},
checked: {},
}))(Switch);

export default AntSwitch;
42 changes: 0 additions & 42 deletions src/components/controls/desktop/FilterPopup.js

This file was deleted.

Loading

0 comments on commit 36f38d9

Please sign in to comment.