color-picker/style.css
2025-06-28 21:15:44 -04:00

269 lines
5.4 KiB
CSS

body {
margin: 0;
padding: 10px;
box-sizing: border-box;
/* font-family: sans-serif; */
font-family: "Autour One", serif;
}
#selected-palette {
position: sticky;
top: 0;
background: #fff;
z-index: 100;
padding: 10px;
border-bottom: 2px solid #ccc;
transition: box-shadow 0.3s ease;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
gap: 15px;
}
/* Strong shadow when stuck */
#selected-palette.stuck {
box-shadow: 16px 16px 15px rgba(0, 0, 0, 0.25);
border: 1px solid rgb(0, 0, 0);
border-radius: 7px;
}
#palette-colors {
display: flex;
flex-wrap: wrap;
justify-content: center;
overflow: visible;
padding: 10px;
/* transition: padding 0.3s ease; */
transition: max-height 0.3s ease, padding 0.3s ease;
}
#clear-palette {
margin-top: 20px;
padding: 8px 12px;
font-size: 0.9rem;
background: #8ae7db;
border: 1px solid #ccc;
border-radius: 15px;
cursor: pointer;
margin: auto;
}
#color-families {
display: flex;
flex-direction: column;
gap: 15px;
}
.color-family {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
padding-bottom: 20px;
border-bottom: 1px solid #ccc;
}
.swatch-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 10px 20px; /* add horizontal AND vertical gaps */
}
.color-family h3 {
text-align: center;
margin: 10px 0 5px;
font-size: 1rem;
font-weight: bold;
}
.swatch-wrapper {
display: inline-flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
/* width: 60px; */
margin: 0 5px;
padding: 5px;
max-width: min-content;
/* overflow-wrap: break-word; */
}
/* .color-swatch {
width: 55px;
height: 65px;
border-radius: 50%;
position: relative;
cursor: pointer;
transition: transform 0.2s ease;
} */
.color-swatch::before {
content: '';
position: absolute;
top: 10%;
left: 20%;
width: 60%;
height: 40%;
border-radius: 50% / 30%;
background: linear-gradient(
135deg,
rgba(255, 255, 255, 0.8),
rgba(255, 255, 255, 0) 70%
);
pointer-events: none;
filter: blur(4px);
}
.metallic-element[data-color="#FFD700"] {
background: linear-gradient(to bottom, #B88606, #79550E);
box-shadow:
inset 0 0 0 0 rgba(255, 255, 255, 0.3),
inset 0 0 0 1px rgba(0, 0, 0, 0.3),
inset 0 0 10px rgba(0, 0, 0, 0.2);
}
/* .color-swatch::after {
content: '';
position: absolute;
top: 2%;
left: 2%;
width: 96%;
height: 96%;
border-radius: 50%;
border: 1px solid rgba(255, 255, 255, 0.3);
pointer-events: none;
box-shadow: 0 0 8px 2px rgba(255, 255, 255, 0.2);
}
*/
.color-swatch {
width: 55px;
height: 65px;
border-radius: 50%;
position: relative;
cursor: pointer;
background: linear-gradient(
145deg,
#bbb, /* dark shadow */
#eee 30%, /* bright highlight */
#ddd 50%, /* mid-tone */
#fff 70%, /* brightest highlight */
#bbb /* dark shadow */
);
box-shadow:
inset 2px 2px 6px rgba(255, 255, 255, 0.7), /* inner glossy highlight */
0 4px 8px rgba(0, 0, 0, 0.2); /* subtle drop shadow */
transition: transform 0.3s ease;
}
.color-swatch:hover,
.color-swatch:active {
transform: scale(1.1);
box-shadow: 0 0 5px rgba(0,0,0,0.2);
}
.color-swatch.chosen {
outline: 3px solid #333;
outline-offset: 1px;
}
.color-background {
width: 100%;
height: 100%;
border-radius: 50%;
border: 2px solid rgba(0, 0, 0, 0.1); /* Light gray border */
box-shadow: 1 1 1;
}
.color-shine {
position: absolute;
top: 10%;
left: 40%;
width: 20px;
height: 8px;
opacity: 0.5;
z-index: 10;
}
.color-name {
font-size: 0.8rem;
text-align: center;
margin-top: 5px;
word-break: keep-all; /* Prevent breaking long words */
/* white-space: nowrap; Keep names on a single line */
/* overflow: hidden; /*Hide overflow text if necessary */
text-overflow: ellipsis; /* Add ... when text is too long */
max-width: 90%;
}
#palette-colors .color-swatch {
width: 40px;
height: 48px;
}
/* .checkmark-overlay {
position: absolute;
top: 4px;
right: 4px;
font-size: 16px;
font-weight: bold;
color: white;
background: rgba(0, 0, 0, 0.6);
border-radius: 50%;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
z-index: 20;
pointer-events: none;
} */
@media (max-width: 600px) {
.swatch-wrapper {
width: 50px;
}
.color-name {
font-size: 0.65rem;
}
#selected-palette h2 {
font-size: 1.1rem;
}
}
.color-name {
transition: all 0.3s ease;
}
.color-name.highlighted-name {
text-decoration:underline;
font-weight: bold;
color: #111;
}
@keyframes pop {
0% { transform: scale(1); }
50% { transform: scale(1.2); }
100% { transform: scale(1); }
}
.color-background.pop {
animation: pop 0.25s ease;
}
.color-background.chosen {
/* transform: scale(1.1); */
box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
}