Skip to content

Commit 848f42e

Browse files
committed
Incorporation of UI animation effects for deployment transitions on overview.
The row-expanded-top contains the overview-pod-template and animation-block, which will contain metrics if active, and the overview-deployment-donut. During deployment the previous and current deployment donut charts are grouped and either slideIn from the left or slideDown at mobile widths. At >992 because of space constraints the pod-template and metrics fade out and hidden to allow for both donuts and arrow, and fade in when complete. As the previous-donut scales down and removed it fades out. - Markup structure is controlled by flexbox and 50% widths - Metrics are only beneath a tab when >480 - Networking and builds sections using col-md-6 to match 50% widths above
1 parent a172029 commit 848f42e

File tree

8 files changed

+392
-169
lines changed

8 files changed

+392
-169
lines changed

app/styles/_overview.less

Lines changed: 178 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -141,24 +141,47 @@
141141
.data-toolbar-label {
142142
margin-right: 7px;
143143
}
144-
// TODO: improve on this as it's pretty hacky
145-
.deployment-connector-arrow {
146-
display: inline-block;
147-
font-size: 300%;
148-
line-height: 1;
149-
margin: 50px 0 0 10px;
150-
text-align: center;
151-
.text-muted();
152-
@media (max-width: @screen-xs-max) {
153-
margin: -3px auto 0 -4px;
154-
transform: rotate(90deg);
155-
width: 100%
144+
.deployment-connector {
145+
align-items: flex-end;
146+
display: flex;
147+
flex: 1 1 auto;
148+
justify-content: center;
149+
@media (min-width: @screen-sm-min) {
150+
align-items: center;
151+
justify-content: flex-end;
152+
}
153+
.deployment-connector-arrow {
154+
align-items: center;
155+
display: flex;
156+
font-size: 300%;
157+
.text-muted();
158+
&:before {
159+
content: '\2192';
160+
// center arrow
161+
margin-top: -8px;
162+
padding-right: 0;
163+
}
164+
@media (max-width: @screen-xs-max) {
165+
&:before {
166+
content: '\2191';
167+
// center arrow when donuts stacked
168+
margin-top: -20px;
169+
padding-right: 23px;
170+
}
171+
}
156172
}
157173
}
158174
.expanded-section {
159175
margin-top: 20px;
160176
> .row > [class^=col-] {
161177
margin-bottom: 10px;
178+
@media (min-width: @screen-lg-min) {
179+
// aligns 2nd columns with metrics
180+
&.overview-builds-msg,
181+
&.overview-routes {
182+
padding-left: 0;
183+
}
184+
}
162185
}
163186
h3 {
164187
line-height: 1.4;
@@ -201,6 +224,7 @@
201224
min-width: 19px;
202225
}
203226
.list-pf-details {
227+
.fade-in();
204228
@media (min-width: @screen-sm-min) {
205229
justify-content: flex-end;
206230
}
@@ -225,6 +249,7 @@
225249
}
226250
.list-pf-container {
227251
display: block; // so that .word-break() will work in IE
252+
overflow: hidden; // so animation offsets are hidden
228253
}
229254
.pod-donut {
230255
.text-center();
@@ -320,7 +345,7 @@
320345
max-width: 80px;
321346
}
322347
.usage-label {
323-
// Make sure the labels align with the bottom of the chart.
348+
// Make sure the labels align with the bottom of the chart.
324349
line-height: 1;
325350
margin-bottom: -1px;
326351
}
@@ -346,7 +371,7 @@
346371
margin: 0 20px 10px;
347372
}
348373
overview-list-row + overview-list-row .list-pf-item.active {
349-
// avoid double borders when list-pf-item is open
374+
// avoid double borders when list-pf-item is open
350375
margin-top: -1px;
351376
}
352377
.overview-route {
@@ -396,7 +421,145 @@
396421
margin-top: 10px;
397422
}
398423
}
399-
}
424+
425+
// Deployment animations
426+
@keyframes deploymentSlideDown {
427+
0% {
428+
// align previous and latest donut start position
429+
transform: translateY(-220px);
430+
}
431+
100% {
432+
transform: translateX(0);
433+
}
434+
}
435+
436+
@keyframes deploymentSlideIn {
437+
0% {
438+
// align previous and latest donut start position
439+
transform: translateX(240px);
440+
}
441+
100% {
442+
transform: translateX(0);
443+
}
444+
}
445+
446+
.row-expanded-top {
447+
display: flex;
448+
flex-wrap: wrap;
449+
justify-content: space-between;
450+
@media (min-width: @screen-lg-min) {
451+
// width needed to enable flex to trigger word-break on content
452+
.overview-pod-template,
453+
.overview-animation-block {
454+
width: 50%;
455+
}
456+
}
457+
.overview-pod-template {
458+
flex: 1 1 auto;
459+
.pod-template-block {
460+
// add space so text can't touch metrics or doughnut
461+
padding-right: 10px;
462+
&.ng-leave-prepare {
463+
// prevent previous-donut initial "flash" before animation
464+
display: none;
465+
}
466+
}
467+
}
468+
.overview-animation-block {
469+
display: flex;
470+
flex: 1 1 auto;
471+
justify-content: center;
472+
@media (min-width: @screen-sm-min) {
473+
&.animation-in-progress .overview-deployment-donut .latest-donut {
474+
justify-content: flex-end;
475+
}
476+
}
477+
.overview-deployment-donut {
478+
@media (min-width: @screen-sm-min) {
479+
display: flex;
480+
flex: 1 1 0%;
481+
// prevents resize jump; set height since the donut isn't displayed exactly when expanded-section is rendered
482+
height: 150px;
483+
max-width: 450px;
484+
}
485+
&.ng-enter {
486+
animation: deploymentSlideIn 750ms ease forwards;
487+
}
488+
&.stacked-template {
489+
.overview-pod-template {
490+
min-width: 100%;
491+
}
492+
@media (max-width: @screen-xs-max) {
493+
display: flex;
494+
// stack latest deployment-donut above previous-donut
495+
flex-direction: column-reverse;
496+
&.ng-enter {
497+
animation: deploymentSlideDown 750ms ease forwards;
498+
}
499+
}
500+
}
501+
.previous-donut {
502+
display: flex;
503+
flex: 1 1 auto;
504+
.fade-out();
505+
&.ng-enter-prepare {
506+
// prevent previous-donut initial "flash" before animation
507+
display: none;
508+
}
509+
@media (max-width: @screen-xs-max) {
510+
flex-direction: column;
511+
deployment-donut {
512+
// move arrow to point at latest deployment-donut
513+
order: 2;
514+
}
515+
}
516+
}
517+
.latest-donut {
518+
display: flex;
519+
flex: 1 1 auto;
520+
// right align donut
521+
justify-content: flex-end;
522+
}
523+
}
524+
}
525+
&.metrics-active {
526+
@media (max-width: @screen-md-max) {
527+
flex-direction: column;
528+
.overview-pod-template {
529+
min-width: 100%;
530+
order: 3;
531+
}
532+
}
533+
.overview-animation-block {
534+
@media (min-width: @screen-xs-min) and (max-width: @screen-md-max) {
535+
// add spacing when pod-template-block is stacked beneath
536+
padding-bottom: 20px;
537+
justify-content: space-between;
538+
&.animation-in-progress {
539+
justify-content: center;
540+
}
541+
}
542+
}
543+
.overview-metrics {
544+
display:none;
545+
// display metrics beside donut
546+
@media (min-width: @screen-xs-min) {
547+
display:block;
548+
.fade-in();
549+
.fade-out();
550+
width: 50%;
551+
}
552+
}
553+
}
554+
&.metrics-not-active {
555+
.overview-pod-template {
556+
// prevent wrapping of flex containers
557+
width: 50%;
558+
}
559+
}
560+
}
561+
562+
} // end overview-new
400563

