I want to add to my button a cooldown but I have no clue how - html

It's a React.Js Website. If you know how I can add a cooldown to that button it would help me a lot since it would make the Contact Me page better. I didn't include all the code
for more information add my Discord: uvejs#5162
import "./contactpage.css"
import Footer from "../../Components/Footer/Footer";
import Navbar from "../../Components/Navbar/Navbar";
import React, { useRef, useState } from 'react';
import emailjs from '#emailjs/browser';
const initialInputs = {
return (
<div className="group">
<Navbar />
<form action="" ref={form} onSubmit={sendEmail} className="contact-form">
<label className="form-input-label" > Your Name
<input required name="from_name" value={inputs.from_name} onChange={handleChange} className="form-input" type="text" />
</label>
<br />
<label required className="form-input-label"> Your Email
<input name="from_email" value={inputs.from_email} onChange={handleChange} className="form-input" type="text" />
</label>
<br />
<label required className="form-input-label" > About Your Project
<input name="message" value={inputs.message} onChange={handleChange} className="form-input" type="text" />
</label>
<button className="custom-button" > Send </button>
</form>
<Footer />
</div>
)
}
export default Contact;

You can follow this code pen link - cooldown button
$('button.cooldown').click(function(){
var btn = $(this);
btn.prop('disabled', true);
setTimeout(function(){
btn.prop('disabled', false);
},15000);
});
$buttonBaseColor: #336699;
$disableDuration: 15s;
button.cooldown{
background: $buttonBaseColor;
min-height: 48px;
min-width: 144px;
position: relative;
margin: 5px;
border-radius: 5px;
border: 0;
color: #fff;
padding: 0 15px;
font-size: 16px;
outline: none;
overflow: hidden;
cursor: pointer;
&:active, &:focus{
outline: none;
}
&:disabled{
background: darken($buttonBaseColor, 10%);
color: darken(#fff, 15%);
cursor: default;
box-shadow: inset 3px 3px 10px 0px rgba(0,0,0,0.2);
&:after{
content: '';
position: absolute;
bottom: 0;
width: 100%;
left: 0;
height: 5px;
background: darken($buttonBaseColor, 20%);
animation: cooldown $disableDuration linear;
}
}
}
#keyframes cooldown {
0% { width: 100%; }
100% { width: 0; }
}
/* layout stuff */
section{
text-align: center;
margin-top: 100px;
color: #333;
}
p{font-size: 12px;}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<section>
<button class="cooldown">Push Me!</button>
<p>This button has a cool down of 30s until re-enabled</p>
</section>

Related

Having trouble recreating this login page in HTML/CSS

