Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HTML
- <div>
- <div id="actions_container">
- <button id="google" type="button"><i class="fa fa-google fa-lg fa-fw" aria-hidden="true"> </i>CONNECT WITH GOOGLE</button>
- <button id="signup" class="reg-link" type="button">SIGN UP</button>
- <button id="signin" class="reg-link" type="button">SIGN IN</button>
- </div>
- </div>
- <div id="signup_container">
- <input type="text" placeholder="First Name">
- <input type="text" placeholder="Last Name">
- <input type="email" placeholder="Email">
- <input type="password" placeholder="Create Password">
- <button id="join" type="button">JOIN YUM YUM</button>
- </div>
- <div id="login_container">
- <input type="email" placeholder="Email">
- <input type="password" placeholder="Password">
- <div id="forgot">Forgot Your Password?</div>
- <button id="login" type="button">SIGN INTO YUM YUM</button>
- </div>
- CSS
- @charset "utf-8";
- /* CSS Document */
- html, body
- {
- width:100%;
- height: 100%;
- }
- body
- {
- background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 1)), url(../images/bg.jpg);
- background-attachment: fixed;
- background-position: center center;
- background-repeat: no-repeat;
- background-size: cover;
- }
- /*---Login Page---*/
- h7
- {
- font-family: 'Roboto', sans-serif;
- font-size:70px;
- color:#DDDDDD;
- }
- #container
- {
- margin-left:25%;
- margin-right:25%;
- }
- #greeting
- {
- width:100%;
- margin-top:15%;
- margin-bottom:15%;
- }
- #first_part, #second_part
- {
- text-align:center;
- }
- #first_part
- {
- font-size:52px;
- line-height:0.8;
- margin-bottom:30px;
- }
- #second_part
- {
- font-size:30px;
- }
- #google
- {
- background-color: #D34836;
- width:70%;
- height:35px;
- margin-bottom:20px;
- margin-left:15%;
- margin-right:15%;
- border:none;
- color:#FFFFFF;
- font-family:'Source Sans Pro', sans serif;
- font-size:15px;
- border-radius:5px;
- -moz-border-radius: 5px;
- -webkit-border-radius:5px;
- }
- #signup, #signin
- {
- font-family:'Source Sans Pro', sans serif;
- font-size:15px;
- background-color:transparent;
- border: solid 1px;
- border-color:#FFFFFF;
- border-radius:5px;
- -moz-border-radius: 5px;
- -webkit-border-radius:5px;
- color:#FFFFFF;
- width:33.6%;
- height:35px;
- }
- #signup
- {
- margin-left: 15%;
- margin-right:1%;
- }
- #signin
- {
- margin-right: 15%;
- margin-left:1%;
- }
- #signup_container, #login_container
- {
- overflow:hidden;
- text-align:center;
- border-top: 1px solid #D1D1D1;
- box-shadow:0px -1px 2px #888888;
- -webkit-box-shadow:0px -1px 2px #888888;
- -moz-box-shadow:0px -1px 2px #888888;
- opacity:0.9;
- position:absolute;
- bottom:0px;
- display:none;
- background-color:#FFFFFF;
- margin:25%;
- width:50%;
- }
- /* .wideActive
- {
- margin:25%;
- width:50%;
- }
- .narrowActive
- {
- margin:0;
- width:100%;
- }*/
- #forgot
- {
- font-size:14px;
- margin-top:4%;
- }
- input[type=text], input[type=email], input[type=password]
- {
- width:100%;
- padding-bottom:20px;
- padding-top:10px;
- padding-left:10px;
- padding-right:10px;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- border:none;
- border-bottom: 1px solid #D1D1D1;
- color:#2A2929;
- }
- #join, #login
- {
- font-family:'Source Sans Pro', sans serif;
- font-size:15px;
- background-color:#111111;
- border: solid 1px;
- border-color:#111111;
- border-radius:5px;
- -moz-border-radius: 5px;
- -webkit-border-radius:5px;
- color:#FFFFFF;
- width:94%;
- height:35px;
- margin-left:3%;
- margin-right:3%;
- margin-top:2%;
- margin-bottom:5%;
- }
- @media only screen and (min-width: 320px) and (max-width: 480px) and (orientation: portrait)
- {
- /*---Login Page---*/
- h7
- {
- font-family: 'Roboto', sans-serif;
- font-size:52px;
- color:#DDDDDD;
- }
- #container
- {
- margin-left:8%;
- margin-right:8%;
- }
- #greeting
- {
- width:100%;
- margin-top:28%;
- margin-bottom:32%;
- }
- #first_part
- {
- font-size:38px;
- line-height:0.8;
- margin-bottom:30px;
- }
- #second_part
- {
- font-size:22px;
- }
- #google
- {
- margin:0px;
- width:100%;
- margin-bottom:20px;
- }
- #signup, #signin
- {
- font-family:'Source Sans Pro', sans serif;
- font-size:15px;
- background-color:transparent;
- border: solid 1px;
- border-color:#FFFFFF;
- border-radius:5px;
- -moz-border-radius: 5px;
- -webkit-border-radius:5px;
- color:#FFFFFF;
- width:48%;
- height:35px;
- margin:0px;
- }
- #signin
- {
- margin-left: 3%;
- }
- input[type=text], input[type=email], input[type=password]
- {
- width:100%;
- padding-bottom:20px;
- padding-top:10px;
- padding-left:10px;
- padding-right:10px;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- border:none;
- border-bottom: 1px solid #D1D1D1;
- color:#2A2929;
- }
- #join, #login
- {
- font-family:'Source Sans Pro', sans serif;
- font-size:15px;
- background-color:#111111;
- border: solid 1px;
- border-color:#111111;
- border-radius:5px;
- -moz-border-radius: 5px;
- -webkit-border-radius:5px;
- color:#FFFFFF;
- width:94%;
- height:35px;
- margin-left:3%;
- margin-right:3%;
- margin-top:2%;
- margin-bottom:5%;
- }
- #signup_container, #login_container
- {
- overflow:hidden;
- text-align:center;
- border-top: 1px solid #D1D1D1;
- box-shadow:0px -1px 2px #888888;
- -webkit-box-shadow:0px -1px 2px #888888;
- -moz-box-shadow:0px -1px 2px #888888;
- opacity:0.9;
- position:absolute;
- bottom:0px;
- display:none;
- background-color:#FFFFFF;
- margin:0;
- width:100%;
- }
- }
- JS (changed the effect on mobile width)
- // Use enquirejs to listen for a media query match with matchMedia
- enquire
- .register('screen and (max-width: 480px)', {
- match: function() {
- // remove any namespaced click event then create
- // a new listener to handle max-width: 480px clicky behaviour.
- jQuery('.reg-link').off('click.userReg');
- jQuery('.reg-link').on('click.userReg', function() {
- // create a context to the clicked link so we can reference it later
- var self = this;
- // check if the form is already open if not show it
- if (!jQuery(this).data('isOpen')) {
- // set the isOpen flag to true
- jQuery(this).data('isOpen', true);
- jQuery('#' + this.id + '_container').show("slide",{direction:'down'}, function() {
- // after the animation has fired register an event handler on the body
- // to listen for all clicks.
- jQuery('body').on('click.closeOutside', function(event) {
- // if the event target isn't inside the 'open' container then we close
- // it by removing the style attribute, then we remove the body click
- if (!jQuery(event.target).closest('#' + self.id + '_container').length) {
- // hide open form.
- jQuery('#' + self.id + '_container').removeAttr('style');
- // unbind event and remove the data flag so subsequent clicks
- jQuery('body').off('click.closeOutside');
- jQuery(self).data('isOpen', false);
- }
- });
- });
- }
- });
- // visual aids!
- jQuery('.reg-link').css('color', 'red');
- }
- })
- // Use enquirejs to listen for another media query match with matchMedia
- .register('screen and (min-width: 481px)', {
- match: function() {
- // remove any namespaced click event then create
- // a new listener to handle min-width: 481px clicky behaviour.
- jQuery('.reg-link').off('click.userReg');
- jQuery('.reg-link').on('click.userReg', function() {
- // create a context to the clicked link so we can reference it later
- var self = this;
- // check if the form is already open if not show it
- if (!jQuery(this).data('isOpen')) {
- // set the isOpen flag to true
- jQuery(this).data('isOpen', true);
- jQuery('#' + this.id + '_container').fadeIn("fast", function() {
- // after the animation has fired register an event handler on the body
- // to listen for all clicks.
- jQuery('body').on('click.closeOutside', function(event) {
- // if the event target isn't inside the 'open' container then we close
- // it by removing the style attribute, then we remove the body click
- if (!jQuery(event.target).closest('#' + self.id + '_container').length) {
- // hide open form.
- jQuery('#' + self.id + '_container').removeAttr('style');
- // unbind event and remove the data flag so subsequent clicks
- jQuery('body').off('click.closeOutside');
- jQuery(self).data('isOpen', false);
- }
- });
- });
- }
- });
- // visual aids!
- jQuery('.reg-link').css('color', 'blue');
- }
- });
Add Comment
Please, Sign In to add comment