Skip to content

Commit

Permalink
feat: heh
Browse files Browse the repository at this point in the history
  • Loading branch information
stifskere committed Jul 28, 2024
1 parent 604a79e commit f9bb52d
Show file tree
Hide file tree
Showing 11 changed files with 771 additions and 28 deletions.
1 change: 1 addition & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/** @type {import('next').NextConfig} */
const nextConfig = {}
const nextConfig = {};

export default nextConfig;
715 changes: 700 additions & 15 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"react-dom": "^18",
"react-icons": "^5.0.1",
"react-syntax-highlighter": "^15.5.0",
"sharp": "^0.33.2"
"sharp": "^0.33.2",
"use-sound": "^4.0.3"
},
"devDependencies": {
"@babel/plugin-transform-class-static-block": "^7.23.4",
Expand All @@ -30,6 +31,7 @@
"braces": "^3.0.3",
"eslint": "^8",
"eslint-config-next": "14.1.0",
"file-loader": "^6.2.0",
"typescript": "^5"
}
}
Binary file added public/explosion.mp3
Binary file not shown.
Binary file added public/pixelated-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 23 additions & 2 deletions src/app/page.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400..700&display=swap');

:root {
--font-family: "Figtree";
--border-radius: 8px;
--background: url("/background.png");
}

* {
margin: 0;

font-family: "Figtree", sans-serif;
font-family: var(--font-family), sans-serif;

user-select: none;

Expand Down Expand Up @@ -33,7 +40,7 @@ section, footer {
body {
height: fit-content;

background: linear-gradient( rgba(0, 0, 0, 40%), rgba(0, 0, 0, 40%)), url("/background.png");
background: linear-gradient( rgba(0, 0, 0, 40%), rgba(0, 0, 0, 40%)), var(--background);
}

.spin {
Expand Down Expand Up @@ -181,6 +188,20 @@ body {
}
}

.presentation-container-text > p > a {
color: #676767;

text-decoration: none;

transition: color 0.3s, text-shadow 0.3s;
}

.presentation-container-text > p > a:hover {
color: white;

text-shadow: 0 0 10px;
}

.presentation-socials {
display: flex;

Expand Down
46 changes: 40 additions & 6 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default function Home(): ReactElement {
const [page, setPage]: StateTuple<number> = useState(0);
const [gists, setGists]: StateTuple<GithubCompiledGist[] | undefined | null> = useState();
const [phrase, setPhrase]: StateTuple<ReactElement | undefined> = useState();
const [easterEnabled, setEasterEnabled]: StateTuple<boolean> = useState<boolean>(false);

const waitingPhrases: ReactElement[] = [
<>... It&apos;s not the time <b>YET</b></>,
Expand All @@ -41,7 +42,17 @@ export default function Home(): ReactElement {
<>... The wait is not <b>OVER</b></>
];

useEffect((): void => {
useEffect((): (() => void) | void => {
if (easterEnabled)
return;

const code: string[] = [
"ArrowUp", "ArrowUp", "ArrowDown", "ArrowDown",
"ArrowLeft", "ArrowRight", "ArrowLeft", "ArrowRight",
"KeyA", "KeyB"
];
let codePosition: number = 0;

fetch("/github/repos")
.then(async (r: Response): Promise<void> => setRepos(
r.ok
Expand All @@ -59,6 +70,24 @@ export default function Home(): ReactElement {
));

setPhrase(waitingPhrases[Math.floor(Math.random() * waitingPhrases.length)]);

function listenKonamiSequence(ev: KeyboardEvent): void {
codePosition = ev.code == code[codePosition] ? codePosition + 1 : 0;

if (codePosition == code.length) {
document.documentElement.style.setProperty("--font-family", "Pixelify Sans");
document.documentElement.style.setProperty("--border-radius", "0");
document.documentElement.style.setProperty("--background", "url(\"/pixelated-background.png\")");
(document.getElementById("pixel-audio") as HTMLAudioElement).play().then();

setEasterEnabled(true);
}
}

document.addEventListener("keydown", listenKonamiSequence);
return (): void => {
document.removeEventListener("keydown", listenKonamiSequence);
};
}, []);

function setCurrentPage(page: number): void {
Expand All @@ -75,6 +104,9 @@ export default function Home(): ReactElement {
}

return <main>
<audio id="pixel-audio" hidden>
<source src="/explosion.mp3" type="audio/mp3"/>
</audio>
<section className="title">
<div>
<h1>MEMW</h1>
Expand All @@ -94,11 +126,13 @@ export default function Home(): ReactElement {
{`
I'm Esteve, a ${formatDistanceToNowStrict(new Date("2005-11-06"))} old developer I started
coding ${formatDistanceToNowStrict(new Date("2017-11-6"))} ago, when I was 12, even tho I
started my professional journey 2 years ago, I have experience in a lot of things, from
low level like compilers, operative systems to web development, desktop apps, and service
deployment, I'm usually freelancing now but also open to job offers, I speak english,
spanish, catalan and russian, if you'd like to collaborate with me, get in touch.
started my professional journey ${formatDistanceToNowStrict(new Date("2021-12-26"))} ago,
I have experience in a lot of things, from low level like compilers, operative systems
to web development, desktop apps, and service deployment, I'm usually freelancing now
but also open to job offers, I speak english, spanish, catalan and russian, if you'd
like to collaborate with me,
`}
<a href="#footer" className="desc-link">get in touch.</a>
</p>
</div>
<div className="presentation-interactable">
Expand Down Expand Up @@ -164,7 +198,7 @@ export default function Home(): ReactElement {
</>
</Loader>
</section>
<footer>
<footer id="footer">
<div className="footer-content">
<Image unoptimized src={logo} alt="logo"/>
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/box/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
background-color: black;

border: white 1px solid;
border-radius: 8px;
border-radius: var(--border-radius);
}

.error-box {
Expand Down
2 changes: 1 addition & 1 deletion src/components/gist/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
width: 85vw;
}

border-radius: 8px;
border-radius: var(--border-radius);
border: 1px solid white;

overflow: hidden;
Expand Down
2 changes: 1 addition & 1 deletion src/components/page-selector/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

justify-content: space-between;

border-radius: 8px;
border-radius: var(--border-radius);
border: 1px white solid;
}

Expand Down

0 comments on commit f9bb52d

Please sign in to comment.