forked from z-9527/react-admin-master
-
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.
- Loading branch information
Showing
5 changed files
with
472 additions
and
28 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
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
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,71 @@ | ||
import React from 'react' | ||
import './style.css' | ||
|
||
class ErrorPage extends React.Component { | ||
componentDidMount(){ | ||
this.error404() | ||
} | ||
componentWillUnmount(){ | ||
window.cancelAnimationFrame(this.myReq) | ||
} | ||
error404 = ()=>{ | ||
const c = document.getElementById("canv"); | ||
const $ = c.getContext("2d"); | ||
const w = c.width; | ||
const h = c.height; | ||
const id = $.createImageData(w, h); | ||
const _this = this | ||
function draw() { | ||
_this.myReq = window.requestAnimationFrame(draw); | ||
let r; | ||
for (let p = 4 * (w * h - 1); p >= 0; p -= 4) { | ||
r = Math.random(); | ||
id.data[p] = id.data[p+1] = id.data[p+2] = 255 * Math.pow(r, 1.6); | ||
id.data[p+3] = 255; | ||
} | ||
$.putImageData(id, 0, 0); | ||
} | ||
draw(); | ||
} | ||
render () { | ||
return ( | ||
<div style={styles.bg} className='error404'> | ||
<svg className="overlay text" viewBox="0 0 900 400"> | ||
<symbol id="main"> | ||
<text textAnchor="middle" x="50%" y="50%" dy="0.25em" className="txt">404</text> | ||
<text textAnchor="middle" x="50%" y="90%" dy="0.25em" className="txt2">Not Found</text> | ||
</symbol> | ||
<mask id="msk" maskUnits="userSpaceOnUse" maskContentUnits="userSpaceOnUse"> | ||
<rect width="100%" height="100%" className="wrap"> | ||
</rect> | ||
<use xlinkHref="#main" className="mtxt"/> | ||
</mask> | ||
</svg> | ||
<section> | ||
<h1 href="#"> | ||
<div className="fill"> | ||
<canvas id="canv" width="460" height="360" style={{background: 'hsla(0, 0, 0, 1)'}}> | ||
</canvas> | ||
</div> | ||
<svg viewBox="0 0 900 400" className="inv"> | ||
<rect width="100%" height="100%" mask="url(#msk)" | ||
className="rect"/> | ||
<use xlinkHref="#main" className="clear"/> | ||
</svg> | ||
</h1> | ||
</section> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
const styles = { | ||
bg: { | ||
position: 'absolute', | ||
top: 0, | ||
left: 0, | ||
width: '100%', | ||
height: 'calc(100vh - 64px)', | ||
}, | ||
} | ||
export default ErrorPage |
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,92 @@ | ||
/* latin-ext */ | ||
@font-face { | ||
font-family: 'Black Ops One'; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: local('Black Ops One Regular'), local('BlackOpsOne-Regular'), url(https://fonts.gstatic.com/s/blackopsone/v9/qWcsB6-ypo7xBdr6Xshe96H3aDXbtxsis4IxXw.woff2) format('woff2'); | ||
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; | ||
} | ||
/* latin */ | ||
@font-face { | ||
font-family: 'Black Ops One'; | ||
font-style: normal; | ||
font-weight: 400; | ||
src: local('Black Ops One Regular'), local('BlackOpsOne-Regular'), url(https://fonts.gstatic.com/s/blackopsone/v9/qWcsB6-ypo7xBdr6Xshe96H3aDvbtxsis4I.woff2) format('woff2'); | ||
unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; | ||
} | ||
|
||
.error404 { | ||
background: #e6e6e6; | ||
font-weight: bold; | ||
font-size: 1em; | ||
display: flex; | ||
justify-content: center; | ||
flex-direction: column; | ||
font-family: 'Black Ops One', cursive; | ||
-webkit-user-select: none; | ||
-moz-user-select: none; | ||
-ms-user-select: none; | ||
user-select: none; | ||
} | ||
|
||
.error404 canvas { | ||
left: 50%; | ||
position: absolute; | ||
top: 50%; | ||
-webkit-transform: translate(-50%, -50%); | ||
transform: translate(-50%, -50%); | ||
} | ||
|
||
.error404 .text .wrap { | ||
fill: #FFF; | ||
} | ||
|
||
.error404 .overlay { | ||
height: 0; | ||
width: 0; | ||
overflow: hidden; | ||
position: absolute; | ||
} | ||
.error404 .overlay .txt { | ||
font-size: 14rem; | ||
text-transform: uppercase; | ||
font-weight: 900; | ||
letter-spacing: -.5rem; | ||
text-shadow: 0 -3px 0 #0d0d0d, 0 6px 8px rgba(13, 13, 13, 0.55), 0 9px 10px rgba(13, 13, 13, 0.25); | ||
} | ||
.error404 .overlay .txt2 { | ||
font-size: 4rem; | ||
} | ||
|
||
.error404 section { | ||
align-self: center; | ||
} | ||
|
||
.error404 h1 { | ||
position: relative; | ||
font-size: 8em; | ||
font-weight: bold; | ||
line-height: 1; | ||
display: inline-block; | ||
width: 900px; | ||
height: 400px; | ||
} | ||
.error404 h1 .fill { | ||
position: relative; | ||
width: 100%; | ||
height: 100%; | ||
overflow: hidden; | ||
} | ||
.error404 h1 .inv { | ||
position: absolute; | ||
width: 900px; | ||
height: 400px; | ||
top: 0; | ||
left: 0; | ||
} | ||
.error404 h1 .rect { | ||
fill: #e6e6e6; | ||
} | ||
.error404 h1 .clear { | ||
fill: transparent; | ||
} |
Oops, something went wrong.