css sign in with google
<div class='g-sign-in-button'>
<div class=content-wrapper>
<div class='logo-wrapper'>
<img src='https://developers.google.com/identity/images/g-logo.png'>
</div>
<span class='text-container'>
<span>Sign in with Google</span>
</span>
</div>
</div>
<style>
*, *:before, *:after {
box-sizing: border-box;
}
.g-sign-in-button {
margin: 10px;
display: inline-block;
width: 240px;
height: 50px;
background-color: #4285f4;
color: #fff;
border-radius: 1px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
transition: background-color .218s, border-color .218s, box-shadow .218s;
}
.g-sign-in-button:hover {
cursor: pointer;
-webkit-box-shadow: 0 0 3px 3px rgba(66, 133, 244, 0.3);
box-shadow: 0 0 3px 3px rgba(66, 133, 244, 0.3);
}
.g-sign-in-button:active {
background-color: #3367D6;
transition: background-color 0.2s;
}
.g-sign-in-button .content-wrapper {
height: 100%;
width: 100%;
border: 1px solid transparent;
}
.g-sign-in-button img {
width: 18px;
height: 18px;
}
.g-sign-in-button .logo-wrapper {
padding: 15px;
background: #fff;
width: 48px;
height: 100%;
border-radius: 1px;
display: inline-block;
}
.g-sign-in-button .text-container {
font-family: Roboto,arial,sans-serif;
font-weight: 500;
letter-spacing: .21px;
font-size: 16px;
line-height: 48px;
vertical-align: top;
border: none;
display: inline-block;
text-align: center;
width: 180px;
}
</style>
4.5
10
<html><head> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet" type="text/css"> <script src="https://apis.google.com/js/api:client.js"></script> <script> var googleUser = {}; var startApp = function() { gapi.load('auth2', function(){ // Retrieve the singleton for the GoogleAuth library and set up the client. auth2 = gapi.auth2.init({ client_id: 'YOUR_CLIENT_ID.apps.googleusercontent.com', cookiepolicy: 'single_host_origin', // Request scopes in addition to 'profile' and 'email' //scope: 'additional_scope' }); attachSignin(document.getElementById('customBtn')); }); }; function attachSignin(element) { console.log(element.id); auth2.attachClickHandler(element, {}, function(googleUser) { document.getElementById('name').innerText = "Signed in: " + googleUser.getBasicProfile().getName(); }, function(error) { alert(JSON.stringify(error, undefined, 2)); }); } </script> <style type="text/css"> #customBtn { display: inline-block; background: white; color: #444; width: 190px; border-radius: 5px; border: thin solid #888; box-shadow: 1px 1px 1px grey; white-space: nowrap; } #customBtn:hover { cursor: pointer; } span.label { font-family: serif; font-weight: normal; } span.icon { background: url('/identity/sign-in/g-normal.png') transparent 5px 50% no-repeat; display: inline-block; vertical-align: middle; width: 42px; height: 42px; } span.buttonText { display: inline-block; vertical-align: middle; padding-left: 42px; padding-right: 42px; font-size: 14px; font-weight: bold; /* Use the Roboto font that is loaded in the <head> */ font-family: 'Roboto', sans-serif; } </style> </head> <body> <!-- In the callback, you would hide the gSignInWrapper element on a successful sign in --> <div id="gSignInWrapper"> <span class="label">Sign in with:</span> <div id="customBtn" class="customGPlusSignIn"> <span class="icon"></span> <span class="buttonText">Google</span> </div> </div> <div id="name"></div> <script>startApp();</script></body></html>
Thank you!
10
0
Are there any code examples left?
New code examples in category CSS
-
CSS 2022-03-27 22:50:16 make text bigger html5
-
CSS 2022-03-27 21:40:08 move list item to left css
-
CSS 2022-03-27 21:35:05 reduce image size css
-
CSS 2022-03-27 21:30:21 css image background center horizontally in div
-
CSS 2022-03-27 21:05:02 css button styles
-
CSS 2022-03-27 18:50:09 compass font awesome
-
CSS 2022-03-27 18:50:06 modal in materialize css
-
CSS 2022-03-27 17:55:12 box round corner css
-
CSS 2022-03-27 17:45:12 jquery add css
-
CSS 2022-03-27 17:45:01 css image fit in div with aspect ratio