Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d8d8eea

Browse files
authored
Merge pull request #6900 from afvincent/enh_website_mainpage
DOC: break website screenshot banner into 4 pieces and introduce a responsive layout
2 parents 0e46a9d + 775b373 commit d8d8eea

File tree

6 files changed

+72
-3
lines changed

6 files changed

+72
-3
lines changed

doc/_static/contour_frontpage.png

14.6 KB
Loading

doc/_static/histogram_frontpage.png

3.09 KB
Loading

doc/_static/membrane_frontpage.png

5.73 KB
Loading

doc/_static/mpl.css

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,3 +682,58 @@ figcaption {
682682
background: #003c63;
683683
outline-color: #003c63;
684684
}
685+
686+
687+
div.responsive_screenshots {
688+
/* Horizontally centered */
689+
display: block;
690+
margin: auto;
691+
692+
/* Do not go beyond 1:1 scale (and ensure a 1x4 tight layout) */
693+
max-width: 648px; /* at most 4 x 1:1 subfig width */
694+
max-height: 139px; /* at most 1 x 1:1 subfig height */
695+
}
696+
697+
/* To avoid subfigure parts outside of the responsive_screenshots */
698+
/* element (see: https://stackoverflow.com/questions/2062258/ */
699+
/* floating-stuff-within-a-div-floats-outside-of-div-why) */
700+
span.clear_screenshots { clear: left; display: block; }
701+
702+
div.responsive_subfig{
703+
float: left;
704+
width: 25%; /* we want 4 subfigs in a row */
705+
706+
/* Include content, padding and border in width. This should */
707+
/* avoid having to use tricks like "width: 24.9999%" */
708+
box-sizing: border-box;
709+
}
710+
711+
div.responsive_subfig img {
712+
/* Horizontally centered */
713+
display: block;
714+
margin: auto;
715+
716+
/* Possible downscaling */
717+
max-width: 162px; /* at most 1 x 1:1 subfig width */
718+
max-height: 139px; /* at most 1 x 1:1 subfig height */
719+
720+
width: 100%;
721+
}
722+
723+
@media only screen and (max-width: 1000px){
724+
/* The value of 1000px was handcrafted to provide a more or less */
725+
/* smooth transition between the 1x4 and the 2x2 layouts. It is */
726+
/* NB: it is slightly below 1024px: so one should still have a */
727+
/* row in a 1024x768 window */
728+
729+
div.responsive_screenshots {
730+
/* Do not go beyond 1:1 scale (and ensure a 2x2 tight layout) */
731+
max-width: 324px; /* at most 2 x 1:1 subfig width */
732+
max-height: 278px; /* at most 2 x 1:1 subfig height */
733+
}
734+
735+
div.responsive_subfig {
736+
width: 50%; /* we want 2 subfigs in a row */
737+
}
738+
739+
}

doc/_static/surface3d_frontpage.png

19.5 KB
Loading

doc/_templates/index.html

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,23 @@ <h1>Introduction</h1>
5757
web application servers, and six graphical user
5858
interface toolkits.</p>
5959

60-
<p align="center"><a href="{{ pathto('users/screenshots') }}"><img align="middle"
61-
src="{{ pathto('_static/logo_sidebar_horiz.png', 1) }}" border="0"
62-
alt="screenshots"/></a></p>
60+
<div class="responsive_screenshots">
61+
<a a href="{{ pathto('users/screenshots') }}">
62+
<div class="responsive_subfig">
63+
<img align="middle", src="{{ pathto('_static/membrane_frontpage.png', 1) }}", border="0", alt="screenshots"/>
64+
</div>
65+
<div class="responsive_subfig">
66+
<img align="middle", src="{{ pathto('_static/histogram_frontpage.png', 1) }}", border="0", alt="screenshots"/>
67+
</div>
68+
<div class="responsive_subfig">
69+
<img align="middle", src="{{ pathto('_static/contour_frontpage.png', 1) }}", border="0", alt="screenshots"/>
70+
</div>
71+
<div class="responsive_subfig">
72+
<img align="middle", src="{{ pathto('_static/surface3d_frontpage.png', 1) }}", border="0", alt="screenshots"/>
73+
</div>
74+
</a>
75+
</div>
76+
<span class="clear_screenshots"></span>
6377

6478
<p>matplotlib tries to make easy things easy and hard things possible.
6579
You can generate plots, histograms, power spectra, bar charts,

0 commit comments

Comments
 (0)