Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-sussman authored Dec 17, 2023
1 parent 04c5a61 commit 4afd08f
Show file tree
Hide file tree
Showing 16 changed files with 129 additions and 0 deletions.
Binary file added assets/favicon.ico
Binary file not shown.
Binary file added assets/reset.mp3
Binary file not shown.
Binary file added assets/siren.mp3
Binary file not shown.
Binary file added assets/swan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/tick.mp3
Binary file not shown.
Binary file added assets/typing_sounds/button1.mp3
Binary file not shown.
Binary file added assets/typing_sounds/button2.mp3
Binary file not shown.
Binary file added assets/typing_sounds/button3.mp3
Binary file not shown.
Binary file added assets/typing_sounds/button4.mp3
Binary file not shown.
Binary file added assets/typing_sounds/button5.mp3
Binary file not shown.
Binary file added assets/typing_sounds/button6.mp3
Binary file not shown.
Binary file added assets/typing_sounds/button7.mp3
Binary file not shown.
Binary file added assets/typing_sounds/button8.mp3
Binary file not shown.
16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="favicon icon" href="assets/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="src/style.css" />
</head>

<body>
<div class="container">
<h1><span>&gt;</span>:</h1>
<input type="text" class="input" maxlength="15" />
</div>

<script src="src/script.js"></script>
</body>
68 changes: 68 additions & 0 deletions src/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
document.title = 108
const input = document.querySelector('input')

const siren = new Audio('assets/siren.mp3')
const type = new Audio('assets/type.mp3')
const reset = new Audio('assets/reset.mp3')
const tick = new Audio('assets/tick.mp3')

const typeSound = () => {
let randomNumber = Math.floor(Math.random() * 7)
switch (randomNumber) {
case 0:
new Audio('assets/typing_sounds/button1.mp3').play()
break
case 1:
new Audio('assets/typing_sounds/button2.mp3').play()
break
case 2:
new Audio('assets/typing_sounds/button3.mp3').play()
break
case 3:
new Audio('assets/typing_sounds/button4.mp3').play()
break
case 4:
new Audio('assets/typing_sounds/button5.mp3').play()
break
case 5:
new Audio('assets/typing_sounds/button6.mp3').play()
break
case 6:
new Audio('assets/typing_sounds/button7.mp3').play()
break
case 7:
new Audio('assets/typing_sounds/button8.mp3').play()
}
}

input.onkeydown = (event) => {
typeSound()
if (event.key == 'Enter') {
input.value.trim()
if (input.value == '4 8 15 16 23 42') {
document.title = 108
input.value = ''
siren.pause()
siren.currentTime = 0
reset.play()
} else if (input.value == 'terminate') {
document.title = 4
input.value = ''
siren.play()
} else {
input.value = ''
}
}
}

setInterval(() => {
document.title--
if (document.title <= 4) {
siren.play()
}
tick.play()
}, 60000)

setInterval(() => {
input.focus()
}, 1)
45 changes: 45 additions & 0 deletions src/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}

body {
background-color: rgb(0, 0, 0);
color: rgba(0, 247, 0, 0.75);
font: 1rem Courier New, monospace;
height: 100vh;
overflow: hidden;
text-shadow: 0 0 5px rgba(56, 255, 56, 0.75);
}

.container {
align-items: center;
display: flex;
justify-content: flex-start;
margin: 0.3rem 0 0 0.8rem;
padding: 40px;
}

.input {
background-color: rgb(0, 0, 0);
border: none;
color: rgba(0, 247, 0, 0.75);
font-family: Courier New, monospace;
font-size: 3.2rem;
font-weight: bold;
margin-left: 0.5rem;
margin-top: 0.5rem;
outline: none;
text-shadow: 0 0 5px rgba(56, 255, 56, 0.75);
}

h1 {
display: inline-block;
font-size: 3.8rem;
letter-spacing: -4px;
}

span {
font-size: 3rem;
}

0 comments on commit 4afd08f

Please sign in to comment.