I am trying to create a login page based on this one in HTML and CSS. Of course, my logo will be different, and I am trying to add some transparency to the background image.
I'm new to web dev, but I don't think this is too complicated. It's just one background pic, with a single div spreading across the screen to hold the username and password bars.
I have put what I've got so far into this JSFiddle: https://jsfiddle.net/6eLuw2th/
Here's the code:
body {
opacity: 0.2;
background-image: url(https://wallpaperplay.com/walls/full/e/d/e/104382.jpg);
background-size:cover;
z-index: -1;
}
form {
border: 3px solid #f1f1f1;
z-index: 0;
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
z-index: 0;
}
button {
background-color: #8C1515;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
font-size: 15px;
width: 100%;
z-index: 0;
}
button:hover {
opacity: 0.8;
z-index: 0;
}
.container {
padding: 16px;
z-index: 0;
}
span.psw {
float: right;
padding-top: 16px;
z-index: 0;
}
/* Change styles for span and cancel button on extra small screens */
#media screen and (max-width: 300px) {
span.psw {
display: block;
float: left;
width: 100%;
z-index: 0;
}
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="login.css" />
</head>
<body>
<form action="/action_page.php" method="post">
<div class="container">
<label for="uname"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit">Login</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
</form>
</body>
</html>
As you can see, the username/password content appears to be behind the image (even though the z-index is -1 for the background?). I do want to make the background appear slightly transparent, but have been having a bit of trouble that as well. Furthermore, my username and password bars stretch across the entire screen; I would prefer for them to be more like the example page I'm trying to recreate, with the login info bars restricted to the middle of the screen.
Any help or suggestions would be greatly appreciated!
Actually the issue you are facing is not about z-index. the issue is that you have opacity:0.2 set on the body, that's why it looks weird:
body {
opacity: 0.2; /* just remove this line */
background-image: url(https://wallpaperplay.com/walls/full/e/d/e/104382.jpg);
background-size:cover;
z-index: -1;
}
also I amended the form to have less width and centered:
form {
border: 3px solid #f1f1f1;
z-index: 0;
width: 60%;
margin: 0 auto;
}
label {
color: #FFF;
}
Here is a working snippet:
body {
background-image: url(https://wallpaperplay.com/walls/full/e/d/e/104382.jpg);
background-size:cover;
z-index: -1;
}
form {
border: 3px solid #f1f1f1;
z-index: 0;
width: 60%;
margin: 0 auto;
}
label {
color: #FFF;
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
z-index: 0;
}
button {
background-color: #8C1515;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
font-size: 15px;
width: 100%;
z-index: 0;
}
button:hover {
opacity: 0.8;
z-index: 0;
}
.container {
padding: 16px;
z-index: 0;
}
span.psw {
float: right;
padding-top: 16px;
z-index: 0;
}
/* Change styles for span and cancel button on extra small screens */
#media screen and (max-width: 300px) {
span.psw {
display: block;
float: left;
width: 100%;
z-index: 0;
}
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="login.css" />
</head>
<body>
<form action="/action_page.php" method="post">
<div class="container">
<label for="uname"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit">Login</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
</form>
</body>
</html>
1) You are not loading a faded background. You're loading a solid background and trying to fade the body, which faded EVERYTHING within the body, including your form.
2) Remove "width=100%" from your INPUT parts in the CSS and it will not stretch across the screen.
Body opacity affects everything in the body, so don't do it there.
Instead put the background image in a div
<div id="background"></div>
Then the css for it
#background {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url(https://wallpaperplay.com/walls/full/e/d/e/104382.jpg);
background-repeat: no-repeat;
background-attachment: fixed;
background-size: 100%;
opacity: 0.8;
filter:alpha(opacity=80);
}
For the input fields make sure not to have the width as 100%
If you want to have columns then check out:
https://www.w3schools.com/howto/howto_css_three_columns.asp
/*
Make the background in a div
*/
.bg {
width: 100%;
height: 100%;
position: fixed;
background-image: url(https://wallpaperplay.com/walls/full/e/d/e/104382.jpg);
background-position: center;
background-repeat: no-repeat;
opacity: 0.2;
z-index: -1;
}
form {
border: 3px solid #f1f1f1;
}
input[type=text], input[type=password] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
background-color: #8C1515;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
font-size: 15px;
width: 100%;
}
button:hover {
opacity: 0.8;
}
.container {
padding: 16px;
}
span.psw {
float: right;
padding-top: 16px;
}
/* Change styles for span and cancel button on extra small screens */
#media screen and (max-width: 300px) {
span.psw {
display: block;
float: left;
width: 100%;
}
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="login.css" />
</head>
<body>
<!-- the div that contains the background -->
<div class="bg"></div>
<form action="/action_page.php" method="post">
<div class="container">
<label for="uname"><b>Username</b></label>
<input type="text" placeholder="Enter Username" name="uname" required>
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit">Login</button>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
</form>
</body>
</html>
Please see the code snippets for the effect you want to achieve.
body {
background-image: url(https://wallpaperplay.com/walls/full/e/d/e/104382.jpg);
background-size: cover;
}
form {
border: 3px solid #f1f1f1;
}
input[type=text],
input[type=password] {
width: 50%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
box-sizing: border-box;
}
button {
background-color: #8C1515;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
font-size: 15px;
width: 50%;
}
button:hover {
opacity: 0.8;
}
.container {
padding: 16px 16px 16px 180px;
background-color: rgba(238, 238, 238, 0.3);
;
}
span.psw {
float: right;
padding-top: 16px;
}
/* Change styles for span and cancel button on extra small screens */
#media screen and (max-width: 300px) {
span.psw {
display: block;
float: left;
width: 100%;
}
}
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="login.css" />
</head>
<body>
<form action="/action_page.php" method="post">
<div class="container">
<label for="uname"><b>Username</b></label><br>
<input type="text" placeholder="Enter Username" name="uname" required><br>
<label for="psw"><b>Password</b></label><br>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit">Login</button><br>
<label>
<input type="checkbox" checked="checked" name="remember"> Remember me
</label>
</div>
</form>
</body>
</html>

