Advertisement
dibusure

css code

Jul 13th, 2021
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. * { box-sizing:border-box; }
  2.  
  3. /* basic stylings ------------------------------------------ */
  4. .container {
  5. font-family:'Roboto';
  6. width:600px;
  7. margin:30px auto 0;
  8. display:block;
  9. background:#FFF;
  10. padding:10px 50px 50px;
  11. }
  12. h2 {
  13. text-align:center;
  14. margin-bottom:50px;
  15. }
  16. h2 small {
  17. font-weight:normal;
  18. color:#888;
  19. display:block;
  20. }
  21. .footer { text-align:center; }
  22. .footer a { color:#53B2C8; }
  23.  
  24. /* form starting stylings ------------------------------- */
  25. .group {
  26. position:relative;
  27. margin-bottom:45px;
  28. }
  29. input {
  30. font-size:18px;
  31. padding:10px 10px 10px 5px;
  32. display:block;
  33. width:300px;
  34. border:none;
  35. border-bottom:1px solid #757575;
  36. }
  37. input:focus { outline:none; }
  38.  
  39. /* LABEL ======================================= */
  40. label {
  41. color:#999;
  42. font-size:18px;
  43. font-weight:normal;
  44. position:absolute;
  45. pointer-events:none;
  46. left:5px;
  47. top:10px;
  48. transition:0.2s ease all;
  49. -moz-transition:0.2s ease all;
  50. -webkit-transition:0.2s ease all;
  51. }
  52.  
  53. /* active state */
  54. input:focus ~ label, input:valid ~ label {
  55. top:-20px;
  56. font-size:14px;
  57. color:#5264AE;
  58. }
  59.  
  60. /* BOTTOM BARS ================================= */
  61. .bar { position:relative; display:block; width:300px; }
  62. .bar:before, .bar:after {
  63. content:'';
  64. height:2px;
  65. width:0;
  66. bottom:1px;
  67. position:absolute;
  68. background:#5264AE;
  69. transition:0.2s ease all;
  70. -moz-transition:0.2s ease all;
  71. -webkit-transition:0.2s ease all;
  72. }
  73. .bar:before {
  74. left:50%;
  75. }
  76. .bar:after {
  77. right:50%;
  78. }
  79.  
  80. /* active state */
  81. input:focus ~ .bar:before, input:focus ~ .bar:after {
  82. width:50%;
  83. }
  84.  
  85. /* HIGHLIGHTER ================================== */
  86. .highlight {
  87. position:absolute;
  88. height:60%;
  89. width:100px;
  90. top:25%;
  91. left:0;
  92. pointer-events:none;
  93. opacity:0.5;
  94. }
  95.  
  96. /* active state */
  97. input:focus ~ .highlight {
  98. -webkit-animation:inputHighlighter 0.3s ease;
  99. -moz-animation:inputHighlighter 0.3s ease;
  100. animation:inputHighlighter 0.3s ease;
  101. }
  102.  
  103. /* ANIMATIONS ================ */
  104. @-webkit-keyframes inputHighlighter {
  105. from { background:#5264AE; }
  106. to { width:0; background:transparent; }
  107. }
  108. @-moz-keyframes inputHighlighter {
  109. from { background:#5264AE; }
  110. to { width:0; background:transparent; }
  111. }
  112. @keyframes inputHighlighter {
  113. from { background:#5264AE; }
  114. to { width:0; background:transparent; }
  115. }
  116.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement