Pen Settings

HTML

CSS

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

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                #app
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Nunito:600,700&display=swap')

$primary: #4D6FE5

*
	box-sizing: border-box

body
	font-family: Nunito, Roboto, Arial, sans-serif
	background: $primary
	height: 100vh

#app
	height: 100%
	display: flex
	justify-content: center

.container
	text-align: center
	color: #fff
	margin-top: 100px

	> header
		font-size: 1.3rem
		font-weight: 700
		margin: 0 auto 60px auto
		position: relative
		height: 25px
		width: 250px
		overflow: hidden
	
.header-headings
	display: flex
	flex-direction: column
	position: absolute
	width: 100%
	transition: all .4s cubic-bezier(.785,.135,.15,.86)

	> span
		margin: 3px 0

	&.sign-in
		transform: translateY(0)
	
	&.sign-up
		transform: translateY(-25px)
	
	&.forgot
		transform: translateY(-50px)
	
.options
	display: flex
	align-items: center
	width: 350px

	@media screen and (max-width: 380px)
		width: 100%

	> li
		cursor: pointer
		opacity: .5
		transition: all .2s ease
		
		&:hover
			opacity: 1
		
		&.active
			opacity: 1
		
		&:nth-of-type(2)
			margin-left: 15px
	
		&:last-of-type
			margin-left: auto
	
.account-form
	display: flex
	flex-direction: column
	margin-top: 30px

.account-form-fields
	display: flex
	flex-direction: column
	overflow: hidden
	transition: all .4s cubic-bezier(.785,.135,.15,.86)

	&.sign-in
		max-height: 123px
	
	&.sign-up
		max-height: 250px
	
	&.forgot
		max-height: 61px

	> input
		border: 0
		margin-bottom: 10px
		padding: 15px
		font-size: 1rem
		font-family: Nunito, sans-serif
		color: #000
		border-radius: 5px
	
		&::placeholder
			color: #aaa
	
		&::-webkit-input-placeholder
			color: #aaa
	
		&:-ms-input-placeholder
			color: #aaa
	
		&:focus
			outline: none
	
.btn-submit-form
	border: 0
	appearance: none
	-webkit-appearance: none
	-moz-appearance: none
	cursor: pointer
	padding: 15px 0
	border-radius: 5px
	color: #fff
	font-size: 1rem
	font-family: Nunito, sans-serif
	background: lighten($primary, 5%)
	box-shadow: 0px 1px 2px rgba(0,0,0,.13)
	transition: all .2s ease

	&:hover
		background: darken($primary, 2%)

	&:active, &:focus
		outline: none
		background: darken($primary, 7%)
	
footer
	position: fixed
	width: 100%
	bottom: 0
	left: 0
	padding: 30px 0
	text-align: center

	> a
		color: #fff
		font-weight: 700
              
            
!

JS

              
                function Form ({ option }) {
	return (
		<form className='account-form' onSubmit={(evt) => evt.preventDefault()}>
			<div className={'account-form-fields ' + (option === 1 ? 'sign-in' : (option === 2 ? 'sign-up' : 'forgot')) }>
				<input id='email' name='email' type='email' placeholder='E-mail' required />
				<input id='password' name='password' type='password' placeholder='Password' required={option === 1 || option === 2 ? true : false} disabled={option === 3 ? true : false} />
				<input id='repeat-password' name='repeat-password' type='password' placeholder='Repeat password' required={option === 2 ? true : false} disabled={option === 1 || option === 3 ? true : false} />
			</div>
			<button className='btn-submit-form' type='submit'>
				{ option === 1 ? 'Sign in' : (option === 2 ? 'Sign up' : 'Reset password') }
			</button>
		</form>
	)
}

function App () {
	const [option, setOption] = React.useState(1)
	
	return (
		<div className='container'>
			<header>
				<div className={'header-headings ' + (option === 1 ? 'sign-in' : (option === 2 ? 'sign-up' : 'forgot')) }>
					<span>Sign in to your account</span>
					<span>Create an account</span>
					<span>Reset your password</span>
				</div>
			</header>
			<ul className='options'>
				<li className={option === 1 ? 'active' : ''} onClick={() => setOption(1)}>Sign in</li>
				<li className={option === 2 ? 'active' : ''} onClick={() => setOption(2)}>Sign up</li>
				<li className={option === 3 ? 'active' : ''} onClick={() => setOption(3)}>Forgot</li>
			</ul>
			<Form option={option} />
			<footer>
				<a href='https://dribbble.com/shots/5041581-Zenbu-Sign-in-up-forgot-page' target='_blank'>Original design with animations by Zenbu</a>
			</footer>
		</div>
	)
}

ReactDOM.render(<App />, document.getElementById('app'))
              
            
!
999px

Console