css实现减色和加色对比效果代码
代码语言:html
所属分类:布局界面
代码描述:css实现减色和加色对比效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<style>
.wrapper {
display: flex;
flex-direction: column;
}
@media (min-width: 1200px) {
.wrapper {
flex-direction: row;
flex-wrap: nowrap;
min-height: calc(100vh - 58px);
}
}
.colorsContainer {
position: relative;
width: 100%;
aspect-ratio: 1/1;
}
.materialsColors {
background: #eee;
color: #111;
}
.materialsColors .colorBox {
mix-blend-mode: multiply;
}
.lightsColors {
background: #111;
color: #eee;
}
.lightsColors .colorBox {
mix-blend-mode: screen;
}
.colorBox {
position: absolute;
top: 50%;
left: 50%;
width: 40%;
aspect-ratio: 1/1;
margin: -20%;
border-radius: 50%;
}
.colorBox:nth-child(0n+1) {
transform: rotate(0deg) translateY(-45%) rotate(0deg);
}
.lightsColors .colorBox:nth-child(0n+1) {
background-color: #330000;
}
.materialsColors .colorBox:nth-child(0n+1) {
background-color: #ffcccc;
}
.colorBox:nth-child(1n+2) {
transform: rotate(9deg) translateY(-45%) rotate(-9deg);
}
.lightsColors .colorBox:nth-child(1n+2) {
background-color: #330800;
}
.materialsColors .colorBox:nth-child(1n+2) {
background-color: #ffd4cc;
}
.colorBox:nth-child(2n+3) {
transform: rotate(18deg) translateY(-45%) rotate(-18deg);
}
.lightsColors .colorBox:nth-child(2n+3) {
background-color: #330f00;
}
.materialsColors .colorBox:nth-child(2n+3) {
background-color: #ffdbcc;
}
.colorBox:nth-child(3n+4) {
transform: rotate(27deg) translateY(-45%) rotate(-27deg);
}
.lightsColors .colorBox:nth-child(3n+4) {
background-color: #331700;
}
.materialsColors .colorBox:nth-child(3n+4) {
background-color: #ffe3cc;
}
.colorBox:nth-child(4n+5) {
transform: rotate(36deg) translateY(-45%) rotate(-36deg);
}
.lightsColors .colorBox:nth-child(4n+5) {
background-color: #331f00;
}
.materialsColors .colorBox:nth-child(4n+5) {
background-color: #ffebcc;
}
.colorBox:nth-child(5n+6) {
transform: rotate(45deg) translateY(-45%) rotate(-45deg);
}
.lightsColors .colorBox:nth-child(5n+6) {
background-color: #332600;
}
.materialsColors .colorBox:nth-child(5n+6) {
background-color: #fff2cc;
}
.colorBox:nth-child(6n+7) {
transform: rotate(54deg) translateY(-45%) rotate(-54deg);
}
.lightsColors .colorBox:nth-child(6n+7) {
background-color: #332e00;
}
.materialsColors .colorBox:nth-child(6n+7) {
background-color: #fffacc;
}
.colorBox:nth-child(7n+8) {
transform: rotate(63deg) translateY(-45%) rotate(-63deg);
}
.lightsColors .colorBox:nth-child(7n+8) {
background-color: #303300;
}
.materialsColors .colorBox:nth-child(7n+8) {
background-color: #fcffcc;
}
.colorBox:nth-child(8n+9) {
transform: rotate(72deg) translateY(-45%) rotate(-72deg);
}
.lightsColors .colorBox:nth-child(8n+9) {
background-color: #293300;
}
.materialsColors .colorBox:nth-child(8n+9) {
background-color: #f5ffcc;
}
.colorBox:nth-child(9n+10) {
transform: rotate(81deg) translateY(-45%) rotate(-81deg);
}
.lightsColors .colorBox:nth-child(9n+10) {
background-color: #213300;
}
.materialsColors .colorBox:nth-child(9n+10) {
background-color: #edffcc;
}
.colorBox:nth-child(10n+11) {
transform: rotate(90deg) translateY(-45%) rotate(-90deg);
}
.lightsColors .colorBox:nth-child(10n+11) {
background-color: #1a3300;
}
.materialsColors .colorBox:nth-child(10n+11) {
background-color: #e6ffcc;
}
.colorBox:nth-child(11n+12) {
transform: rotate(99deg) translateY(-45%) rotate(-99deg);
}
.lightsColors .colorBox:nth-child(11n+12) {
background-color: #123300;
}
.materialsColors .colorBox:nth-child(11n+12) {
background-color: #deffcc;
}
.colorBox:nth-child(12n+13) {
transform: rotate(108deg) translateY(-45%) rotate(-108deg);
}
.lightsColors .colorBox:nth-child(12n+13) {
background-color: #0a3300;
}
.materialsColors .colorBox:nth-child(12n+13) {
background-color: #d6ffcc;
}
.colorBox:nth-child(13n+14) {
transform: rotate(117deg) translateY(-45%) rotate(-117deg);
}
.lightsColors .colorBox:nth-child(13n+14) {
background-color: #033300;
}
.materialsColors .colorBox:nth-child(13n+14) {
background-color: #cfffcc;
}
.colorBox:nth-child(14n+15) {
transform: rotate(126deg) translateY(-45%) rotate(-126deg);
}.........完整代码请登录后点击上方下载按钮下载查看
网友评论0