Skip to content

Commit b0a2a90

Browse files
authored
Merge pull request #36 from satvshr/main
fixes
2 parents 595b5ef + c6486b3 commit b0a2a90

7 files changed

Lines changed: 39 additions & 6 deletions

File tree

frontend/app/src/main/java/com/example/terrace/features/home/components/BigDipper.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,15 @@ import androidx.compose.runtime.setValue
1212
import androidx.compose.ui.Modifier
1313
import androidx.compose.ui.geometry.Offset
1414
import androidx.compose.ui.graphics.Color
15-
import androidx.compose.ui.graphics.PathEffect
16-
import androidx.compose.ui.graphics.TransformOrigin
15+
import kotlinx.coroutines.delay
16+
import androidx.compose.runtime.LaunchedEffect
1717
import androidx.compose.ui.graphics.drawscope.Stroke
1818
import androidx.compose.ui.graphics.graphicsLayer
1919
import androidx.compose.ui.res.painterResource
2020
import androidx.compose.ui.unit.IntOffset
2121
import androidx.compose.ui.unit.dp
2222
import com.example.terrace.R
2323
import com.example.terrace.features.global.layout.screen.GlowingCommentBox
24-
import androidx.compose.ui.graphics.BlendMode
2524

2625
@Composable
2726
fun BigDipper(offsetX: Float, opacity: Float) {
@@ -95,6 +94,10 @@ fun BigDipper(offsetX: Float, opacity: Float) {
9594
}
9695
}
9796
if (showDescription) {
97+
LaunchedEffect(showDescription) {
98+
delay(5000) // Wait for 5 seconds
99+
showDescription = false
100+
}
98101
GlowingCommentBox(title = "Big Dipper", description = description)
99102
}
100103
}

frontend/app/src/main/java/com/example/terrace/features/home/components/Cancer.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import androidx.compose.ui.unit.IntOffset
2121
import androidx.compose.ui.unit.dp
2222
import com.example.terrace.R
2323
import com.example.terrace.features.global.layout.screen.GlowingCommentBox
24+
import kotlinx.coroutines.delay
25+
import androidx.compose.runtime.LaunchedEffect
2426

2527
@Composable
2628
fun Cancer(offsetX: Float, opacity: Float) {
@@ -88,6 +90,10 @@ fun Cancer(offsetX: Float, opacity: Float) {
8890
}
8991
}
9092
if (showDescription) {
93+
LaunchedEffect(showDescription) {
94+
delay(5000) // Wait for 5 seconds
95+
showDescription = false
96+
}
9197
GlowingCommentBox(title = "Cancer", description = description)
9298
}
9399
}

frontend/app/src/main/java/com/example/terrace/features/home/components/Leo.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import androidx.compose.ui.unit.IntOffset
2121
import androidx.compose.ui.unit.dp
2222
import com.example.terrace.R
2323
import com.example.terrace.features.global.layout.screen.GlowingCommentBox
24+
import kotlinx.coroutines.delay
25+
import androidx.compose.runtime.LaunchedEffect
2426

2527
@Composable
2628
fun Leo(offsetX: Float, opacity: Float) {
@@ -99,6 +101,10 @@ fun Leo(offsetX: Float, opacity: Float) {
99101
}
100102
}
101103
if (showDescription) {
104+
LaunchedEffect(showDescription) {
105+
delay(5000) // Wait for 5 seconds
106+
showDescription = false
107+
}
102108
GlowingCommentBox(title = "Leo", description = description)
103109
}
104110
}

frontend/app/src/main/java/com/example/terrace/features/home/components/Libra.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import androidx.compose.ui.unit.IntOffset
1717
import androidx.compose.ui.unit.dp
1818
import com.example.terrace.features.global.layout.screen.GlowingCommentBox
1919
import com.example.terrace.R
20+
import kotlinx.coroutines.delay
21+
import androidx.compose.runtime.LaunchedEffect
2022

2123
@Composable
2224
fun Libra(offsetX: Float, opacity: Float) {
@@ -90,6 +92,10 @@ fun Libra(offsetX: Float, opacity: Float) {
9092
}
9193
}
9294
if (showDescription) {
95+
LaunchedEffect(showDescription) {
96+
delay(5000) // Wait for 5 seconds
97+
showDescription = false
98+
}
9399
GlowingCommentBox(title = "Libra", description = description)
94100
}
95101
}

frontend/app/src/main/java/com/example/terrace/features/home/components/LittleDipper.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import androidx.compose.ui.unit.IntOffset
2121
import androidx.compose.ui.unit.dp
2222
import com.example.terrace.R
2323
import com.example.terrace.features.global.layout.screen.GlowingCommentBox
24+
import kotlinx.coroutines.delay
25+
import androidx.compose.runtime.LaunchedEffect
2426

2527
@Composable
2628
fun LittleDipper(offsetX: Float,opacity: Float) {
@@ -96,6 +98,10 @@ fun LittleDipper(offsetX: Float,opacity: Float) {
9698
}
9799
}
98100
if (showDescription) {
101+
LaunchedEffect(showDescription) {
102+
delay(5000) // Wait for 5 seconds
103+
showDescription = false
104+
}
99105
GlowingCommentBox(title = "Little Dipper", description = description)
100106
}
101107
}

frontend/app/src/main/java/com/example/terrace/features/home/components/Orion.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import androidx.compose.ui.unit.IntOffset
2121
import androidx.compose.ui.unit.dp
2222
import com.example.terrace.R
2323
import com.example.terrace.features.global.layout.screen.GlowingCommentBox
24+
import kotlinx.coroutines.delay
25+
import androidx.compose.runtime.LaunchedEffect
2426

2527
@Composable
2628
fun Orion(offsetX: Float,opacity: Float) {
@@ -96,6 +98,10 @@ fun Orion(offsetX: Float,opacity: Float) {
9698
}
9799
}
98100
if (showDescription) {
101+
LaunchedEffect(showDescription) {
102+
delay(4000) // Wait for 4 seconds
103+
showDescription = false
104+
}
99105
GlowingCommentBox(title = "Orion", description = description)
100106
}
101107
}

frontend/app/src/main/java/com/example/terrace/features/home/screens/HomeScreen.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ fun HomeScreen(navController: NavController, usageViewModel: UsageViewModel, isF
306306
Box(
307307
modifier = Modifier
308308
.fillMaxSize()
309-
.offset { IntOffset((offsetX * 0.5).toInt(), 0) }
309+
.offset { IntOffset((offsetX * 0.35).toInt(), 0) }
310310
) {
311311
starPositions.filter { it.sizeCategory == StarSizeCategory.SMALL }
312312
.forEach { star ->
@@ -318,7 +318,7 @@ fun HomeScreen(navController: NavController, usageViewModel: UsageViewModel, isF
318318
Box(
319319
modifier = Modifier
320320
.fillMaxSize()
321-
.offset { IntOffset((offsetX * 0.7).toInt(), 0) }
321+
.offset { IntOffset((offsetX * 0.55).toInt(), 0) }
322322
) {
323323
starPositions.filter { it.sizeCategory == StarSizeCategory.MEDIUM }
324324
.forEach { star ->
@@ -330,7 +330,7 @@ fun HomeScreen(navController: NavController, usageViewModel: UsageViewModel, isF
330330
Box(
331331
modifier = Modifier
332332
.fillMaxSize()
333-
.offset { IntOffset((offsetX * 0.9).toInt(), 0) }
333+
.offset { IntOffset((offsetX * 0.75).toInt(), 0) }
334334
) {
335335
starPositions.filter { it.sizeCategory == StarSizeCategory.LARGE }
336336
.forEach { star ->

0 commit comments

Comments
 (0)