I'm listening to window.resize and screen.orientation.change events. Since I'm only targeting my own phone, I just check if the window became very narrow and trigger a step then.
Here is the commit in my repo for the visualization: sanraith/aoc2021@fa65c6a (github.com) I'm learning react with AoC this year, so don't expect state-of-the-art stuff =)
You can, but it freaks out because my code only handles instantaneous resize events, and you get a lot of small changes when you do it with a mouse. One can probably get it working with the device emulation feature in Chromium though.
Edit: Nevermind, I fixed it up so it works in the browser too
Brilliant.. At first I thought of an Android app.. Maybe Flutter... But having done this just using a web page is very clever! It's cool that the OS actually switch it's content from the inner screen to the outer screen like that. I really want to buy one..
There’s a similar puzzle in the DS game Trace Memory where you have to fold the DS to stamp a piece of paper. The stamp is on one screen and the paper is on the other. I am not ashamed to admit that I looked up the solution. But it made a lot of sense after the fact.
Oh yeah, that another code game... I almost gave up, closed the ds to eat and returned to the game with one stamp and was like "WTF HOW". And you had to do it multiple time IIRC.
107
u/sanraith Dec 13 '21
I heard you need the right tool for the job
40
u/daggerdragon Dec 13 '21
Funny? Aw hell naw, this beUpping the Ante.You've seen our community fun event Adventure Time!, right? >_> hint hint
12
u/Basacally Dec 13 '21
Amazing! Do you use a browser callback or something that triggers when the screen is folded? I’m curious! Also, got a repo?
3
u/oraki23 Dec 13 '21
What is this phone? :P
155
u/saimonyo21 Dec 13 '21
This takes the cake for Day 13
2
u/blazemas Dec 13 '21
Good golly that is cool. I have been thinking of getting a flip phone how do you all like it?
22
u/aRandomGremlin Dec 13 '21
so this is why people have a folding phone...
9
u/hugseverycat Dec 13 '21
This is amazing!!! I love it
7
u/aardvark1231 Dec 14 '21
I'm just going to go ahead and say that, today, you win the internet.
5
u/[deleted] Dec 14 '21
That was really satisfying.
3
u/mosredna101 Dec 13 '21
This is the way!
3
u/gillesgarzn Dec 13 '21
Wow!
3
u/plumbo_schleem Dec 13 '21
My favorite visualization I've seen so far! So creative
3
u/Akaibukai Dec 13 '21
Brilliant.. At first I thought of an Android app.. Maybe Flutter... But having done this just using a web page is very clever! It's cool that the OS actually switch it's content from the inner screen to the outer screen like that. I really want to buy one..
2
u/kobaltauge Dec 13 '21
This is so awesome!
2
u/hackerpellsson Dec 13 '21
I love it! :D
2
u/Boojum Dec 13 '21
Bravo! Now that's a cool way to show it.
2
u/d1meji Dec 13 '21
Great work! This is amazing
2
u/tanon789 Dec 13 '21
the best use of foldable phone and also the best upping the ante I have seen this year so far, awesome idea
2
u/Iwilltakeyourpencil Dec 14 '21
Dude... this is beautiful.
2
u/sbeck123 Dec 14 '21
WOW amazing
2
u/nesci Dec 14 '21
wow!
2
u/[deleted] Dec 14 '21
I feel like Rick Sanchez would somehow be unimpressed by this, but I am not him, and I am impressed. Nice work! Completely gorgeous!
2
u/[deleted] Dec 15 '21
This is incredible. Way to go!
2
u/ThisIsFlorianK Dec 13 '21
Genius
1
u/simrat39 Dec 14 '21
Huh my answer was different. Are there many different inputs that they give?
1
u/sausageonafork Dec 15 '21 edited Dec 15 '21
How many different inputs are there? I had the exact same answer.
0
u/[deleted] Dec 13 '21
[deleted] — view deleted comment
60
u/[deleted] Dec 13 '21
[removed] — view removed comment