401564
.overview {
402565
font-weight: @overview-font-weight;

app/views/_pod-template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
<div class="icon-wrap">
5757
<span class="fa fa-code" aria-hidden="true"></span>
5858
</div>
59-
<div flex>
59+
<div flex class="word-break">
6060
<span class="pod-template-key">Source:</span>
6161
<span ng-switch="build.spec.source.type">
6262
<span ng-switch-when="Git">

app/views/overview/_builds.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<div ng-if="overviewBuilds.buildConfigs.length" class="expanded-section">
22
<div class="section-title hidden-xs">Builds</div>
33
<div ng-repeat="buildConfig in overviewBuilds.buildConfigs track by (buildConfig | uid)" class="row">
4-
<div class="col-sm-5">
4+
<div class="col-sm-5 col-md-6">
55
<h3 class="mar-top-xs">
66
<a ng-href="{{buildConfig | navigateResourceURL}}">{{buildConfig.metadata.name}}</a>
77
</h3>
88
</div>
9-
<div class="col-sm-7">
9+
<div class="col-sm-7 col-md-6 overview-builds-msg">
1010
<div ng-if="!(overviewBuilds.recentBuildsByBuildConfig[buildConfig.metadata.name] | hashSize)">
1111
No builds.
1212
</div>

0 commit comments

Comments
 (0)