Skip to content

Commit 77deb8f

Browse files
committed
some shit related to an easter egg
1 parent c50af57 commit 77deb8f

File tree

3 files changed

+51
-30
lines changed

3 files changed

+51
-30
lines changed

src/components/App.tsx

+35-21
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
1-
import ClickScungus from '../hooks/ClickScungus';
2-
import LoadScungus from '../hooks/LoadScungus';
3-
import ResetScungus from '../hooks/ResetScungus';
4-
import SaveScungus from '../hooks/SaveScungus';
5-
import './app.css';
1+
import React from "react";
2+
3+
import ClickScungus from "../hooks/ClickScungus";
4+
import LoadScungus from "../hooks/LoadScungus";
5+
import ResetScungus from "../hooks/ResetScungus";
6+
import SaveScungus from "../hooks/SaveScungus";
7+
import "./app.css";
68

79
const App = () => {
10+
const handleKeyDown = (event: React.KeyboardEvent<HTMLInputElement>) => {
11+
if (["CapsLock", "Alt"].indexOf(event.key) !== -1) {
12+
event.preventDefault();
13+
event.stopPropagation();
14+
}
15+
console.log(`${event.key}\nhello ultra!!!`);
16+
};
17+
818
return (
9-
<div className='root' style={{display: 'flex', width: '100%'}}>
10-
<div className='side left'>
11-
<div className='title-text heading'>
12-
<h1>this is scungus:)</h1>
13-
</div>
14-
<div className='text center top'>
15-
you can click on scungus:)
16-
<br />
17-
doing so will increase your scungus:)
18-
<br />
19-
try it~!
20-
</div>
21-
<div className='button scungus padding'>
22-
<ClickScungus />
23-
</div>
19+
<div
20+
className="root"
21+
style={{ display: "flex", width: "100%" }}
22+
onKeyDown={handleKeyDown}
23+
>
24+
<div className="side left">
25+
<div className="title-text heading">
26+
<h1>this is scungus:)</h1>
27+
</div>
28+
<div className="text center top">
29+
you can click on scungus:)
30+
<br />
31+
doing so will increase your scungus:)
32+
<br />
33+
try it~!
34+
</div>
35+
<div className="button scungus padding">
36+
<ClickScungus />
37+
</div>
2438
</div>
25-
<div className='side right'>
39+
<div className="side right">
2640
<br />
2741
<SaveScungus />
2842
<br />

src/components/Scungus.tsx

-9
This file was deleted.

src/functions/EasterEggs.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { useState } from "react";
2+
3+
const [imageSrc, setImageSrc] = useState("./scungus.gif");
4+
5+
const changeImageSrc = () => {
6+
setImageSrc("./ultra.jpg");
7+
};
8+
9+
let keylog = [];
10+
document.onkeydown = function (e) {
11+
let keypressed = e.key;
12+
keylog.push(keypressed);
13+
console.log(keylog);
14+
};
15+
16+
export { changeImageSrc, imageSrc };

0 commit comments

Comments
 (0)