-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Enh: break website screenshot banner into 4 pieces and introduce a responsive layout #6900
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
Conversation
Some feedback for your questions and concerns:
Hope this helps! |
@doraf Thanks for the comments and remarks :). WiPTo jump directly from 1x4 to 2x2, I was simply planning to do something like: <p align="center">
<div class="flex-container">
<div class="flex-item">
<a a href="users/screenshots.html">
<img align="left", src="_static/membrane_frontpage.png", border="0", alt="screenshots"/>
</a>
<a a href="users/screenshots.html">
<img align="right", src="_static/histogram_frontpage.png", border="0", alt="screenshots"/>
</a>
</div>
<div class="flex-item">
<a a href="users/screenshots.html">
<img align="left", src="_static/contour_frontpage.png", border="0", alt="screenshots"/>
</a>
<a a href="users/screenshots.html">
<img align="right", src="_static/surface3d_frontpage.png", border="0", alt="screenshots"/>
</a>
</div>
</div>
</p> which behaves as expected (at least with Firefox 38 ESR): a flex container with 2 flex items, each one with 2 images (of identical shape), the first left-aligned and the second right-aligned. Tests with IE11 in a Windows 7 VM seem to be OK (subfigures are centered and they wrap). I will see if I have time (and space) to test another Windows VM with Edge. I did some experiments with I will update the PR tonight. Exotic or old browsersFor the record, when I reload the page with Dillo, the CSS seems to be better taken into account the second time (!) and the subfigures somehow wraps when window width becomes too narrow. Though they are not centered, the overall feeling is then OK to me (on such kind of browser). Being there, I have also tested with an old version of Konqueror (version 4.10.5, 2008…) that I have at work on CentOS 7, and I noticed a regression when using a flex-based layout: the subfigures wraps but the banner is left-anchored (the former unbreakable 4-in-1 banner was centered). |
I think that this example is what we need. It scales images, displays 1x4 on wide windows, 2x2 on smaller ones and 4x1 on the smallest. And it does not use flexbox. |
margin: auto; | ||
|
||
max-height: 139px; /* at most 1 x 1:1 subfig height */ | ||
width=100%; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a mistake
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is a mistake? (My wish was to have the banner to take the full column width, with its height being reduced if needed.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kojoley OK I got it! Sorry I was tired last night… (for those who are too: '=' <- ':'). Anyway, looking on the web, it seems that width: 100%
is actually useless (and not that clever either) for div
element. I will correct it soon.
@Kojoley Thank you for the ressource address, it was (very) helpful (I did not know anything about CSS until yesterday…). I managed to get something that is somehow responsive to the window width and does not use flexbox. I am not sure that we want to go down to the 4x1 layout: the main column cannot become narrower than ~ 500 pixels and each subfigure of the banner is 162 x139 pixels². Due to this very low resolution, I do not think it is neither wise to upscale the subfigure as in @Kojoley's link example. Currently I implemented something in between:
See below for an overview of the proposed behavior:
Disclaimer: I did not tested it yet with any browser but Firefox (47). |
f116605
to
ff42fb6
Compare
I think that this time I got something rather OK. It has a simpler code than before and behave similarly¹ to my previous post with screenshots (and some CSS typos were corrected thanks to @Kojoley). I rebased, squashing some of the intermediate commits that had been (totally) overwritten by my last commit and reordering them to get something logical. I tested it as much as I could using free web services like the ones @Kojoley reported. The responsive layout seemed fine to me on all major recent (and major) browsers I was able to test:
Unfortunately I ran out of “free samples” before having tested it on any Apple OS and Safari version. However I gave it a try with a recent version of Epiphany on my computer (that is also using Webkit if I am correct) and everything was looking fine. ¹ : I reduced to 1000px (prev. 1024px) the window width value that switches from 1x4 to 2x2 layout. This way, people with a 1024x768 full screen will still be shown the 1x4 layout that present more information without having to scroll. |
I don't totally understand the CI failure: AppVeyor seems to complain about |
The error is not about
But anyway I think it is not your fault. attn @JanSchulz |
Yes, that's true, it was just easier to do it on appveyor so that the downloaded artefacts already have the html file which you can use to visually compare the results.
This looks like something got the quotes wrong: I'm restarting the build to see if it is a fluke... |
So, it builds now... No idea what is the problem here, but I saw that it happened in a few other builds. Sorry, but I've no clue :-/ |
@JanSchulz Thanks for taking care of the AppVeyor stuff. Is the failure of |
DOC: break website screenshot banner into 4 pieces and introduce a responsive layout
backported to v2.x as b3d33ef |
This is still WiP: feel free to comment, enhance or simply disagree and argue this PR should be closed.Edit: I think the PR is quite OK for review now (and of course remarks and comments are still welcome).This PR is a proposal to solve a small issue noticed and mentioned by @story645 on gitter a while ago (July 18-19). A possible solution was then briefly discussed with @story645 and @tacaswell but no issue was reported.
Currently the main page of the web site has a “screenshots” banner that does not look very well on narrow displays. When the width of the window becomes narrow, the right side of the banner is going out of the main column (hiding stuff on the sidebar) eventhough it looks like 4 different subfigures that might adapt to the width:

The proposal is to break the banner into 4 subfigures and rely on the
flex
CSS property to handle the layout of the banner depending on the window width. My very first naive lines of CSS or HTML produce this kind of behavior:I still have two hesitations:
flex
CSS property is well supported by old web browsers. Or simply more exotic ones… For example I tested it in Dillo, and then the banner is displayed in a 4x1 layout but this looks to be normal with this browser: I looked at the gallery with Dillo too and currently all the thumbnails are also displayed on a single column (even with a wide window).From the technical point of view, for the moment, I simply extracted the 4 subfigures manually with Gimp from the former. I am also planning to write scripts that regenerate them with the new mpl version, but I guess that this will be for another PR (and when I will have dealt with other opened PRs…).
NB: with the current static images, the surface 3D subfigure is a bit wider than the 3 other ones, which “breaks” a bit the alignment in the 2x2 configuration. It may be nicer to resize the surface 3D thumbnail to have exactly the same size as the other ones.
Edit: orthography…