{"id":264352,"date":"2015-08-26T20:08:02","date_gmt":"2015-08-26T16:08:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=264352"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=264352","title":{"rendered":"Telegram-like \u0430\u043d\u0438\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 placeholder \u0434\u043b\u044f HTML-\u0438\u043d\u043f\u0443\u0442\u043e\u0432"},"content":{"rendered":"<p>     \t\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f UX\/UI \u044f \u0447\u0430\u0441\u0442\u043e \u0441\u0438\u0436\u0443 \u0438 \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u044b\u043b\u043e \u0447\u0443\u0442\u043e\u0447\u043a\u0443 \u0432\u0435\u0441\u0435\u043b\u0435\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c.<\/p>\n<p>  \u041a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437 \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e placeholder&#8217;a \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c Desktop \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 Telegram. \u041f\u043e\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0438 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u0421\u0440\u0430\u0437\u0443 \u043f\u043e\u043d\u044f\u043b, \u0447\u0442\u043e \u0443 HTML \u043d\u0435\u0442 \u0441\u0432\u043e\u0435\u0433\u043e API \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438 \u043d\u0430\u0434\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c JavaScript-\u0445\u0430\u043a\u0438. \u041d\u043e \u0441\u043b\u0438\u0448\u043a\u043e\u043c \u043c\u043d\u043e\u0433\u043e \u0445\u0430\u043a\u043e\u0432 \u043c\u043d\u0435 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c, \u0442.\u043a. \u043a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0438, \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0442\u044c \u0433\u043e\u0442\u043e\u0432\u0443\u044e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043d\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0436\u0435 \u0432 \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d\u0435.<\/p>\n<p>  \u0421 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c <a href=\"https:\/\/developer.mozilla.org\/ru\/docs\/Web\/CSS\/attr\">CSS attr property<\/a> \u0438 CSS content \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043d\u0446\u0435\u043f\u0442:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">SCSS<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"css\">label.placeholder {     position: relative;      &:after {         display: flex;         align-items: center;          content: attr(data-placeholder);         position: absolute;         top:0;         right: 0;         bottom: 0;         left: $after-left;          font-size: 14px;         color: grey;         cursor: text;         transition: transform $tf-duration $tf, opacity $tf-duration $tf;         transform: translateX(0);         opacity: 1; \t\tcolor: $input-default-color;     }      &.hidden {         &:after {             transform: translateX(40%);             opacity: 0;         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0418 \u043d\u0435\u043c\u043d\u043e\u0433\u043e <b>jQuery:<\/b><\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">jQuery<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">$(document).ready(function() {     function placeholderAnimation() {     \tvar $placeholder = $('input[placeholder]');          $placeholder.each(function () {     \t    $(this).wrap('&lt;label class=&quot;placeholder&quot; data-placeholder=&quot;' + this.placeholder + '&quot;&gt;').attr('placeholder', '');     \t}).on('keyup', function () {     \t    $(this).parent().toggleClass('hidden', this.value !== '');     \t});     }      placeholderAnimation(); }); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <b>\u0418\u0437 \u043f\u043b\u044e\u0441\u043e\u0432:<\/b>  <\/p>\n<ul>\n<li>\u041b\u0435\u0433\u043a\u043e \u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0433\u043e\u0442\u043e\u0432\u044b\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u044b<\/li>\n<li>CSS \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043b\u0435\u0439\u0441\u0445\u043e\u043b\u0434\u0435\u0440\u043e\u0432 \u0438\u0437 HTML =&gt; <i>\u043d\u0435 \u043d\u0430\u0434\u043e \u043c\u0435\u043d\u044f\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443<\/i><\/li>\n<li>\u0412\u0441\u0451 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f CSS-\u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044f\u043c\u0438, \u0441\u043e\u043e\u0442\u0432. \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043b\u0435\u043f\u0438\u0442\u044c \u0432\u0441\u044f\u043a\u0438\u0435 cubic-bezier&#8217;\u044b \u0438 \u0438\u0433\u0440\u0430\u0442\u044c\u0441\u044f.<\/li>\n<li>\u0412\u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0432 \u043b\u044e\u0431\u044b\u0435 \u0434\u0438\u0437\u0430\u0439\u043d\u044b, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 \u0432\u0441\u044f\u043a\u0438\u0445 \u0442\u0430\u043c \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u043d\u043f\u0443\u0442\u043e\u0432, \u0433\u0434\u0435 \u0432\u0441\u0451 \u043f\u0440\u044b\u0433\u0430\u0435\u0442 \u0438 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0434\u0438\u0437\u0430\u0439\u043d\u0430 \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/li>\n<li>\u0411\u044b\u0441\u0442\u0440\u044b\u0439 \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u0434\u0435\u043b\u0430\u0442\u044c UX \u0438\u043d\u043f\u0443\u0442\u043e\u0432 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435 \u0438 \u043f\u0440\u0438\u044f\u0442\u043d\u0435\u0435<\/li>\n<\/ul>\n<p>  <b>\u0418\u0437 \u043c\u0438\u043d\u0443\u0441\u043e\u0432:<\/b>  <\/p>\n<ul>\n<li>\u0418\u0437-\u0437\u0430 flexbox&#8217;a \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 IE11+<\/li>\n<li>\u0418\u0437-\u0437\u0430 \u043b\u0430\u0433\u0430 \u0432 keyup \u0441\u043e\u0431\u044b\u0442\u0438\u0438, \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u043a\u0443\u0440\u0441\u043e\u0440 \u0438 \u043f\u0435\u0440\u0432\u0443\u044e \u0431\u0443\u043a\u0432\u0443 \u043f\u043b\u0435\u0439\u0441\u0445\u043e\u043b\u0434\u0435\u0440\u0430 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0439 \u0431\u0443\u043a\u0432\u043e\u0439, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438 \u0432\u0432\u043e\u0434\u0435 \u0432 \u0438\u043d\u043f\u0443\u0442, \u043f\u043b\u0435\u0439\u0441\u0445\u043e\u043b\u0434\u0435\u0440 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u043f\u0443\u0442\u0430 \u043d\u0435 \u043d\u0430\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043b\u0438\u0441\u044c \u0434\u0440\u0443\u0433 \u043d\u0430 \u0434\u0440\u0443\u0433\u0430.<\/li>\n<\/ul>\n<p>  <a href=\"http:\/\/codepen.io\/knitevision1\/pen\/rVXKwq\">\u0414\u0435\u043c\u043a\u0430 \u043d\u0430 CodePen<\/a><br \/>  <a href=\"https:\/\/github.com\/knitevision1\/animated-placeholder\">GitHub<\/a><\/p>\n<p>  P.S. \u041f\u043e\u043b\u0443\u0447\u0438\u043b\u0441\u044f \u043d\u0435\u0434\u043e\u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043a\u043e\u043d\u0446\u0435\u043f\u0442 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e; \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u0438 \u043f\u0440\u043e\u0447\u0435\u0435, \u043d\u043e \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434 \u0441\u0442\u043e\u0438\u0442 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f.     \t<\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/265497\/\"> http:\/\/habrahabr.ru\/post\/265497\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>     \t\u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f UX\/UI \u044f \u0447\u0430\u0441\u0442\u043e \u0441\u0438\u0436\u0443 \u0438 \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u044b\u043b\u043e \u0447\u0443\u0442\u043e\u0447\u043a\u0443 \u0432\u0435\u0441\u0435\u043b\u0435\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0438\u043c.<\/p>\n<p>  \u041a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437 \u044f \u0437\u0430\u043c\u0435\u0442\u0438\u043b \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e placeholder&#8217;a \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u043c Desktop \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 Telegram. \u041f\u043e\u0434\u0443\u043c\u0430\u043b, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u0438 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-264352","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264352","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=264352"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264352\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264352"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264352"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264352"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}