diff --git a/Gruntfile.js b/Gruntfile.js index 08f2faa..40f4fc0 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -74,8 +74,12 @@ module.exports = function (grunt) { }, copy: { template: { - src: 'src/w11k-slides.tpl.html', - dest: 'dist/w11k-slides.tpl.html' + src: 'src/slides/slides.tpl.html', + dest: 'dist/slides/slides.tpl.html' + }, + footer: { + src: 'src/footer/footer.tpl.html', + dest: 'dist/footer/footer.tpl.html' }, sass: { files: [{ @@ -105,7 +109,10 @@ module.exports = function (grunt) { } }, files: { - 'dist/w11k-slides.tpl.js': 'src/slides/slides.tpl.html' + 'dist/w11k-slides.tpl.js': [ + 'src/slides/slides.tpl.html', + 'src/footer/footer.tpl.html' + ] } } }, diff --git a/src/_variables.scss b/src/_variables.scss index c96d511..0ccbe5f 100644 --- a/src/_variables.scss +++ b/src/_variables.scss @@ -19,6 +19,12 @@ $w11k-slides-slide-regular-header-logo: none !default; $w11k-slides-blockquote-border-color: #999 !default; $w11k-slides-blockquote-cize-text-color: #999 !default; +/* * * * * * * * * * * * * * * * * * * * + * Footer + * * * * * * * * * * * * * * * * * * * */ + +$w11k-slides-footer-text-color: #999 !default; + /* * * * * * * * * * * * * * * * * * * * * Open Once * * * * * * * * * * * * * * * * * * * */ diff --git a/src/footer/_footer.scss b/src/footer/_footer.scss new file mode 100644 index 0000000..5939322 --- /dev/null +++ b/src/footer/_footer.scss @@ -0,0 +1,20 @@ +.w11k-footer { + position: absolute; + bottom: 1em; + right: 1.5em; + left: 1.5em; + font-size: 0.8em; + color: $w11k-slides-footer-text-color; + + .footer-left { + text-align: left; + } + + .footer-middle { + text-align: center; + } + + .footer-right { + text-align: right; + } +} diff --git a/src/footer/footer.js b/src/footer/footer.js new file mode 100644 index 0000000..2f79417 --- /dev/null +++ b/src/footer/footer.js @@ -0,0 +1,25 @@ +'use strict'; + +angular.module('w11k.slides').directive('w11kFooter', ['slidesConfig', function (slidesConfig) { + return { + restrict: 'EA', + templateUrl: slidesConfig.footer.templateUrl || 'footer/footer.tpl.html', + replace: true, + link: function (scope, element, attrs) { + var left = element[0].querySelector('.footer-left'); + var middle = element[0].querySelector('.footer-middle'); + var right = element[0].querySelector('.footer-right'); + + function setContent(element, expression) { + var content = scope.$eval(expression); + if (angular.isDefined(content)) { + element.innerHTML = content; + } + } + + setContent(left, attrs.left || slidesConfig.footer.left); + setContent(middle, attrs.middle || slidesConfig.footer.middle); + setContent(right, attrs.right || slidesConfig.footer.right); + } + }; +}]); diff --git a/src/footer/footer.less b/src/footer/footer.less new file mode 100644 index 0000000..0724097 --- /dev/null +++ b/src/footer/footer.less @@ -0,0 +1,20 @@ +.w11k-footer { + position: absolute; + bottom: 1em; + right: 1.5em; + left: 1.5em; + font-size: 0.8em; + color: @w11k-slides-footer-text-color; + + .footer-left { + text-align: left; + } + + .footer-middle { + text-align: center; + } + + .footer-right { + text-align: right; + } +} diff --git a/src/footer/footer.tpl.html b/src/footer/footer.tpl.html new file mode 100644 index 0000000..d266f6f --- /dev/null +++ b/src/footer/footer.tpl.html @@ -0,0 +1,7 @@ +
diff --git a/src/variables.less b/src/variables.less index c71da77..8f549a0 100644 --- a/src/variables.less +++ b/src/variables.less @@ -19,6 +19,12 @@ @w11k-slides-blockquote-border-color: #999; @w11k-slides-blockquote-cize-text-color: #999; +/* * * * * * * * * * * * * * * * * * * * + * Footer + * * * * * * * * * * * * * * * * * * * */ + +@w11k-slides-footer-text-color: #999; + /* * * * * * * * * * * * * * * * * * * * * Open Once * * * * * * * * * * * * * * * * * * * */ diff --git a/src/w11k-slides.less b/src/w11k-slides.less index cf2dd58..7fab765 100644 --- a/src/w11k-slides.less +++ b/src/w11k-slides.less @@ -2,6 +2,7 @@ @import "variables"; +@import "footer/footer"; @import "corner-ribbon/corner-ribbon"; @import "open-once/open-once"; @import "prettyprint/prettyprint"; diff --git a/src/w11k-slides.scss b/src/w11k-slides.scss index 3ed6a7c..df64410 100644 --- a/src/w11k-slides.scss +++ b/src/w11k-slides.scss @@ -3,6 +3,7 @@ $theCodeCampus_orange: #ed5502; @import "variables"; +@import "footer/footer"; @import "corner-ribbon/corner-ribbon"; @import "open-once/open-once"; @import "prettyprint/prettyprint";