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="container">
	<img src="https://1-notes.com/wp-content/uploads/2020/06/quality-50-1024x682.jpg" />
	<div class="texts">
		<p>吾輩は猫である 名前はまだ無い</p>
		<p>どこで生れたか とんと見当がつかぬ</p>
		<p>何でも薄暗いじめじめした所で ニャーニャー泣いていた事だけは記憶している</p>
		<p>吾輩はここで始めて 人間というものを見た</p>
		<p>しかもあとで聞くとそれは</p>
		<p>書生という人間中で一番 獰悪な種族であったそうだ</p>
		<p>この書生というのは時々我々を 捕て煮て食うという話である</p>
		<p>しかしその当時は何という考もなかったから</p>
		<p>別段恐しいとも思わなかった</p>
		<p>ただ彼の掌に載せられて スーと持ち上げられた時何だか</p>
		<p>フワフワした感じが あったばかりである</p>
		<p>掌の上で少し落ちついて 書生の顔を見たのが</p>
		<p>いわゆる人間というものの 見始めであろう</p>
	</div>
</div>
<p><a href="https://1-notes.com/css-movie-subtitles-animation/" target="_blank" rel="noopener">映画の字幕っぽいCSSアニメーションサンプル | ONE NOTES</a></p>
              
            
!

CSS

              
                body{
	margin: 0;
	padding: 0;
}

.container{
	position: relative;
	width:100%;
	height: 220px;
	background: #000;
}

.container img{
	width:100%;
	height: 100%;
	object-fit: cover;
	filter: brightness(0.3);
}


.texts p{
	margin: 0;
	padding: 0;
	position: absolute;
	bottom: 5px;
	left: 50%;
	transform: translateX(-50%);
	-webkit-transform: translateX(-50%);
	text-align: center;
	color: #FFF;
	font-size: 16px;
	overflow-wrap: break-word;
	word-break: keep-all;
	opacity: 0;
}

.texts p:nth-child(1) {	animation: text-anim 5s 0s;}
.texts p:nth-child(2) {	animation: text-anim 5s 5s;}
.texts p:nth-child(3) {	animation: text-anim 5s 10s;}
.texts p:nth-child(4) {	animation: text-anim 5s 15s;}
.texts p:nth-child(5) {	animation: text-anim 5s 20s;}
.texts p:nth-child(6) {	animation: text-anim 5s 25s;}
.texts p:nth-child(7) {	animation: text-anim 5s 30s;}
.texts p:nth-child(8) {	animation: text-anim 5s 35s;}
.texts p:nth-child(9) {	animation: text-anim 5s 40s;}
.texts p:nth-child(10) {	animation: text-anim 5s 45s;}
.texts p:nth-child(11) {	animation: text-anim 5s 50s;}
.texts p:nth-child(12) {	animation: text-anim 5s 55s;}
.texts p:nth-child(13) {	animation: text-anim 5s 60s;}

@keyframes text-anim {
	0%, 100% {opacity: 0;}
	20%, 80% {opacity: 1;}
}
              
            
!

JS

              
                
              
            
!
999px

Console