forked from cw118/totallyslay
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial id verification animation test
- Loading branch information
Showing
10 changed files
with
250 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.