Files
fizzy/app/assets/stylesheets/bubble.css
T
2024-09-06 11:10:45 -05:00

275 lines
5.1 KiB
CSS

:root {
--bubble-size: 30vw;
--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: 40vh !important;
}
}
.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: grid;
min-inline-size: 6ch;
padding: 0;
place-items: center;
inset: 55cqi -2cqi auto auto;
a {
grid-area: 1/1;
text-decoration: none;
}
.windshield .bubble:hover & {
transform: translate(0, 1rem) !important;
}
&.boosting {
animation: bubble-up 500ms normal forwards ease-out;
}
}
&.bubble__tag {
inset: auto auto 10cqi -3cqi;
+ & {
inset: auto auto -2cqi 13cqi;
+ & {
inset: auto auto -12cqi 29cqi;
}
}
.windshield &:has(.bubble__tag--new) {
display: none;
}
}
&.bubble__attachment {
aspect-ratio: 1;
inset: -4cqi 24cqi auto auto;
.btn {
font-size: 4cqi;
}
.windshield & {
display: none;
}
}
&.bubble__date {
aspect-ratio: 1;
inset: 2cqi 2cqi auto auto;
}
&: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"])) {
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__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__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;
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;
pointer-events: none;
text-overflow: clip;
white-space: normal;
@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 {
--hover-size: 0;
.bubble__title-link {
color: var(--color-txt);
text-decoration: none;
}
li {
border-radius: 0.6em;
list-style: none;
padding: 0.5em 1em;
transition: background-color 200ms ease;
&:hover{
background-color: var(--color-selected);
}
}
}