Initial commit
This commit is contained in:
commit
bab0d82cfc
54
camera-test.html
Normal file
54
camera-test.html
Normal file
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Your Game</title>
|
||||
</head>
|
||||
<style>
|
||||
#cameraContainer {
|
||||
text-align: center;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
#cameraButton {
|
||||
background-color: #0074d9;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#uploadedImage {
|
||||
max-width: 100%;
|
||||
margin-top: 10px;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<div id="cameraContainer">
|
||||
<input type="file" accept="image/*" capture="camera" id="cameraInput" style="display: none;">
|
||||
<img id="uploadedImage" src="" alt="Uploaded Image">
|
||||
<button id="cameraButton">Take a Picture</button>
|
||||
</div>
|
||||
<!-- Add your game content here -->
|
||||
</body>
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
const cameraInput = document.getElementById("cameraInput");
|
||||
const uploadedImage = document.getElementById("uploadedImage");
|
||||
const cameraButton = document.getElementById("cameraButton");
|
||||
|
||||
// When the camera button is clicked, open the camera
|
||||
cameraButton.addEventListener("click", function () {
|
||||
cameraInput.click();
|
||||
});
|
||||
|
||||
// When a photo is selected, display it in the image element
|
||||
cameraInput.addEventListener("change", function () {
|
||||
const file = cameraInput.files[0];
|
||||
if (file) {
|
||||
const imageUrl = URL.createObjectURL(file);
|
||||
uploadedImage.src = imageUrl;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</html>
|
98
notes.txt
Normal file
98
notes.txt
Normal file
@ -0,0 +1,98 @@
|
||||
# Description
|
||||
A party game of sexual ambitions.
|
||||
|
||||
Which Shrek character does your friend secretly want to bang? Wanna hint? It's not the ogre.
|
||||
|
||||
# Requirements
|
||||
A web browser based game.
|
||||
|
||||
|
||||
Workflow:
|
||||
A. Landing page
|
||||
--> Create new game
|
||||
--> Join existing game
|
||||
B. Create new game
|
||||
1. Click button
|
||||
- Make an https request to server
|
||||
POST
|
||||
/games
|
||||
RESPONSE
|
||||
UUID game_id
|
||||
- Parse game_id from response
|
||||
--> Open game screen.
|
||||
C. Join existing game
|
||||
1. Enter game_id into input box
|
||||
2. Click enter / hit button
|
||||
--> Open game screen.
|
||||
D. Open game screen.
|
||||
- Validate game exists
|
||||
- Make https request to server
|
||||
GET
|
||||
/games/<game_id>
|
||||
OK -> proceed
|
||||
404 -> error
|
||||
- Join game
|
||||
1. Enter Name (string)
|
||||
2. Take picture (html & javascript)
|
||||
3. Join game
|
||||
- Upload image to server
|
||||
POST
|
||||
/images
|
||||
RESPONSE
|
||||
OK -> image_id
|
||||
- Make https request to server
|
||||
PUT
|
||||
/games/<game_id>
|
||||
{
|
||||
"name": "",
|
||||
"avatar": "image_id"
|
||||
}
|
||||
|
||||
Ok, I found the hard part. What is the structure of data for each game?
|
||||
|
||||
Model
|
||||
|
||||
Image
|
||||
- uuid
|
||||
- filepath?
|
||||
|
||||
Game
|
||||
- uuid
|
||||
- code: alpha-numeric 6 figure string
|
||||
- active: bool
|
||||
- player_ids: list of players
|
||||
- round_ids: list of rounds
|
||||
|
||||
Player
|
||||
- uuid
|
||||
- display_name
|
||||
- avatar_id: image_id
|
||||
- is_prompt: bool
|
||||
|
||||
Round
|
||||
- uuid
|
||||
- active: bool
|
||||
- answer_player_id: player_uuid
|
||||
- prompts: list of prompt_ids
|
||||
|
||||
Prompt
|
||||
- uuid
|
||||
- prompt_id: player_uuid
|
||||
- answers: list of answer_ids
|
||||
|
||||
Answers
|
||||
- uuid
|
||||
- player_id: player_uuid
|
||||
- would_smash: bool
|
||||
|
||||
Each game has:
|
||||
1. player_ids - UUIDs for players participating.
|
||||
- is_prompt = false
|
||||
2. rounds - list, n = number of players (each player goes once)
|
||||
- answer_player: player uuid
|
||||
- active: bool
|
||||
- prompts: list, n = 10.
|
||||
- player_id: uuid, where is_prompt = true
|
||||
- answers: list, n = number of players
|
||||
- player_id: UUID of player that submitted
|
||||
- would_smash: bool
|
Loading…
Reference in New Issue
Block a user