diff --git a/.gitignore b/.gitignore index 8a20151d..85c61e5c 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,6 @@ Icon # Bower components /src/bower_components + +# IDEA +/.idea diff --git a/README.md b/README.md index ac9976ca..46bb4f0b 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,47 @@ ## AngularJS + Bootstrap Responsive Dashboard -This dashboard front-end was created as I was lacking a simple responsive but slick looking dashboard for another project of mine. Other available dashboards were bloated with external plugins and required a lot of hackery/work out of the box - plus the fact many were powered by jQuery. The design takes inspiration from other dashboards around, but the code to create the layout is my own. +This AngularJS driven dashboard was created as there is a lack of free, open-source, readable and bloat free admin templates. Many premium templates require a lot of hackery out of the box - this template is intended to have only the extra features we think are needed to get up and running as quick as possible. -Compatibility/Tested: -* Chrome, Firefox, IE 11+ -* Works best on screen sizes greater than ~335px +> [Live Demo!](http://ehesp.github.io/Responsive-Dashboard) -[Responsive Screenshots](http://ami.responsivedesign.is/?url=http://ehesp.github.io/Responsive-Dashboard/) +[*Want the dashboard without AngularJS and build functionality?*](https://github.com/Ehesp/Responsive-Dashboard/tree/barebones) -Live Example: -* http://ehesp.github.io/Responsive-Dashboard/ - -> jQuery version available on the [jQuery branch](https://github.com/Ehesp/Responsive-Dashboard/tree/jquery)! - -### Usage - -Simply clone, or download and unzip this repository and access the dist folder via your browser. There is only one page on show (`index.html`), and the relevant sections have been commented. - -### Development - -Requirements: +### Requirements * [Node](http://nodejs.org/) * [NPM](http://npmjs.org/) -The project uses: +### Usage + +This project uses the following tools: * [Gulp](http://gulpjs.com/) * [Bower](http://bower.io/) * [AngularJS](https://angularjs.org/) #### Getting Started -Clone the repo, run `npm install` to install all dependencies. -After that you can either: -- Run `node_mopdules/.bin/gulp build` to build the project. -- Run `node_mopdules/.bin/gulp` to start a local webserver with **AWESOME** automatic compilation and [Livereload](http://livereload.com/) (We use [gulp-connect](https://github.com/avevlad/gulp-connect)). +1. Clone the repository and run `npm install` to install all dependencies. This will also run the `bower install` automatically after completion. +2. There are now two `gulp` commands to choose from: +- `node_modules/.bin/gulp build` to build the project. +- `node_modules/.bin/gulp` to start a local webserver with **AWESOME** automatic compilation and [Livereload](http://livereload.com/) (We use [gulp-connect](https://github.com/avevlad/gulp-connect)). +3. The files will now be built into the `dist` directory. + +### Styling -### Stylesheets +Currently, only the sidebar colours can be easily be changed. [LESS](http://lesscss.org/) is used for styling so we take advantage of variables - checkout `src/less/dashboard/variables.less` and change the sidebar base colour, the others will be converted for you. -#### Theme +#### Hamburg Menu -Responsive Dashboard uses [LESS](http://lesscss.org/) for styling so we take advantage of variables to theme the dashboard. Take a look at `src/less/dashboard/variables.less` and customize with your own colors. +By default the responsive dashboard menu on a small sized screen sticks to the left side of the screen. If you wish the menu to have 'native app' menu functionality, where the sidebar overlaps the content from the left and side, simply add the `hamburg` class to the body: -#### Bootstrap + Font Awesome +```HTML + +``` -The grid layout and components are powered by [Bootstrap](http://getbootstrap.com/), also Font Awesome icons are ready to use. +### Bootstrap & Font Awesome -##### Widgets +The grid layout and components are powered by [Bootstrap](http://getbootstrap.com/), also [Font Awesome](http://fontawesome.io/) icons are ready to use. + +#### Widgets A widget is essentially a white container box with some styling, that will expand 100% of it's parent container. To separate these out, I suggest putting them inside a bootstrap grid item, e.g: @@ -60,7 +56,7 @@ Any content can be inside a `widget-body`, which will be padded by default. Thre > If no size is set, the content will expand vertically based on content size. -###### Widget Body +##### Widget Body **Padding** @@ -106,14 +102,44 @@ Usage of the directive: `` or `
` If you want to change it, simply replace the template and CSS! -#### Widget component +##### Widget component -Usage: +Instead of hardcoding the widget HTML directly, AngularJS widget component functionality is ready to use: + +```HTML + + + Widget Link + + + +