Having problem resizing form, input text and font height

i´m having some problem trying to resize the height of the forms, input text´s and fonts.
I´m writing a forms that will show up inside a background image, and i´m trying to fit the form size inside that image. But he is not changing his height.
I dont know how i can do it, i already tried a lot of google and stack overflow stuff but nothing worked.
body {
margin: 0;
padding: 0;
overflow: hidden;
height: 100%;
width: 100%;
}
.inner {
float: left;
width: 600px;
height: 410px;
}
.jright {
background: url("../img/visa_erased.png");
}
form {
float: right;
width: 40%;
padding-top: 80px;
}
.input-field {
box-sizing: border-box;
color: #000000 !important;
}
#register {
height: auto;
width: 30%;
padding: 1;
background: #392c34 !important;
}
.dropdown-content {
top: 0 !important;
}
.select-wrapper li {
background: #b5a795 !important;
}
.select-wrapper li span {
color: #ffffff !important;
}
.select-wrapper .disabled {
background: #897d6e !important;
}
.select-wrapper .selected {
background: #d6c7b3 !important;
}
.datepicker-date-display {
background: #392c34;
}
.datepicker-container button {
color: #392c34;
}
.datepicker-container button:focus {
background: none;
}
.datepicker-container .is-selected {
background: #7a5f70 !important;
}
.dropdown-content li>a,
.dropdown-content li>span {
color: #392c34 !important;
}
.datepicker-container input {
color: #392c34 !important;
}
label {
color: #392c34 !important;
text-shadow: -1px 0 rgba(0, 0, 0, 0.2), 0 1px rgba(0, 0, 0, 0.2), 1px 0 rgba(0, 0, 0, 0.2), 0 -1px rgba(0, 0, 0, 0.2);
}
.input-field input[type=text] {
border-bottom: 1px solid #392c34 !important;
box-shadow: 0 1px 0 0 #392c34 !important;
}
.input-field input[type=text]:focus+label {
color: #6b0742 !important;
}
.input-field input[type=text]:focus {
border-bottom: 1px solid #6b0742 !important;
box-shadow: 0 1px 0 0 #6b0742 !important;
}
::-webkit-scrollbar {
width: 0px;
background: transparent;
}
::-webkit-scrollbar-thumb {
background: #FF0000;
}
#media only screen and (max-width: 1250px) {
.container {
width: 100% !important;
}
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="css/style.css" type="text/css">
<link rel="stylesheet" href="css/materialize.css" type="text/css">
<script src="nui://game/ui/jquery.js" type="text/javascript"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="inner jright">
<form>
<div class="input-field">
<input id="firstname" name="firstname" placeholder="" type="text" required>
<label for="firstname">1. Nome</label>
</div>
<div class="input-field">
<input id="lastname" placeholder="" type="text" required>
<label for="lastname">2. Sobrenome</label>
</div>
<div class="input-field">
<input id="height" placeholder="" type="text" maxlength="3" minlength="2" required>
<label for="height">3. Altura (CM)</label>
</div>
<div class="input-field">
<input id="dateofbirth" placeholder="" type="text" class="datepicker" required>
<label for="dateofbirth">4. Aniversário (DD-MM-YYYY)</label>
</div>
<div class="input-field" id="sex">
<select data-beloworigin="true" required>
<option value="none" disabled selected>Escolha o gênero</option>
<option value="M">Masculino</option>
<option value="F">Feminino</option>
</select>
<label>5. Sexo</label>
</div>
<button id="register" class="btn btn-large waves-effect">OK</button>
</form>
</div>
</div>
</div>
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/materialize.js" type="text/javascript"></script>
<script src="js/init.js" type="text/javascript"></script>
</body>
</html>
Here's an example from w3school that shows a nicely made form over a image in background.
Have a look in the below snippet.
body, html {
height: 100%;
font-family: Arial, Helvetica, sans-serif;
}
* {
box-sizing: border-box;
}
.bg-img {
/* The image used */
background-image: url("https://www.w3schools.com/howto/img_nature.jpg");
min-height: 380px;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
}
/* Add styles to the form container */
.container {
position: absolute;
right: 0;
margin: 20px;
max-width: 300px;
padding: 16px;
background-color: white;
}
/* Full-width input fields */
input[type=text], input[type=password] {
width: 100%;
padding: 15px;
margin: 5px 0 22px 0;
border: none;
background: #f1f1f1;
}
input[type=text]:focus, input[type=password]:focus {
background-color: #ddd;
outline: none;
}
/* Set a style for the submit button */
.btn {
background-color: #4CAF50;
color: white;
padding: 16px 20px;
border: none;
cursor: pointer;
width: 100%;
opacity: 0.9;
}
.btn:hover {
opacity: 1;
}
<body>
<h2>Form on Hero Image</h2>
<div class="bg-img">
<form action="/action_page.php" class="container">
<h1>Login</h1>
<label for="email"><b>Email</b></label>
<input type="text" placeholder="Enter Email" name="email" required>
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit" class="btn">Login</button>
</form>
</div>
<p>This example creates a form on a responsive image. Try to resize the browser window to see how it always will cover the whole width of the screen, and that it scales nicely on all screen sizes.</p>
</body>
Now, lets modify the snippet according to your need (as mentioned in your question).
[ Pay attention to the changes in the style tag ]
Change height of form. (height attribute)
Change input text size. (font-size attribute)
Change input text font. (font-family attribute)
body, html {
height: 100%;
font-family: Arial, Helvetica, sans-serif;
}
* {
box-sizing: border-box;
}
.bg-img {
/* The image used */
background-image: url("https://www.w3schools.com/howto/img_nature.jpg");
min-height: 380px;
/* Center and scale the image nicely */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
position: relative;
}
/* Add styles to the form container */
.container {
position: absolute;
right: 0;
margin: 20px;
max-width: 300px;
padding: 16px;
background-color: white;
}
/* Full-width input fields */
input[type=text], input[type=password] {
width: 100%;
padding: 15px;
margin: 5px 0 22px 0;
border: none;
background: #f1f1f1;
height:10%;
font-size:10px;
font-family: monospace;
}
input[type=text]:focus, input[type=password]:focus {
background-color: #ddd;
outline: none;
}
/* Set a style for the submit button */
.btn {
background-color: #4CAF50;
color: white;
padding: 16px auto;
border: none;
cursor: pointer;
width: 100%;
opacity: 0.9;
height:10%;
text-align:center;
}
.btn:hover {
opacity: 1;
}
form{
height:70%;
}
h2{
margin-top:0px;
}
label{
font-size:15px;
}
<body>
<h2>Form on Hero Image</h2>
<div class="bg-img">
<form action="/action_page.php" class="container">
<h2>Login</h2>
<label for="email"><b>Email</b></label>
<input type="text" placeholder="Enter Email" name="email" required>
<label for="psw"><b>Password</b></label>
<input type="password" placeholder="Enter Password" name="psw" required>
<button type="submit" class="btn">Login</button>
</form>
</div>
<p>This example creates a form on a responsive image. Try to resize the browser window to see how it always will cover the whole width of the screen, and that it scales nicely on all screen sizes.</p>
</body>
Hope, this gives you an idea about the whole thing.

