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

Commit

Permalink
bound about menu to body
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Paige committed Apr 30, 2015
1 parent c27ba5a commit c15353d
Show file tree
Hide file tree
Showing 7 changed files with 365 additions and 153 deletions.
1 change: 1 addition & 0 deletions app/index.html
Expand Up @@ -69,6 +69,7 @@
<script src="scripts/services/errorservice.js"></script>
<script src="scripts/services/errorinterceptor.js"></script>
<script src="scripts/directives/notification.js"></script>
<script src="scripts/directives/about.js"></script>
<!-- endbuild -->

</body>
Expand Down
82 changes: 82 additions & 0 deletions app/scripts/directives/about.js
@@ -0,0 +1,82 @@
'use strict';

/**
* @ngdoc directive
* @name iLayers.directive:about
* @description
* # about
*/
angular.module('iLayers')
.directive('about', ['$timeout', '$templateRequest', function ($timeout, $templateRequest) {
return {
restrict: 'A',
scope: {},
controller: function($scope) {
$templateRequest('views/about-menu.html');
},
link: function postLink(scope, element, attrs) {
var position = element.position(),
height = element.outerHeight(),
speed = 400;

scope.bindEvents = function(menu) {
menu.bind('mouseover', function() {
scope.menuActive = true;
});
menu.bind('mouseleave', function() {
scope.menuActive = false;
scope.hideMenu(menu);
});
};

scope.unbindEvents = function(menu) {
menu.unbind('mouseover');
menu.unbind('mouseleave');
};

scope.showMenu = function(aboutMenu) {
if (!scope.menuVisible) {
scope.bindEvents(aboutMenu);

aboutMenu.css('display', 'block');
aboutMenu.animate({
'top': (position.top + height) + 'px',
'opacity': 1
}, speed, function() {
scope.menuVisible = true;
});
}
};

scope.hideMenu = function(aboutMenu) {
if (scope.menuVisible && !scope.menuActive) {
scope.unbindEvents(aboutMenu);

aboutMenu.animate({
'top': (position.top + 90) + 'px',
'opacity': 0
}, speed, function() {
aboutMenu.css('display','none');
scope.menuVisible = false;
});
}
};

scope.menuVisible = false;
scope.menuActive = false;

element.bind('mouseover', function() {
var aboutMenu = $('ul.about');
scope.showMenu(aboutMenu);
});

element.bind('mouseleave', function() {
var aboutMenu = $('ul.about');
$timeout(function() {
scope.hideMenu(aboutMenu);
}, 120);
});
}

};
}]);
198 changes: 95 additions & 103 deletions app/styles/ctl.scss
Expand Up @@ -7,7 +7,7 @@ nav.ctl {
margin-bottom: 0;
padding-top: 20px;

> ul > li {
ul > li {
font-size: 0.8em;
font-weight: normal;
float: left;
Expand Down Expand Up @@ -36,123 +36,115 @@ nav.ctl {
@extend .icon-thin-arrow-down;
@include icon-light-grey;
}
}
}

&:hover {
&:after {
@include icon-grey;
}
ul.about {
z-index: 300;
display: none;
font-size: 0.8em;
font-weight: normal;
position: absolute;
top: 100px;
left: 190px;
opacity: 1;
width: 722px;
margin: 0;
padding: 0;

.logo {
width: 190px;
border: none;
padding: 0;
margin: 0;
}

> a {
color: #666;
}
li {
padding: 20px;
background: #fff;
overflow: auto;
border: 1px solid #999;
border-top: none;
color: #777;

> ul {
display: block;
top: 100%;
opacity: 1;
z-index: 100;
transition: opacity 0.4s, top 0.4s;
}
.strong {
font-weight: bold;
}
}

p {
padding-top: 20px;
line-height: 1.25em;

> a {
color: #9c9c9c;
text-decoration: none;
}
}

> ul {
transition: opacity 0.3s, top 0.4s;
position: absolute;
z-index:-1;
top: 170%;
opacity: 0;
width: 722px;
margin: 0;
padding: 0;

li {
padding: 20px;
background: #fff;
overflow: auto;
border: 1px solid #999;
border-top: none;
color: #777;

.strong {
font-weight: bold;
}
}
hr {
display: block; height: 1px;
border: 0; border-top: 1px solid #ccc;
margin: 1.1em 0;
padding: 0;
}

a.project {
display: inline-block;
background: #f1f1f1;
margin-right: 10px;
color: inherit;
text-decoration: none;
float: left;

&:hover {
background: #e1e1e1;

mark {
text-decoration: none;
}
}

&:nth-last-of-type(1) {
margin-right: 0;
}
article {
width: 220px;
padding: 20px;

p {
padding-top: 20px;
line-height: 1.25em;
font-size: 0.9em;
padding: 0;
}

mark {
background: none;
text-decoration: underline;
}

h4 {
margin: 20px 0 0 0;
color: #444;
}

.pmx-logo {
background: url(../images/panamax_id_02.svg) -125px -290px no-repeat;
background-size: 245%;
padding: 0;
padding-bottom: 50px;
}

.lorry-logo {
background: url(../images/logo_lorry.svg) -5px -5px no-repeat;
padding: 0;
padding-bottom: 50px;
}

hr {
display: block; height: 1px;
border: 0; border-top: 1px solid #ccc;
margin: 1.1em 0;
.dray-logo {
background: url(../images/logo_dray_long.svg) -190px -285px no-repeat;
background-size: 260%;
padding: 0;
}

a.project {
display: inline-block;
background: #f1f1f1;
margin-right: 10px;
color: inherit;
text-decoration: none;
float: left;

&:hover {
background: #e1e1e1;

mark {
text-decoration: none;
}
}

&:nth-last-of-type(1) {
margin-right: 0;
}
article {
width: 220px;
padding: 20px;

p {
font-size: 0.9em;
padding: 0;
}

mark {
background: none;
text-decoration: underline;
}

h4 {
margin: 20px 0 0 0;
color: #444;
}

.pmx-logo {
background: url(../images/panamax_id_02.svg) -125px -290px no-repeat;
background-size: 245%;
padding: 0;
padding-bottom: 50px;
}

.lorry-logo {
background: url(../images/logo_lorry.svg) -5px -5px no-repeat;
padding: 0;
padding-bottom: 50px;
}

.dray-logo {
background: url(../images/logo_dray_long.svg) -190px -285px no-repeat;
background-size: 260%;
padding: 0;
padding-bottom: 50px;
}
}
padding-bottom: 50px;
}
}
}
Expand Down
49 changes: 49 additions & 0 deletions app/views/about-menu.html
@@ -0,0 +1,49 @@
<ul class="about">
<li>
<img class="logo" src="images/logo_image_layers.svg">
<p class="clear strong">
ImageLayers.io, is a CenturyLink Cloud hosted utility and CenturyLink Labs open-source project that provides a visualization in the browser of user specified Docker Images and their layers. This visualization provides key information on the composition of a Docker Image and any commonalities between them. ImageLayers.io allows Docker users to easily discover best practices for image construction, and aid in determining which images are most appropriate to use in their specific use cases.
</p>
<p>
<a href="https://github.com/CenturyLinkLabs/imagelayers-graph" target="_blank">ImageLayers UI on GitHub</a>
<a href="https://github.com/CenturyLinkLabs/imagelayers" target="_blank">ImageLayers API on GitHub</a>
</p>
<hr>
<h3>Other Projects from CenturyLink Labs</h3>
<a class="project" href="http://panamax.io" target="_blank">
<article>
<div class="pmx-logo"></div>
<h4>Panamax</h4>
<p>
Docker Management for Humans<br>
<mark>panamax.io</mark>
</p>
</article>
</a>
<a class="project" href="http://lorry.io" target="_blank">
<article>
<div class="lorry-logo"></div>
<h4>Lorry.io</h4>
<p>
Compose YML validator.<br>
<mark>lorry.io</mark>
</p>
</article>
</a>
<a class="project" href="http://dray.it" target="_blank">
<article>
<div class="dray-logo"></div>
<h4>Dray</h4>
<p>
Docker Workflow Engine.<br>
<mark>dray.it</mark>
</p>
</article>
</a>
<div class="clear"></div>
<hr>
<h4>
Read tutorials and articles about these tools at <a href="http://www.centurylinklabs.com" target="_blank">centurylinklabs.com</a>
</h4>
</li>
</ul>

0 comments on commit c15353d

Please sign in to comment.