Add shadow when scrolling panel

When the panel is scrolling a shadow is added to better communicate that
the panel moves over the image.
More details: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/193

Change-Id: I06866a3a034977002b98658a3d09b5421b583ee7
This commit is contained in:
Pau Giner 2014-09-23 17:37:41 +02:00
parent 43d88d8d30
commit 956cd4b47e
2 changed files with 7 additions and 0 deletions

View file

@ -225,6 +225,7 @@
var panelIsOpen = !!$.scrollTo().scrollTop();
this.$dragIcon.toggleClass( 'panel-open', panelIsOpen );
this.$container.toggleClass( 'panel-open', panelIsOpen );
if ( panelIsOpen && !this.panelIsOpen ) { // just opened (this is skipped in some cases, see the $dragIcon click handler)
this.$container.trigger( 'mmv-metadata-open' );

View file

@ -9,6 +9,8 @@
.mw-mmv-post-image {
.animation( mw-mmv-appear-animation 0.5s ease 0s 1 normal forwards );
transition: box-shadow 0.25s;
&.invite {
.animation( mw-mmv-invite-animation 0.9s ease 0.2s 1 normal forwards );
}
@ -16,6 +18,10 @@
.jq-fullscreened & {
.animation(none);
}
&.panel-open {
box-shadow: 0 -4px 0px rgba(0,0,0,0.2);
}
}
.mw-mmv-appear-animation() {