Hello world from a widget!

+
+
+``` + +Loading widget ```HTML Hello Universe - -``` \ No newline at end of file + +``` + + +### FAQ + +#### What is the dashboard compatible with? + +The dashboard uses CSS3 for animations along with other style enhancements meaning browsers supporting this (Chrome, Firefox, IE11+) are compatible. +As for smaller screen sizes, the dashboard works best on screen sizes greater than ~335px. + +#### Any screenshots? + +Checkout [am-i-responsive](http://ami.responsivedesign.is/?url=http://ehesp.github.io/Responsive-Dashboard), this doesn't have the Hamburg menu enabled though. + +#### I don't want to use AngularJS or NPM/Bower/Gulp! + +No worries, theres a barebones branch available with the basic HTML and CSS! \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 1f93c0ae..8e431ea9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,58 +1,120 @@ var gulp = require('gulp'), less = require('gulp-less'), - usemin = require('gulp-usemin'), wrap = require('gulp-wrap'), + watch = require('gulp-watch'), + concat = require('gulp-concat'), + insert = require('gulp-insert'), + uglify = require('gulp-uglify'), connect = require('gulp-connect'), - watch = require('gulp-watch'); + cssmin = require('gulp-minify-css'), + templates = require('gulp-angular-templates'); + +var vendors = [ + 'src/bower_components/angular/angular.js', + 'src/bower_components/angular-cookies/angular-cookies.js', + 'src/bower_components/angular-bootstrap/ui-bootstrap.js', + 'src/bower_components/angular-bootstrap/ui-bootstrap-tpls.js', + 'src/bower_components/angular-ui-router/release/angular-ui-router.js', +]; + +var styles = [ + 'src/bower_components/bootstrap/dist/css/bootstrap.css', + 'src/bower_components/font-awesome/css/font-awesome.css', + 'src/less/dashboard/variables.less', + 'src/less/dashboard/mixins.less', + 'src/less/dashboard/main.less', + 'src/less/dashboard/loading.less', + 'src/less/dashboard/content.less', + 'src/less/dashboard/header.less', + 'src/less/dashboard/sidebar.less', + 'src/less/dashboard/widgets.less', + 'src/less/dashboard/hamburg.less', +]; + +var fonts = [ + 'src/fonts/**.*', + 'src/bower_components/bootstrap/dist/fonts/*.{ttf,woff,eof,svg}', + 'src/bower_components/font-awesome/fonts/*.{ttf,woff,eof,svg}' +]; var paths = { - js: 'src/js/**/*.*', - fonts: 'src/fonts/**.*', + js: ['src/js/**/*.*', 'dist/js/templates.js'], + files: ['src/index.html'], images: 'src/img/**/*.*', - styles: 'src/less/**/*.less', - index: 'src/index.html', - bower_fonts: 'src/bower_components/**/*.{ttf,woff,eof,svg}', - bower_components: 'src/bower_components/**/*.*', + templates: 'src/templates/**/*.html', + fonts: fonts, + styles: styles, + vendors: vendors }; +// The name of the Angular module which will be injected into the templates. +var moduleName = 'Dashboard'; -gulp.task('usemin', function() { - return gulp.src(paths.index) - .pipe(usemin({ - less: ['concat', less()], - js: ['concat', wrap('(function(){ \n<%= contents %>\n})();')], - })) - .pipe(gulp.dest('dist/')); +// Minify and copy all 3rd party libs to vendors.min.js +gulp.task('copy-vendors', function() { + return gulp.src(paths.vendors) + .pipe(uglify()) + .pipe(concat('vendors.min.js')) + .pipe(gulp.dest('dist/js')); }); -/** - * Copy assets - */ -gulp.task('copy-assets', ['copy-images', 'copy-fonts', 'copy-bower_fonts']); +// Minify and copy all dashboard script files to dashboard.min.js +gulp.task('copy-scripts', function() { + return gulp.src(paths.js) + .pipe(uglify()) + .pipe(concat('dashboard.min.js')) + .pipe(insert.prepend('\'use strict\';')) + .pipe(gulp.dest('dist/js')); +}); +// Minify and copy all angular templates to templates.min.js +gulp.task('copy-templates', function() { + return gulp.src(paths.templates) + .pipe(templates({module: moduleName})) + .pipe(uglify()) + .pipe(concat('templates.min.js')) + .pipe(insert.prepend('\'use strict\';')) + .pipe(gulp.dest('dist/js')); +}); + +// Copy all static/HTML files to output directory +gulp.task('copy-files', function(){ + return gulp.src(paths.files) + .pipe(gulp.dest('dist')); +}); + +// Copy all images to output directory gulp.task('copy-images', function(){ return gulp.src(paths.images) .pipe(gulp.dest('dist/img')); }); +// Copy all fonts to output directory gulp.task('copy-fonts', function(){ return gulp.src(paths.fonts) .pipe(gulp.dest('dist/fonts')); }); -gulp.task('copy-bower_fonts', function(){ - return gulp.src(paths.bower_fonts) - .pipe(gulp.dest('dist/lib')); +// Compile less styles into dashboard.css +gulp.task('compile-less', function(){ + return gulp.src(paths.styles) + .pipe(less()) + .pipe(cssmin()) + .pipe(concat('dashboard.min.css')) + .pipe(gulp.dest('dist/css')); }); /** * Watch src */ gulp.task('watch', function () { - gulp.watch([paths.styles, paths.index, paths.js], ['usemin']); - gulp.watch([paths.images], ['copy-images']); - gulp.watch([paths.fonts], ['copy-fonts']); - gulp.watch([paths.bower_fonts], ['copy-bower_fonts']); + gulp.watch(paths.vendors, ['copy-vendors']); + gulp.watch(paths.js, ['copy-scripts']); + gulp.watch(paths.templates, ['copy-templates']); + gulp.watch(paths.files, ['copy-files']); + gulp.watch(paths.images, ['copy-images']); + gulp.watch(paths.fonts, ['copy-fonts']); + gulp.watch(paths.styles, ['compile-less']); }); gulp.task('webserver', function() { @@ -68,14 +130,5 @@ gulp.task('livereload', function() { .pipe(connect.reload()); }); -/** - * Compile less - */ -gulp.task('compile-less', function(){ - return gulp.src(paths.styles) - .pipe(less()) - .pipe(gulp.dest('dist/css')); -}); - -gulp.task('build', ['usemin', 'copy-assets']); +gulp.task('build', ['copy-vendors', 'copy-scripts', 'copy-templates', 'copy-files', 'copy-images', 'copy-fonts', 'compile-less']); gulp.task('default', ['build', 'webserver', 'livereload', 'watch']); diff --git a/package.json b/package.json index a7be2666..1b19b4cb 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,14 @@ "name": "Responsive-Dashboard", "version": "0.0.2", "author": "Elliot Hesp", + "repository": { + "type": "git", + "url": "git://github.com/Ehesp/Responsive-Dashboard" + }, "contributors": [ "Leonel Samayoa (http://gobliip.com)", - "Ricardo Pascua " + "Ricardo Pascua ", + "Mathew Goldsborough " ], "scripts": { "postinstall": "node node_modules/bower/bin/bower install" @@ -12,9 +17,13 @@ "devDependencies": { "bower": "^1.3.9", "gulp": "~3.8.0", + "gulp-angular-templates": "^0.0.1", + "gulp-concat": "^2.3.4", "gulp-connect": "^2.0.6", + "gulp-insert": "^0.4.0", "gulp-less": "~1.3.3", - "gulp-usemin": "^0.3.7", + "gulp-minify-css": "^0.3.7", + "gulp-uglify": "^1.0.0", "gulp-watch": "^0.6.9", "gulp-wrap": "^0.3.0" } diff --git a/src/index.html b/src/index.html index 75669835..9524c0d9 100644 --- a/src/index.html +++ b/src/index.html @@ -6,51 +6,7 @@ Dashboard - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -73,16 +29,6 @@ - - - - + + + + diff --git a/src/js/dashboard/directives/widget-body.js b/src/js/dashboard/directives/widget-body.js index 90fef1ed..373cbf8a 100644 --- a/src/js/dashboard/directives/widget-body.js +++ b/src/js/dashboard/directives/widget-body.js @@ -6,10 +6,11 @@ function rdWidgetBody () { var directive = { requires: '^rdWidget', scope: { - loading: '@?' + loading: '@?', + classes: '@?' }, transclude: true, - template: '
', + template: '
', restrict: 'E' }; return directive; diff --git a/src/js/dashboard/routes.js b/src/js/dashboard/routes.js index 109200ed..e7b4af33 100644 --- a/src/js/dashboard/routes.js +++ b/src/js/dashboard/routes.js @@ -1,5 +1,3 @@ -'use strict'; - /** * Route configuration for the Dashboard module. */ diff --git a/src/less/dashboard/header.less b/src/less/dashboard/header.less index 8b1e4ed1..6055ff7b 100644 --- a/src/less/dashboard/header.less +++ b/src/less/dashboard/header.less @@ -72,9 +72,8 @@ right: 23px; display: inline-block; border-right: 7px solid transparent; - border-bottom: 7px solid #ccc; + border-bottom: 7px solid rgba(0, 0, 0, 0.2); border-left: 7px solid transparent; - border-bottom-color: rgba(0, 0, 0, 0.2); content: ''; } ul.dropdown-menu:after { @@ -89,4 +88,4 @@ } } } -} \ No newline at end of file +} diff --git a/src/less/dashboard/main.less b/src/less/dashboard/main.less index 7b3effea..5d08a999 100644 --- a/src/less/dashboard/main.less +++ b/src/less/dashboard/main.less @@ -1,18 +1,20 @@ +@import "variables.less"; + /* Fonts */ @font-face { font-family: 'Montserrat'; - src: url('../../fonts/montserrat-regular-webfont.eot'); - src: url('../../fonts/montserrat-regular-webfont.eot?#iefix') format('embedded-opentype'), - url('../../fonts/montserrat-regular-webfont.woff') format('woff'), - url('../../fonts/montserrat-regular-webfont.ttf') format('truetype'), - url('../../fonts/montserrat-regular-webfont.svg#montserratregular') format('svg'); + src: url('@{fontPath}/montserrat-regular-webfont.eot'); + src: url('@{fontPath}/montserrat-regular-webfont.eot?#iefix') format('embedded-opentype'), + url('@{fontPath}/montserrat-regular-webfont.woff') format('woff'), + url('@{fontPath}/montserrat-regular-webfont.ttf') format('truetype'), + url('@{fontPath}/montserrat-regular-webfont.svg#montserratregular') format('svg'); font-weight: normal; font-style: normal; } @media screen and (-webkit-min-device-pixel-ratio:0) { @font-face { font-family: 'Montserrat'; - src: url('../../fonts/montserrat-regular-webfont.svg') format('svg'); + src: url('@{fontPath}/montserrat-regular-webfont.svg') format('svg'); } select { font-family: Arial, Helvetica, sans-serif; diff --git a/src/less/dashboard/sidebar.less b/src/less/dashboard/sidebar.less index 0c9be998..6eb389e7 100644 --- a/src/less/dashboard/sidebar.less +++ b/src/less/dashboard/sidebar.less @@ -1,3 +1,5 @@ +@import "variables.less"; + /** * Sidebar */ @@ -51,6 +53,7 @@ ul.sidebar { height: 35px; line-height: 40px; text-transform: uppercase; + transition: all .6s ease 0s; } .sidebar-list { height: 40px; @@ -80,7 +83,8 @@ ul.sidebar { ul.sidebar { bottom: 0; .sidebar-title { - display: none; + height: 0px; + text-indent: -100px; } .sidebar-title.separator { display: block; @@ -108,6 +112,7 @@ ul.sidebar { padding: 0; margin: 0; text-align: center; + transition: all .6s ease 0s; div { a { color: #b2bfdc; diff --git a/src/less/dashboard/variables.less b/src/less/dashboard/variables.less index 51992939..5c5677b9 100644 --- a/src/less/dashboard/variables.less +++ b/src/less/dashboard/variables.less @@ -8,3 +8,7 @@ @sidebarHeaderColor: darken(@sidebarBaseColor, 2%); /* Sidebar title text colour */ @sidebarTitleColor: lighten(@sidebarBaseColor, 30%); /*#627cb7*/ + + + /* Font path: */ + @fontPath: '../fonts'; diff --git a/src/less/dashboard/widgets.less b/src/less/dashboard/widgets.less index 38e66195..2e4956f6 100644 --- a/src/less/dashboard/widgets.less +++ b/src/less/dashboard/widgets.less @@ -2,12 +2,11 @@ * Widgets */ .widget { - .box-shadow(0 1px 1px rgba(0, 0, 0, 0.05)); - background: #ffffff; - border: 1px solid transparent; - border-radius: 2px; - border-color: #e9e9e9; - .widget-header, .widget-footer { + box-shadow: 1px 1px rgba(0, 0, 0, 0.05); + background: #ffffff; + border-radius: 2px; + border: 1px solid #e9e9e9; + .widget-header, .widget-footer { .pagination { margin: 0; } diff --git a/src/templates/dashboard.html b/src/templates/dashboard.html new file mode 100644 index 00000000..95b715a9 --- /dev/null +++ b/src/templates/dashboard.html @@ -0,0 +1,169 @@ +
+
+ {{alert.msg}} +
+
+ +
+
+
+
+
+ +
+
+
80
+
Users
+
+
+
+
+
+
+
+
+
+ +
+
+
16
+
Servers
+
+
+
+
+
+
+
+
+
+ +
+
+
225
+
Documents
+
+
+
+
+
+
+
+
+
+
+ +
+
+
62
+
Tickets
+
+
+
+
+
+
+
+
+
+
+ Servers + Manage +
+
+
+ + + + + + + + + + + + + + +
RDVMPC001238.103.133.37
RDVMPC00268.66.63.170
RDVMPC00376.117.212.33
RDPHPC00191.88.224.5
RDESX001197.188.15.93
RDESX002168.85.154.251
RDESX003209.25.191.61
RDESX004252.37.192.235
RDTerminal01139.71.18.207
RDTerminal02136.80.122.212
RDDomainCont01196.80.245.33
+
+
+
+
+
+
+
+ Users + +
+
+
+
+ + + + + + + + + +
IDUsernameRoleAccount
1Joe BloggsSuper AdminAZ23045
2Timothy HernandezAdminAU24783
3Joe BickhamUserAM23781
+
+
+
+
+
+
+
+
+
+ Extras + +
+
+
+ +
+ This is a standard message which will also work the ".no-padding" class, I can also be an error message! +
+ +
+ +
+ UI Bootstrap is included, so you can use tooltips and all of the other native Bootstrap JS components! +
+ +
+ +
+
+ +
+ + +
+
+
I'm an input mask!
+
+
+
+ +
+
+
+
+
+
+ Loading Directive + SpinKit +
+
+ + +
+
+
+
+ \ No newline at end of file diff --git a/src/templates/tables.html b/src/templates/tables.html new file mode 100644 index 00000000..d12ebff4 --- /dev/null +++ b/src/templates/tables.html @@ -0,0 +1,56 @@ +
+
+
+
+ Servers + Manage +
+
+
+ + + + + + + + + + + + + + +
RDVMPC001238.103.133.37
RDVMPC00268.66.63.170
RDVMPC00376.117.212.33
RDPHPC00191.88.224.5
RDESX001197.188.15.93
RDESX002168.85.154.251
RDESX003209.25.191.61
RDESX004252.37.192.235
RDTerminal01139.71.18.207
RDTerminal02136.80.122.212
RDDomainCont01196.80.245.33
+
+
+
+
+
+
+
+ Striped Servers + Manage +
+
+
+ + + + + + + + + + + + + + +
RDVMPC001238.103.133.37
RDVMPC00268.66.63.170
RDVMPC00376.117.212.33
RDPHPC00191.88.224.5
RDESX001197.188.15.93
RDESX002168.85.154.251
RDESX003209.25.191.61
RDESX004252.37.192.235
RDTerminal01139.71.18.207
RDTerminal02136.80.122.212
RDDomainCont01196.80.245.33
+
+
+
+
+
\ No newline at end of file