Skip to content

Commit

Permalink
minor refactoring + added copyright footer
Browse files Browse the repository at this point in the history
  • Loading branch information
SergiyGolov committed Nov 4, 2020
1 parent d8e5dae commit 9966fbb
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
8 changes: 5 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ Vue.component('question', {
})

Vue.component('answer', {
props: ['answer', 'position'],
props: ['answer', 'position', 'title'],
template: `
<b-list-group-item>
<img
title="icon by Aman from the Noun Project"
v-bind:title="answer.title"
height="50px" width="50px"
v-bind:src="answer.position">
{{answer.answer}}
Expand All @@ -48,7 +48,7 @@ var vm = new Vue({
question: undefined,
answers: [{
answer: undefined,
svg_style: undefined,
title: undefined,
position: undefined
}],
category: undefined,
Expand All @@ -75,6 +75,7 @@ function new_game() {
}).catch(err => console.log(err))
}
let positions = ["./img/normal.svg", "./img/side.svg", "./img/upside_down.svg"];
let position_titles = ["Normal", "On the side", "Upside down"];
async function getQuestion() {
fetch(`http://${SERVER_ADRESS}/api/games/${vm.game_id}/question/`, {
method: 'get'
Expand All @@ -85,6 +86,7 @@ async function getQuestion() {
vm.answers = data.answers;
vm.answers.forEach(x => {
x.position = positions[vm.answers.indexOf(x)];
x.title = position_titles[vm.answers.indexOf(x)];
x.answer = decodeHTML(x.answer);
});
vm.question = decodeHTML(data.question);
Expand Down
9 changes: 9 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
</div>
</b-col>
</b-row>
<div class="fluid-container footer">
<p>
<small>
Advanced Software Engineering 2020 project for team "orange"
<br />Team members: Sergiy Goloviatinski, Fabien Vorpe, Ludovic Herbelin, Raphaël Margueron
<br />Icons &copy by Aman from the Noun Project
</small>
</p>
</div>
</b-container>
</div>
<script src="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.js"></script>
Expand Down
8 changes: 7 additions & 1 deletion style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
.selected_answer img{
.selected_answer img {
filter: invert(1);
}

.fluid-container.footer {
position: absolute;
bottom: 0px;
right: 10px;
}

0 comments on commit 9966fbb

Please sign in to comment.