Dough Git

clove/web

src/lib/styles/index.css

back to src/lib/styles

/* src/lib/styles/index.css
 * DASL-1.2 — (c) Clove Twilight
 */

.selfie-box {
	flex: 0 0 auto;
	width: min(100%, 14rem);
	margin: 0;
	padding: 0.5rem;
	border: 1px solid var(--line);
	border-radius: 1rem;
	background: var(--raised);
	box-shadow: 0 0 0 4px var(--accent-dim);
}

@media (min-width: 52rem) {
	.selfie-box {
		margin-top: -6rem;
	}
}

/* Pixel art and the real selfie are stacked. SelfieDust blows one into the
   other as dust on a canvas behind them. No overflow: hidden here, or the
   status badge on the corner and the flying dust get clipped */

.selfie-photo {
	position: relative;
	aspect-ratio: 1;
}

.selfie-stack {
	position: absolute;
	inset: 0;
}

.selfie-dust {
	position: absolute;
	pointer-events: none;
}

.selfie {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0.6rem;
}

.selfie-pixel {
	image-rendering: pixelated;
}

/* No canvas (reduced motion, or the images failed to load): plain crossfade */

.selfie-fade .selfie {
	transition: opacity 350ms ease;
}

/* Polaroid-style caption under the photo, inside the frame. Both captions
   share one grid cell so swapping them doesn't shift the layout */

.selfie-box figcaption {
	display: grid;
	padding: 0.45rem 0 0.1rem;
	color: var(--muted);
	font-size: 0.8rem;
	font-style: italic;
	text-align: center;
}

.selfie-caption {
	grid-area: 1 / 1;
	transition: opacity 350ms ease;
}

.selfie-caption-hover,
.selfie-box.revealed .selfie-caption:not(.selfie-caption-hover) {
	opacity: 0;
}

.selfie-box.revealed .selfie-caption-hover {
	opacity: 1;
}

/* Discord status badge, sat on the photo's corner like a Discord avatar */

.selfie-status {
	position: absolute;
	right: -0.6rem;
	bottom: -0.6rem;
	z-index: 2;
	width: 1.9rem;
	height: 1.9rem;
	border: 0.35rem solid var(--bg);
	border-radius: 50%;
	background: var(--status);
	transition: transform 0.2s ease;
}

.selfie-status:hover,
.selfie-status:focus-visible {
	transform: scale(1.15);
}

@media (prefers-reduced-motion: reduce) {
	.selfie-caption,
	.selfie-status {
		transition: none;
	}
}

/* Cards */

.card {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1.25rem 1.5rem;
	border: 1px solid var(--line);
	border-radius: 1rem;
	background: var(--raised);
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		transform 0.2s ease;
}

.card:hover {
	border-color: rgb(235 69 158 / 40%);
	box-shadow: 0 0 0 4px var(--accent-dim);
	transform: translateY(-2px);
}

.card-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 600;
	letter-spacing: -0.01em;
}

.card-body {
	flex: 1;
	margin: 0;
	color: var(--muted);
	font-size: 0.95rem;
}

@media (prefers-reduced-motion: reduce) {
	.card {
		transition: none;
	}

	.card:hover {
		transform: none;
	}
}

/* Now strip */

.now {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 2rem 0 0;
	font-size: 0.9rem;
}

.now-item {
	display: inline-flex;
	gap: 0.5rem;
	align-items: center;
	min-width: 0;
	padding: 0.35rem 0.85rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--raised);
	color: var(--muted);
	text-decoration: none;
	transition: border-color 0.2s ease;
}

.now-item:hover {
	border-color: rgb(235 69 158 / 40%);
	color: var(--text);
}

.now-item strong {
	color: var(--text);
	font-weight: 500;
}

.now-icon {
	display: inline-flex;
	flex: none;
	width: 1.1em;
	height: 1.1em;
}

.now-icon svg {
	width: 100%;
	height: 100%;
}

.now-muted {
	opacity: 0.85;
}

.now-heart {
	color: mediumvioletred;
}

@media (prefers-reduced-motion: reduce) {
	.now-item {
		transition: none;
	}
}

/* Fronting and phone pills. Their contents are one centred flex row so the
   avatars and icons line up with the text instead of shifting its baseline */

.now-row {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 0.15rem 0.4rem;
	align-items: center;
}

.now-member {
	display: inline-flex;
	align-items: center;
}

.now-member strong {
	color: var(--member, var(--text));
}

.now-member .now-muted {
	margin-left: 0.3em;
}

.now-avatar {
	width: 1.25em;
	height: 1.25em;
	margin-right: 0.35rem;
	border-radius: 50%;
	object-fit: cover;
}

.now-battery {
	display: inline-flex;
	gap: 0.25rem;
	align-items: center;
}

.now-battery-low {
	color: #ed4245;
}

/* The badge breathes while I'm around: a ring ripples out when online, and a
   soft glow pulses while streaming */

@media (prefers-reduced-motion: no-preference) {
	.selfie-status[data-status='online']::after {
		content: '';
		position: absolute;
		inset: -0.35rem;
		border-radius: 50%;
		box-shadow: 0 0 0 0 var(--status);
		animation: status-ripple 2.4s ease-out infinite;
		pointer-events: none;
	}

	.selfie-status[data-status='streaming'] {
		animation: status-glow 2s ease-in-out infinite;
	}
}

@keyframes status-ripple {
	0% {
		box-shadow: 0 0 0 0 color-mix(in srgb, var(--status) 70%, transparent);
	}
	70%,
	100% {
		box-shadow: 0 0 0 0.6rem transparent;
	}
}

@keyframes status-glow {
	50% {
		box-shadow: 0 0 1.1rem 0.2rem color-mix(in srgb, var(--status) 60%, transparent);
	}
}