Skip to content

Commit 65678e1

Browse files
committed
V1.2.1 New Easter Eggs
1 parent 6836d6c commit 65678e1

File tree

5 files changed

+40
-6
lines changed

5 files changed

+40
-6
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
1. [**V1.2.0 - `6836d6c`**](https://github.com/RlxChap2/quiz-master/commit/6836d6cb8ebe304774a3f0f3d390496aa8bfbd0e)
2+
1. [**V1.2.0 - `cae9647`**](https://github.com/RlxChap2/quiz-master/commit/cae9647493e0d0d983587d4639a8fa4273c36e6a)
3+
1. [**V1.2.0 - `4fa28ea`**](https://github.com/RlxChap2/quiz-master/commit/4fa28eab519130707f0af7b775caa7e7d002d3e5)
4+
1. [**New EasterEgg - `030a327`**](https://github.com/RlxChap2/quiz-master/commit/030a32762456dd0fed1cc7753fbe4c28c2dc8e76)
5+
1. [**Merge branch 'main' of https://github.com/RlxChap2/quiz-master - `1a694e5`**](https://github.com/RlxChap2/quiz-master/commit/1a694e552191abab5532d952c7d8875d0924c570)
6+
1. [**New Changes - `d9b2453`**](https://github.com/RlxChap2/quiz-master/commit/d9b24535a668c840fcd20a86dff27c3b87d0bbeb)
7+
1. [**Update App.tsx - `ee7e8d5`**](https://github.com/RlxChap2/quiz-master/commit/ee7e8d5f2ad05a911a5cecf4043cceae2555300c)
8+
1. [**Update App.tsx - `f184ecf`**](https://github.com/RlxChap2/quiz-master/commit/f184ecf372ea4ff5753dc44d8d653c5665d7aa03)
9+
1. [**Update .gitignore - `0b74087`**](https://github.com/RlxChap2/quiz-master/commit/0b740872963b5b0eae22ef21f1b67b5fc5a7fb33)
10+
1. [**V1.1.0 - `d5e6352`**](https://github.com/RlxChap2/quiz-master/commit/d5e6352af45a73f7fe226c9b6268eede2b188250)
111
1. [**v1.0.3 - fixed Errors & UI - `702e827`**](https://github.com/RlxChap2/quiz-master/commit/702e8273df857682d4b9f6df3f6e843262e9df97)
212
1. [**v1.0.2 - `f081b43`**](https://github.com/RlxChap2/quiz-master/commit/f081b43d70c548072d46b29c1c23b37f0db6bb8b)
313
1. [**v1.0.1 - `fd7e012`**](https://github.com/RlxChap2/quiz-master/commit/fd7e012394154ab74ad1cb7126d65cd4cf46727f)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "quiz-master",
33
"private": true,
4-
"version": "1.2.0",
4+
"version": "1.2.1",
55
"type": "module",
66
"author": {
77
"name": "RlxChap2 - Mohammed Mahmoud"
@@ -11,7 +11,7 @@
1111
"build": "vite build",
1212
"lint": "eslint .",
1313
"preview": "vite preview",
14-
"push": "git add . && git commit -m \"V1.2.0\" && git push",
14+
"push": "git add . && git commit -m \"V1.2.1 New Easter Eggs\" && git push",
1515
"changelog": "git log --pretty=format:\"1. [**%s - `%h`**](https://github.com/RlxChap2/quiz-master/commit/%H)\" > CHANGELOG.md"
1616
},
1717
"dependencies": {

public/easteregg2.mp4

352 KB
Binary file not shown.

src/App.tsx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState } from 'react';
1+
import React, { useState, useEffect } from 'react';
22
import { Navbar } from './components/Navbar';
33
import { TestView } from './components/TestView';
44
import { LectureSelector } from './components/LectureSelector';
@@ -15,6 +15,26 @@ function App() {
1515
const [activePage, setActivePage] = useState<ActivePage>('home');
1616
const [showEasterEgg, setShowEasterEgg] = useState(false);
1717

18+
const [showArrowEasterEgg, setShowArrowEasterEgg] = useState(false);
19+
const [, setInputSequence] = useState<string[]>([]);
20+
21+
const secretCode = ['ArrowUp', 'ArrowUp', 'ArrowDown', 'ArrowDown'];
22+
23+
useEffect(() => {
24+
const handleKeyDown = (e: KeyboardEvent) => {
25+
setInputSequence((prev) => {
26+
const newSequence = [...prev, e.key].slice(-secretCode.length);
27+
if (JSON.stringify(newSequence) === JSON.stringify(secretCode)) {
28+
setShowArrowEasterEgg(true);
29+
}
30+
return newSequence;
31+
});
32+
};
33+
34+
window.addEventListener('keydown', handleKeyDown);
35+
return () => window.removeEventListener('keydown', handleKeyDown);
36+
}, []);
37+
1838
const toggleTheme = () => {
1939
setIsDark(!isDark);
2040
document.documentElement.classList.toggle('dark');
@@ -89,7 +109,10 @@ function App() {
89109
<div className="min-h-screen pt-20 p-6 bg-gray-50 dark:bg-gray-900">
90110
<div className="max-w-7xl mx-auto">{renderContent()}</div>
91111
</div>
92-
<EasterEgg show={showEasterEgg} onClose={() => setShowEasterEgg(false)} />
112+
113+
{/* Easter Eggs */}
114+
<EasterEgg show={showEasterEgg} onClose={() => setShowEasterEgg(false)} videoSrc="./easteregg.mp4" />
115+
<EasterEgg show={showArrowEasterEgg} onClose={() => setShowArrowEasterEgg(false)} videoSrc="./easteregg2.mp4" />
93116
</>
94117
);
95118
}

src/components/EasterEgg.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@ import React from 'react';
33
interface EasterEggProps {
44
show: boolean;
55
onClose: () => void;
6+
videoSrc: string;
67
}
78

8-
export const EasterEgg: React.FC<EasterEggProps> = ({ show, onClose }) => {
9+
export const EasterEgg: React.FC<EasterEggProps> = ({ show, onClose, videoSrc }) => {
910
if (!show) return null;
1011

1112
return (
1213
<div className="fixed inset-0 bg-black bg-opacity-75 flex items-center justify-center z-50" onClick={onClose}>
1314
<div className="relative w-full max-w-4xl bg-black rounded-xl overflow-hidden">
1415
<video autoPlay controls className="w-full" onClick={(e) => e.stopPropagation()}>
15-
<source src="./easteregg.mp4" type="video/mp4" />
16+
<source src={videoSrc} type="video/mp4" />
1617
Your browser does not support the video tag.
1718
</video>
1819
</div>

0 commit comments

Comments
 (0)