package com.peachpasswords.ui.components import androidx.compose.foundation.Canvas import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Modifier import androidx.compose.ui.geometry.Offset import androidx.compose.ui.geometry.Size import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.drawscope.Stroke import androidx.compose.ui.graphics.drawscope.rotate import androidx.compose.ui.graphics.drawscope.scale import androidx.compose.ui.graphics.vector.PathParser import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp /** * The Peach brand mark — a peach fruit with a single leaf. Exact port of the * browser PeachMark.tsx SVG (viewBox 240×240). The leaf is ALWAYS sage green * (#92AC65 fill, #5E7A42 vein) and the body is fixed peach tones — none of it * is accent-driven. [alpha] dims the whole mark for the faint lock-screen art. */ @Composable fun PeachMark( modifier: Modifier = Modifier, size: Dp = 14.dp, alpha: Float = 1f, ) { val leaf = remember { PathParser().parsePathString("M 124 64 C 134 32 168 16 200 22 C 198 56 168 72 130 66 Z").toPath() } val vein = remember { PathParser().parsePathString("M 130 64 C 152 46 178 30 196 24").toPath() } val bodyLight = remember { PathParser().parsePathString("M 120 60 C 75 45 28 75 22 130 C 18 185 65 222 125 222 C 185 222 222 185 220 130 C 218 78 170 45 120 60 Z").toPath() } val bodyShadow = remember { PathParser().parsePathString("M 120 60 C 75 45 28 75 22 130 C 18 185 65 222 125 222 C 105 195 75 150 100 90 C 105 75 112 65 120 60 Z").toPath() } Canvas(modifier = modifier.size(size)) { val s = this.size.minDimension / 240f scale(scaleX = s, scaleY = s, pivot = Offset.Zero) { drawPath(bodyLight, Color(0xFFFFB082), alpha = alpha) drawPath(bodyShadow, Color(0xFFE5805C), alpha = alpha) // Highlight ellipse: cx178 cy108 rx20 ry11, rotate(-26°). rotate(degrees = -26f, pivot = Offset(178f, 108f)) { drawOval( color = Color(0xFFFFD0A8), topLeft = Offset(178f - 20f, 108f - 11f), size = Size(40f, 22f), alpha = alpha * 0.7f, ) } drawPath(leaf, Color(0xFF92AC65), alpha = alpha) drawPath(vein, Color(0xFF5E7A42), alpha = alpha, style = Stroke(width = 2.6f)) } } } /** * Mark + "peach" lockup, top-left on the pre-vault screens. Extracted because * Lock and Onboarding each hand-rolled it and drifted apart — onboarding lost * the mark entirely. */ @Composable fun PeachWordmark(modifier: Modifier = Modifier, isPro: Boolean = false) { androidx.compose.foundation.layout.Row( modifier = modifier, verticalAlignment = androidx.compose.ui.Alignment.CenterVertically, ) { PeachMark(modifier = Modifier.padding(end = com.peachpasswords.ui.theme.PeachSpacing.xs)) if (isPro) { androidx.compose.foundation.layout.Column { androidx.compose.material3.Text( text = "peach", color = com.peachpasswords.ui.theme.peachColors.T0, style = com.peachpasswords.ui.theme.PeachType.wordmark.copy(lineHeight = 13.sp), ) androidx.compose.material3.Text( text = "pro", color = com.peachpasswords.ui.theme.LocalPeachAccent.current, style = com.peachpasswords.ui.theme.PeachType.wordmark.copy(fontSize = 10.sp, lineHeight = 9.sp), ) } } else { androidx.compose.material3.Text( text = "peach", color = com.peachpasswords.ui.theme.LocalPeachAccent.current, style = com.peachpasswords.ui.theme.PeachType.wordmark, ) } } }