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

Examples: Resizable grid view #19438

Closed

Conversation

marcofugaro
Copy link
Contributor

@marcofugaro marcofugaro commented May 24, 2020

Followup of #19375

I implemented a resizable examples view as suggested in #19375 (comment).

It is under a breakpoint, so it is enabled on landscape iPad and up.

I've set the minimum card width to 200px, but it can be adjusted.

Note: on Chrome, in certain situations, the resizing may be a little bit laggy. This is because it triggers re-paint, and painting is handled on the CPU in Chrome.

demo

Live demo

@munrocket
Copy link
Contributor

Looks like it's hard to catch scrollbar with this UX (._.) Actually it's what I am afraid of and this is the reason why simple button #18841 looks better for me. Also grid unreachable on mobile phones.

Anyway thanks for you effort, we are going to the best three.js webpage. Don't want to stop this, but we need more feedback IMHO. I never seen draggable scrollbar before.

@marcofugaro
Copy link
Contributor Author

marcofugaro commented May 24, 2020

You're right.
I moved the interaction area towards the outside so now the scrollbar is still usable.

It is not supposed to work on mobile, it is disabled there.

The problem with the button, is that it overlaps with the x of the search. This might confuse the user. It is generally avoided to change the layout without the user specifically requesting so.
It could work if we find another place for the button.

@munrocket
Copy link
Contributor

Wow, looks better now!
Githack

@NicolasRannou
Copy link
Contributor

NicolasRannou commented May 27, 2020

I'm a bit late to the party and maybe that's for another PR, but I think it may still be useful to have the previous list of examples without thumbnails? If so, we could add 2 toggle buttons at the right of the search bar to switch from "preview" to "no-preview" list?

threes_examples

@marcofugaro
Copy link
Contributor Author

@NicolasRannou could you elaborate on why you would want to use the list without images instead of the one with the images?

@NicolasRannou
Copy link
Contributor

So I think that this new view is great to explore examples but it does take a lot of scrolling to reach the end of the list - granted that the search bar is there to quickly access one example.

I'm not strongly feeling about it but I just wanted to mention it!

Great work!

@marcofugaro
Copy link
Contributor Author

marcofugaro commented May 28, 2020

it does take a lot of scrolling to reach the end of the list

I totally agree! Does the grid view I proposed in this PR help with that? Keep in mind that we could still make the cards smaller so there are more in a single view.

@mrdoob mrdoob added this to the rXXX milestone Jul 2, 2020
@mrdoob
Copy link
Owner

mrdoob commented Jul 22, 2020

@NicolasRannou #19881

@mrdoob mrdoob modified the milestones: rXXX, r119 Jul 22, 2020
@marcofugaro marcofugaro force-pushed the example-mode-resizable-grid branch from 5ff8bab to 21d9116 Compare July 27, 2020 15:44
@marcofugaro
Copy link
Contributor Author

I rebased this PR and integrated it with the minimal layout toggle.

https://raw.githack.com/marcofugaro/three.js/example-mode-resizable-grid/examples/index.html

@mrdoob
Copy link
Owner

mrdoob commented Jul 27, 2020

I think it would be nice to have some more days to test this. Moving it to next release.

@mrdoob mrdoob modified the milestones: r119, r120 Jul 27, 2020
@mrdoob
Copy link
Owner

mrdoob commented Aug 25, 2020

Implemented a resizer in the editor using event.movementX (Safari doesn't support it though)... 42a1d5e

@marcofugaro
Copy link
Contributor Author

@mrdoob Nice! Should I refactor using event.movementX as well?

@mrdoob mrdoob modified the milestones: r120, r121 Aug 25, 2020
@mrdoob mrdoob modified the milestones: r121, r122 Sep 29, 2020
@mrdoob mrdoob modified the milestones: r122, r123 Oct 28, 2020
@mrdoob mrdoob modified the milestones: r123, r124 Nov 25, 2020
@marcofugaro marcofugaro force-pushed the example-mode-resizable-grid branch from 21d9116 to 22014d5 Compare December 1, 2020 16:19
@marcofugaro
Copy link
Contributor Author

Alright, rebased and converted to let/const!

@mrdoob mrdoob modified the milestones: r146, r147 Oct 27, 2022
@mrdoob mrdoob modified the milestones: r147, r148 Nov 30, 2022
@mrdoob mrdoob modified the milestones: r148, r149 Dec 22, 2022
@OndrejSpanel
Copy link
Contributor

could you elaborate on why you would want to use the list without images instead of the one with the images?

I would often prefer it because I can see much more examples on one screen. Currently when looking for something I see four examples on one page. With text only (as can be seen in 2016 version of the page I saw about 40 of them and the whole list would fit on 10 pages, which was quite possible to read through just to get an impression what examples are available. The complete list is 100 pages long with images.

@marcofugaro
Copy link
Contributor Author

@OndrejSpanel a toggle between text/image version has been added since then.

@mrdoob mrdoob modified the milestones: r149, r150 Jan 26, 2023
@mrdoob mrdoob modified the milestones: r150, r151 Feb 23, 2023
@mrdoob mrdoob modified the milestones: r151, r152 Mar 30, 2023
@mrdoob mrdoob modified the milestones: r152, r153 Apr 27, 2023
@Mugen87 Mugen87 modified the milestones: r153, r154 Jun 1, 2023
@mrdoob mrdoob modified the milestones: r154, r155 Jun 29, 2023
@mrdoob mrdoob modified the milestones: r155, r156 Jul 27, 2023
@mrdoob mrdoob modified the milestones: r156, r157 Aug 31, 2023
@mrdoob mrdoob modified the milestones: r157, r158 Sep 28, 2023
@Mugen87
Copy link
Collaborator

Mugen87 commented Oct 6, 2023

Although the feature is nice, it adds quite a loot of code `examples/index.html. In the interests of maintainability and simplicity, it's better to not merge the PR until a more compact solution is found.

@Mugen87 Mugen87 closed this Oct 6, 2023
@Mugen87 Mugen87 removed this from the r158 milestone Oct 6, 2023
@marcofugaro
Copy link
Contributor Author

@Mugen87 I am afraid there is not a more compact solution, the resizer in the editor is structured more or less the same: https://github.com/mrdoob/three.js/blob/dev/editor/js/Resizer.js

But it looks like people are not interested in this grid feature anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants