Cadiac / sanuli

A finnish version of a popular word guessing game, written in Rust.
https://sanuli.fi
MIT License
64 stars 6 forks source link

Share button like Wordle has #11

Closed petzku closed 2 years ago

petzku commented 2 years ago

Wordle has a "share" button on the win screen, which allows one to share their result as a set of emoji without revealing the word or their guesses (the asterisk indicates "hard mode", other parts should be self-explanatory):

Wordle 220 3/6*

โฌœโฌœ๐ŸŸฉ๐ŸŸจโฌœ
โฌœ๐ŸŸฉ๐ŸŸฉโฌœโฌœ
๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ

I've written a javascript bookmarklet to do this, but it would be nice to have this as a "proper" feature.

Cadiac commented 2 years ago

This is coming soon, the rough implementation is already at beta.sanuli.fi but I need some proper place for the button & a toast message to let the user know that the input was copied to their clipboard.

And perhaps polyfill browsers without navigator.clipboard features, but that is annoying to do at non-js world

petzku commented 2 years ago

Love to hear it!

And perhaps polyfill browsers without navigator.clipboard features, but that is annoying to do at non-js world

ah, the perils of web design: always constrained by backwards compatibility

petzku commented 2 years ago

Ah, went to try it just now, and you might have an off-by-one error (today's is 19). I agree that the button is not really in a good place now, also you seem to insert newlines for all unguessed rows too?

Sanuli #18 3/6

โฌ›๐ŸŸฉโฌ›๐ŸŸฉโฌ›
โฌ›๐ŸŸฉโฌ›๐ŸŸฉ๐ŸŸฉ
๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ๐ŸŸฉ
Cadiac commented 2 years ago

The deployed version indeed has the off-by-one error and the newlines, both fixed at local dev branch :) Thanks for pointing that out though! And the button placement was just an easy placeholder, as I needed to test the clipboard there (since it can't be used in non-HTTPS context)

I'm also planning another sharing feature: a way to generate a link to share any completed game, not just the daily word, which would open the game without the characters shown, and the user who clicked could either reveal them, or try to solve the same word from the beginning.

This is something that the refactoring I've done last week would allow without resetting the current streaks the user might have at sanuliketju/classic mode

Cadiac commented 2 years ago

A simple version of this was deployed yesterday, clicking the link after pรคivรคn sanuli is solved copies the string on clipboard.

Cadiac commented 2 years ago

The link sharing feature was now also added, closing this issue.