Skip to content

Commit d8c6a7b

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 dd72cfb commit d8c6a7b

File tree

8 files changed

+378
-151
lines changed

8 files changed

+378
-151
lines changed

app/styles/_overview.less

Lines changed: 177 additions & 18 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
}
@@ -345,10 +370,6 @@
345370
border-top: 1px solid @list-pf-border-color;
346371
margin: 0 20px 10px;
347372
}
348-
overview-list-row + overview-list-row .list-pf-item.active {
349-
// avoid double borders when list-pf-item is open
350-
margin-top: -1px;
351-
}
352373
.overview-route {
353374
.word-break();
354375
}
@@ -396,7 +417,145 @@
396417
margin-top: 10px;
397418
}
398419
}
399-
}
420+
421+
// Deployment animations
422+
@keyframes deploymentSlideDown {
423+
0% {
424+
// align previous and latest donut start position
425+
transform: translateY(-220px);
426+
}
427+
100% {
428+
transform: translateX(0);
429+
}
430+
}
431+
432+
@keyframes deploymentSlideIn {
433+
0% {
434+
// align previous and latest donut start position
435+
transform: translateX(240px);
436+
}
437+
100% {
438+
transform: translateX(0);
439+
}
440+
}
441+
442+
.row-expanded-top {
443+
display: flex;
444+
flex-wrap: wrap;
445+
justify-content: space-between;
446+
@media (min-width: @screen-lg-min) {
447+
// width needed to enable flex to trigger word-break on content
448+
.overview-pod-template,
449+
.overview-animation-block {
450+
width: 50%;
451+
}
452+
}
453+
.overview-pod-template {
454+
flex: 1 1 auto;
455+
.pod-template-block {
456+
// add space so text can't touch metrics or doughnut
457+
padding-right: 10px;
458+
&.ng-leave-prepare {
459+
// prevent previous-donut initial "flash" before animation
460+
display: none;
461+
}
462+
}
463+
}
464+
.overview-animation-block {
465+
display: flex;
466+
flex: 1 1 auto;
467+
justify-content: center;
468+
@media (min-width: @screen-sm-min) {
469+
&.animation-in-progress .overview-deployment-donut .latest-donut {
470+
justify-content: flex-end;
471+
}
472+
}
473+
.overview-deployment-donut {
474+
@media (min-width: @screen-sm-min) {
475+
display: flex;
476+
flex: 1 1 0%;
477+
// prevents resize jump; set height since the donut isn't displayed exactly when expanded-section is rendered
478+
height: 150px;
479+
max-width: 450px;
480+
}
481+
&.ng-enter {
482+
animation: deploymentSlideIn 750ms ease forwards;
483+
}
484+
&.stacked-template {
485+
.overview-pod-template {
486+
min-width: 100%;
487+
}
488+
@media (max-width: @screen-xs-max) {
489+
display: flex;
490+
// stack latest deployment-donut above previous-donut
491+
flex-direction: column-reverse;
492+
&.ng-enter {
493+
animation: deploymentSlideDown 750ms ease forwards;
494+
}
495+
}
496+
}
497+
.previous-donut {
498+
display: flex;
499+
flex: 1 1 auto;
500+
.fade-out();
501+
&.ng-enter-prepare {
502+
// prevent previous-donut initial "flash" before animation
503+
display: none;
504+
}
505+
@media (max-width: @screen-xs-max) {
506+
flex-direction: column;
507+
deployment-donut {
508+
// move arrow to point at latest deployment-donut
509+
order: 2;
510+
}
511+
}
512+
}
513+
.latest-donut {
514+
display: flex;
515+
flex: 1 1 auto;
516+
// right align donut
517+
justify-content: flex-end;
518+
}
519+
}
520+
}
521+
&.metrics-active {
522+
@media (max-width: @screen-md-max) {
523+
flex-direction: column;
524+
.overview-pod-template {
525+
min-width: 100%;
526+
order: 3;
527+
}
528+
}
529+
.overview-animation-block {
530+
@media (min-width: @screen-xs-min) and (max-width: @screen-md-max) {
531+
// add spacing when pod-template-block is stacked beneath
532+
padding-bottom: 20px;
533+
justify-content: space-between;
534+
&.animation-in-progress {
535+
justify-content: center;
536+
}
537+
}
538+
}
539+
.overview-metrics {
540+
display:none;
541+
// display metrics beside donut
542+
@media (min-width: @screen-xs-min) {
543+
display:block;
544+
.fade-in();
545+
.fade-out();
546+
width: 50%;
547+
}
548+
}
549+
}
550+
&.metrics-not-active {
551+
.overview-pod-template {
552+
// prevent wrapping of flex containers
553+
width: 50%;
554+
}
555+
}
556+
}
557+
558+
} // end overview-new
400559

401560
.overview {
402561
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)