OneTallor

CSS LOGIN

Jul 27th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
CSS 9.86 KB | None | 0 0
  1. CSS (SCSS)
  2.  
  3. @import "bourbon";
  4.  
  5. // Main Colors
  6. $accent: null;
  7. $white: #ffffff;
  8. $black: #000000;
  9. $dark-gray: lighten($black, 20%);
  10. $gray: lighten($black, 40%);
  11. $light-gray: lighten($black, 60%);
  12. $lighter-gray: lighten($black, 80%);
  13.  
  14. // Pen Settings
  15. $primary: #363636;
  16. $accent: #ed2553;
  17. $max-width: 460px;
  18.  
  19. // Mixins
  20. $level: 1;
  21.  
  22. @mixin materialShadow($level) {
  23.   @if $level == 1 {
  24.     box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  25.   }
  26.  
  27.   @else if $level == 2 {
  28.     box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16), 0 3px 6px rgba(0, 0, 0, 0.23);
  29.   }
  30.  
  31.   @else if $level == 3 {
  32.     box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
  33.   }
  34.  
  35.   @else if $level == 4 {
  36.     box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
  37.   }
  38.  
  39.   @else if $level == 5 {
  40.     box-shadow: 0 19px 38px rgba(0, 0, 0, 0.3), 0 15px 12px rgba(0, 0, 0, 0.22);
  41.   }
  42. }
  43.  
  44. body {
  45.   background: #e9e9e9;
  46.   color: $gray;
  47.   font-family: 'RobotoDraft', 'Roboto', sans-serif;
  48.   font-size: 14px;
  49.   -webkit-font-smoothing: antialiased;
  50.   -moz-osx-font-smoothing: grayscale;
  51. }
  52.  
  53. /* Pen Title */
  54. .pen-title {
  55.   padding: 50px 0;
  56.   text-align: center;
  57.   letter-spacing: 2px;
  58.  
  59.   h1 {
  60.     margin: 0 0 20px;
  61.     font-size: 48px;
  62.     font-weight: 300;
  63.   }
  64.  
  65.   span {
  66.     font-size: 12px;
  67.  
  68.     .fa {
  69.       color: $accent;
  70.     }
  71.  
  72.     a {
  73.       color: $accent;
  74.       font-weight: 600;
  75.       text-decoration: none;
  76.     }
  77.   }
  78. }
  79.  
  80. /* Rerun */
  81. .rerun {
  82.   margin: 0 0 30px;
  83.   text-align: center;
  84.  
  85.   a {
  86.     cursor: pointer;
  87.     display: inline-block;
  88.     background: $accent;
  89.     border-radius: 3px;
  90.     @include materialShadow(1);
  91.     padding: 10px 20px;
  92.     color: $white;
  93.     text-decoration: none;
  94.     @include transition(0.3s ease);
  95.  
  96.     &:hover {
  97.       @include materialShadow(2);
  98.     }
  99.   }
  100. }
  101.  
  102. /* Scroll To Bottom */
  103. #codepen {
  104.   position: fixed;
  105.   bottom: 30px;
  106.   right: 30px;
  107.   background: $primary;
  108.   width: 56px;
  109.   height: 56px;
  110.   border-radius: 100%;
  111.   @include materialShadow(1);
  112.   @include transition(0.3s ease);
  113.   color: $white;
  114.   text-align: center;
  115.  
  116.   i {
  117.     line-height: 56px;
  118.   }
  119.  
  120.   &:hover {
  121.     @include materialShadow(3);
  122.   }
  123. }
  124.  
  125. /* CodePen */
  126. #portfolio {
  127.   @extend #codepen;
  128.   bottom: 96px;
  129.   right: 36px;
  130.   background: $accent;
  131.   width: 44px;
  132.   height: 44px;
  133.   @include animation(buttonFadeInUp 1s ease);
  134.  
  135.   i {
  136.     line-height: 44px;
  137.   }
  138. }
  139.  
  140. /* Container */
  141. .container {
  142.   position: relative;
  143.   max-width: $max-width;
  144.   width: 100%;
  145.   margin: 0 auto 100px;
  146.  
  147.   &.active {
  148.     .card {
  149.       &:first-child {
  150.         background: darken($white, 5%);
  151.         margin: 0 15px;
  152.       }
  153.  
  154.       &:nth-child(2) {
  155.         background: darken($white, 2%);
  156.         margin: 0 10px;
  157.       }
  158.  
  159.       &.alt {
  160.         top: 20px;
  161.         right: 0;
  162.         width: 100%;
  163.         min-width: 100%;
  164.         height: auto;
  165.         border-radius: 5px;
  166.         padding: 60px 0 40px;
  167.         overflow: hidden;
  168.  
  169.         .toggle {
  170.           position: absolute;
  171.           top: 40px;
  172.           right: -70px;
  173.           box-shadow: none;
  174.           @include transform(scale(10));
  175.           transition: transform .3s ease;
  176.  
  177.           &:before {
  178.             content: '';
  179.           }
  180.         }
  181.  
  182.         .title,
  183.         .input-container,
  184.         .button-container {
  185.           left: 0;
  186.           opacity: 1;
  187.           visibility: visible;
  188.           transition: .3s ease;
  189.         }
  190.  
  191.         .title {
  192.           transition-delay: .3s;
  193.         }
  194.  
  195.         .input-container {
  196.           transition-delay: .4s;
  197.  
  198.           &:nth-child(2) {
  199.             transition-delay: .5s;
  200.           }
  201.  
  202.           &:nth-child(3) {
  203.             transition-delay: .6s;
  204.           }
  205.         }
  206.  
  207.         .button-container {
  208.           transition-delay: .7s;
  209.         }
  210.       }
  211.     }
  212.   }
  213. }
  214.  
  215. /* Card */
  216. .card {
  217.   position: relative;
  218.   background: $white;
  219.   border-radius: 5px;
  220.   padding: 60px 0 40px 0;
  221.   box-sizing: border-box;
  222.   @include materialShadow(1);
  223.   transition: .3s ease;
  224.  
  225.   &:first-child {
  226.     background: darken($white, 2%);
  227.     height: 10px;
  228.     border-radius: 5px 5px 0 0;
  229.     margin: 0 10px;
  230.     padding: 0;
  231.   }
  232.  
  233.   /* Title */
  234.   .title {
  235.     position: relative;
  236.     z-index: 1;
  237.     border-left: 5px solid $accent;
  238.     margin: 0 0 35px;
  239.     padding: 10px 0 10px 50px;
  240.     color: $accent;
  241.     font-size: 32px;
  242.     font-weight: 600;
  243.     text-transform: uppercase;
  244.   }
  245.  
  246.   /* Inputs */
  247.   .input-container {
  248.     position: relative;
  249.     margin: 0 60px 50px;
  250.  
  251.     input {
  252.       outline: none;
  253.       z-index: 1;
  254.       position: relative;
  255.       background: none;
  256.       width: 100%;
  257.       height: 60px;
  258.       border: 0;
  259.       color: #212121;
  260.       font-size: 24px;
  261.       font-weight: 400;
  262.  
  263.       &:focus {
  264.         ~ label {
  265.           color: #9d9d9d;
  266.           transform: translate(-12%, -50%) scale(0.75);
  267.         }
  268.  
  269.         ~ .bar {
  270.           &:before,
  271.           &:after {
  272.             width: 50%;
  273.           }
  274.         }
  275.       }
  276.  
  277.       &:valid {
  278.         ~ label {
  279.           color: #9d9d9d;
  280.           transform: translate(-12%, -50%) scale(0.75);
  281.         }
  282.       }
  283.     }
  284.  
  285.     label {
  286.       position: absolute;
  287.       top: 0;
  288.       left: 0;
  289.       color: #757575;
  290.       font-size: 24px;
  291.       font-weight: 300;
  292.       line-height: 60px;
  293.       @include transition(0.2s ease);
  294.     }
  295.  
  296.     .bar {
  297.       position: absolute;
  298.       left: 0;
  299.       bottom: 0;
  300.       background: #757575;
  301.       width: 100%;
  302.       height: 1px;
  303.  
  304.       &:before,
  305.       &:after {
  306.         content: '';
  307.         position: absolute;
  308.         background: $accent;
  309.         width: 0;
  310.         height: 2px;
  311.         transition: .2s ease;
  312.       }
  313.  
  314.       &:before {
  315.         left: 50%;
  316.       }
  317.  
  318.       &:after {
  319.         right: 50%;
  320.       }
  321.     }
  322.   }
  323.  
  324.   /* Button */
  325.   .button-container {
  326.     margin: 0 60px;
  327.     text-align: center;
  328.  
  329.     button {
  330.       outline: 0;
  331.       cursor: pointer;
  332.       position: relative;
  333.       display: inline-block;
  334.       background: 0;
  335.       width: 240px;
  336.       border: 2px solid #e3e3e3;
  337.       padding: 20px 0;
  338.       font-size: 24px;
  339.       font-weight: 600;
  340.       line-height: 1;
  341.       text-transform: uppercase;
  342.       overflow: hidden;
  343.       transition: .3s ease;
  344.  
  345.       span {
  346.         position: relative;
  347.         z-index: 1;
  348.         color: #ddd;
  349.         transition: .3s ease;
  350.       }
  351.  
  352.       &:before {
  353.         content: '';
  354.         position: absolute;
  355.         top: 50%;
  356.         left: 50%;
  357.         display: block;
  358.         background: $accent;
  359.         width: 30px;
  360.         height: 30px;
  361.         border-radius: 100%;
  362.         margin: -15px 0 0 -15px;
  363.         opacity: 0;
  364.         transition: .3s ease;
  365.       }
  366.  
  367.       &:hover,
  368.       &:active,
  369.       &:focus {
  370.         border-color: $accent;
  371.  
  372.         span {
  373.           color: $accent;
  374.         }
  375.       }
  376.  
  377.       &:active,
  378.       &:focus {
  379.         span {
  380.           color: $white;
  381.         }
  382.  
  383.         &:before {
  384.           opacity: 1;
  385.           @include transform(scale(10));
  386.         }
  387.       }
  388.     }
  389.   }
  390.  
  391.   /* Footer */
  392.   .footer {
  393.     margin: 40px 0 0;
  394.     color: #d3d3d3;
  395.     font-size: 24px;
  396.     font-weight: 300;
  397.     text-align: center;
  398.  
  399.     a {
  400.       color: inherit;
  401.       text-decoration: none;
  402.       transition: .3s ease;
  403.  
  404.       &:hover {
  405.         color: darken(#d3d3d3, 10%);
  406.       }
  407.     }
  408.   }
  409.  
  410.   /* Alt Card */
  411.   &.alt {
  412.     position: absolute;
  413.     top: 40px;
  414.     right: -70px;
  415.     z-index: 10;
  416.     width: 140px;
  417.     height: 140px;
  418.     background: none;
  419.     border-radius: 100%;
  420.     box-shadow: none;
  421.     padding: 0;
  422.     transition: .3s ease;
  423.  
  424.     /* Toggle */
  425.     .toggle {
  426.       position: relative;
  427.       background: $accent;
  428.       width: 140px;
  429.       height: 140px;
  430.       border-radius: 100%;
  431.       @include materialShadow(1);
  432.       color: $white;
  433.       font-size: 58px;
  434.       line-height: 140px;
  435.       text-align: center;
  436.       cursor: pointer;
  437.  
  438.       &:before {
  439.         content: '\f040';
  440.         display: inline-block;
  441.         font: normal normal normal 14px/1 FontAwesome;
  442.         font-size: inherit;
  443.         text-rendering: auto;
  444.         -webkit-font-smoothing: antialiased;
  445.         -moz-osx-font-smoothing: grayscale;
  446.         transform: translate(0, 0);
  447.       }
  448.     }
  449.  
  450.     .title,
  451.     .input-container,
  452.     .button-container {
  453.       left: 100px;
  454.       opacity: 0;
  455.       visibility: hidden;
  456.     }
  457.  
  458.     /* Title */
  459.     .title {
  460.       position: relative;
  461.       border-color: $white;
  462.       color: $white;
  463.  
  464.       .close {
  465.         cursor: pointer;
  466.         position: absolute;
  467.         top: 0;
  468.         right: 60px;
  469.         display: inline;
  470.         color: $white;
  471.         font-size: 58px;
  472.         font-weight: 400;
  473.  
  474.         &:before {
  475.           content: '\00d7';
  476.         }
  477.       }
  478.     }
  479.  
  480.     /* Input */
  481.     .input-container {
  482.       input {
  483.         color: $white;
  484.  
  485.         &:focus {
  486.           ~ label {
  487.             color: $white;
  488.           }
  489.  
  490.           ~ .bar {
  491.             &:before,
  492.             &:after {
  493.               background: $white;
  494.             }
  495.           }
  496.         }
  497.  
  498.         &:valid {
  499.           ~ label {
  500.             color: $white;
  501.           }
  502.         }
  503.       }
  504.  
  505.       label {
  506.         color: rgba($white, 0.8);
  507.       }
  508.  
  509.       .bar {
  510.         background: rgba($white, 0.8);
  511.       }
  512.     }
  513.  
  514.     /* Button */
  515.     .button-container {
  516.       button {
  517.         width: 100%;
  518.         background: $white;
  519.         border-color: $white;
  520.  
  521.         span {
  522.           color: $accent;
  523.         }
  524.  
  525.         &:hover {
  526.           background: rgba($white, 0.9);
  527.         }
  528.  
  529.         &:active,
  530.         &:focus {
  531.           &:before {
  532.             display: none;
  533.           }
  534.         }
  535.       }
  536.     }
  537.   }
  538. }
  539.  
  540. /* Keyframes */
  541. @include keyframes(buttonFadeInUp) {
  542.   0% {
  543.     bottom: 30px;
  544.     opacity: 0;
  545.   }
  546. }
Add Comment
Please, Sign In to add comment