commit:b45a695b93c2c356e1e68153268d2d1dd3fb7165
author:Chip Black
committer:Chip Black
date:Mon Mar 17 03:40:13 2014 -0500
parents:4143be3ff9d5da0f8cbcec88360194612fc00dda
Snazzy animations for new post widget
diff --git a/www/css/blerg.css b/www/css/blerg.css
line changes: +42/-2
index f9c36ed..1853c78
--- a/www/css/blerg.css
+++ b/www/css/blerg.css
@@ -182,8 +182,8 @@ h1, h2, h3 {
 	position: fixed;
 	top: 0;
 	left: 0;
-	bottom: 0;
-	right: 0;
+	width: 100%;
+	height: 100%;
 	background-color: #1E1E1E;
 }
 
@@ -241,6 +241,46 @@ h1, h2, h3 {
 	padding: 0 12pt;
 }
 
+.blerg-post.enter {
+	animation: blerg-post-enter 750ms;
+}
+
+@keyframes blerg-post-enter {
+	from {
+		transform: translateY(-100%);
+		animation-timing-function: ease-in;
+	}
+
+	60% {
+		transform: translateY(0);
+		animation-timing-function: ease-out;
+	}
+
+	80% {
+		transform: translateY(-2%);
+		animation-timing-function: ease-in;
+	}
+
+	to {
+		transform: translateY(0);
+	}
+}
+
+.blerg-post.exit {
+	animation: blerg-post-exit 500ms forwards;
+}
+
+@keyframes blerg-post-exit {
+	from {
+		transform: translateY(0);
+		animation-timing-function: ease-in;
+	}
+
+	to {
+		transform: translateY(100%);
+	}
+}
+
 .login {
 	display: inline-block;
 	width: 200px;

diff --git a/www/jssrc/blerg/Post.js b/www/jssrc/blerg/Post.js
line changes: +6/-1
index 064db00..f39520e
--- a/www/jssrc/blerg/Post.js
+++ b/www/jssrc/blerg/Post.js
@@ -93,8 +93,13 @@ enyo.kind({
             this.$.toolbar.reflow();
             this.reflow();
         } else {
-            this.hide();
+            setTimeout(function() {
+                this.hide();
+                this.removeClass('exit');
+            }.bind(this), 500);
         }
+        this.addRemoveClass('enter', inEvent.showing);
+        this.addRemoveClass('exit', !inEvent.showing);
     },
     updatePreview: function(inSender, inEvent) {
         this.$.preview.setContent(blerg.Util.blergFormat(this.getData()));