AWV-3: Adding CSS3 animations to the CINE dialog

This commit is contained in:
Bruno Alves de Faria 2016-09-05 10:20:30 -03:00
parent b1a786071e
commit 6b86b8d2dc
21 changed files with 189 additions and 124 deletions

View File

@ -35,6 +35,7 @@ Package.onUse(function(api) {
// Component styles // Component styles
api.addFiles([ api.addFiles([
'styles/components/dialog.styl',
'styles/components/radio.styl', 'styles/components/radio.styl',
'styles/components/select2.styl', 'styles/components/select2.styl',
'styles/components/selectTree.styl', 'styles/components/selectTree.styl',

View File

@ -1,11 +1,33 @@
@import "{design}/app.styl" @import "{design}/app.styl"
@keyframes zoomIn @keyframes zoomIn
from 0%
transform(scale(0)) transform(scale(0))
to 100%
transform(scale(1)) transform(scale(1))
@keyframes zoomOut
0%
transform(scale(1))
100%
transform(scale(0))
@keyframes slideInDown
0%
opacity: 0
transform(translateY(-100%) scale(0))
100%
opacity: 1
transform(translateY(0) scale(1))
@keyframes slideOutUp
0%
opacity: 1
transform(translateY(0) scale(1))
100%
opacity: 0
transform(translateY(-100%) scale(0))
@keyframes fadeIn @keyframes fadeIn
from from
opacity: 0 opacity: 0

View File

@ -0,0 +1,12 @@
@import "{design}/app"
.viewerDialogs>*
&:not(.dialog-closed):not(.dialog-open)
display: none
&.dialog-closed
animateSlideOutUp()
&.dialog-open
animateSlideInDown()

View File

@ -8,6 +8,18 @@ animateZoomIn()
animationDefaults() animationDefaults()
animation-name: zoomIn animation-name: zoomIn
animateZoomOut()
animationDefaults()
animation-name: zoomOut
animateSlideInDown()
animationDefaults()
animation-name: slideInDown
animateSlideOutUp()
animationDefaults()
animation-name: slideOutUp
animateFadeIn() animateFadeIn()
animationDefaults() animationDefaults()
animation-name: fadeIn animation-name: fadeIn

View File

@ -1,32 +1,69 @@
$themes = {} $themes = {}
$defaultTheme = 'tide' $defaultTheme = 'tide'
// Import the theme variables
@import "./theme-tide.styl" @import "./theme-tide.styl"
@import "./theme-tigerlilly.styl" @import "./theme-tigerlilly.styl"
parseSpaceVars($theme, $value) /*
* Process each theme variable in the given value, splitting it by space
*/
parseSpaceVars($theme, $value, $alpha)
// Split values by space
$valueSplit = split(' ', $value) $valueSplit = split(' ', $value)
// Create an empty list
$list = '' $list = ''
pop($list) pop($list)
// Iterate over split values
for $property in $valueSplit for $property in $valueSplit
if ($theme[$property]) // Try to get the theme with current property key
push($list, $theme[$property]) $val = $theme[$property]
if ($val)
if($val is a 'color')
// Apply given alpha if it's a color
$val = alpha($val, $alpha)
// Push the processed theme variable to the list
push($list, $val)
else else
// Push the property itself if not found in theme variables
push($list, $property) push($list, $property)
// Merge the resulting processed list by joining values back with space
join(' ', $list) join(' ', $list)
parseCommaVars($theme, $value) /*
* Process each theme variable in the given value, splitting it by comma
*/
parseCommaVars($theme, $value, $alpha)
// Split values by comma
$valueSplit = split(',', $value) $valueSplit = split(',', $value)
// Create an empty list
$list = '' $list = ''
pop($list) pop($list)
// Iterate over split values
for $sentence in $valueSplit for $sentence in $valueSplit
push($list, parseSpaceVars($theme, $sentence)) // Procces the values splitting by space
push($list, parseSpaceVars($theme, $sentence, $alpha))
// Merge the resulting processed list by joining values back with comma
unquote(join(',', $list)) unquote(join(',', $list))
theme($property, $value) /*
* Return a processed theme variable or color with alpha
*/
theme($property, $value, $alpha=1)
// Crete the selector for default theme
/ {selector()} / {selector()}
{$property}: parseCommaVars($themes[$defaultTheme], $value) {$property}: parseCommaVars($themes[$defaultTheme], $value, $alpha)
// Create the selector for each registered theme
for $themeName, $theme in $themes for $themeName, $theme in $themes
for $selectorPiece in split(',', selector()) for $selectorPiece in split(',', selector())
// prefix the selector with the body.theme-{themeName} selector
/ body.theme-{$themeName} {$selectorPiece} / body.theme-{$themeName} {$selectorPiece}
{$property}: parseCommaVars($theme, $value) {$property}: parseCommaVars($theme, $value, $alpha)

View File

@ -1,10 +1,9 @@
@import "{design}/app.styl" @import "{design}/app.styl"
.ruleEntryDialog .ruleEntryDialog
theme('background', '$uiGrayDarkest') theme('background', '$uiGrayDarkest', 0.95)
theme('border', '1px solid $uiBorderColor') theme('border', '1px solid $uiBorderColor', 0.95)
theme('color', '$textSecondaryColor') theme('color', '$textSecondaryColor')
display: none
position: absolute position: absolute
top: 0 top: 0
bottom: 0 bottom: 0
@ -17,7 +16,6 @@
padding: 10px padding: 10px
background-color: rgba(255,255,255,1) background-color: rgba(255,255,255,1)
outline: none outline: none
opacity: 0.95
border-radius: 8px border-radius: 8px
.dialogContent .dialogContent

View File

@ -1,10 +1,9 @@
@import "{design}/app.styl" @import "{design}/app.styl"
.settingEntryDialog .settingEntryDialog
theme('border', '1px solid $uiBorderColor') theme('border', '1px solid $uiBorderColor', 0.95)
theme('background', '$uiGrayDarkest') theme('background', '$uiGrayDarkest', 0.95)
theme('color', '$textSecondaryColor') theme('color', '$textSecondaryColor')
display: none
position: absolute position: absolute
top: 0 top: 0
bottom: 0 bottom: 0
@ -16,7 +15,6 @@
margin: auto margin: auto
padding: 10px padding: 10px
outline: none outline: none
opacity: 0.95
border-radius: 8px border-radius: 8px
.dialogContent .dialogContent

View File

@ -1,10 +1,9 @@
@import "{design}/app.styl" @import "{design}/app.styl"
.textEntryDialog .textEntryDialog
theme('border', '1px solid $uiBorderColor') theme('border', '1px solid $uiBorderColor', 0.95)
theme('background', '$uiGrayDarkest') theme('background', '$uiGrayDarkest', 0.95)
theme('color', '$textSecondaryColor') theme('color', '$textSecondaryColor')
display: none
position: absolute position: absolute
top: 0 top: 0
bottom: 0 bottom: 0
@ -16,7 +15,6 @@
margin: auto margin: auto
padding: 10px padding: 10px
outline: none outline: none
opacity: 0.95
border-radius: 8px border-radius: 8px
.dialogContent .dialogContent

View File

@ -1,5 +1,4 @@
#confirmDeleteDialog #confirmDeleteDialog
display: none
position: absolute position: absolute
top: 0 top: 0
bottom: 0 bottom: 0

View File

@ -1,5 +1,4 @@
#lesionLocationDialog, #lesionLocationRelabelDialog #lesionLocationDialog, #lesionLocationRelabelDialog
display: none
position: absolute position: absolute
top: 0 top: 0
bottom: 0 bottom: 0

View File

@ -3,13 +3,12 @@
$borderColor = rgba(77, 99, 110, 0.81) $borderColor = rgba(77, 99, 110, 0.81)
#lesionTableHUD #lesionTableHUD
background: black background: rgba(0, 0, 0, 0.95)
border-radius: 8px border-radius: 8px
border: solid 1px $borderColor; border: solid 1px $borderColor;
bottom: 3px bottom: 3px
height: 326px height: 326px
left: auto left: auto
opacity: 0.95
overflow: hidden overflow: hidden
position: absolute position: absolute
right: 3px right: 3px

View File

@ -1,5 +1,4 @@
#nonTargetLesionLocationDialog, #nonTargetLesionRelabelDialog #nonTargetLesionLocationDialog, #nonTargetLesionRelabelDialog
display: none
position: absolute position: absolute
top: 0 top: 0
bottom: 0 bottom: 0
@ -10,7 +9,7 @@
height: 230px height: 230px
border-radius: 5px border-radius: 5px
padding: 10px 20px 10px 20px padding: 10px 20px 10px 20px
background-color: rgba(255,255,255,1) background-color: white
outline: none outline: none
#selectNonTargetLesionLocation, #selectNonTargetLesionLocationResponse #selectNonTargetLesionLocation, #selectNonTargetLesionLocationResponse

View File

@ -1,5 +1,4 @@
#nonTargetResponseDialog #nonTargetResponseDialog
display: none
position: absolute position: absolute
top: 0 top: 0
bottom: 0 bottom: 0
@ -21,4 +20,3 @@
.locationOK .locationOK
text-align: center text-align: center

View File

@ -1,10 +1,9 @@
@import "{design}/app.styl" @import "{design}/app.styl"
.annotationDialog .annotationDialog
theme('border', '1px solid $uiBorderColor') theme('border', '1px solid $uiBorderColor', 0.95)
theme('background', '$uiGrayDarkest') theme('background', '$uiGrayDarkest', 0.95)
theme('color', '$textSecondaryColor') theme('color', '$textSecondaryColor')
display: none
z-index: 1000 z-index: 1000
position: absolute position: absolute
top: 0 top: 0
@ -16,7 +15,6 @@
padding: 10px padding: 10px
width: 300px width: 300px
height: 140px height: 140px
opacity: 0.95
border-radius: 8px border-radius: 8px
h5, label h5, label

View File

@ -1,23 +1,22 @@
@import "{design}/app.styl" @import "{design}/app.styl"
#cineDialog #cineDialog
theme('border', '1px solid $uiBorderColor') theme('border', '1px solid $uiBorderColor', 0.95)
theme('background', '$uiGrayDarkest') theme('background', '$uiGrayDarkest', 0.95)
theme('color', '$textSecondaryColor') theme('color', '$textSecondaryColor')
border-radius: 8px border-radius: 8px
bottom: 3px bottom: 3px
box-sizing: border-box box-sizing: border-box
display: none
height: 150px height: 150px
left: auto left: 50%
opacity: 0.95
overflow: hidden overflow: hidden
padding: 10px padding: 10px
position: absolute position: absolute
right: 3px right: 3px
top: auto top: 50%
width: 300px width: 300px
z-index: 1000 z-index: 1000
transform(translateX(-50%) translateY(-50%))
h5 h5
font-size: 20px font-size: 20px
@ -28,8 +27,8 @@
font-weight: 400 font-weight: 400
.btn .btn
theme('background', '$uiGrayDarkest')
theme('color', '$textSecondaryColor') theme('color', '$textSecondaryColor')
background-color: transparent
&:hover &:hover
theme('color', '$hoverColor') theme('color', '$hoverColor')

View File

@ -1,5 +1,5 @@
<template name="layoutChooser"> <template name="layoutChooser">
<div id="layoutChooser" class="layoutChooser pull-left dropdown-menu" role="menu"> <div id="layoutChooser" class="layoutChooser">
<table> <table>
<tr> <tr>
<td></td> <td></td>

View File

@ -3,18 +3,16 @@
$borderColor = rgba(77, 99, 110, 0.81) $borderColor = rgba(77, 99, 110, 0.81)
.layoutChooser .layoutChooser
theme('background', '$uiGrayDarkest') theme('background', '$uiGrayDarkest', 0.95)
width: 92px
height: 92px
min-width: 92px // to override bootstrap's dropdown-menu class
min-height: 92px
// theme('background-color', '$primaryBackgroundColor')
opacity: 0.95
border-radius: 8px
border: 1px solid $borderColor; border: 1px solid $borderColor;
border-radius: 8px
&.open height: 92px
display: block min-height: 92px
min-width: 92px // to override bootstrap's dropdown-menu class
padding: 5px 0;
position: absolute;
width: 92px
z-index: 5000
table table
margin: 0 auto margin: 0 auto

View File

@ -145,10 +145,10 @@ Meteor.startup(function() {
} }
}, },
previousDisplaySet() { previousDisplaySet() {
OHIF.viewer.moveDisplaySet(false); OHIF.viewer.moveDisplaySets(false);
}, },
nextDisplaySet() { nextDisplaySet() {
OHIF.viewer.moveDisplaySet(true); OHIF.viewer.moveDisplaySets(true);
}, },
nextPanel: function() { nextPanel: function() {
nextActivePanel(); nextActivePanel();

View File

@ -1,8 +1,6 @@
toggleDialog = function(element) { toggleDialog = element => {
var elem = $(element); const $element = $(element);
if (elem.css('display') === 'none') { const isClosed = $element.hasClass('dialog-open');
elem.css('display', 'block'); $element.toggleClass('dialog-closed', isClosed);
} else { $element.toggleClass('dialog-open', !isClosed);
elem.css('display', 'none');
}
}; };