Thành viên:NguoiDungKhongDinhDanh/CSS/1/styles.css

Bách khoa toàn thư mở Wikipedia
/**
 * Copyright (c) 2022 by web-tiki (https://codepen.io/web-tiki/pen/oNzzey)
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
**/

.t div {
	position: absolute;
	top: 0; left: 0;
	
	transform-origin: 0 0;
	transition: all 1s;
}

.t .wrap {
	top: 50%; left: 50%;

	transform: skewX(30deg);
}

.t .wrap .triangle {
	position: relative;
	top: 0; left: 0;
	width: 200px;
	height: 173px;
	cursor: pointer;
	z-index: 1;
}
.t .wrap:nth-child(1) .triangle {
	background-color: #FF0000;
}
.t .wrap:nth-child(2) .triangle {
	background-color: #FF8700;
}
.t .wrap:nth-child(3) .triangle {
	background-color: #FFD300;
}
.t .wrap:nth-child(4) .triangle {
	background-color: #0AFF99;
}
.t .wrap:nth-child(5) .triangle {
	background-color: #0AEFFF;
}
.t .wrap:nth-child(6) .triangle {
	background-color: #147DF5;
}
.t .wrap .mask {
	width: 100%;
	height: 115.5%;
	background-color: #FFFFFF;
	left: 100%;
	z-index: 2;
	
	transform: skewX(-30deg) rotate(30deg);
}

.t .wrap .triangle:hover {
	transform: translate(10%, 10%);
}
.t .wrap:nth-child(1) .triangle:hover {
	background-color: #FF5151;
}
.t .wrap:nth-child(2) .triangle:hover {
	background-color: #FFAE51;
}
.t .wrap:nth-child(3) .triangle:hover {
	background-color: #FFE251;
}
.t .wrap:nth-child(4) .triangle:hover {
	background-color: #5AFFBA;
}
.t .wrap:nth-child(5) .triangle:hover {
	background-color: #5AF4FF;
}
.t .wrap:nth-child(6) .triangle:hover {
	background-color: #60A7F8;
}

.t .triangle:hover + .mask {
	transform: skewX(-30deg) rotate(30deg) translate(17.5%, 0);
}

.t > div:nth-child(2) {
	transform: rotate(60deg) skewX(30deg);
}
.t > div:nth-child(3) {
	transform: rotate(120deg) skewX(30deg);
}
.t > div:nth-child(4) {
	transform: rotate(-60deg) skewX(30deg);
}
.t > div:nth-child(5) {
	transform: rotate(-120deg) skewX(30deg);
}
.t > div:nth-child(6) {
	transform: rotate(-180deg) skewX(30deg);
}