Skip to content

Commit

Permalink
Initial id verification animation test
Browse files Browse the repository at this point in the history
  • Loading branch information
cw118 committed Nov 17, 2022
1 parent eefb9ee commit 4a605ad
Show file tree
Hide file tree
Showing 10 changed files with 250 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "next/core-web-vitals"
"extends": "next/core-web-vitals",
"rules": {
"@next/next/no-img-element": "off"
}
}
36 changes: 36 additions & 0 deletions components/IdScan.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import { useState } from 'react';
import styles from '../styles/Scantest.module.css';

const IdScan = () => {
const [mouseDown, setMouseDown] = useState(false);
const [scanComplete, setScanComplete] = useState(false);

const playScan = () => {
setMouseDown(true);
}

const pauseScan = () => {
setMouseDown(false);
}

const validate = () => {
setScanComplete(true);
}

return (
<div className={styles.container} onMouseDown={playScan} onTouchStart={playScan} onMouseUp={pauseScan} onTouchEnd={pauseScan}>
<div className={styles.idScan}>
<div className={styles.fingerprint}>
<div className={styles.printUnverified + (scanComplete ? `${styles.hide}` : '')}></div>
<div className={styles.printVerified} id={scanComplete ? `` : (styles.scanPaused + (mouseDown ? `${styles.scan}` : ''))} onAnimationEnd={validate}></div>
</div>
<div className={styles.idCard}>
<div className={styles.cardUnverified}></div>
<div className={styles.cardVerified} id={scanComplete ? `` : (styles.scanPaused + (mouseDown ? `${styles.scan}` : ''))} onAnimationEnd={validate}></div>
</div>
</div>
</div>
)
}

export default IdScan;
9 changes: 9 additions & 0 deletions pages/scantest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import IdScan from '../components/IdScan';

const scantest = () => {
return (
<IdScan />
);
}

export default scantest;
27 changes: 27 additions & 0 deletions public/idscan/fingerprint-scanned.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions public/idscan/fingerprint.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4a605ad

Please sign in to comment.