OWLISH Web便利帖

フルスクリーンでムービー再生


<div class="openingVideo overlay">
	<video class="video" muted autoplay loop playsinline>
		<source src="Path/to/movie.mov" type="video/mp4">
	</video>
</div>

<div class="textBox">
	<h2>SITE TITLE</h2>
</div>

.openingVideo {
	position: relative;
	top: 0;
	overflow: hidden;
	width: 100%;
	height: 100vh;
	}
video {
	position: absolute;
	left: 50%;
	top: 50%;
	min-width: 100%;
	min-height: 100%;
	transform: translate(-50%,-50%);
	z-index: -100;
	}
@media screen and (max-width: 767px) {
	video {
		height: auto;
		min-height: 100vh;
		}
	}

.overlay::after {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 100%;
	height: 100%;
	content: "";
	background: rgba(0, 0, 0, 0.4);
	}

.textBox {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100%;
	transform: translate(-50%, -50%);
	}
.textBox h2 {
	font-size: 5rem;
	font-weight: bold;
	line-height: 1.2;
	padding: 0 50px;
	text-align: center;
	color: #fff;
	}

TOP