Transitioned to using SASS and CoffeeScript for assets; using Grunt.js for compiling
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
d899ffe58a
commit
e3a334546f
6
.gitignore
vendored
6
.gitignore
vendored
@ -59,3 +59,9 @@ build-iPhoneSimulator/
|
||||
# Ignore local data
|
||||
data/
|
||||
|
||||
# Node modules
|
||||
node_modules/
|
||||
|
||||
# Compiled assets
|
||||
public/css/
|
||||
public/js/
|
||||
|
65
Gruntfile.js
Normal file
65
Gruntfile.js
Normal file
@ -0,0 +1,65 @@
|
||||
module.exports = function(grunt) {
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
|
||||
sass: {
|
||||
dist: {
|
||||
options: {
|
||||
style: 'compressed'
|
||||
},
|
||||
files: [{
|
||||
expand: true,
|
||||
cwd: 'assets/styles',
|
||||
src: ['**/*.sass'],
|
||||
dest: 'public/css',
|
||||
ext: '.css'
|
||||
}]
|
||||
}
|
||||
},
|
||||
|
||||
coffee: {
|
||||
options: {
|
||||
sourceMap: true,
|
||||
style: 'compressed'
|
||||
},
|
||||
files: {
|
||||
expand: true,
|
||||
flatten: true,
|
||||
cwd: 'assets/scripts',
|
||||
src: ['*.coffee'],
|
||||
dest: 'public/js',
|
||||
ext: '.js'
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
css: {
|
||||
files: ['assets/styles/**/*.sass'],
|
||||
tasks: ['sass'],
|
||||
options: {
|
||||
atBegin: true,
|
||||
spawn: false
|
||||
}
|
||||
},
|
||||
js: {
|
||||
files: ['assets/scripts/**/*.js'],
|
||||
tasks: ['coffee'],
|
||||
options: {
|
||||
atBegin: true,
|
||||
spawn: false
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Load plugins.
|
||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
||||
grunt.loadNpmTasks('grunt-contrib-sass');
|
||||
grunt.loadNpmTasks('grunt-contrib-coffee');
|
||||
|
||||
// CLI tasks.
|
||||
grunt.registerTask('default', ['sass', 'coffee']);
|
||||
|
||||
};
|
2
assets/scripts/edgeville.coffee
Normal file
2
assets/scripts/edgeville.coffee
Normal file
@ -0,0 +1,2 @@
|
||||
$ ->
|
||||
$(document).foundation()
|
54
assets/scripts/reports.coffee
Normal file
54
assets/scripts/reports.coffee
Normal file
@ -0,0 +1,54 @@
|
||||
$(document).ready ->
|
||||
$('#generate_button').on 'click', (e) ->
|
||||
e.preventDefault()
|
||||
$.ajax(
|
||||
method: 'POST'
|
||||
url: '/reports'
|
||||
data:
|
||||
type: $('#report_type').val()
|
||||
choice: $('#report_choice').val()
|
||||
compare: $('#report_compare').val()).done (data) ->
|
||||
benchChart.options.title.text = data.choice
|
||||
benchChart.data.labels = data.names
|
||||
benchChart.data.datasets[0].data = data.avg_results
|
||||
benchChart.data.datasets[1].data = data.min_results
|
||||
benchChart.update()
|
||||
return
|
||||
return
|
||||
return
|
||||
|
||||
benchChart = new Chart(document.getElementById('chart_canvas').getContext('2d'),
|
||||
type: 'horizontalBar'
|
||||
data:
|
||||
labels: []
|
||||
datasets: [
|
||||
{
|
||||
label: 'Average FPS'
|
||||
data: []
|
||||
backgroundColor: 'hotpink'
|
||||
borderColor: '#212121'
|
||||
borderWidth: 1
|
||||
}
|
||||
{
|
||||
label: 'Minimum FPS'
|
||||
data: []
|
||||
backgroundColor: 'cornflowerblue'
|
||||
borderColor: '#212121'
|
||||
borderWidth: 1
|
||||
}
|
||||
]
|
||||
options:
|
||||
title:
|
||||
display: true
|
||||
text: 'N/a'
|
||||
scales: xAxes: [ {
|
||||
display: true
|
||||
ticks: beginAtZero: true
|
||||
} ]
|
||||
animation: onComplete: ->
|
||||
dwnbtn = $('#download_button')
|
||||
dwnbtn.attr 'href', benchChart.toBase64Image()
|
||||
dwnbtn.attr 'download', 'benchmark_chart.png'
|
||||
dwnbtn.attr 'disabled', false
|
||||
return
|
||||
)
|
5
assets/styles/remmington.sass
Normal file
5
assets/styles/remmington.sass
Normal file
@ -0,0 +1,5 @@
|
||||
#main-nav
|
||||
margin-bottom: 15px
|
||||
|
||||
h1.invalid
|
||||
color: red
|
1853
package-lock.json
generated
Normal file
1853
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
28
package.json
Normal file
28
package.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "game-data",
|
||||
"description": "PC hardware benchmarking data logger",
|
||||
"version": "0.1.0",
|
||||
"main": "src/server.rb",
|
||||
"scripts": {
|
||||
"grunt": "grunt"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://git.metaunix.net/BitGoblin/game-data"
|
||||
},
|
||||
"keywords": [
|
||||
"pc",
|
||||
"hardware",
|
||||
"benchmarking"
|
||||
],
|
||||
"author": "Gregory Ballantine <gballantine@bitgoblin.tech>",
|
||||
"license": "BSD-2-Clause",
|
||||
"devDependencies": {
|
||||
"grunt": "^1.6.1",
|
||||
"grunt-cli": "^1.4.3",
|
||||
"grunt-contrib-coffee": "^2.1.0",
|
||||
"grunt-contrib-sass": "^2.0.0",
|
||||
"grunt-contrib-watch": "^1.1.0",
|
||||
"sass": "^1.77.4"
|
||||
}
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
#main-nav{
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
h1.invalid{
|
||||
color: red;
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
$(document).foundation();
|
||||
|
||||
});
|
@ -1,68 +0,0 @@
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#generate_button').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
method: 'POST',
|
||||
url: '/reports',
|
||||
data: {
|
||||
type: $('#report_type').val(),
|
||||
choice: $('#report_choice').val(),
|
||||
compare: $('#report_compare').val(),
|
||||
}
|
||||
}).done(function(data) {
|
||||
benchChart.options.title.text = data.choice;
|
||||
benchChart.data.labels = data.names;
|
||||
benchChart.data.datasets[0].data = data.avg_results;
|
||||
benchChart.data.datasets[1].data = data.min_results;
|
||||
benchChart.update();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
var benchChart = new Chart(document.getElementById('chart_canvas').getContext('2d'), {
|
||||
type: 'horizontalBar',
|
||||
data: {
|
||||
labels: [],
|
||||
datasets: [
|
||||
{
|
||||
label: 'Average FPS',
|
||||
data: [],
|
||||
backgroundColor: 'hotpink',
|
||||
borderColor: '#212121',
|
||||
borderWidth: 1,
|
||||
},
|
||||
{
|
||||
label: 'Minimum FPS',
|
||||
data: [],
|
||||
backgroundColor: 'cornflowerblue',
|
||||
borderColor: '#212121',
|
||||
borderWidth: 1,
|
||||
}
|
||||
]
|
||||
},
|
||||
options: {
|
||||
title: {
|
||||
display: true,
|
||||
text: 'N/a'
|
||||
},
|
||||
scales: {
|
||||
xAxes: [{
|
||||
display: true,
|
||||
ticks: {
|
||||
beginAtZero: true
|
||||
}
|
||||
}]
|
||||
},
|
||||
animation: {
|
||||
onComplete: function() {
|
||||
var dwnbtn = $('#download_button');
|
||||
dwnbtn.attr('href', benchChart.toBase64Image());
|
||||
dwnbtn.attr('download', 'benchmark_chart.png');
|
||||
dwnbtn.attr('disabled', false);
|
||||
},
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user