Compare commits
No commits in common. "b0005ee465a3b2c8a03e6d7db42514783ba51127" and "e0280bafe6ddbf5b5fc6207fb1c28804aeff344a" have entirely different histories.
b0005ee465
...
e0280bafe6
|
|
@ -1,6 +1,6 @@
|
||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
FROM node:25.9.0-alpine
|
FROM node:19.9.0-alpine
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm install --production
|
RUN npm install --production
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
67
package.json
67
package.json
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "jeobeardy",
|
"name": "jeobeardy",
|
||||||
"version": "1.1.0",
|
"version": "1.0.0",
|
||||||
"description": "Jeobeardy (/dʒebeərdi/) is similiar to but not quite like Jeopardy. It is a quiz game where you can create your own boards with categories and then make your friends compete in a fun and interactive way",
|
"description": "Jeobeardy (/dʒebeərdi/) is similiar to but not quite like Jeopardy. It is a quiz game where you can create your own boards with categories and then make your friends compete in a fun and interactive way",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"jeobeardy",
|
"jeobeardy",
|
||||||
|
|
@ -29,39 +29,40 @@
|
||||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fortawesome/fontawesome-svg-core": "~7.2.0",
|
"@fortawesome/fontawesome-svg-core": "6.5.1",
|
||||||
"@fortawesome/free-regular-svg-icons": "~7.2.0",
|
"@fortawesome/free-regular-svg-icons": "6.5.1",
|
||||||
"@fortawesome/free-solid-svg-icons": "~7.2.0",
|
"@fortawesome/free-solid-svg-icons": "6.5.1",
|
||||||
"@fortawesome/vue-fontawesome": "~3.1.3",
|
"@fortawesome/vue-fontawesome": "3.0.6",
|
||||||
"@popperjs/core": "~2.11.8",
|
"@popperjs/core": "2.11.8",
|
||||||
"axios": "~1.15.0",
|
"@vitejs/plugin-vue": "5.0.4",
|
||||||
"bcryptjs": "~3.0.3",
|
"archetype": "github:LaurentGoderre/archetype#fix-lodash_set-vuln",
|
||||||
"body-parser": "~2.2.2",
|
"axios": "1.6.7",
|
||||||
"bootstrap": "~5.3.8",
|
"bcryptjs": "2.4.3",
|
||||||
"connect-history-api-fallback": "~2.0.0",
|
"body-parser": "1.20.2",
|
||||||
"connect-mongodb-session": "~5.0.0",
|
"bootstrap": "5.3.3",
|
||||||
"cors": "~2.8.6",
|
"connect-history-api-fallback": "2.0.0",
|
||||||
"dotenv": "~17.4.2",
|
"connect-mongodb-session": "5.0.0",
|
||||||
"express": "~5.2.1",
|
"cors": "2.8.5",
|
||||||
"express-session": "~1.19.0",
|
"dotenv": "16.4.5",
|
||||||
"helmet": "~8.1.0",
|
"express": "4.18.2",
|
||||||
"mongoose": "~9.4.1",
|
"express-session": "1.18.0",
|
||||||
"morgan": "~1.10.1",
|
"helmet": "7.1.0",
|
||||||
"multer": "~2.1.1",
|
"mongoose": "8.2.0",
|
||||||
"pinia": "~3.0.4",
|
"morgan": "1.10.0",
|
||||||
"uuid": "~13.0.0",
|
"multer": "1.4.5-lts.1",
|
||||||
"vite": "~8.0.8",
|
"pinia": "2.1.7",
|
||||||
"vue": "~3.5.32",
|
"uuid": "9.0.1",
|
||||||
"vue-router": "~5.0.4",
|
"vite": "5.1.4",
|
||||||
"ws": "~8.20.0"
|
"vue": "3.4.20",
|
||||||
|
"vue-router": "4.3.0",
|
||||||
|
"ws": "8.16.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@rushstack/eslint-patch": "~1.16.1",
|
"@rushstack/eslint-patch": "1.7.2",
|
||||||
"@vitejs/plugin-vue": "~6.0.5",
|
"@vue/eslint-config-prettier": "9.0.0",
|
||||||
"@vue/eslint-config-prettier": "~10.2.0",
|
"eslint": "8.57.0",
|
||||||
"eslint": "~10.2.0",
|
"eslint-plugin-vue": "9.22.0",
|
||||||
"eslint-plugin-vue": "~10.8.0",
|
"prettier": "3.2.5",
|
||||||
"prettier": "~3.8.2",
|
"sass": "1.71.1"
|
||||||
"sass": "~1.99.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -162,7 +162,7 @@ exports.findGameAndAddAnsweredEntry = ( id, categoryIndex, boardEntryIndex ) =>
|
||||||
categoryIndex: categoryIndex,
|
categoryIndex: categoryIndex,
|
||||||
boardEntryIndex: boardEntryIndex,
|
boardEntryIndex: boardEntryIndex,
|
||||||
}
|
}
|
||||||
GameModel.findByIdAndUpdate(id, { $addToSet: { "answeredBoardEntries": dbEntry } }, { returnDocument: 'after' } ).populate("board")
|
GameModel.findByIdAndUpdate(id, { $addToSet: { "answeredBoardEntries": dbEntry } }, { new: true } ).populate("board")
|
||||||
.then( ( game ) => {
|
.then( ( game ) => {
|
||||||
if( game === null ){
|
if( game === null ){
|
||||||
let gameNotFoundError = new Error(`No game found with id "${id}"`);
|
let gameNotFoundError = new Error(`No game found with id "${id}"`);
|
||||||
|
|
@ -187,7 +187,7 @@ exports.findGameAndAddAnsweredEntry = ( id, categoryIndex, boardEntryIndex ) =>
|
||||||
*/
|
*/
|
||||||
exports.findGameAndRemoveAnsweredEntry = ( id, categoryIndex, boardEntryIndex ) => {
|
exports.findGameAndRemoveAnsweredEntry = ( id, categoryIndex, boardEntryIndex ) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
GameModel.findByIdAndUpdate(id, { $pull: { answeredBoardEntries: { categoryIndex: categoryIndex, boardEntryIndex: boardEntryIndex } } }, { returnDocument: 'after' } ).populate("board")
|
GameModel.findByIdAndUpdate(id, { $pull: { answeredBoardEntries: { categoryIndex: categoryIndex, boardEntryIndex: boardEntryIndex } } }, { new: true } ).populate("board")
|
||||||
.then( ( game ) => {
|
.then( ( game ) => {
|
||||||
if( game === null ){
|
if( game === null ){
|
||||||
let gameNotFoundError = new Error(`No game found with id "${id}"`);
|
let gameNotFoundError = new Error(`No game found with id "${id}"`);
|
||||||
|
|
@ -205,7 +205,7 @@ exports.findGameAndRemoveAnsweredEntry = ( id, categoryIndex, boardEntryIndex )
|
||||||
|
|
||||||
exports.findAcceptingGameAndSetNotAccepting = ( id ) => {
|
exports.findAcceptingGameAndSetNotAccepting = ( id ) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
GameModel.findOneAndUpdate({ _id : id, acceptAnswers: true }, { acceptAnswers: false }, { returnDocument: 'after' })
|
GameModel.findOneAndUpdate({ _id : id, acceptAnswers: true }, { acceptAnswers: false }, { new: true })
|
||||||
.then((game) => {
|
.then((game) => {
|
||||||
if( game === null){
|
if( game === null){
|
||||||
resolve( false );
|
resolve( false );
|
||||||
|
|
@ -221,7 +221,7 @@ exports.findAcceptingGameAndSetNotAccepting = ( id ) => {
|
||||||
|
|
||||||
exports.findGameAndSetAccepting = ( id, isAccepting ) => {
|
exports.findGameAndSetAccepting = ( id, isAccepting ) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
GameModel.findByIdAndUpdate( id, { acceptAnswers: isAccepting }, { returnDocument: 'after' }).populate("players")
|
GameModel.findByIdAndUpdate( id, { acceptAnswers: isAccepting }, { new: true }).populate("players")
|
||||||
.then((game) => {
|
.then((game) => {
|
||||||
if( game === null){
|
if( game === null){
|
||||||
let gameNotFoundError = new Error(`No game found with code "${id}"`);
|
let gameNotFoundError = new Error(`No game found with code "${id}"`);
|
||||||
|
|
@ -264,7 +264,7 @@ exports.setPlayerPointsAndReturnGame = ( gameId, playerId, pointsAdjusted ) => {
|
||||||
points: pointsAdjusted,
|
points: pointsAdjusted,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ returnDocument: 'after' }
|
{ new: true }
|
||||||
)
|
)
|
||||||
.then( ( player ) => {
|
.then( ( player ) => {
|
||||||
if( player === null ){
|
if( player === null ){
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,7 @@ exports.checkPlayerAcceptAnswers = ( playerId ) => {
|
||||||
*/
|
*/
|
||||||
exports.checkPlayerAcceptAnswersAndSetAccepting = ( playerId, canAcceptAfter ) => {
|
exports.checkPlayerAcceptAnswersAndSetAccepting = ( playerId, canAcceptAfter ) => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
PlayerModel.findByIdAndUpdate( playerId, { acceptAnswers: canAcceptAfter }, { returnDocument: 'before' } )
|
PlayerModel.findByIdAndUpdate( playerId, { acceptAnswers: canAcceptAfter }, { new: false } )
|
||||||
.then( ( player ) => {
|
.then( ( player ) => {
|
||||||
if( player ){
|
if( player ){
|
||||||
resolve( player.acceptAnswers );
|
resolve( player.acceptAnswers );
|
||||||
|
|
|
||||||
|
|
@ -159,7 +159,7 @@ exports.updateProfilePicture = ( userId, pfpFilename ) => {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then( () => {
|
.then( () => {
|
||||||
return UserModel.findById( userId , {}, { returnDocument: 'after' });
|
return UserModel.findById( userId , {}, { new: true });
|
||||||
})
|
})
|
||||||
.then( ( user ) => {
|
.then( ( user ) => {
|
||||||
resolve( user );
|
resolve( user );
|
||||||
|
|
|
||||||
|
|
@ -12,20 +12,11 @@ const storage = multer.diskStorage({
|
||||||
destination: (req, file, cb) => {
|
destination: (req, file, cb) => {
|
||||||
cb( null, 'public/uploads' )
|
cb( null, 'public/uploads' )
|
||||||
},
|
},
|
||||||
limits: {
|
|
||||||
fileSize: 1024 * 1024 * 2,
|
|
||||||
},
|
|
||||||
filename: (req, file, cb) => {
|
filename: (req, file, cb) => {
|
||||||
let fileExtension = '.jpg';
|
let fileExtension = '.jpg';
|
||||||
if( file.mimetype === 'image/png' ){
|
if( file.mimetype === 'image/png' ){
|
||||||
fileExtension = '.png';
|
fileExtension = '.png';
|
||||||
}
|
}
|
||||||
if( file.mimetype === 'image/webp' ){
|
|
||||||
fileExtension = '.webp';
|
|
||||||
}
|
|
||||||
if( file.mimetype === 'image/avif' ){
|
|
||||||
fileExtension = '.avif';
|
|
||||||
}
|
|
||||||
if( file.mimetype === 'image/gif' ){
|
if( file.mimetype === 'image/gif' ){
|
||||||
fileExtension = '.gif';
|
fileExtension = '.gif';
|
||||||
}
|
}
|
||||||
|
|
@ -59,12 +50,13 @@ const fileFilterFn = function( req, file, cb ){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !["image/jpeg","image/jpg","image/png","image/gif","image/webp","image/avif","audio/mpeg"].includes( file.mimetype ) ){
|
if( !["image/jpeg","image/jpg","image/png","image/gif","audio/mpeg"].includes( file.mimetype ) ){
|
||||||
cb( new Error( "MIME Type not supported!" ) );
|
cb( new Error( "MIME Type not supported!" ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if( file.size > 1024 * 1024 * 2){
|
|
||||||
cb( new Error( "File is too large! Must be less than 2MB" ) );
|
if( file.size > 1024 * 1024 * 5){
|
||||||
|
cb( new Error( "File is too large! Must be less than 5MB" ) );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -161,20 +161,10 @@ exports.handleMessage = ( gameSocketList, socket, dataRaw ) => {
|
||||||
break;
|
break;
|
||||||
case "selectBoardEntry":
|
case "selectBoardEntry":
|
||||||
if( socket.locals.isHost ){
|
if( socket.locals.isHost ){
|
||||||
gameController.findGameAndSetAccepting( socket.locals.game, true )
|
|
||||||
.then( ( game ) => {
|
|
||||||
return playerController.setAllPlayersAcceptAnswers( game.players.map( playerEntry => playerEntry._id ), true )
|
|
||||||
})
|
|
||||||
.then( () => {
|
|
||||||
let message = `BoardEntry ${payload.boardEntryIndex} selected in Category ${payload.categoryIndex}`;
|
let message = `BoardEntry ${payload.boardEntryIndex} selected in Category ${payload.categoryIndex}`;
|
||||||
let sendingData = { categoryIndex: payload.categoryIndex, boardEntryIndex: payload.boardEntryIndex };
|
let sendingData = { categoryIndex: payload.categoryIndex, boardEntryIndex: payload.boardEntryIndex };
|
||||||
sendAllPlayers( socket, gameSocketList, "boardEntrySelected", message, sendingData );
|
sendAllPlayers( socket, gameSocketList, "boardEntrySelected", message, sendingData );
|
||||||
resolve();
|
resolve();
|
||||||
})
|
|
||||||
.catch( ( err ) => {
|
|
||||||
reject( err );
|
|
||||||
});
|
|
||||||
resolve();
|
|
||||||
} else {
|
} else {
|
||||||
reject( new Error("Message not sent by host") );
|
reject( new Error("Message not sent by host") );
|
||||||
}
|
}
|
||||||
|
|
@ -245,27 +235,27 @@ exports.handleMessage = ( gameSocketList, socket, dataRaw ) => {
|
||||||
break;
|
break;
|
||||||
case "selectBoard":
|
case "selectBoard":
|
||||||
if( socket.locals.isHost ){
|
if( socket.locals.isHost ){
|
||||||
gameController.findGameAndSetAccepting( socket.locals.game, false )
|
|
||||||
.then( ( game ) => {
|
|
||||||
return playerController.setAllPlayersAcceptAnswers( game.players.map( playerEntry => playerEntry._id ), false )
|
|
||||||
})
|
|
||||||
.then( () => {
|
|
||||||
let message = "Board selected";
|
let message = "Board selected";
|
||||||
sendAllPlayers( socket, gameSocketList, "boardSelected", message, {});
|
sendAllPlayers( socket, gameSocketList, "boardSelected", message, {});
|
||||||
resolve();
|
resolve();
|
||||||
})
|
|
||||||
.catch( ( err ) => {
|
|
||||||
reject( err );
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
reject( new Error("Message not sent by host") );
|
reject( new Error("Message not sent by host") );
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "showQuestion":
|
case "showQuestion":
|
||||||
if( socket.locals.isHost ){
|
if( socket.locals.isHost ){
|
||||||
|
gameController.findGameAndSetAccepting( socket.locals.game, true )
|
||||||
|
.then( ( game ) => {
|
||||||
|
return playerController.setAllPlayersAcceptAnswers( game.players.map( playerEntry => playerEntry._id ), true )
|
||||||
|
})
|
||||||
|
.then( () => {
|
||||||
let message = "Question revealed";
|
let message = "Question revealed";
|
||||||
sendAllPlayers( socket, gameSocketList, "questionRevealed", message, {});
|
sendAllPlayers( socket, gameSocketList, "questionRevealed", message, {});
|
||||||
resolve();
|
resolve();
|
||||||
|
})
|
||||||
|
.catch( ( err ) => {
|
||||||
|
reject( err );
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
reject( new Error("Message not sent by host") );
|
reject( new Error("Message not sent by host") );
|
||||||
}
|
}
|
||||||
|
|
@ -290,9 +280,15 @@ exports.handleMessage = ( gameSocketList, socket, dataRaw ) => {
|
||||||
break;
|
break;
|
||||||
case "hideQuestion":
|
case "hideQuestion":
|
||||||
if( socket.locals.isHost ){
|
if( socket.locals.isHost ){
|
||||||
|
gameController.findGameAndSetAccepting( socket.locals.game, false )
|
||||||
|
.then( ( _game ) => {
|
||||||
let message = "Question hidden";
|
let message = "Question hidden";
|
||||||
sendAllPlayers( socket, gameSocketList, "questionHidden", message, {});
|
sendAllPlayers( socket, gameSocketList, "questionHidden", message, {});
|
||||||
resolve();
|
resolve();
|
||||||
|
})
|
||||||
|
.catch( ( err ) => {
|
||||||
|
reject( err );
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
reject( new Error("Message not sent by host") );
|
reject( new Error("Message not sent by host") );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,8 +81,8 @@ function handleModalButtonClick( buttonIndex ){
|
||||||
<div class="col-auto border-start">
|
<div class="col-auto border-start">
|
||||||
<div class="h-100 d-flex flex-column justify-content-evenly">
|
<div class="h-100 d-flex flex-column justify-content-evenly">
|
||||||
<div>
|
<div>
|
||||||
<label class="form-label fs-5" for="question-image">Upload new profile picture <span style="font-size: 0.6em;">(max. 2MB)</span></label>
|
<label class="form-label fs-5" for="question-image">Upload new profile picture</label>
|
||||||
<input ref="imageInput" class="form-control bg-dark-blue" type="file" name="question-image" id="question-image" @change="newImageUploaded" accept="image/jpeg, image/jpg, image/png, image/gif, image/webp, image/avif">
|
<input ref="imageInput" class="form-control bg-dark-blue" type="file" name="question-image" id="question-image" @change="newImageUploaded" accept="image/*">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<button class="btn btn-pink-accent-primary me-3" :disabled="uploadedFileObj === null" @click="saveProfilePicture">
|
<button class="btn btn-pink-accent-primary me-3" :disabled="uploadedFileObj === null" @click="saveProfilePicture">
|
||||||
|
|
|
||||||
|
|
@ -68,21 +68,17 @@ function boardSelected(){
|
||||||
selectedObject.value = gameStore.board;
|
selectedObject.value = gameStore.board;
|
||||||
categoryIndex.value = -1;
|
categoryIndex.value = -1;
|
||||||
boardEntryIndex.value = -1;
|
boardEntryIndex.value = -1;
|
||||||
gameStore.acceptAnswers = false;
|
|
||||||
for(const playerIdx in gameStore.players ){
|
|
||||||
gameStore.players[playerIdx].isAnswering = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
function selectBoardEntryWithCategory( cIndex, entryIndex ){
|
function selectBoardEntryWithCategory( cIndex, entryIndex ){
|
||||||
categoryIndex.value = cIndex;
|
categoryIndex.value = cIndex;
|
||||||
boardEntryIndex.value = entryIndex;
|
boardEntryIndex.value = entryIndex;
|
||||||
questionIndex.value = 0;
|
questionIndex.value = 0;
|
||||||
selectedObject.value = gameStore.board.categories[cIndex].boardEntries[entryIndex];
|
selectedObject.value = gameStore.board.categories[cIndex].boardEntries[entryIndex];
|
||||||
gameStore.acceptAnswers = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setUpListeners(){
|
function setUpListeners(){
|
||||||
gameStore.addSocketListener("boardEntrySelected", ( data ) => {
|
gameStore.addSocketListener("boardEntrySelected", ( data ) => {
|
||||||
|
gameStore.acceptAnswers = false;
|
||||||
showingAnswer.value = false;
|
showingAnswer.value = false;
|
||||||
showingQuestion.value = false;
|
showingQuestion.value = false;
|
||||||
selectBoardEntryWithCategory( data.payload.categoryIndex, data.payload.boardEntryIndex );
|
selectBoardEntryWithCategory( data.payload.categoryIndex, data.payload.boardEntryIndex );
|
||||||
|
|
@ -138,9 +134,11 @@ function setUpListeners(){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
gameStore.addSocketListener("questionRevealed", ( _data ) => {
|
gameStore.addSocketListener("questionRevealed", ( _data ) => {
|
||||||
|
gameStore.acceptAnswers = true;
|
||||||
showingQuestion.value = true;
|
showingQuestion.value = true;
|
||||||
});
|
});
|
||||||
gameStore.addSocketListener("questionHidden", ( _data ) => {
|
gameStore.addSocketListener("questionHidden", ( _data ) => {
|
||||||
|
gameStore.acceptAnswers = false;
|
||||||
showingQuestion.value = false;
|
showingQuestion.value = false;
|
||||||
});
|
});
|
||||||
gameStore.addSocketListener("answerRevealed", ( _data ) => {
|
gameStore.addSocketListener("answerRevealed", ( _data ) => {
|
||||||
|
|
@ -316,7 +314,7 @@ function questionAnsweredRevert( cIndex, bEIndex ){
|
||||||
|
|
||||||
function manualPointsAdjustment( playerId, playerName, points ){
|
function manualPointsAdjustment( playerId, playerName, points ){
|
||||||
let payload = {
|
let payload = {
|
||||||
reopenQuestion: gameStore.acceptAnswers,
|
reopenQuestion: false,
|
||||||
playerId: playerId,
|
playerId: playerId,
|
||||||
playerName: playerName,
|
playerName: playerName,
|
||||||
pointsAdjustment: points,
|
pointsAdjustment: points,
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,8 @@ onBeforeRouteLeave((to, from) => {
|
||||||
</span>
|
</span>
|
||||||
<font-awesome-layers class="ms-1" fixed-width>
|
<font-awesome-layers class="ms-1" fixed-width>
|
||||||
<font-awesome-icon icon="fa-solid fa-square" size="xl" />
|
<font-awesome-icon icon="fa-solid fa-square" size="xl" />
|
||||||
<font-awesome-icon class="text-pink-accent-primary ms-1" icon="fa-solid fa-play" />
|
<font-awesome-icon class="text-pink-accent-primary" icon="fa-solid fa-play" size="sm" />
|
||||||
|
<!-- <font-awesome-icon class="align-middle border-dark rounded" icon="fa-solid fa-play" border /> -->
|
||||||
</font-awesome-layers>
|
</font-awesome-layers>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ function addCategoryButtonClicked(_event){
|
||||||
if( newCategoryName.value === "" ){
|
if( newCategoryName.value === "" ){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let category = new Category( newCategoryName.value, "", [] );
|
let category = new Category( newCategoryName.value, "New Category", [] );
|
||||||
gameCreationStore.$patch((state)=>{
|
gameCreationStore.$patch((state)=>{
|
||||||
state.board.categories.push( category );
|
state.board.categories.push( category );
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -151,12 +151,12 @@ watch(
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="question.questionType === 'imageQuestion'">
|
<div v-if="question.questionType === 'imageQuestion'">
|
||||||
<label class="form-label fs-4 mt-3" for="question-image">Question Image <span style="font-size: 0.5em;">(max. 2MB)</span></label>
|
<label class="form-label fs-4 mt-3" for="question-image">Question Image</label>
|
||||||
<input class="form-control bg-dark-blue" type="file" name="question-image" id="question-image" @change="onQuestionImageChanged( questionIndex, $event )" accept="image/jpeg, image/jpg, image/png, image/gif, image/webp, image/avif">
|
<input class="form-control bg-dark-blue" type="file" name="question-image" id="question-image" @change="onQuestionImageChanged( questionIndex, $event )" accept="image/jpeg, image/jpg, image/png, image/gif, audio/mpeg">
|
||||||
</div>
|
</div>
|
||||||
<div v-if="question.questionType === 'audioQuestion'">
|
<div v-if="question.questionType === 'audioQuestion'">
|
||||||
<label class="form-label fs-4 mt-3" for="question-audio">Question Audio <span style="font-size: 0.5em;">(max. 2MB)</span></label>
|
<label class="form-label fs-4 mt-3" for="question-audio">Question Audio</label>
|
||||||
<input ref="questionImageInput" class="form-control bg-dark-blue" type="file" name="question-audio" id="question-audio" @change="onQuestionAudioChanged( questionIndex, $event )" accept="audio/mpeg">
|
<input ref="questionImageInput" class="form-control bg-dark-blue" type="file" name="question-audio" id="question-audio" @change="onQuestionAudioChanged( questionIndex, $event )" accept="image/jpeg, image/jpg, image/png, image/gif, audio/mpeg">
|
||||||
</div>
|
</div>
|
||||||
<div class="row mt-3">
|
<div class="row mt-3">
|
||||||
<div class="col-xxl-4 col-12 mb-1 px-1">
|
<div class="col-xxl-4 col-12 mb-1 px-1">
|
||||||
|
|
@ -194,8 +194,8 @@ watch(
|
||||||
<input v-model="gameCreationStore.board.categories[props.categoryIndex].boardEntries[props.boardEntryIndex].answer.answerText" class="form-control bg-dark-blue" type="text">
|
<input v-model="gameCreationStore.board.categories[props.categoryIndex].boardEntries[props.boardEntryIndex].answer.answerText" class="form-control bg-dark-blue" type="text">
|
||||||
</div>
|
</div>
|
||||||
<div v-if="gameCreationStore.board.categories[props.categoryIndex].boardEntries[props.boardEntryIndex].answer.answerType === 'imageAnswer'">
|
<div v-if="gameCreationStore.board.categories[props.categoryIndex].boardEntries[props.boardEntryIndex].answer.answerType === 'imageAnswer'">
|
||||||
<label class="form-label fs-4 mt-3" for="answer-image">Answer Image <span style="font-size: 0.5em;">(max. 2MB)</span></label>
|
<label class="form-label fs-4 mt-3" for="answer-image">Answer Image</label>
|
||||||
<input ref="answerImageInput" class="form-control bg-dark-blue" type="file" name="answer-image" id="answer-image" @change="onAnswerImageChanged" accept="image/jpeg, image/jpg, image/png, image/gif, image/webp, image/avif">
|
<input ref="answerImageInput" class="form-control bg-dark-blue" type="file" name="answer-image" id="answer-image" @change="onAnswerImageChanged" accept="image/jpeg, image/jpg, image/png, image/gif, audio/mpeg">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ function stopAudio(){
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="container-fluid h-100 d-flex justify-content-center align-items-center">
|
<div class="container-fluid h-100 d-flex justify-content-center align-items-center">
|
||||||
<div v-show="showingQuestion || props.isHost" class="w-100 h-100">
|
<div v-show="showingQuestion" class="w-100 h-100">
|
||||||
<QuestionView
|
<QuestionView
|
||||||
:cIndex="props.cIndex"
|
:cIndex="props.cIndex"
|
||||||
:bEIndex="props.bEIndex"
|
:bEIndex="props.bEIndex"
|
||||||
|
|
@ -85,7 +85,6 @@ function stopAudio(){
|
||||||
:questions="boardEntry.questions"
|
:questions="boardEntry.questions"
|
||||||
:board="props.board"
|
:board="props.board"
|
||||||
:isHost="props.isHost"
|
:isHost="props.isHost"
|
||||||
:isBeingShown="showingQuestion"
|
|
||||||
@specificQuestionLayerSelected="specificQuestionLayerSelected"
|
@specificQuestionLayerSelected="specificQuestionLayerSelected"
|
||||||
@playAudio="playAudio"
|
@playAudio="playAudio"
|
||||||
@stopAudio="stopAudio"
|
@stopAudio="stopAudio"
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,7 @@ const props = defineProps({
|
||||||
isHost: {
|
isHost: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
},
|
}
|
||||||
isBeingShown: Boolean,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
let emit = defineEmits(["specificQuestionLayerSelected", "playAudio", "stopAudio"])
|
let emit = defineEmits(["specificQuestionLayerSelected", "playAudio", "stopAudio"])
|
||||||
|
|
@ -70,7 +69,7 @@ watch(
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<template v-for="(question, questionIndex) in props.questions" :key="questionIndex">
|
<template v-for="(question, questionIndex) in props.questions" :key="questionIndex">
|
||||||
<div v-if="props.questionIndex === questionIndex" class="d-flex flex-column justify-content-center align-items-center h-100 w-100" :class="[{'opacity-50': props.isHost && !props.isBeingShown}]">
|
<div v-if="props.questionIndex === questionIndex" class="d-flex flex-column justify-content-center align-items-center h-100 w-100">
|
||||||
<h1 class="text-center" :class="[{ 'white-space-show-nl': question.questionType === 'multilineQuestion'}]">
|
<h1 class="text-center" :class="[{ 'white-space-show-nl': question.questionType === 'multilineQuestion'}]">
|
||||||
{{ question.questionText }}
|
{{ question.questionText }}
|
||||||
</h1>
|
</h1>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue