-
Notifications
You must be signed in to change notification settings - Fork 0
/
Entries.kt
127 lines (122 loc) · 4.18 KB
/
Entries.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
package com.bumble.puzzyx.model
import androidx.compose.animation.animateColor
import androidx.compose.animation.core.LinearEasing
import androidx.compose.animation.core.RepeatMode
import androidx.compose.animation.core.infiniteRepeatable
import androidx.compose.animation.core.rememberInfiniteTransition
import androidx.compose.animation.core.tween
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import com.bumble.puzzyx.ui.md_indigo_500
import com.bumble.puzzyx.ui.md_lime_500
val entries = listOf(
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "codeNinja",
message = "Having a blast at the conference!"
),
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "techWanderlust",
message = "Keynote was inspiring"
),
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "dataGeek",
message = "Shoutout to the organizers for an amazing lineup!"
),
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "codeCraftsman",
message = "Learning, networking, and free coffee – conference life is good!"
),
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "byteBender",
message = "Let's connect! Find me at the networking session!"
),
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "stellarCoder",
message = "L77tc0der was here"
),
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "codeWaveSurfer",
message = "Mind blown by the innovative ideas shared today."
),
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "devDreamer",
message = "Great to see old friends and make new ones!"
),
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "cyberPioneer",
message = "Who's up for a post-conference karaoke session tonight?"
),
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "codeMaverick",
message = "Kudos to the speakers for keeping us engaged all day."
),
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "gitGuru",
message = "Highlight of the day: the interactive workshop on Appyx."
),
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "byteBlaze",
message = "Impressed by the cool tech showcased in the exhibition hall!"
),
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "bugHuntingHero",
message = "Taking copious notes – my brain might explode!"
),
Entry.Text(
puzzle = Puzzle.PUZZLE1,
githubUserName = "algoExplorer",
message = "Attending from NYC – making my hometown proud!"
),
Entry.Image(
puzzle = Puzzle.PUZZLE1,
githubUserName = "codeWhizKid",
path = "cake.png",
contentScale = ContentScale.Crop
),
Entry.ComposableContent(
puzzle = Puzzle.PUZZLE1,
githubUserName = "pixelPirate",
content = {
val infiniteTransition = rememberInfiniteTransition()
val color by infiniteTransition.animateColor(
initialValue = md_indigo_500,
targetValue = md_lime_500,
animationSpec = infiniteRepeatable(
animation = tween(500, easing = LinearEasing),
repeatMode = RepeatMode.Reverse
)
)
Box(
modifier = Modifier
.fillMaxSize()
.background(color)
)
}
),
)
val puzzle1Entries = entries
.filter { it.puzzle == Puzzle.PUZZLE1 }
.also {
if (it.size > Puzzle.PUZZLE1.maxEntryCount)
error("This puzzle is already filled up. Add your entry to another one!")
if (it.map { it.githubUserName }.distinct().size < it.size) {
error("One entry per puzzle is the limit, but you can try again in the next one!")
}
}