Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Wallpaper preview selector #43

Open
gios2 opened this issue May 20, 2022 · 2 comments
Open

[Enhancement] Wallpaper preview selector #43

gios2 opened this issue May 20, 2022 · 2 comments
Labels
good first issue Good for newcomers ⚙️ Quick Win 20min or less

Comments

@gios2
Copy link

gios2 commented May 20, 2022

It would be useful to be able to set in the link settings how the preview of the wallpaper should be shown, for users who for example use the monitor vertically, in order to show the correct preview.
As previews there should be at least: smartphone, tablet portrait, tablet landscape, vertical monitor, horizontal monitor

@pupgray
Copy link
Collaborator

pupgray commented May 28, 2022

Makes sense! I imagine this as NOT a restriction on the wallpapers that can be posted (blocking if wrong ratio) since sometimes the cropping is desirable (a wide picture could crop well on a vertical phone)

This would just be for the preview area.

@pupgray pupgray added good first issue Good for newcomers ⚙️ Quick Win 20min or less labels May 28, 2022
@pupgray
Copy link
Collaborator

pupgray commented May 28, 2022

For anyone trying this as a first issue:

This would require a new migration to add a "preview_type" (suggested name) column to the links table. I'd suggest making a bigint, so you can use rail's enum in the model. This will let you instead use it with symbols like :smartphone_portrait to interact with this column.

Then, inside the app/views/links/_details.html.erb view, depending on the value of this column for a given link, display a cropped preview approximating the ratio of hight and width of a device, replacing the current janky solution that uses an icon of the device

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers ⚙️ Quick Win 20min or less
Projects
None yet
Development

No branches or pull requests

2 participants