Skip to content

Commit b4d4ba3

Browse files
authored
Merge pull request #56 from etvinh/add-etvinh
2 parents 11ec8ad + f058fa9 commit b4d4ba3

2 files changed

Lines changed: 76 additions & 0 deletions

File tree

‎src/main/scala/gsoc/contributors/all.scala‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ val allContributors = NonEmptyList.of(
3636
ap44444,
3737
saifk16,
3838
`alokkumardalei-wq`,
39+
etvinh,
3940
`nvshinde`,
4041
lucasdu2,
4142
boss6825,
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package gsoc
2+
package contributors
3+
4+
import cats.effect.*
5+
import cats.effect.syntax.all.*
6+
import fs2.concurrent.*
7+
import fs2.dom.HtmlElement
8+
import calico.html.io.{*, given}
9+
import calico.syntax.*
10+
import scala.concurrent.duration.*
11+
12+
val etvinh: Contributor = Contributor("etvinh"):
13+
SignallingRef[IO].of(0).toResource.flatMap { frame =>
14+
val smallHeart = Vector(
15+
" ### ### ",
16+
" ##### ##### ",
17+
" ########### ",
18+
" ######### ",
19+
" ####### ",
20+
" ##### ",
21+
" ### ",
22+
" # "
23+
)
24+
25+
val bigHeart = Vector(
26+
" #### #### ",
27+
"###### ######",
28+
"#############",
29+
" ########### ",
30+
" ######### ",
31+
" ####### ",
32+
" ##### ",
33+
" ### ",
34+
" # "
35+
)
36+
37+
// lub, deflate, dub, deflate, pause
38+
val frames = Vector(bigHeart, smallHeart, bigHeart, smallHeart, smallHeart)
39+
val delays = Vector(120, 120, 120, 120, 800)
40+
41+
val ticker = frame
42+
.get
43+
.flatMap { f => IO.sleep(delays(f).millis) >> frame.update(f => (f + 1) % frames.size) }
44+
.foreverM
45+
.background
46+
47+
ticker.flatMap { _ =>
48+
div(
49+
styleAttr := """
50+
font-family: arial;
51+
display: flex;
52+
flex-direction: column;
53+
align-items: center;
54+
gap: 16px;
55+
padding: 20px;
56+
""",
57+
frame.map(f => frames(f)).changes.map { lines =>
58+
pre(
59+
styleAttr := """
60+
font-size: 20px;
61+
line-height: 1.3;
62+
margin: 0;
63+
color: rgb(219, 12, 84);
64+
transition: font-size 0.1s;
65+
""",
66+
lines.mkString("\n")
67+
)
68+
},
69+
p(
70+
"Hello, I'm @etvinh on GitHub. I agree to follow the Typelevel CoC and GSoC AI policy."
71+
),
72+
p("Excited to start building <3")
73+
)
74+
}
75+
}

0 commit comments

Comments
 (0)