Gmail Like textbox tooltips in CSS

I want to create a textbox tooltip like gmail use. I tried my end to make and this done reaches on various community and unique google one but I don't get any answer as I was want the screenshot i try to make is below.
Screenshot image is "https://ibb.co/xCcgMs6"
The error or issue is the popup is not show when input field is focus or active , I means.
Please help me how I make this..
My code is below-
$(function(){
var jfk = $(".jfk-bubble");
$("#name").focus(function(){
jfk.addClass("active");
}).blur(function(){
jfk.removeClass("active");
});
});
form {
padding: 25px;
background: #fff;
border: 1px solid #c5edf9;
div {
position: relative;
margin: 0 0 1.5em;
}
}
/* BUBBLE */
.jfk-bubble {
box-shadow: 0 1px 3px rgba(black,.2);
background-color: #fff;
border: 1px solid;
position: absolute;
z-index: 1201 !important;
border-color: #bbb #bbb #a8a8a8;
padding: 16px;
width: 255px;
line-height: 17px;
visibility: hidden;
opacity: 0;
left: 16px;
top: 48px;
#include transition(all 0.218s);
&.active {
visibility: visible;
opacity: 1;
}
}
/* bubble arrow */
.jfk-bubble-arrow {
position: absolute;
top: 20px;
&:before, &:after {
content: "";
position: absolute;
height: 0;
width: 0;
}
&:before {
border: 9px solid;
border-color: transparent #bbb;
top: -9px;
}
&:after {
border: 8px solid;
border-color: transparent #fff;
top: -8px;
}
}
.jfk-bubble-arrowright {
right: 0;
&:before, &:after {
border-right-width: 0;
}
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<h3>Login for Form 2</h3>
<div class="login-temp">
<form class="form-horizontal">
<div class="form-group">
<input type="text" name="name" id="name" />
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Your Password *" value="" />
</div>
<div class="form-group">
<input type="submit" class="btnSubmit" value="Login" />
</div>
<div class="form-group">
Forget Password?
</div>
</form>
</div>
<div class="jfk-bubble active">
<p>
People you connect with on Google may see the month and day of your birthday.
<a target="_blank" href="#">Learn more</a>
</p>
<div class="jfk-bubble-arrow jfk-bubble-arrowright"></div>
</div>
please help me.

inline login form image not display full

HTML :
form {
padding-top: 5px;
text-align: right;
margin-bottom: 15px;
}
form img {
width: 75px;
height: 25px;
margin-left: -5px;
}
form input {
padding: 12px 17px;
border: 0px solid #fff;
background: rgba(0, 0, 0, 0.2);
border-radius: 15px;
width: 155px;
color: #fff;
}
form button,
#btnDaftar,
#btnLivechat {
display: inline-block; background: url(http://jawapoker88.com/img/images/login.png) top left no-repeat; width: 110px; height: 25px; border: none; cursor: pointer;}
#btnDaftar {
background-image: url(http://jawapoker88.com/img/images/daftar.png)
}
form input::-webkit-input-placeholder {
color: #fff;
}
form input:-moz-placeholder {
color: #fff
}
form input::-moz-placeholder {
color: #fff
}
form input:-ms-input-placeholder {
color: #fff;
}
<div class="wrapper">
<form method="post" action="#">
<input type="text" name="username" placeholder="Username" class="SITELOGIN" method="username" />
<input type="password" name="password" placeholder="Password" class="SITELOGIN" method="password" />
<button type="submit" class="SITELOGIN" method="login"></button>
</form>
</div>
CSS
Question : how to display a full image of login button and daftar button?
Here's what it looks like at the moment:
In this case, the easiest thing to do, without setting a height to the buttons, is to just use an img element:
form {
padding-top: 5px;
text-align: right;
margin-bottom: 15px;
}
form input {
padding: 12px 17px;
border: 0px solid #fff;
background: rgba(0, 0, 0, 0.2);
border-radius: 15px;
width: 155px;
color: #fff;
}
form button,
#btnDaftar,
#btnLivechat {
display: inline-block;
border: none;
cursor: pointer;
background:transparent;
vertical-align:middle;
}
form input::-webkit-input-placeholder {
color: #fff;
}
form input:-moz-placeholder {
color: #fff
}
form input::-moz-placeholder {
color: #fff
}
form input:-ms-input-placeholder {
color: #fff;
}
<div class="wrapper">
<form method="post" action="#">
<input type="text" name="username" placeholder="Username" class="SITELOGIN" method="username" />
<input type="password" name="password" placeholder="Password" class="SITELOGIN" method="password" />
<button type="submit" class="SITELOGIN" method="login">
<img src="http://jawapoker88.com/img/images/login.png">
</button>
<a href="#" id="btnDaftar" class="SITELOGIN" method="register">
<img src="http://jawapoker88.com/img/images/daftar.png">
</a>
</form>
</div>
You should add background-size: contain to #header form button, #btnDaftar, #btnLivechat to let the image fit the container. For a prettier end-result, you could also add vertical-align: middle; to make it align right.

How do I direct the login button to another page?

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Welcome to Wave - Log In, Sign Up or Learn More</title>
<style>
#import url(http://fonts.googleapis.com/css?family=Exo:100,200,400);
#import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:700,400,300);
body{
margin: 0;
padding: 0;
background: #fff;
color: #fff;
font-family: Arial;
font-size: 12px;
}
.body{
position: absolute;
top: -20px;
left: -20px;
right: -40px;
bottom: -40px;
width: auto;
height: auto;
background-image: url(http://ginva.com/wp-content/uploads/2012/07/city-skyline-wallpapers-008.jpg);
background-size: cover;
-webkit-filter: blur(5px);
z-index: 0;
}
.grad{
position: absolute;
top: -20px;
left: -20px;
right: -40px;
bottom: -40px;
width: auto;
height: auto;
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,0.65))); /* Chrome,Safari4+ */
z-index: 1;
opacity: 0.7;
}
.header{
position: absolute;
top: calc(50% - 35px);
left: calc(50% - 255px);
z-index: 2;
}
.header div{
float: left;
color: #fff;
font-family: 'Exo', sans-serif;
font-size: 35px;
font-weight: 200;
}
.header div span{
color: #5379fa !important;
}
.login{
position: absolute;
top: calc(50% - 75px);
left: calc(50% - 50px);
height: 150px;
width: 350px;
padding: 10px;
z-index: 2;
}
.login input[type=text]{
width: 250px;
height: 30px;
background: transparent;
border: 1px solid rgba(255,255,255,0.6);
border-radius: 2px;
color: #fff;
font-family: 'Exo', sans-serif;
font-size: 16px;
font-weight: 400;
padding: 4px;
}
.login input[type=password]{
width: 250px;
height: 30px;
background: transparent;
border: 1px solid rgba(255,255,255,0.6);
border-radius: 2px;
color: #fff;
font-family: 'Exo', sans-serif;
font-size: 16px;
font-weight: 400;
padding: 4px;
margin-top: 10px;
}
.login input[type=button]{
width: 260px;
height: 35px;
background: #fff;
border: 1px solid #fff;
cursor: pointer;
border-radius: 2px;
color: #a18d6c;
font-family: 'Exo', sans-serif;
font-size: 16px;
font-weight: 400;
padding: 6px;
margin-top: 10px;
}
.login input[type=button]:hover{
opacity: 0.8;
}
.login input[type=button]:active{
opacity: 0.6;
}
.login input[type=text]:focus{
outline: none;
border: 1px solid rgba(255,255,255,0.9);
}
enter code here
.login input[type=password]:focus{
outline: none;
border: 1px solid rgba(255,255,255,0.9);
}
.login input[type=button]:focus{
outline: none;
}
::-webkit-input-placeholder{
color: rgba(255,255,255,0.6);
}
::-moz-input-placeholder{
color: rgba(255,255,255,0.6);
}
</style>
<script src="js/prefixfree.min.js"></script>
</head>
<body>
<div class="body"></div>
<div class="grad"></div>
<div class="header">
<div>Welcome to<span><br>Wave</span></div>
</div>
<br>
<div class="login">
<input type="text" placeholder="username" name="user"><br>
<input type="password" placeholder="password" name="password"><br>
<input type="button" value="Login">
</div>
<script src='http://codepen.io/assets/libs/fullpage/jquery.js'></script>
enter code here
</body>
</html>
How do I make the login button direct to another page? I am doing this for my class (High school) and need help. What do people need to login in. I have already completed a registration form. I would really appreciate the help.
Just add an "onclick" event to your button. Really you should add an ID to your button and break out the event into a separate JS script, but this would work for your purposes.
<input type="button" value="Login" onclick="location.href = 'otherpage.html';">
Also definitely move all that style into a style.css file and then link it with
<link rel="stylesheet" type="text/css" href="style.css">
That way you don't have it clogging up your html.
You should send user's login information to a server-side script to be processed and then assign a session to that user.
Credentials checking and redirecting from JavaScript is not scure and an expert user can easily bypass this authentication phase. My suggestion is create a HTML form element and then submit those information to server side and from server, redirect the user to another page.
HTML Form:
<form action="address to server-side script" class="login" >
<input type="text" placeholder="username" name="user"><br>
<input type="password" placeholder="password" name="password"><br>
<input type="submit" value="Login">
</form>
<form action="other page link" method="post">
<div class="login">
<input type="text" placeholder="username" name="user"><br>
<input type="password" placeholder="password" name="password"><br>
<input type="submit" value="Login">
</div>
</form>
try this
<div class="login"
<form action="otherpage.html" method="post">
<input type="text" placeholder="username" name="user"><br>
<input type="password" placeholder="password" name="password"><br>
<input type="submit" value="Login">
</form>
</div>
I hope this is useful for you.,