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

              
                <div class="links"><a href="https://www.npmjs.com/package/glitched-writer"><svg id="npm" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewbox="0 0 780 250" style="enable-background:new 0 0 780 250;" xml:space="preserve"><path class="st0" d="M240,250h100v-50h100V0H240V250z M340,50h50v100h-50V50z M480,0v200h100V50h50v150h50V50h50v150h50V0H480z					M0,200h100V50h50v150h50V0H0V200z"></path></svg></a></div>
<div
  class="log" id="logs">
  <p>Welcome</p>
  </div>
  <div class="text" id="glitch_this">Welcome</div><input class="input" id="input" placeholder="$" autocomplete="off" disabled="">
  <div class="input--shadow"></div>
              
            
!

CSS

              
                *
	-webkit-font-smoothing: antialiased
	-moz-osx-font-smoothing: grayscale

*, *::before, *::after
	margin: 0
	padding: 0
	box-sizing: border-box

$light-blue: #A5E5D4
$blue: #42C3C8
$pink: #D93DA5
$black: #1D1E22

=text-shadow($color)
	text-shadow: 2px 4px 10px rgba($color, .5)

=text-shadow-small($color)
	text-shadow: 1px 3px 6px rgba($color, .5)

=font-family
	font-family: 'M PLUS 1p', 'Open Sans', sans-serif

body
	height: 100vh
	overflow: hidden
	display: flex
	justify-content: center
	align-items: center
	background-color: $black
	background-image: radial-gradient(rgba($blue, .2), $black 120%)

	&::after
		content: ''
		position: absolute

		// z-index: -1;
		top: 0
		left: 0
		width: 100%
		height: 100%
		background: repeating-linear-gradient(0deg, rgba($black, .5), rgba($black, .5) 1px, transparent 1px, transparent 2px)
		pointer-events: none

\::selection
	background: $light-blue
	color: $black
	text-shadow: none

.input
	position: absolute
	bottom: 30px
	width: 240px
	height: 35px
	padding: 0 8px
	background: transparent
	outline: none
	border: 1px solid $light-blue
	caret-color: $blue
	color: $light-blue
	font-weight: 300

	+text-shadow-small($light-blue)
	+font-family

	@keyframes an
		0%, 50%
			--ph: visible

		51%, 100%
			--ph: hidden

	animation: an .9s infinite alternate
	transition: border-color .1s, color .1s, text-shadow .1s, transform .3s 1.2s

	&::placeholder
		color: $light-blue
		transition: opacity .1s, color .1s
		visibility: var(--ph)

		+text-shadow-small($light-blue)

	&:focus, &:hover
		border-color: $blue
		color: $blue

		+text-shadow-small($blue)

		&::placeholder
			color: $blue

		&::selection
			background: $blue

		& ~ .input--shadow
			border-color: $blue

	&:focus::placeholder
		opacity: 0

	&:disabled
		transform: translatey(70px)

		& ~ .input--shadow
			transform: translatey(70px)

	&--shadow
		position: absolute
		bottom: calc(30px - 4px)
		transform: translatex(2px)
		filter: blur(4px)
		opacity: .5
		width: 240px
		height: 35px
		border: 2px solid $light-blue
		pointer-events: none
		transition: transform .3s 1.2s

.text
	position: relative
	padding: 30px
	font-size: 35px
	color: $light-blue

	+font-family
	+text-shadow($light-blue)

	&::after, &::before
		content: attr(data-decrypted-text)
		position: absolute
		opacity: 0
		left: 0
		top: 0
		width: 100%
		height: 100%
		padding: 30px
		overflow: hidden
		color: $blue

	&::before
		z-index: -1
		color: $pink

	&.glitch-writing
		animation: glitch-skew 1s steps(10, end) infinite alternate-reverse

		&::after, &::before
			opacity: 1

		&::after
			animation: glitch-animation-1 1.5s steps(20, end) infinite alternate-reverse

		&::before
			animation: glitch-animation-2 2s steps(20, end) infinite alternate-reverse

	@keyframes glitch-skew
		$steps: 10

		@for $i from 0 through $steps
			#{percentage($i * 1 / $steps)}
				transform: skew(random(10) - 5 + deg)

	@keyframes glitch-animation-1
		$steps: 20

		@for $i from 0 through $steps
			#{percentage($i * 1 / $steps)}
				clip: rect(random(100) + px, 1000px, random(100) + px, 0)
				transform: skew(random(16) - 8 + deg) translatex(random(30) - 15 + px)

	@keyframes glitch-animation-2
		$steps: 20

		@for $i from 0 through $steps
			#{percentage($i * 1 / $steps)}
				clip: rect(random(100) + px, 1000px, random(100) + px, 0)
				transform: skew(random(10) - 5 + deg) translatex(random(20) - 10 + px)

.log
	position: absolute
	top: 4vh
	left: 30px
	color: $light-blue
	font-weight: 300
	font-size: 13px
	line-height: 20px
	display: flex
	flex-direction: column-reverse

	+font-family
	+text-shadow-small($light-blue)

	&::after
		content: ''
		position: absolute
		top: -2px
		left: -7px
		width: 1px
		height: 100%
		background: $light-blue

.links
	position: absolute
	bottom: 4vh
	right: 30px
	display: flex

	svg
		height: 16px

		path
			fill: $light-blue
			stroke: none
			transition: fill .1s

		&:hover
			path
				fill: $blue

              
            
!

JS

              
                const wait = time => new Promise(resolve => setTimeout(resolve, time))

// GlitchedWriter: https://www.npmjs.com/package/glitched-writer

wait(1200)
	.then(() => glitchWrite(glitch_this, 'my old friend.', ))
	.then(() => wait(1200))
	.then(() => glitchWrite(glitch_this, 'This is only the beginning'))
	.then(() => wait(1500))
	.then(() => glitchWrite(glitch_this, 'Please, say something...'))
	.then(() => input.removeAttribute('disabled'))

const displayWriter = setGlitchedWriter(glitch_this)

input.addEventListener(
	'input',
	_.debounce(() => displayWriter.write(input.value), 500, {
		maxWait: 1000,
	}),
)

glitch_this.addEventListener(
	'glitchWrote',
	e => (logs.innerHTML += `<p>${e.detail.text}</p>`),
)
              
            
!
999px

Console