Skip to content

Commit d4f3553

Browse files
authored
Merge pull request numpy#228 from rgommers/rebase-moveshell
Moves shell below key features
2 parents 2721953 + 50409bd commit d4f3553

13 files changed

+208
-228
lines changed

config.yaml

+6-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ params:
3131
image: logos/numpy.svg
3232
# Customizable navbar. For a dropdown, add a "sublinks" list.
3333
news:
34-
title: NumPy News
34+
title: NumPy v1.18.0
35+
content: The C-API for numpy.random defined and documented - Basic infrastructure for linking with 64-bit BLAS and LAPACK - Improved documentation
36+
37+
shell:
38+
title: placeholder
3539
section3:
3640
title: CASE STUDIES
3741
features:
@@ -51,7 +55,7 @@ params:
5155
alttext: Cricket ball on green field.
5256
url: /case-studies/cricket-analytics
5357

54-
section2:
58+
keyfeatures:
5559
title: KEY FEATURES
5660
features:
5761
- title: Powerful N-dimensional arrays

layouts/index.html

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,12 @@
77
{{ partial "news.html" . }}
88
{{ end }}
99

10-
{{ if .Site.Params.section2 }}
11-
{{ partial "section2.html" . }}
10+
{{ if .Site.Params.keyfeatures }}
11+
{{ partial "keyfeatures.html" . }}
12+
{{ end }}
13+
14+
{{ if .Site.Params.shell }}
15+
{{ partial "shell.html" . }}
1216
{{ end }}
1317

1418
{{ if .Site.Params.tabs }}
@@ -37,4 +41,4 @@
3741
{{ if .Site.Params.sidebar }}
3842
{{ partial "sidebar.html" . }}
3943
{{ end }}
40-
{{ end }}
44+
{{ end }}

layouts/partials/css.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@
2525
<link rel="stylesheet" type="text/css" href="{{ "css/tabs.css" | relURL }}" />
2626
<link rel="stylesheet" type="text/css" href="{{ "css/content.css" | relURL }}" />
2727
<link rel="stylesheet" type="text/css" href="{{ "css/news.css" | relURL }}" />
28-
<link rel="stylesheet" type="text/css" href="{{ "css/section2.css" | relURL }}" />
28+
<link rel="stylesheet" type="text/css" href="{{ "css/keyfeatures.css" | relURL }}" />
2929
<link rel="stylesheet" type="text/css" href="{{ "css/section3.css" | relURL }}" />

layouts/partials/hero-body.html

-20
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,5 @@
2222
</div>
2323
</div>
2424
</div>
25-
<div class="hero-right">
26-
<div class="numpy-shell-canvas">
27-
<div class="numpy-shell-container">
28-
{{ partial "shell-content.html" . }}
29-
<!-- Interactive Shell -->
30-
<div class="fake-shell" id="demo-code">
31-
<div class="demo-caret" aria-label="interactive shell prompt">&gt;</div>
32-
<button class="shell-enable-button shell-button" onclick="loadShell();" aria-label="Enables the interactive tutorial shell">
33-
Enable
34-
<div class="loader-container">
35-
<div id="shell-loader" class="loader"></div>
36-
</div>
37-
</button>
38-
</div>
39-
<div class="real-shell" id="numpy-shell" style="display: none;">
40-
<pre id="demo-code" data-executable="true" data-language="python" style="white-space: pre-line;">import numpy as np</pre>
41-
</div>
42-
</div>
43-
</div>
44-
</div>
4525
</div>
4626
</div>

layouts/partials/hero.html

-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
{{ partial "navbar.html" . }}
33
{{ partial "navbar-clone.html" . }}
44
{{ partial "hero-body.html" . }}
5-
{{ partial "hero-footer.html" . }}
65
</section>

layouts/partials/keyfeatures.html

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- $keyfeatures := .Site.Params.keyfeatures }}
2+
{{- $title := index $keyfeatures "title" }}
3+
{{- $features := index $keyfeatures "features" }}
4+
5+
<section class="keyfeatures">
6+
<div class="container">
7+
<h1 class="keyfeatures-header">
8+
{{ $title }}
9+
</h1>
10+
<div class="keyfeatures-box-container">
11+
{{- range $features }}
12+
<div class="keyfeatures-box-content keyfeatures-underline">
13+
<p>
14+
<div class="keyfeatures-box-title">{{ .title }}</div>
15+
<div class="keyfeatures-box-text">{{ .text | markdownify }}</div>
16+
</p>
17+
</div>
18+
{{- end }}
19+
</div>
20+
</div>
21+
</section>

layouts/partials/news.html

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{{- $news := .Site.Params.news }}
22
{{- $title := index $news "title" }}
3+
{{- $content := index $news "content" }}
34

45
<div class="news-container">
56
<div class="news-title">{{ $title }}</div>
6-
<div class="news-content">NumPy News goes here</div>
7+
<div class="news-content">{{ $content }}</div>
78
</div>

layouts/partials/section2.html

-26
This file was deleted.

layouts/partials/shell.html

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<div class="hero-right">
2+
<div class="numpy-shell-canvas">
3+
<div class="numpy-shell-container">
4+
<div class="flex-column shell-title-container">
5+
{{ partial "shell-content.html" . }}
6+
</div>
7+
<!-- Interactive Shell -->
8+
<div class="fake-shell" id="demo-code">
9+
<div class="demo-caret" aria-label="interactive shell prompt">&gt;</div>
10+
<button class="shell-enable-button shell-button" onclick="loadShell();" aria-label="Enables the interactive tutorial shell">
11+
Enable
12+
<div class="loader-container">
13+
<div id="shell-loader" class="loader"></div>
14+
</div>
15+
</button>
16+
</div>
17+
<div class="real-shell" id="numpy-shell" style="display: none;">
18+
<pre id="demo-code" data-executable="true" data-language="python" style="white-space: pre-line;">import numpy as np</pre>
19+
</div>
20+
</div>
21+
</div>
22+
</div>

static/css/keyfeatures.css

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
.keyfeatures {
2+
margin: 50px 0;
3+
}
4+
5+
.keyfeatures .container {
6+
display: flex;
7+
flex-direction: column;
8+
}
9+
10+
.keyfeatures-header {
11+
display: flex;
12+
flex-direction: column;
13+
width: 100%;
14+
align-items: center;
15+
letter-spacing: 1.5px;
16+
font-size: 27px;
17+
}
18+
19+
.keyfeatures-box-container {
20+
display: flex;
21+
flex-wrap: wrap;
22+
justify-content: center;
23+
}
24+
25+
.keyfeatures-box-content {
26+
height: 175px;
27+
min-width: 275px;
28+
width: 325px;
29+
margin: 30px 30px 30px 0;
30+
border-radius: 3px;
31+
}
32+
33+
.keyfeatures-box-title {
34+
margin: 15px;
35+
font-size: 16px;
36+
text-transform: uppercase;
37+
}
38+
39+
.keyfeatures-box-text > a {
40+
color: #4D77CF;
41+
}
42+
43+
.keyfeatures-box-text {
44+
margin: 30px 15px;
45+
font-size: 14px;
46+
}
47+
48+
.keyfeatures-box-content:hover > .keyfeatures-box-text, .keyfeatures-box-content:focus > .keyfeatures-box-text, .keyfeatures-box-content:active > .keyfeatures-box-text {
49+
color: #6C7A89;
50+
}
51+
52+
@media only screen and (max-width: 1280px) {
53+
.keyfeatures .container {
54+
align-items: center;
55+
justify-content: center;
56+
}
57+
58+
.keyfeatures-box-container {
59+
justify-content: center;
60+
}
61+
}
62+
63+
@media only screen and (max-width: 1090px) {
64+
.keyfeatures .container {
65+
margin: 0 6vw;
66+
}
67+
}
68+
69+
@media only screen and (max-width: 525px) {
70+
.keyfeatures-header {
71+
flex-direction: column;
72+
}
73+
}
74+
75+
@media only screen and (max-width: 425px) {
76+
.keyfeatures .container {
77+
align-items: center;
78+
justify-content: center;
79+
margin: 0 10%;
80+
}
81+
82+
.keyfeatures-box-content {
83+
margin: 30px;
84+
}
85+
}
86+
87+
.keyfeatures-underline {
88+
display: inline-block;
89+
vertical-align: middle;
90+
-webkit-transform: perspective(1px) translateZ(0);
91+
transform: perspective(1px) translateZ(0);
92+
/* Black, with 10% opacity */
93+
box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.1);
94+
position: relative;
95+
overflow: hidden;
96+
}
97+
98+
.keyfeatures-underline:before {
99+
content: "";
100+
position: absolute;
101+
z-index: -1;
102+
left: 0;
103+
right: 100%;
104+
bottom: 0;
105+
background: #013243;
106+
height: 4px;
107+
-webkit-transition-property: right;
108+
transition-property: right;
109+
-webkit-transition-duration: 0.3s;
110+
transition-duration: 0.3s;
111+
-webkit-transition-timing-function: ease-out;
112+
transition-timing-function: ease-out;
113+
}
114+
115+
.keyfeatures-underline:hover:before, .keyfeatures-underline:focus:before, .keyfeatures-underline:active:before {
116+
right: 0;
117+
}

static/css/news.css

+29-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
11
.news-container {
22
display: flex;
3-
flex-direction: column;
3+
justify-content: center;
44
align-items: center;
55
width: 100vw;
6-
min-height: 100px;
6+
min-height: 45px;
7+
background-color: #013243;
8+
color: white;
9+
white-space: nowrap;
710
}
811

912
.news-title {
1013
display: flex;
11-
flex-direction: column;
12-
width: 100%;
13-
align-items: center;
1414
letter-spacing: 1.5px;
1515
font-size: 27px;
16-
}
16+
font-weight: bold;
17+
margin: 10px;
18+
}
19+
20+
@media only screen and (max-width: 1300px) {
21+
.news-container {
22+
white-space: unset;
23+
}
24+
25+
.news-title {
26+
text-align: center;
27+
}
28+
}
29+
30+
@media only screen and (max-width: 1087px) {
31+
.news-container {
32+
flex-direction: column;
33+
padding: 30px;
34+
}
35+
36+
.news-content {
37+
text-align: center;
38+
}
39+
}

0 commit comments

Comments
 (0)