Files
fizzy/app/assets/stylesheets/bubbles.css
T

444 lines
7.9 KiB
CSS

:root {
--bubble-size-one: 14cqi;
--bubble-size-two: 16cqi;
--bubble-size-three: 18cqi;
--bubble-size-four: 20cqi;
--bubble-size-five: 22cqi;
--bubble-shift: 10deg;
}
.windshield {
margin-block: clamp(var(--block-space), 3%, calc(var(--block-space) * 2));
> * {
flex-shrink: 1;
}
}
.bubble {
--hover-size: 0;
--bubble-color: var(--color-ink);
aspect-ratio: 1;
block-size: var(--bubble-size);
color: var(--bubble-color, currentColor);
container-type: inline-size;
display: grid;
max-inline-size: 100%;
place-items: center;
position: relative;
transition: all 0.2s ease;
.windshield & {
animation: float-up-left 400ms normal forwards ease-out;
&:nth-of-type(2n+1) {
animation-delay: 50ms;
animation: float-down-right 400ms normal forwards ease-out;
}
&:nth-of-type(3n+1) {
animation-delay: 150ms;
}
}
.windshield &:nth-of-type(n+5) {
align-self: start;
}
[data-turbo-preview] & { animation: none; }
@media (hover: hover) {
.windshield &:hover {
animation: shimmy 400ms normal forwards ease-out;
scale: 1.1;
z-index: 999;
.bubble__svg {
transform: rotate(calc(var(--bubble-rotate) + var(--bubble-shift)));
}
.bubble__image {
transform: rotate(calc(var(--bubble-rotate) + var(--bubble-shift)));
}
}
}
> * {
grid-area: 1/1;
}
.bubble__perma & {
--bubble-size: 100% !important;
z-index: 1;
}
}
.bubble__bubble {
background-color: var(--color-bg);
border: max(3px, 0.3em) solid var(--bubble-color);
border-radius: 50%;
position: absolute;
z-index: -1;
a {
color: var(--bubble-color);
}
&:is(.bubble__boosts) {
aspect-ratio: 1;
display: flex;
inset: 75cqi 5cqi auto auto;
min-inline-size: 6ch;
padding: 0;
place-items: center;
.btn {
--btn-color: var(--bubble-color);
appearance: none;
font-weight: 800;
}
.windshield .bubble:hover & {
transform: translate(0, 1rem) !important;
}
&.boosting {
animation: bubble-up 500ms normal forwards ease-out;
}
}
&.bubble__tag {
inset: auto auto -6cqi 15cqi;
+ & {
inset: auto auto 8cqi 5cqi;
+ & {
inset: auto auto 22cqi -2cqi;
}
}
.windshield &:has(.bubble__tag--new) {
display: none;
}
@media (hover: hover) {
.windshield .bubble:hover & {
transform: translate(-1rem, -1rem);
}
.windshield .bubble:hover & + & {
transform: translate(-1.25rem, -1.25rem);
}
.windshield .bubble:hover & + & + & {
transform: translate(-1.5rem, -1.5rem);
}
}
}
&.bubble__assignee {
aspect-ratio: 1;
inset: -1cqi auto auto 28cqi;
padding: 0.4em;
select {
inset: 0;
position: absolute;
}
@media (hover: hover) {
.windshield .bubble:hover & {
transform: translate(1rem, 0);
}
}
}
&.bubble__assignee--new {
.windshield & {
display: none;
}
}
&.bubble__attachment {
aspect-ratio: 1;
inset: -4cqi 24cqi auto auto;
.btn {
font-size: 4cqi;
}
.windshield & {
display: none;
}
}
&.bubble__color {
cursor: pointer;
inset: 10cqi auto auto 0cqi;
padding: 0.4em;
.windshield & {
display: none;
}
}
&.bubble__date {
aspect-ratio: 1;
cursor: pointer;
inset: 2cqb 2cqi auto auto;
label {
display: grid;
place-items: center;
> * {
grid-area: 1/1;
}
}
}
&.bubble__date--new {
padding: 0.7em;
.windshield & {
display: none;
}
}
&:where(.bubble__meta) {
background-color: var(--color-bg);
block-size: auto;
color: var(--bubble-color);
display: flex;
font-size: 5cqi;
font-weight: 800;
line-height: 1;
max-inline-size: 18ch;
padding: 1em;
place-items: center;
position: absolute;
scale: 1;
text-overflow: ellipsis;
transform: none;
transition: transform 200ms ease-out;
white-space: nowrap;
z-index: 1;
&:has(.input:not([type="file"], [type="date"], select)) {
border-radius: 2em;
padding: 0.2em 0.5em;
.input {
color: var(--bubble-color);
}
}
}
@media (hover: hover) {
.windshield .bubble:hover & {
transform: translate(1rem, 1rem);
}
.windshield .bubble:hover & + & {
transform: translate(0, -1rem);
}
.windshield .bubble:hover & + & + & {
transform: translate(-1rem, -1rem);
}
}
}
.bubble__color-picker {
border: 0;
display: none;
margin-block-start: -6.5em;
&[open] {
display: block;
}
.bubble__color-picker__color {
--btn-size: 2em;
--rotation: 0deg;
block-size: 4.33em;
inset: 0 auto auto 0;
position: absolute;
transform: rotate(var(--rotation));
transform-origin: bottom center;
.btn {
transform: rotate(calc(var(--rotation) * -1));
}
&:nth-of-type(2) {
--rotation: 40deg;
}
&:nth-of-type(3) {
--rotation: 80deg;
}
&:nth-of-type(4) {
--rotation: 120deg;
}
&:nth-of-type(5) {
--rotation: 160deg;
}
&:nth-of-type(6) {
--rotation: 200deg;
}
&:nth-of-type(7) {
--rotation: 240deg;
}
&:nth-of-type(8) {
--rotation: 280deg;
}
&:nth-of-type(9) {
--rotation: -40deg;
}
}
}
.bubble__image {
mask-image: url(blob.svg);
mask-position: center;
mask-repeat: no-repeat;
block-size: 100cqi;
inline-size: 100cqi;
pointer-events: none;
transform: rotate(var(--bubble-rotate));
transition: all 0.2s ease;
@media (hover: hover) {
.windshield .bubble:hover & {
transform: rotate(calc(var(--bubble-rotate) + var(--bubble-shift)));
}
}
img {
block-size: 100cqi;
inline-size: 100cqi;
object-fit: cover;
transform: rotate(calc(var(--bubble-rotate) * -1));
}
}
.bubble__link {
content: "";
inset: 0;
position: absolute;
z-index: -1;
}
.bubble__notes {
position: relative;
}
.bubble__perma {
block-size: 65cqb;
max-inline-size: 100%;
}
.bubble__svg {
fill: var(--color-bg);
pointer-events: none;
position: relative;
scale: 1.1;
stroke: var(--bubble-color);
stroke-width: 1.1rem;
transform: rotate(var(--bubble-rotate));
transition: all 200ms ease-out;
.bubble:has(.bubble__link) & {
z-index: -1;
}
}
.bubble__title {
-webkit-line-clamp: var(--lines, 5);
-webkit-box-orient: vertical;
display: -webkit-box;
font-size: 8cqi;
hyphens: auto;
line-height: 1.2;
margin: auto;
max-block-size: 75cqi;
max-inline-size: 75cqi;
overflow: hidden;
text-overflow: clip;
white-space: normal;
.windshield & {
pointer-events: none;
}
a {
color: var(--splat-color);
}
@media (hover: hover) {
.bubble:has(.bubble__image img:not([src=""])):hover & {
color: var(--color-ink-reversed);
text-shadow: 0 0 0.2em var(--bubble-color), 0 0 0.2em var(--bubble-color), 0 0 0.2em var(--bubble-color);
position: relative;
z-index: 1;
}
}
}
.bubbles-list {
--bubble-size: 1.2em;
--bubble-shift: 15deg;
--hover-size: 0;
font-size: clamp(1rem, 1.8cqi, 2rem);
max-inline-size: 80ch;
.bubble__title-link {
color: var(--color-txt);
text-decoration: none;
}
li {
border-radius: 0.6em;
list-style: none;
padding: 0.5em var(--inline-space);
transition: background-color 200ms ease-out;
@media (hover: hover) {
&:hover {
background-color: color(from var(--bubble-color) srgb r g b / 0.15);
.bubble__svg {
transform: rotate(calc(var(--bubble-rotate) + var(--bubble-shift))) scale(1.2);
}
}
}
}
}
.bubble__title-text {
font-weight: 600;
flex-grow: 1;
white-space: nowrap;
&::after {
border-block-end: 1px dotted var(--color-subtle-dark);
content: "";
flex-grow: 1;
margin-block-end: 0.25em;
}
}