Re-organized website
This commit is contained in:
parent
113f57d1dd
commit
59d9128afe
11 changed files with 151 additions and 86 deletions
|
|
@ -40,6 +40,7 @@ module.exports = {
|
||||||
'no-bitwise': 'off',
|
'no-bitwise': 'off',
|
||||||
'react/no-array-index-key': 'off',
|
'react/no-array-index-key': 'off',
|
||||||
'nonblock-statement-body-position': 'off',
|
'nonblock-statement-body-position': 'off',
|
||||||
'react/button-has-type': 'off'
|
'react/button-has-type': 'off',
|
||||||
|
'no-unused-vars': 'warn',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -26,12 +26,6 @@ body {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: var(--main);
|
background: var(--main);
|
||||||
background: linear-gradient(
|
|
||||||
165deg,
|
|
||||||
rgba(87, 35, 117, 1) 0%,
|
|
||||||
rgba(148, 62, 197, 1) 40%,
|
|
||||||
rgba(169, 100, 208, 1) 100%
|
|
||||||
);
|
|
||||||
z-index: -1;
|
z-index: -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,7 +52,7 @@ b {
|
||||||
|
|
||||||
.tableWrap {
|
.tableWrap {
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
border-radius: 6px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
table {
|
table {
|
||||||
|
|
@ -118,7 +112,7 @@ input[type="checkbox"] {
|
||||||
display: block;
|
display: block;
|
||||||
background-color: var(--main);
|
background-color: var(--main);
|
||||||
color: #fff;
|
color: #fff;
|
||||||
border-radius: 6px;
|
border-radius: 4px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
@ -136,7 +130,7 @@ input[type="checkbox"] {
|
||||||
|
|
||||||
.boxWrap {
|
.boxWrap {
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
border-radius: 6px;
|
border-radius: 4px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
.contentBlock {
|
.contentBlock {
|
||||||
color: var(--text);
|
color: var(--text);
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 6px;
|
border-radius: 4px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
|
box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 12px;
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ const Blocks = () => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{initialData && delayedData && frameData && workerData ? (
|
|
||||||
<DataContext.Provider
|
<DataContext.Provider
|
||||||
value={{
|
value={{
|
||||||
initialData,
|
initialData,
|
||||||
|
|
@ -64,12 +63,12 @@ const Blocks = () => {
|
||||||
<DataBlock title="navigator.userAgent" type="userAgent" />
|
<DataBlock title="navigator.userAgent" type="userAgent" />
|
||||||
</div>
|
</div>
|
||||||
<div className="centerBlockInner">
|
<div className="centerBlockInner">
|
||||||
<DataBlock title="new Date().toString()" type="dateString" />
|
|
||||||
<DataBlock title="new Date().toLocaleString()" type="dateLocale" />
|
|
||||||
<DataBlock
|
<DataBlock
|
||||||
title="new Date().getTimezoneOffset()"
|
title="new Date().getTimezoneOffset()"
|
||||||
type="timezoneOffset"
|
type="timezoneOffset"
|
||||||
/>
|
/>
|
||||||
|
<DataBlock title="new Date().toLocaleString()" type="dateLocale" />
|
||||||
|
<DataBlock title="new Date().toString()" type="dateString" />
|
||||||
<GeolocationBlock />
|
<GeolocationBlock />
|
||||||
</div>
|
</div>
|
||||||
<div className="centerBlockMobile">
|
<div className="centerBlockMobile">
|
||||||
|
|
@ -91,11 +90,6 @@ const Blocks = () => {
|
||||||
<GeolocationBlock />
|
<GeolocationBlock />
|
||||||
</div>
|
</div>
|
||||||
</DataContext.Provider>
|
</DataContext.Provider>
|
||||||
) : (
|
|
||||||
<div className="contentBlock loadBlock">
|
|
||||||
<center>Loading...</center>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,18 @@ import Block from './Block';
|
||||||
import TableRow from './TableRow';
|
import TableRow from './TableRow';
|
||||||
|
|
||||||
const DataBlock = ({ title, type }) => {
|
const DataBlock = ({ title, type }) => {
|
||||||
const { initialData, delayedData, frameData, workerData } = useContext(DataContext);
|
const { initialData, delayedData, frameData, workerData } =
|
||||||
|
useContext(DataContext);
|
||||||
|
|
||||||
|
// const test = !workerData || !window.Worker.length;
|
||||||
|
|
||||||
|
const isWorkerValid = workerData && window.Worker.length;
|
||||||
|
|
||||||
|
// if(workerData && window.Worker.length) {
|
||||||
|
// isWorkerValid = true
|
||||||
|
// }
|
||||||
|
|
||||||
|
// console.log(isWorkerValid);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Block>
|
<Block>
|
||||||
|
|
@ -12,17 +23,33 @@ const DataBlock = ({ title, type }) => {
|
||||||
<div className="tableWrap">
|
<div className="tableWrap">
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
<TableRow title="Initial" value={initialData[type].value} issues={initialData[type].issues} />
|
<TableRow
|
||||||
<TableRow title="Delayed" value={delayedData[type].value} issues={delayedData[type].issues} />
|
title="Initial"
|
||||||
<TableRow title="Frame" value={frameData[type].value} issues={frameData[type].issues} />
|
value={initialData ? initialData[type].value : ''}
|
||||||
<TableRow title="Web worker" value={window.Worker.length ? workerData[type].value : null} issues={window.Worker.length ? workerData[type].issues : ['Web workers blocked']} />
|
issues={initialData ? initialData[type].issues : []}
|
||||||
|
/>
|
||||||
|
<TableRow
|
||||||
|
title="Delayed"
|
||||||
|
value={delayedData ? delayedData[type].value : ''}
|
||||||
|
issues={delayedData ? delayedData[type].issues : []}
|
||||||
|
/>
|
||||||
|
<TableRow
|
||||||
|
title="Frame"
|
||||||
|
value={frameData ? frameData[type].value : ''}
|
||||||
|
issues={frameData ? frameData[type].issues : []}
|
||||||
|
/>
|
||||||
|
<TableRow
|
||||||
|
title="Web worker"
|
||||||
|
value={isWorkerValid ? workerData[type].value : ''}
|
||||||
|
issues={
|
||||||
|
isWorkerValid
|
||||||
|
? workerData[type].issues
|
||||||
|
: ['Web workers blocked']
|
||||||
|
}
|
||||||
|
/>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<p>
|
|
||||||
Date and language data can be used to identify your
|
|
||||||
location. Changing the settings on your computer can prevent this.
|
|
||||||
</p>
|
|
||||||
</Block>
|
</Block>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -17,9 +17,6 @@ const GeolocationBlock = () => {
|
||||||
</div>
|
</div>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<p style={{ marginBottom: '10px' }}>
|
|
||||||
This data is not included in location prediction
|
|
||||||
</p>
|
|
||||||
<div className="tableWrap">
|
<div className="tableWrap">
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
@ -48,11 +45,6 @@ const GeolocationBlock = () => {
|
||||||
value={buttonValue}
|
value={buttonValue}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<p>
|
|
||||||
HTML Geolocation API is used to get the geographical position of a user.
|
|
||||||
Since this can compromise privacy, its not available unless the user
|
|
||||||
approves it.
|
|
||||||
</p>
|
|
||||||
</Block>
|
</Block>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import './Logo.css';
|
// import './HeaderBar.css';
|
||||||
import { ReactComponent as LogoImg } from '../images/logo.svg';
|
import { ReactComponent as LogoImg } from '../images/logo.svg';
|
||||||
|
import chromeImage from '../images/chrome.png';
|
||||||
|
import githubImage from '../images/github.png';
|
||||||
|
|
||||||
const HeaderBar = () => (
|
const HeaderBar = () => (
|
||||||
<div
|
<div
|
||||||
|
|
@ -8,19 +10,74 @@ const HeaderBar = () => (
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
justifyContent: 'space-between',
|
justifyContent: 'space-between',
|
||||||
width: '1024px',
|
width: '1024px',
|
||||||
|
margin: '18px 0',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
href="."
|
href="."
|
||||||
style={{
|
style={{
|
||||||
width: '180px',
|
width: '206px',
|
||||||
margin: '18px 0',
|
|
||||||
}}
|
}}
|
||||||
alt="LocateJS logo"
|
alt="LocateJS logo"
|
||||||
>
|
>
|
||||||
<LogoImg />
|
<LogoImg />
|
||||||
</a>
|
</a>
|
||||||
<div>Download</div>
|
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
height: '50px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
backgroundColor: '#fff',
|
||||||
|
height: '50px',
|
||||||
|
borderRadius: '4px',
|
||||||
|
padding: '0 18px',
|
||||||
|
boxShadow: 'rgb(0 0 0 / 10%) 0px 4px 12px',
|
||||||
|
margin: '0 24px 0 0',
|
||||||
|
fontSize: '15px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={chromeImage}
|
||||||
|
alt="Chrome logo"
|
||||||
|
height="28"
|
||||||
|
width="28"
|
||||||
|
style={{
|
||||||
|
marginRight: '8px',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
Download Extension
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
display: 'flex',
|
||||||
|
alignItems: 'center',
|
||||||
|
backgroundColor: '#fff',
|
||||||
|
height: '50px',
|
||||||
|
borderRadius: '4px',
|
||||||
|
padding: '0 18px',
|
||||||
|
boxShadow: 'rgb(0 0 0 / 10%) 0px 4px 12px',
|
||||||
|
fontSize: '15px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src={githubImage}
|
||||||
|
alt="Github logo"
|
||||||
|
height="28"
|
||||||
|
width="28"
|
||||||
|
style={{
|
||||||
|
marginRight: '8px',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
Source Code
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
.mapImg {
|
.mapImg {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-radius: 6px;
|
border-radius: 4px;
|
||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ const modalStyles = {
|
||||||
transform: 'translate(-50%, -50%)',
|
transform: 'translate(-50%, -50%)',
|
||||||
padding: '18px',
|
padding: '18px',
|
||||||
border: '1px solid var(--border)',
|
border: '1px solid var(--border)',
|
||||||
borderRadius: '6px',
|
borderRadius: '4px',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
BIN
src/images/chrome.png
Normal file
BIN
src/images/chrome.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 75 KiB |
BIN
src/images/github.png
Normal file
BIN
src/images/github.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
Loading…
Add table
Reference in a new issue