html,
body {
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: navajowhite;
}

.box {
	display: flex;
}

/* Rainbow Animation */
@keyframes rainbow {
    0% { color: red; }
    16.666% { color: orange; }
    33.333% { color: yellow; }
    50% { color: green; }
    66.666% { color: blue; }
    83.333% { color: indigo; }
    100% { color: violet; }
}

@keyframes rainbow_left {
    0% { color: rgb(255, 128, 128); }
    16.666% { color: rgb(255, 210, 126); }
    33.333% { color: rgb(255, 255, 122); }
    50% { color: rgb(64, 127, 64); }
    66.666% { color: rgb(112, 112, 255); }
    83.333% { color: rgb(100, 63, 126); }
    100% { color: rgb(242, 194, 242); }
}

.box .inner {
	width: 400px;
	height: 200px;
	line-height: 200px;
	font-size: 4em;
	font-family: sans-serif;
	font-weight: bold;
	white-space: nowrap;
	overflow: hidden;
}

.box .inner:first-child {
	background-color: indianred;
	animation: rainbow_left 5s infinite;
	transform-origin: right;
	transform: perspective(100px) rotateY(-15deg);
}

.box .inner:last-child {
	background-color: lightcoral;
	animation: rainbow 5s infinite;
	transform-origin: left;
	transform: perspective(100px) rotateY(15deg);
}

.box .inner span {
	position: absolute;
	animation: marquee 5s linear infinite;
}

.box .inner:first-child span {
	animation-delay: 2.5s;
	left: -100%;
}

@keyframes marquee {
	from {
		left: 100%;
	}

	to {
		left: -100%;
	}
}