Skip to content

Commit d653640

Browse files
timer added
1 parent 527b56a commit d653640

File tree

6 files changed

+54
-5
lines changed

6 files changed

+54
-5
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Below are the various libraries used in the app.
1717
- [Axios](https://github.com/axios/axios) - Promise based HTTP client for the browser and node.js.
1818
- [Charts](https://vue-chartjs.org/) - vue-chartjs is a wrapper for [Chart.js](https://github.com/chartjs/Chart.js) in Vue.
1919
- [Vue test utils](https://vue-test-utils.vuejs.org) - Vue Test Utils is the official unit testing utility library for Vue.js.
20+
- [Vue circular count down timer](https://github.com/noorzaie/vue-circular-count-down-timer) - Count down timer library for vue.js.
2021

2122
## Installation
2223

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"router": "^1.3.4",
1616
"vue": "^2.6.11",
1717
"vue-chartjs": "^3.5.0",
18+
"vue-circular-count-down-timer": "^1.0.4",
1819
"vue-material": "^1.0.0-beta-11",
1920
"vue-router": "^3.1.5",
2021
"vuetify": "^2.2.14",
@@ -68,6 +69,6 @@
6869
"moduleNameMapper": {
6970
"^@/(.*)$": "<rootDir>/src/$1"
7071
},
71-
"verbose" : false
72+
"verbose": false
7273
}
7374
}

src/components/Question.vue

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
11
<template>
22
<v-container class="quiz-inner-block">
3-
<div class="title-quiz"><h1>Vue.js Quiz</h1></div>
3+
<div class="title-quiz">
4+
<h1 class="title-h1"> Vue.js Quiz</h1>
5+
<circular-count-down-timer
6+
:initial-value="300"
7+
:stroke-width="5"
8+
:seconds-stroke-color="'#6fcbbb'"
9+
:minutes-stroke-color="'#3a96d5'"
10+
:underneath-stroke-color="'lightgrey'"
11+
:size="80"
12+
:padding="4"
13+
:minute-label="'minutes'"
14+
:second-label="'seconds'"
15+
:show-second="true"
16+
:show-minute="true"
17+
:show-hour="false"
18+
:show-negatives="false"
19+
:notify-every="'minute'"
20+
></circular-count-down-timer>
21+
</div>
422
<v-card
523
v-show="showQuestion(index)"
624
v-for="(question, index) in questions"
@@ -61,12 +79,12 @@
6179
</template>
6280

6381
<script>
64-
import {mapState} from 'vuex'
82+
import { mapState } from "vuex";
6583
export default {
6684
name: "Question",
6785
data() {
6886
return {
69-
alert : false,
87+
alert: false,
7088
qIndex: 0,
7189
currentAnswer: null,
7290
};
@@ -104,7 +122,7 @@ export default {
104122
},
105123
},
106124
computed: {
107-
...mapState(["questions", "answers"])
125+
...mapState(["questions", "answers"]),
108126
},
109127
};
110128
</script>
@@ -126,6 +144,11 @@ export default {
126144
margin: 0;
127145
border-top-right-radius: 2px;
128146
border-top-left-radius: 2px;
147+
display:flex;
148+
}
149+
150+
.quiz-inner-block .title-h1 {
151+
flex: 1;
129152
}
130153
.q-chip {
131154
background-color: #c2dfff;

src/main.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import App from "./App.vue";
33
import router from "./router";
44
import vuetify from "./plugins/vuetify";
55
import store from "./store";
6+
import counter from "./plugins/counter";
67

78
Vue.config.productionTip = false;
89

@@ -13,5 +14,6 @@ new Vue({
1314
vuetify,
1415
router,
1516
store,
17+
counter,
1618
render: (h) => h(App),
1719
}).$mount("#app");

src/plugins/counter.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Vue from "vue";
2+
import CircularCountDownTimer from "vue-circular-count-down-timer";
3+
Vue.use(CircularCountDownTimer);
4+
5+
export default {};
6+

0 commit comments

Comments
 (0)