feat(US-06): use JetBrains Mono font and rectangular buttons
Bundle JetBrains Mono Regular and Bold TTF files for a modern monospace look without needing network access. All buttons now use RectangleShape to match the sharp-cornered style of the original web version.
This commit is contained in:
parent
8c9cdefe0c
commit
e6fb8506e1
4 changed files with 23 additions and 8 deletions
|
|
@ -34,6 +34,7 @@ import androidx.compose.ui.geometry.Size
|
|||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.drawscope.Stroke
|
||||
import androidx.compose.ui.graphics.lerp
|
||||
import androidx.compose.ui.graphics.RectangleShape
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import androidx.compose.ui.unit.dp
|
||||
|
|
@ -42,6 +43,7 @@ import kotlinx.coroutines.launch
|
|||
import net.jeena.pacer.BpmCalculator
|
||||
import net.jeena.pacer.PacerService
|
||||
import net.jeena.pacer.PacerViewModel
|
||||
import net.jeena.pacer.ui.theme.JetBrainsMono
|
||||
|
||||
private val BG = Color(0xFF0A0A0A)
|
||||
private val FG = Color(0xFFF0EDE8)
|
||||
|
|
@ -119,7 +121,7 @@ fun PacerScreen(viewModel: PacerViewModel, modifier: Modifier = Modifier) {
|
|||
Text(
|
||||
text = "PACER",
|
||||
fontSize = 13.sp,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontFamily = JetBrainsMono,
|
||||
color = FG.copy(alpha = 0.4f),
|
||||
letterSpacing = 5.sp
|
||||
)
|
||||
|
|
@ -130,14 +132,14 @@ fun PacerScreen(viewModel: PacerViewModel, modifier: Modifier = Modifier) {
|
|||
text = "$bpm",
|
||||
fontSize = 80.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontFamily = JetBrainsMono,
|
||||
color = bpmColor,
|
||||
letterSpacing = (-2).sp
|
||||
)
|
||||
Text(
|
||||
text = "BPM",
|
||||
fontSize = 11.sp,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontFamily = JetBrainsMono,
|
||||
color = FG.copy(alpha = 0.35f),
|
||||
letterSpacing = 4.sp
|
||||
)
|
||||
|
|
@ -168,6 +170,7 @@ fun PacerScreen(viewModel: PacerViewModel, modifier: Modifier = Modifier) {
|
|||
// Start/Stop button
|
||||
OutlinedButton(
|
||||
onClick = { viewModel.togglePlayback() },
|
||||
shape = RectangleShape,
|
||||
border = BorderStroke(2.dp, if (isPlaying) ACCENT else FG),
|
||||
colors = ButtonDefaults.outlinedButtonColors(
|
||||
contentColor = if (isPlaying) BG else FG,
|
||||
|
|
@ -178,7 +181,7 @@ fun PacerScreen(viewModel: PacerViewModel, modifier: Modifier = Modifier) {
|
|||
text = if (isPlaying) "STOP" else "START",
|
||||
fontSize = 18.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontFamily = JetBrainsMono,
|
||||
letterSpacing = 3.sp,
|
||||
modifier = Modifier.padding(horizontal = 16.dp, vertical = 4.dp)
|
||||
)
|
||||
|
|
@ -189,7 +192,7 @@ fun PacerScreen(viewModel: PacerViewModel, modifier: Modifier = Modifier) {
|
|||
Text(
|
||||
text = "PACE",
|
||||
fontSize = 10.sp,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontFamily = JetBrainsMono,
|
||||
color = FG.copy(alpha = 0.35f),
|
||||
letterSpacing = 3.sp
|
||||
)
|
||||
|
|
@ -212,6 +215,7 @@ fun PacerScreen(viewModel: PacerViewModel, modifier: Modifier = Modifier) {
|
|||
OutlinedButton(
|
||||
onClick = { viewModel.updateBpm(preset) },
|
||||
modifier = Modifier.size(width = 72.dp, height = 48.dp),
|
||||
shape = RectangleShape,
|
||||
contentPadding = PaddingValues(0.dp),
|
||||
border = BorderStroke(1.dp, if (active) ACCENT else DIM),
|
||||
colors = ButtonDefaults.outlinedButtonColors(
|
||||
|
|
@ -224,12 +228,12 @@ fun PacerScreen(viewModel: PacerViewModel, modifier: Modifier = Modifier) {
|
|||
text = "$preset",
|
||||
fontSize = 13.sp,
|
||||
fontWeight = FontWeight.Bold,
|
||||
fontFamily = FontFamily.Monospace
|
||||
fontFamily = JetBrainsMono
|
||||
)
|
||||
Text(
|
||||
text = label,
|
||||
fontSize = 9.sp,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontFamily = JetBrainsMono,
|
||||
letterSpacing = 1.sp
|
||||
)
|
||||
}
|
||||
|
|
@ -243,7 +247,7 @@ fun PacerScreen(viewModel: PacerViewModel, modifier: Modifier = Modifier) {
|
|||
Text(
|
||||
text = "VOLUME ${(volume * 100).toInt()}%",
|
||||
fontSize = 10.sp,
|
||||
fontFamily = FontFamily.Monospace,
|
||||
fontFamily = JetBrainsMono,
|
||||
color = FG.copy(alpha = 0.35f),
|
||||
letterSpacing = 3.sp
|
||||
)
|
||||
|
|
|
|||
11
app/src/main/kotlin/net/jeena/pacer/ui/theme/Font.kt
Normal file
11
app/src/main/kotlin/net/jeena/pacer/ui/theme/Font.kt
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package net.jeena.pacer.ui.theme
|
||||
|
||||
import androidx.compose.ui.text.font.Font
|
||||
import androidx.compose.ui.text.font.FontFamily
|
||||
import androidx.compose.ui.text.font.FontWeight
|
||||
import net.jeena.pacer.R
|
||||
|
||||
val JetBrainsMono = FontFamily(
|
||||
Font(R.font.jetbrainsmono_regular, FontWeight.Normal),
|
||||
Font(R.font.jetbrainsmono_bold, FontWeight.Bold),
|
||||
)
|
||||
BIN
app/src/main/res/font/jetbrainsmono_bold.ttf
Normal file
BIN
app/src/main/res/font/jetbrainsmono_bold.ttf
Normal file
Binary file not shown.
BIN
app/src/main/res/font/jetbrainsmono_regular.ttf
Normal file
BIN
app/src/main/res/font/jetbrainsmono_regular.ttf
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue