Migrated to SASS and CoffeeScript for stylesheets and scripting

This commit is contained in:
Gregory Ballantine 2024-06-06 23:24:28 -04:00
parent facc252d3b
commit 584a6087ba
7 changed files with 1485 additions and 121 deletions

4
.gitignore vendored
View File

@ -132,3 +132,7 @@ dist
# Local data files
data/*
# Compiled stylesheets and javascripts
public/css/
public/js/

65
Gruntfile.js Normal file
View 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']);
};

View File

@ -0,0 +1,2 @@
$ ->
console.log('Ready.')

71
assets/styles/eye.sass Normal file
View File

@ -0,0 +1,71 @@
html,
body
width: 100%
height: 100%
margin: 0
padding: 0
body
height: auto
min-height: 100%
box-sizing: border-box
padding-top: 80px
padding-bottom: 80px
background: #eee
a
color: teal
transition: all 200ms ease-in-out
&:hover
color: #007070
textarea
max-width: 100%
min-width: 100%
height: 100px
.container
max-width: 1024px
select[multiple]
min-height: 125px
#main-nav
position: fixed
top: 0
left: 0
width: 100%
height: 64px
background: teal
color: white
z-index: 20
ul
list-style: none
display: inline-block
li
display: inline-block
margin-left: 15px
h4
display: inline-block
margin-left: 25px
line-height: 64px
a
color: white
font-size: 2.25rem
line-height: 64px
transition: all 200ms ease-in-out
&:hover
color: #eee
font-size: 2.5rem
#main-content
padding: 14px 20px
background: white
border-radius: 8px
z-index: 10
#main-footer
position: fixed
bottom: 0
left: 0
width: 100%
height: 64px
p
margin-bottom: 5px
text-align: center
#result_form
margin-bottom: 0
*
margin-bottom: 0

1337
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,4 @@
{
"dependencies": {
"express": "^4.18.2",
"express-session": "^1.17.3",
"sequelize": "^6.35.1",
"sqlite3": "^5.1.6",
"twig": "^1.16.0"
},
"name": "leviathan",
"description": "PC hardware benchmarking data logger",
"version": "0.1.0",
@ -13,7 +6,8 @@
"scripts": {
"start": "node index.js",
"dev": "nodemon ./index.js",
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"grunt": "grunt"
},
"repository": {
"type": "git",
@ -26,7 +20,20 @@
],
"author": "Gregory Ballantine <gballantine@metaunix.net>",
"license": "BSD-2-Clause",
"dependencies": {
"express": "^4.18.2",
"express-session": "^1.17.3",
"sequelize": "^6.35.1",
"sqlite3": "^5.1.6",
"twig": "^1.16.0"
},
"devDependencies": {
"nodemon": "^3.0.1"
"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",
"nodemon": "^3.0.1",
"sass": "^1.77.4"
}
}

View File

@ -1,102 +0,0 @@
html,
body{
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
body{
height: auto;
min-height: 100%;
box-sizing: border-box;
padding-top: 80px;
padding-bottom: 80px;
background: #eee;
}
a{
color: teal;
transition: all 200ms ease-in-out;
}
a:hover{
color: #007070;
}
textarea{
max-width: 100%;
min-width: 100%;
height: 100px;
}
.container{
max-width: 1024px;
}
select[multiple]{
min-height: 125px;
}
#main-nav{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 64px;
background: teal;
color: white;
z-index: 20;
}
#main-nav ul{
list-style: none;
display: inline-block;
}
#main-nav h4{
display: inline-block;
margin-left: 25px;
line-height: 64px;
}
#main-nav ul li{
display: inline-block;
margin-left: 15px;
}
#main-nav a{
color: white;
font-size: 2.25rem;
line-height: 64px;
transition: all 200ms ease-in-out;
}
#main-nav a:hover{
color: #eee;
font-size: 2.5rem;
}
#main-content{
padding: 14px 20px;
background: white;
border-radius: 8px;
z-index: 10;
}
#main-footer{
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 64px;
}
#main-footer p{
margin-bottom: 5px;
text-align: center;
}
#result_form{
margin-bottom: 0;
}
#result_form *{
margin-bottom: 0;
}