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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ 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="content">
	<div class="list">
		<div class="list__item">Некий <br>текст</div>
		<div class="list__splitter">
			<div class="list__splitter__content">
				<svg viewBox="0 0 517 123" fill="none" preserveAspectRatio="none">
					<path d="M1.5.9v30.3a30 30 0 0030 30h454a30 30 0 0130 30v31.1" stroke="#000"/>
				</svg>
			</div>
		</div>
		
		<div class="list__item">Некий <br>текст</div>
		<div class="list__splitter list__splitter--revert">
			<div class="list__splitter__content">
				<svg viewBox="0 0 517 123" fill="none" preserveAspectRatio="none">
					<path d="M1.5.9v30.3a30 30 0 0030 30h454a30 30 0 0130 30v31.1" stroke="#000"/>
				</svg>
			</div>
		</div>
		
		<div class="list__item">Некий <br>текст</div>
	</div>
</div>
              
            
!

CSS

              
                .list {
	display: flex;
	flex-direction: column;
	margin: 0 auto;
	max-width: 400px;
	&__item {
		padding: 1em;
		background: #f9f9f9;
		min-height: 92px;
	}
	&__splitter {
		position: relative;
		&--revert {
			transform: scale(-1, 1);
		}
		&__content {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			transform: translatey(-50%);
			
			svg {
				width: 100%;
				height: 123px;
				path {
					vector-effect: non-scaling-stroke;
				}
			}
			&::before, &::after {
				width: 10px;
				height: 10px;
				position: absolute;
				background: #f00;
			}
			&::after {
				content: "";
				bottom: -4px;
				right: -4px;
			}
		}
		
	}
	&>*:nth-child(2) {
		.list__splitter__content::before {
			content: "";
			top: -4px;
			left: -4px;
		}
	}
}

.pathAnima {
	stroke-dasharray: var(--path-length);
	stroke-dashoffset: var(--path-length);
	animation-name: pathAnima;
	animation-duration: 3s;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
    animation-timing-function: linear;
}
@keyframes pathAnima {
  to {
    stroke-dashoffset: 0;
  }
}
              
            
!

JS

              
                // Добываем длну пути
let svgPath = [...document.querySelectorAll(".list__splitter path")]
svgPath.forEach(path => {
	let length = path.getTotalLength()
	path.style.setProperty('--path-length', length);
	
})

// Запуск анимации
svgPath.forEach(path => {
	path.classList.add("pathAnima")
})
              
            
!
999px

Console