Explorar o código

add animation to .comment-form-comment

Yuki Takei %!s(int64=8) %!d(string=hai) anos
pai
achega
1da24e2696

+ 1 - 1
lib/views/crowi-plus/widget/comments.html

@@ -27,7 +27,7 @@
         <div class="comment-form-main">
         <div class="comment-form-main">
           <div class="comment-write" id="comment-write">
           <div class="comment-write" id="comment-write">
             <textarea class="comment-form-comment form-control" id="comment-form-comment" name="commentForm[comment]"
             <textarea class="comment-form-comment form-control" id="comment-form-comment" name="commentForm[comment]"
-                rows="10" placeholder="Write comments here..." {% if not user %}disabled{% endif %}></textarea>
+                required placeholder="Write comments here..." {% if not user %}disabled{% endif %}></textarea>
           </div>
           </div>
           <div class="comment-submit">
           <div class="comment-submit">
             <input type="hidden" name="_csrf" value="{{ csrf() }}">
             <input type="hidden" name="_csrf" value="{{ csrf() }}">

+ 10 - 3
resource/css/_comment_crowi-plus.scss

@@ -90,19 +90,26 @@
   .comment-form {
   .comment-form {
     position: relative;
     position: relative;
     margin-top: 2em;
     margin-top: 2em;
-    // ユーザーアイコン
+    // user icon
     .picture.picture-rounded {
     .picture.picture-rounded {
       @extend %picture-rounded;
       @extend %picture-rounded;
     }
     }
 
 
-    // コメントフォームセクション
+    // seciton
     .comment-form-main {
     .comment-form-main {
       @extend %comment-section;
       @extend %comment-section;
     }
     }
 
 
-    // コメント入力フォーム
+    // textarea
     .comment-write {
     .comment-write {
       margin-bottom: 0.5em;
       margin-bottom: 0.5em;
     }
     }
+    .comment-form-comment {
+      height: 80px;
+      &:focus, &:not(:invalid) {
+        transition: height 0.2s ease-out;
+        height: 180px;
+      }
+    }
   }
   }
 }
 }