Skip to content

Commit 6ccb258

Browse files
authored
Merge pull request #50 from encap/dev
Dev
2 parents 412dddd + 74426dc commit 6ccb258

File tree

6 files changed

+21
-59
lines changed

6 files changed

+21
-59
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "1.0.0",
44
"private": true,
55
"scripts": {
6-
"serve": "vue-cli-service serve --port 80",
6+
"serve": "vue-cli-service serve",
77
"dev": "concurrently -r \"npm:serve\" \"npm:server\"",
88
"vue-ui": "vue ui",
99
"build": "vue-cli-service build",

public/exampleResults.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1912,7 +1912,7 @@
19121912
"oneThirdTime": 34888,
19131913
"lastThirdCharsCount": 53,
19141914
"lastThirdStartTime": 61622,
1915-
"timeFromFirstInput": 76782,
1915+
"timeFromFirstInput": 61782,
19161916
"codeLength": 216,
19171917
"correctLines": 12,
19181918
"mode": 0,

src/components/charts/BarChart.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ export default {
3939
data[score.name].value = score.value;
4040
});
4141
42-
if (Math.round(data.player.value) === data.avg.value || Math.round(data.player.value) === data.best.value) {
43-
data.barWidth = true;
44-
}
45-
4642
return data;
4743
},
4844
options() {
@@ -65,7 +61,6 @@ export default {
6561
},
6662
}],
6763
yAxes: [{
68-
barPercentage: 0.7,
6964
gridLines: {
7065
display: false,
7166
},
@@ -74,7 +69,7 @@ export default {
7469
plugins: {
7570
datalabels: {
7671
color: '#fff',
77-
align: 'end',
72+
align: 'start',
7873
anchor: 'end',
7974
formatter(value) {
8075
return `${value} wpm`;
@@ -88,7 +83,7 @@ export default {
8883
return {
8984
datasets: [
9085
{
91-
barPercentage: this.chartData.barWidth ? 0.75 : 0.9,
86+
barPercentage: 0.75,
9287
label: 'You',
9388
backgroundColor: this.backgroundColors[this.chartData.player.order],
9489
data: [this.chartData.player.value],
@@ -99,12 +94,14 @@ export default {
9994
backgroundColor: this.backgroundColors[this.chartData.avg.order],
10095
data: [this.chartData.avg.value],
10196
order: this.chartData.avg.order,
97+
barPercentage: 0.7,
10298
},
10399
{
104100
label: 'Best',
105101
backgroundColor: this.backgroundColors[this.chartData.best.order],
106102
data: [this.chartData.best.value],
107103
order: this.chartData.best.order,
104+
barPercentage: 0.7,
108105
},
109106
],
110107
};

src/views/Contribute.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<main class="middle">
44
<h1>Contribute</h1>
55

6-
<article :class="{shrink: expand || sent}">
6+
<article :class="{shrink: expand}">
77
<p>
88
Our mission is to ensure the diversity and quality of the code on which our users practice and test their skills. We do our best to ensure that there are no errors in the code but with that many languages and technologies available on CodeRush, it is not possible without your help.
99
</p>
@@ -49,6 +49,7 @@
4949
class="editor-wrapper"
5050
@expand="(value) => expand = value"
5151
/>
52+
5253
<p v-show="sent">
5354
Thank you for your contribution. Your submission will soon be listed <a href="https://github.com/encap/coderush/pulls">here</a>.
5455
</p>
@@ -166,7 +167,6 @@ export default {
166167
167168
.middle
168169
display: flex
169-
justify-content: space-between
170170
flex-basis: 0
171171
flex-direction: column
172172
flex-grow: 2
@@ -250,7 +250,7 @@ article p
250250
display: flex
251251
align-items: flex-end
252252
justify-content: space-between
253-
margin-top: 1em
253+
margin-top: auto
254254
margin-bottom: $thin-gap
255255
256256
.button
@@ -270,7 +270,7 @@ article p
270270
&:first-child
271271
margin-right: $gap
272272
273-
&:hover
273+
&:hover:not(:disabled)
274274
background-color: $purple
275275
276276
&:active

src/views/Results.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
Time
2727
</p>
2828
<h2 class="value">
29-
{{ minutes ? `${minutes}:${seconds}` : `${seconds}s` }}
29+
{{ minutes ? `${minutes}:${('0' + seconds).slice(-2)}` : `${seconds}s` }}
3030
</h2>
3131
</div>
3232
<div v-else class="characters">

vue.config.js

Lines changed: 10 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
const path = require('path');
22
const PrerenderSPAPlugin = require('prerender-spa-plugin');
33

4-
// const zopfli = require('@gfx/zopfli');
5-
64
// const fs = require('fs');
75
// const StatsPlugin = require('stats-webpack-plugin');
8-
6+
const plugins = [
7+
// new StatsPlugin('stats.json')
8+
];
9+
if (process.env.VUE_APP_API_URL === 'https://api.coderush.xyz') {
10+
plugins.push(new PrerenderSPAPlugin({
11+
staticDir: path.join(__dirname, 'dist'),
12+
routes: ['/', '/about', '/contribute'],
13+
}));
14+
}
915

1016
module.exports = {
1117
productionSourceMap: false,
@@ -19,47 +25,16 @@ module.exports = {
1925
},
2026
},
2127
sourceMap: false,
22-
// extract: {
23-
// filename: 'css/[name].css',
24-
// chunkFilename: 'css/[name].css',
25-
// },
26-
},
27-
pluginOptions: {
28-
// compression: {
29-
// zopfli: {
30-
// filename: '[path]',
31-
// include: /\.js$|\.css$/,
32-
// exclude: /cm\/|code\//,
33-
// compressionOptions: {
34-
// numiterations: 15,
35-
// },
36-
// algorithm(input, compressionOptions, callback) {
37-
// return zopfli.gzip(input, compressionOptions, callback);
38-
// },
39-
// },
40-
// },
4128
},
4229
configureWebpack: {
43-
// output: {
44-
// filename: 'js/[name].js',
45-
// chunkFilename: 'js/[name].js',
46-
// },
4730
resolve: {
4831
alias: {
4932
// bundle size optimatization
5033
moment: 'moment/src/moment',
5134
'chart.js$': 'chart.js/dist/Chart.min.js',
5235
},
5336
},
54-
plugins: [
55-
// new StatsPlugin('stats.json'),
56-
process.env.NODE_ENV ? new PrerenderSPAPlugin({
57-
// Required - The path to the webpack-outputted app to prerender.
58-
staticDir: path.join(__dirname, 'dist'),
59-
// Required - Routes to render.
60-
routes: ['/', '/about', '/contribute'],
61-
}) : null,
62-
],
37+
plugins,
6338
},
6439
chainWebpack(config) {
6540
config.optimization.minimizer('terser').tap((args) => {
@@ -82,16 +57,6 @@ module.exports = {
8257
headers: {
8358
'Access-Control-Allow-Origin': '*',
8459
},
85-
// before(app) {
86-
// app.use((req, res, next) => {
87-
// if (req.path.slice(0, 4) === '/cm/') {
88-
// res.header('content-encoding', 'gzip');
89-
// }
90-
// next();
91-
// });
92-
// },
93-
94-
// compress: false,
9560
// https: {
9661
// key: fs.readFileSync(`${process.env.HOME}/localhost.key`),
9762
// cert: fs.readFileSync(`${process.env.HOME}/localhost.crt`),

0 commit comments

Comments
 (0)