<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css" rel="stylesheet">
<style>@charset "utf-8";
/*========= スクロールダウンのためのCSS ===============*/
/*スクロールダウン全体の場所*/
.scrolldown {
/*描画位置※位置は適宜調整してください*/
position: fixed;
bottom: 10px;
right: 10%;
/*マウスの動き1.6秒かけて動く永遠にループ*/
animation: mousemove 1.6s ease-in-out infinite;
}
/*下からの距離が変化して上から下に動く*/
@keyframes mousemove {
0% {
bottom: 10px;
}
50% {
bottom: 5px;
}
100% {
bottom: 10px;
}
}
/*Scrollテキストの描写*/
.scrolldown span {
z-index: 10;
/*描画位置*/
position: absolute;
left: -15px;
bottom: 45px;
/*テキストの形状*/
color: #000;
font-size: 0.7rem;
letter-spacing: 0.05em;
white-space: nowrap;
}
/*マウスの中の線描写 */
.scrolldown span::after {
z-index: 10;
content: "";
/*描画位置*/
position: absolute;
top: 10px;
left: 17px;
/*線の形状*/
width: 1px;
height: 15px;
background: #000;
/*線の動き1.4秒かけて動く。永遠にループ*/
animation: mousepathmove 1.4s linear infinite;
opacity: 0;
}
/*上からの距離・不透明度・高さが変化して上から下に流れる*/
@keyframes mousepathmove {
0% {
height: 0;
top: 10px;
opacity: 0;
}
50% {
height: 15px;
opacity: 1;
}
100% {
height: 0;
top: 30px;
opacity: 0;
}
}
/*マウスの描写 */
.scrolldown:before {
z-index: 10;
content: "";
/*描画位置*/
position: absolute;
bottom: 0;
left: -10px;
/*マウスの形状*/
width: 25px;
height: 37px;
border-radius: 10px;
border: 1px solid #000;
}
/*マウスの中の丸の描写*/
.scrolldown:after {
z-index: 10;
content: "";
/*描画位置*/
position: absolute;
bottom: 26px;
left: 0;
/*丸の形状*/
width: 5px;
height: 5px;
border-radius: 50%;
border: 1px solid #000;
}
/*========= 共通設定:レイアウトのためのCSS ===============*/
a {
color: #333;
text-decoration: none;
}
.lead {
position: absolute;
color: #fff;
text-shadow: 2px 2px 5px #000;
font-size: clamp(12px, 5vw, 2rem);
text-align: center;
font-weight: bold;
top: 50%;
left: 50%;
transform: translateY(-50%) translateX(-50%);
white-space: nowrap;
}
/*画像のレスポンシブ*/
img {
width: 100%;
height: auto;
}
/* 画像基本設定 */
.move {
position: relative;
width: 50vw;
margin: 50px auto; /*中央揃え*/
box-shadow: 20px -10px #d5bfbf;
}
/* 画像のマスク */
.mask {
display: block;
line-height: 0; /*行の高さを0にする*/
overflow: hidden; /*拡大してはみ出る要素を隠す*/
}
/*========= ここから個別設定 ===============*/
/* 画像の拡大 */
.zoomIn img {
transform: scale(1);
transition: 0.5s ease-in-out; /*移り変わる速さを変更したい場合はこの数値を変更*/
}
.zoomIn a:hover img {
/*hoverした時の変化*/
transform: scale(1.2); /*拡大の値を変更したい場合はこの数値を変更*/
}
/* 画像の縮小 */
.zoomOut img {
transform: scale(1.2);
transition: 0.5s ease-in-out; /*移り変わる速さを変更したい場合はこの数値を変更*/
}
.zoomOut a:hover img {
/*hoverした時の変化*/
transform: scale(1); /*拡大の値を変更したい場合はこの数値を変更*/
}
/* 画像拡大+回転 */
.zoomInRotate img {
transform: scale(1);
transition: 0.5s ease-in-out; /*移り変わる速さを変更したい場合はこの数値を変更*/
}
.zoomInRotate a:hover img {
/*hoverした時の変化*/
transform: rotate(10deg) scale(1.2); /*拡大、回転の値を変更したい場合はこの数値を変更*/
}
/* ぼかす */
.blur img {
filter: blur(0);
transition: 0.5s ease-in-out; /*移り変わる速さを変更したい場合はこの数値を変更*/
}
.blur a:hover img {
/*hoverした時の変化*/
filter: blur(5px); /*ぼかし具合を変更したい場合はこの数値を変更*/
}
/* 透過 */
.opacity img {
opacity: 1;
transition: 0.5s ease-in-out; /*移り変わる速さを変更したい場合はこの数値を変更*/
}
.opacity a:hover img {
/*hoverした時の変化*/
opacity: 0.5; /*透過具合を変更したい場合はこの数値を変更*/
}
/* モノクロからカラーへ */
.grayscale img {
filter: grayscale(100%); /*モノクロ具合を変更したい場合はこの数値を変更*/
transition: 0.5s ease-in-out; /*移り変わる速さを変更したい場合はこの数値を変更*/
}
.grayscale a:hover img {
/*hoverした時の変化*/
filter: grayscale(0);
}
/* キラッ */
.shine span.mask {
position: relative; /*キラッの基点となる位置を定義*/
display: block;
line-height: 0; /*行の高さを0にする*/
overflow: hidden; /*拡大してはみ出る要素を隠す*/
}
.shine span.mask::before {
position: absolute;
content: "";
width: 50%; /*キラッの横幅*/
height: 100%; /*キラッの縦幅*/
top: 0; /*.shine span.maskのトップ0を基点*/
left: -75%; /*画面の見えていない左から右へ移動するスタート地点*/
background: linear-gradient(
to right,
rgba(255, 255, 255, 0) 0%,
rgba(255, 255, 255, 0.5) 100%
);
transform: skewX(-25deg); /*背景白透過を斜めに*/
}
.shine span.mask:hover::before {
/*hoverした時の変化*/
animation: shine 1s; /*アニメーションの名前と速度を定義*/
}
@keyframes shine {
100% {
left: 125%; /*画面の見えていない左から右へ移動する終了地点*/
}
}
/* 波紋 */
.circle span.mask {
position: relative; /*波紋の基点となる位置を定義*/
display: block;
line-height: 0; /*行の高さを0にする*/
overflow: hidden; /*拡大してはみ出る要素を隠す*/
}
.circle span.mask::before {
position: absolute;
content: "";
transform: scale(0); /*円の大きさ初期値は0*/
opacity: 0; /*透過0*/
width: 100%; /*円のサイズ指定*/
height: 100%; /*円のサイズ指定*/
border-radius: 50%; /*円の角丸指定*/
background: rgba(255, 255, 255, 0.4); /*円の背景色*/
}
.circle span.mask:hover::before {
/*hoverした時の変化*/
animation: circle 0.75s; /*アニメーションの名前と速度を定義*/
}
@keyframes circle {
0% {
transform: scale(0);
opacity: 1; /*透過なし*/
}
30% {
opacity: 1;
}
100% {
transform: scale(2); /*アニメーションで大きくなった2倍の円の指定*/
}
}</style>
</head>
<body>
<body>
<div class="scrolldown">
<span>Scroll</span>
</div>
<div class="move zoomIn">
<a href="#">
<span class="mask">
<img src="http://localhost:10072/wp-content/uploads/demos/_assets/nail3.jpg" alt="">
</span>
</a>
<p class="lead">画像が拡大</p>
</div>
<div class="move zoomOut">
<a href="#">
<span class="mask">
<img src="http://localhost:10072/wp-content/uploads/demos/_assets/nail3.jpg" alt="">
</span>
</a>
<p class="lead">画像が縮小
</p>
</div>
<div class="move zoomInRotate">
<a href="#">
<span class="mask">
<img src="http://localhost:10072/wp-content/uploads/demos/_assets/nail3.jpg" alt="">
</span>
</a>
<p class="lead">画像が拡大+回転
</p>
</div>
<div class="move blur">
<a href="#">
<span class="mask">
<img src="http://localhost:10072/wp-content/uploads/demos/_assets/nail3.jpg" alt="">
</span>
</a>
<p class="lead">ぼかし
</p>
</div>
<div class="move opacity">
<a href="#">
<span class="mask">
<img src="http://localhost:10072/wp-content/uploads/demos/_assets/nail3.jpg" alt="">
</span>
</a>
<p class="lead">透過
</p>
</div>
<div class="move grayscale">
<a href="#">
<span class="mask">
<img src="http://localhost:10072/wp-content/uploads/demos/_assets/nail3.jpg" alt="">
</span>
</a>
<p class="lead">モノクロからカラーへ
</p>
</div>
<div class="move shine">
<a href="#">
<span class="mask">
<img src="http://localhost:10072/wp-content/uploads/demos/_assets/nail3.jpg" alt="">
</span>
</a>
<p class="lead">キラッ
</p>
</div>
<div class="move circle">
<a href="#">
<span class="mask">
<img src="http://localhost:10072/wp-content/uploads/demos/_assets/nail3.jpg" alt="">
</span>
</a>
<p class="lead">波紋
</p>
</div>
<script>
</script>
</body>
</html>