css Audio - Active file-generic CSS - Active Generic - Active HTML - Active JS - Active SVG - Active Text - Active file-generic Video - Active header Love html icon-new-collection icon-person icon-team numbered-list123 pop-out spinner split-screen star tv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              .container
	form(autocomplete="off" id='form')
		h1#message Get Started
		small#smallMessage 
		.field
			input(type="email" name="email" placeholder="Email" id="email" autocomplete="off")
			label(for="email") Email
				
		.field
			input(type="password" name="password" placeholder="Password" id="password" autocomplete="new-password")
			label(for="password") Password
				
		button#submit Create My Account
		p By signing up, I agree to to the Terms of Service and Privacy Policy
            
          
!
            
              $orange : #ff8473;


body,
html {
	height: 100%;
}

body {
	font-family: "Lato", sans-serif;
	background: $orange;
	display: flex;
	align-items: center;
	flex-direction: column;
	align-content: center;
	justify-content: center;
	color: white;
}

.container {
	width: 400px;
}

form {
	display: flex;
	flex-direction: column;
	//background transparent to allow for :before&::after effect
	background: transparent;
	max-width: 320px;
	//height: 300px;
	padding: 2rem 2rem 2rem 2rem;
	position: relative;
	&::before,
	&::after {
		position: absolute;
		content: "";
		width: 100%;
		height: 100%;
		transition: all 0.5s ease;
	}
	&::before {
		z-index: -1;
		background: transparent;
		transform: translateX(-3.5rem) translateY(-3.75rem);
		border: 6px solid #0e39fe;
	}
	&::after {
		background: #0ea8ec;
		z-index: -2;
		transform: translateX(-2rem) translateY(-2.25rem);
	}
	h1 {
		text-align: center;
		margin: 0 0 0.25rem 0;
		padding: 0;
		font-size: 1.5rem;
	}
	small {
		display: block;
		margin: 0 auto 1rem;
		padding: 0;
		font-size: 14px;
	}
	//focus-with in pseudo element allows us to change elements inside the form when "focused/clicked on"
	&:focus-within {
		background: #0ea8ec;
		&::before {
			width: 0%;
			height: 0%;
			//border: ;
			transform: translatex(0px) translatey(0px);
		}
	}
	//end focus-within
	//containers for input and labels
	.field {
		display: flex;
		flex-flow: column-reverse;
		margin-bottom: 1em;
	}

	& label,
	input {
		transition: all 0.3s ease;
		touch-action: manipulation;
	}
	& label {
		// position: absolute;
		// font-size: 21px;
		// color: white;
		// margin: 0;
		opacity: 0;
	}
	& input {
		padding: 10px 20px;
		border: 4px solid white;
		margin: 0 1.5rem;
		background-color: transparent !important;
		-webkit-appearance: none;
		//font-weight: bold;
		color: white;
		//important to override chrome's yellow background and black text autofill
		&:-webkit-autofill {
			background-color: transparent !important;
			-webkit-box-shadow: 0 0 0px 1000px #0ea8ec inset;
			-webkit-text-fill-color: white !important;
		}
		&::placeholder {
			color: white;
		}
		&:focus {
			color: #0e39fe;
			font-weight: bold;
			outline: 0;
			border: 6px solid #0e39fe;
		}
		&::-webkit-input-placeholder {
			opacity: 1;
			transition: inherit;
		}

		&:focus::-webkit-input-placeholder {
			opacity: 0;
		}
	}

	& button {
		border: none;
		padding: 0.85rem 1rem;
		margin-top: 2rem;
		background-color: #0e39fe;
		color: white;
		font-size: 0.75rem;
		text-transform: uppercase;
		width: 65%;
		position: absolute;
		bottom: -20px;
		right: 18%;
		letter-spacing: 0.15em;
		transition: all 0.3s ease;
		&:hover {
			border: 6px solid #090c9b;
		}
	}
	p {
		font-size: 0.75rem;
		line-height: 1.125rem;
		margin: 0.5rem 1.5rem 1.75rem 1.5rem;
		&.success-message {
			font-size: 1.25rem;
			text-align: center;
			line-height: 2rem;
			margin: 1.5rem auto 5rem auto;
		}
	}
}


            
          
!
            
              const form = document.querySelector('form');
const message = document.getElementById('message');
const smallMessage = document.getElementById('smallMessage');
const emailMessage = 'Type your email';
const passwordMessage = 'Choose your password';
const email = document.getElementById('email');
const password = document.getElementById('password');
const submitBtn = document.getElementById('submit');

function firstMessage(){
	message.innerHTML = emailMessage;
	smallMessage.innerHTML = "";
	document.body.style.background= '#88C9E8';
}

// function message(el,message,color){
// 	el.innerHTML = message;
// 	document.body.style.background = color;
// }

function secondMessage(){
	message.innerHTML = passwordMessage;
	
	document.body.style.background ='#D5F3A6';
}
function length(){
	if(password.value.length <= 3){
		smallMessage.innerHTML = "Make it strong";
		
	} 
	else if(password.value.length  > 3 && password.value.length <10){
		smallMessage.innerHTML = "Strong as a bull!";
		
	}
	else if(password.value.length >=10){
		smallMessage.innerHTML = "It's unbreakable!!!";
		
	}
	else{
		smallMessage.innerHTML = "";
	}
}

function formValidation(){
	//step 1 email
	//display Type your email when user clicks on input and types, 
	//hide after user clicks on something else
	email.addEventListener("input",firstMessage);
	//step 2 password 
	//display Choose your password as user clicks on input
	//change small message as user enters longer password 
	password.addEventListener('input', secondMessage);
	password.addEventListener('keyup', length);

	//step 3 when input 1 and 2 are filled out 
	//display message You're a click away, small message that is why you are here fore
	submitBtn.addEventListener('mouseover', function(event){
		message.innerHTML="You're a click away";
		smallMessage.innerHTML = "Do it. That's what you are here for.";
		document.body.style.background = '#FCEFA6';
	});
	
	//step 4 button click
	//display Congratulations, there is a confirmation link in your email
	submitBtn.addEventListener('click', function(event){
	form.innerHTML = ' <h1>Good job!</h1><p class="success-message">There is a confirmation link waiting in your email inbox.</p>';
	document.body.style.background = '#D7F5DE';
});
	
	
}

formValidation();





            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console