-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
108 lines (97 loc) · 2.87 KB
/
index.html
File metadata and controls
108 lines (97 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MCP</title>
<style>
body {
font-family: "Courier New", monospace;
background-color: black;
color: #00FF00; /* Old-school green text */
margin: 0;
padding: 20px;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
box-sizing: border-box;
}
.terminal {
background-color: black;
width: 80%;
max-width: 600px;
height: 60%;
border: 2px solid white;
padding: 20px;
box-sizing: border-box;
overflow-y: auto;
}
input {
color: white;
background-color: black;
border: none;
outline: none;
font-family: "Courier New", monospace;
font-size: 18px;
width: 100%;
padding: 10px;
box-sizing: border-box;
}
.response {
margin-top: 10px;
color: white;
}
/* Make sure the input field is responsive on mobile */
@media (max-width: 600px) {
input {
font-size: 16px;
padding: 12px;
}
}
</style>
</head>
<body>
<div class="terminal">
<p id="question"></p>
<input type="text" id="userInput" placeholder="Enter your answer here..." />
<div class="response" id="response"></div>
</div>
<script>
const correctAnswer = 'allyson'; // Define the correct answer to unlock
const inputField = document.getElementById('userInput');
const responseDiv = document.getElementById('response');
const questionDiv = document.getElementById('question');
// Function to simulate the typing effect
function typeWriter(text, i = 0) {
if (i < text.length) {
questionDiv.innerHTML += text.charAt(i);
i++;
setTimeout(() => typeWriter(text, i), 150); // Delay of 0.15 second 1 - 1 milisecond
}
}
// Start typing the question
const questionText = "What is your name? (first name only)";
typeWriter(questionText);
// Listen for the "Enter" key press
inputField.addEventListener('keydown', function(event) {
if (event.key === 'Enter') {
const userInput = inputField.value.trim().toLowerCase();
if (userInput === correctAnswer) {
// Display "Thank you" message
responseDiv.innerHTML = '<p style="color: #00FF00;">Thank you!</p>';
// Wait for 3 seconds (3000 milliseconds) before redirecting
setTimeout(() => {
window.location.href = "2,0.html"; // Redirect to index.html after 3 seconds
}, 3000);
} else {
responseDiv.innerHTML = '<p style="color: red;">Access denied. Incorrect answer.</p>';
}
// Clear the input field after checking
inputField.value = '';
}
});
</script>
</body>
</html>