Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

Commit

Permalink
feat(footer): add w11k-footer directive
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Burgmer committed Mar 3, 2015
1 parent c34da3d commit d16095f
Show file tree
Hide file tree
Showing 9 changed files with 96 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: [{
Expand Down Expand Up @@ -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'
]
}
}
},
Expand Down
6 changes: 6 additions & 0 deletions src/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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
* * * * * * * * * * * * * * * * * * * */
Expand Down
20 changes: 20 additions & 0 deletions src/footer/_footer.scss
Original file line number Diff line number Diff line change
@@ -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;
}
}
25 changes: 25 additions & 0 deletions src/footer/footer.js
Original file line number Diff line number Diff line change
@@ -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);
}
};
}]);
20 changes: 20 additions & 0 deletions src/footer/footer.less
Original file line number Diff line number Diff line change
@@ -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;
}
}
7 changes: 7 additions & 0 deletions src/footer/footer.tpl.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="w11k-footer">
<div class="row">
<div class="col-sm-3 footer-left"></div>
<div class="col-sm-6 footer-middle"></div>
<div class="col-sm-3 footer-right"></div>
</div>
</div>
6 changes: 6 additions & 0 deletions src/variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -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
* * * * * * * * * * * * * * * * * * * */
Expand Down
1 change: 1 addition & 0 deletions src/w11k-slides.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

@import "variables";

@import "footer/footer";
@import "corner-ribbon/corner-ribbon";
@import "open-once/open-once";
@import "prettyprint/prettyprint";
Expand Down
1 change: 1 addition & 0 deletions src/w11k-slides.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit d16095f

Please sign in to comment.