Skip to content

Commit 1344d2f

Browse files
Brandon GreenPat Mellon
Brandon Green
authored and
Pat Mellon
committed
Add pages for Deep Learning with PyTorch book download
1 parent 97322bc commit 1344d2f

16 files changed

+371
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!-- Twitter single-event website tag code -->
2+
<img height="1" width="1" style="display:none;" alt="" src="https://analytics.twitter.com/i/adsct?p_id=Twitter&p_user_id=0&txn_id=o2gii&events=%5B%5B%22pageview%22%2Cnull%5D%5D&tw_sale_amount=0&tw_order_quantity=0" />
3+
<img height="1" width="1" style="display:none;" alt="" src="//t.co/i/adsct?p_id=Twitter&p_user_id=0&txn_id=o2gii&events=%5B%5B%22pageview%22%2Cnull%5D%5D&tw_sale_amount=0&tw_order_quantity=0" />
4+
<!-- End Twitter single-event website tag code -->

_includes/deep_learning_form.html

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<div id="mc_embed_signup">
2+
<form
3+
action="https://twitter.us14.list-manage.com/subscribe/post?u=75419c71fe0a935e53dfa4a3f&id=91d0dccd39"
4+
method="post"
5+
id="mc-embedded-subscribe-form"
6+
name="mc-embedded-subscribe-form"
7+
class="email-subscribe-form validate deep-learning-form"
8+
target="_blank">
9+
<div id="mc_embed_signup_scroll" class="email-subscribe-form-fields-wrapper">
10+
<div class="mc-field-group">
11+
<label for="mce-EMAIL" style="display:none;">Email Address</label>
12+
<input type="email" value="" name="EMAIL" class="required email deep-learning-input" id="mce-EMAIL" placeholder="Enter Your Email">
13+
</div>
14+
15+
<div id="mce-responses" class="clear">
16+
<div class="response" id="mce-error-response" style="display:none"></div>
17+
<div class="response" id="mce-success-response" style="display:none"><a href="{{ site.baseurl}}/deep-learning-with-pytorch-thank-you" target="_blank"></a></div>
18+
</div> <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
19+
20+
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_75419c71fe0a935e53dfa4a3f_91d0dccd39" tabindex="-1" value=""></div>
21+
<button id="deep-learning-button" class="btn btn-lg with-right-arrow module-button email-subscribe-button">Download Book</button>
22+
</div>
23+
</form>
24+
</div>
25+
26+
<script src="//cdn.jsdelivr.net/gh/cferdinandi/bouncer@1.0.5/dist/bouncer.polyfills.min.js"></script>
27+
<script type='text/javascript'>
28+
var bouncer = new Bouncer("#mc-embedded-subscribe-form", {
29+
// Don't automatically submit the form if it's verified
30+
disableSubmit: true
31+
});
32+
document.addEventListener(
33+
"bouncerFormValid",
34+
function(event) {
35+
var $form = $(event.target);
36+
var $button = $form.find(".email-subscribe-button");
37+
38+
$.ajax({
39+
type: "GET",
40+
url:
41+
"https://twitter.us14.list-manage.com/subscribe/post-json?u=75419c71fe0a935e53dfa4a3f&amp;id=91d0dccd39&c=?",
42+
data: $form.serialize(),
43+
dataType: "json",
44+
contentType: "application/json; charset=utf-8",
45+
success: function(data) {
46+
if (data.result == "success") {
47+
window.location.href =
48+
"{{site.baseurl}}/deep-learning-with-pytorch-thank-you";
49+
} else {
50+
if (data.msg.includes("is already subscribed to list")) {
51+
window.location.href =
52+
"{{site.baseurl}}/deep-learning-with-pytorch-thank-you";
53+
} else {
54+
$form
55+
.find("#mce-error-response")
56+
.html("There was an error submitting the form. Please try again.")
57+
.show();
58+
}
59+
}
60+
},
61+
error: function(e) {
62+
window.location.href =
63+
"https://twitter.us14.list-manage.com/subscribe/post-json?u=75419c71fe0a935e53dfa4a3f&amp;id=91d0dccd39&c=?";
64+
}
65+
});
66+
},
67+
false
68+
);
69+
</script>

_includes/footer_scripts.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<script src="{{ site.baseurl }}/assets/mobile-menu.js"></script>
22
<script src="{{ site.baseurl }}/assets/scroll-to-anchor.js"></script>
33
<script src="{{ site.baseurl }}/assets/external-links-new-tab.js"></script>
4-
<script src="{{ site.baseurl }}/assets/search-bar.js"></script>
4+
{% if page.layout != "deep_learning" %}
5+
<script src="{{ site.baseurl }}/assets/search-bar.js"></script>
6+
{% endif %}
57
<script src="{{ site.baseurl }}/assets/cookie-banner.js"></script>
68

79
<script type="text/javascript">

_includes/head.html

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
{% include analytics.html %}
2222
{% include pixel.html %}
2323
{% include google_tag.html %}
24+
{% include twitter_pixel.html %}
2425
{% endif %}
2526
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
2627
</head>

_includes/pixel.html

+7-6
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@
99
'https://connect.facebook.net/en_US/fbevents.js');
1010
fbq('init', '243028289693773');
1111
fbq('track', 'PageView');
12-
</script>
13-
<noscript>
14-
<img height="1" width="1"
15-
src="https://www.facebook.com/tr?id=243028289693773&ev=PageView
16-
&noscript=1"/>
17-
</noscript>
12+
</script>
13+
14+
<noscript>
15+
<img height="1" width="1"
16+
src="https://www.facebook.com/tr?id=243028289693773&ev=PageView
17+
&noscript=1"/>
18+
</noscript>

_includes/twitter_pixel.html

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!-- Twitter universal website tag code -->
2+
<img height="1" width="1" style="display:none;" alt="" src="https://analytics.twitter.com/i/adsct?p_id=Twitter&p_user_id=0&txn_id=o2gi1&events=%5B%5B%22pageview%22%2Cnull%5D%5D&tw_sale_amount=0&tw_order_quantity=0 (https://urldefense.proofpoint.com/v2/url?u=https-3A__analytics.twitter.com_i_adsct-3Fp-5Fid-3DTwitter-26p-5Fuser-5Fid-3D0-26txn-5Fid-3Do2gi1-26events-3D-255B-255B-2522pageview-2522-252Cnull-255D-255D-26tw-5Fsale-5Famount-3D0-26tw-5Forder-5Fquantity-3D0&d=DwMGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=GMr8XYCDyeQQZuD3noL91A&m=dAJyokk16UvYy-vMrGn_JwYiGfp_eEgo25B9iGDCG-A&s=o6i4D0V0088WH2RnzIoqiF-vj45PL-2sTrsxQ0SNO3A&e=)" />
3+
<img height="1" width="1" style="display:none;" alt="" src="//t.co/i/adsct?p_id=Twitter&p_user_id=0&txn_id=o2gi1&events=%5B%5B%22pageview%22%2Cnull%5D%5D&tw_sale_amount=0&tw_order_quantity=0 (https://urldefense.proofpoint.com/v2/url?u=https-3A__linkprotect.cudasvc.com_url-3Fa-3Dhttp-253a-252f-252ft.co-252fi-252fadsct-253fp-5Fid-253dTwitter-2526p-5Fuser-5Fid-253d0-2526txn-5Fid-253do2gi1-2526events-253d-25255B-25255B-252522pageview-252522-25252Cnull-25255D-25255D-2526tw-5Fsale-5Famount-253d0-2526tw-5Forder-5Fquantity-253d0-26c-3DE-2C1-2CC33dLwIhtuEcl5FhdztSnUwsioeej5k-2DWy0RYREBAq51kGji32A2Cw94YU9vQBpY5tPN3AukEw3C-5F-2DlbtndnLoR7-5FA-5FLoH0Rr7zLtP1ykptN-26typo-3D1&d=DwMGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=GMr8XYCDyeQQZuD3noL91A&m=dAJyokk16UvYy-vMrGn_JwYiGfp_eEgo25B9iGDCG-A&s=Abgc3XBkhESv8XBYtLchdDZyISGsK6v_BB6cLMJGyCw&e=)" />
4+
<!-- End Twitter universal website tag code -->

_layouts/deep_learning.html

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
{% include head.html %}
4+
<div class="container-fluid header-holder">
5+
<div class="container">
6+
<div class="header-container">
7+
<a class="header-logo" href="{{ site.url }}{{ site.baseurl }}" aria-label="PyTorch"></a>
8+
</div>
9+
</div>
10+
</div>
11+
12+
<body class="{{ page.body-class }}">
13+
<div class="main-background {{ page.background-class }} {% if page.deep-learning-landing == false %}thank-you-background{% endif %}"></div>
14+
15+
<div class="jumbotron jumbotron-fluid on-dark-background">
16+
<div class="container deep-learning-container {% if page.deep-learning-landing == false %}thank-you-page-container{% endif %}">
17+
<div class="row">
18+
<div class="col-md-7 deep-learning-jumbotron-text">
19+
<h1>Deep Learning <br> with PyTorch</h1>
20+
{% if page.deep-learning-landing == true %}
21+
<p class="lead deep-learning-landing-text">Download a free copy of the book and learn how to get started with AI / ML development using PyTorch</p>
22+
{% else %}
23+
<p class="lead deep-learning-thank-you-text">Thanks for requesting a copy of the Deep Learning with PyTorch book!
24+
<span class="download-book-link"><a href="/assets/deep-learning/Deep-Learning-with-PyTorch.pdf" target="_blank">Click here</a> to download the book.</span>
25+
</p>
26+
{% endif %}
27+
</div>
28+
<div class="col-md-5 deep-learning-book-container {% if page.deep-learning-landing == false %}thank-you-book-container{% endif %}">
29+
<img class="deep-learning-book" src="/assets/images/deep-learning-thumbnail.png">
30+
</div>
31+
</div>
32+
</div>
33+
</div>
34+
35+
<div class="main-content-wrapper {% if page.deep-learning-landing == false %}thank-you-wrapper{% endif %}">
36+
<div class="main-content deep-learning-content">
37+
<div class="container">
38+
39+
{{ content }}
40+
41+
</div>
42+
</div>
43+
</div>
44+
45+
{% include footer.html %}
46+
47+
{% if page.deep-learning-landing == false and jekyll.environment == 'production' %}
48+
{% include deep_learning_event_tracking.html %}
49+
{% endif %}
50+
</body>
51+
</html>

_sass/base_styles.scss

+4-1
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,9 @@ a, .btn {
164164
&.mobile-background {
165165
background-image: url($baseurl + "/assets/images/get-started-background.jpg");
166166
}
167+
&.deep-learning-background {
168+
background-image: url($baseurl + "/assets/images/deep-learning-thank-you-background.jpg");
169+
}
167170
}
168171

169172
.bg-light-grey {
@@ -233,7 +236,7 @@ a, .btn {
233236
:-moz-placeholder { /* Firefox 18- */
234237
color: $orange;
235238
}
236-
239+
237240
input[type="submit"] {
238241
position: absolute;
239242
right: 0;

_sass/deep-learning.scss

+178
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
.deep-learning {
2+
.header-container {
3+
@include max-width-desktop {
4+
margin-bottom: 1rem;
5+
}
6+
}
7+
8+
.jumbotron {
9+
height: 180px;
10+
@include desktop {
11+
height: 250px;
12+
}
13+
14+
.thank-you-page-container {
15+
margin-top: 0;
16+
@include small-desktop {
17+
margin-top: 250px;
18+
}
19+
}
20+
21+
.deep-learning-jumbotron-text {
22+
@include desktop {
23+
margin-top: 55px;
24+
}
25+
@include small-desktop {
26+
max-width: 95%;
27+
flex-basis: 100%;
28+
}
29+
}
30+
31+
.deep-learning-thank-you-text {
32+
width: 80%;
33+
.download-book-link {
34+
display: inline-block;
35+
}
36+
}
37+
38+
.deep-learning-landing-text {
39+
width: 100%;
40+
@include desktop {
41+
width: 85%
42+
}
43+
}
44+
45+
.deep-learning-book-container {
46+
display: none;
47+
@include desktop {
48+
display: block
49+
}
50+
@include small-desktop {
51+
display: none;
52+
}
53+
}
54+
55+
.thank-you-book-container {
56+
display: none;
57+
@include small-desktop {
58+
display: block;
59+
}
60+
@include desktop {
61+
display: block;
62+
}
63+
}
64+
}
65+
66+
.deep-learning-col {
67+
@include desktop {
68+
max-width: 80%;
69+
}
70+
}
71+
72+
.deep-learning-background {
73+
@include desktop {
74+
height: 440px;
75+
}
76+
}
77+
78+
.header-holder {
79+
@include desktop {
80+
height: 90px;
81+
}
82+
}
83+
}
84+
85+
.deep-learning {
86+
.main-content-wrapper {
87+
margin-top: 250px;
88+
@include desktop {
89+
margin-top: 480px;
90+
}
91+
}
92+
93+
.deep-learning-content {
94+
@include desktop {
95+
padding-top: 0;
96+
}
97+
}
98+
99+
.main-background {
100+
height: 250px;
101+
@include desktop {
102+
height: 440px
103+
}
104+
}
105+
106+
.thank-you-wrapper {
107+
margin-top: 400px;
108+
@include desktop {
109+
margin-top: 275px;
110+
}
111+
}
112+
113+
.thank-you-background {
114+
height: 438px;
115+
@include desktop {
116+
height: 680px;
117+
}
118+
}
119+
}
120+
121+
.deep-learning-container {
122+
display: flex;
123+
align-items: center;
124+
}
125+
126+
.deep-learning-logo {
127+
background-image: url($baseurl + "/assets/images/pytorch-logo.png");
128+
}
129+
130+
.deep-learning-row {
131+
display: flex;
132+
align-items: center;
133+
.lead {
134+
margin-top: 1rem;
135+
margin-bottom: 2rem;
136+
}
137+
h1 {
138+
@include small-desktop {
139+
font-size: 3rem;
140+
}
141+
@include desktop {
142+
margin-top: 2rem;
143+
}
144+
}
145+
}
146+
147+
.deep-learning-book {
148+
max-width: 100%;
149+
height: 200px;
150+
@include desktop {
151+
height: auto;
152+
}
153+
}
154+
155+
.deep-learning-form {
156+
margin-left: -1rem;
157+
@include desktop {
158+
margin-left: 0;
159+
margin-top: 1rem;
160+
}
161+
}
162+
163+
#deep-learning-button {
164+
margin-top: 2rem;
165+
}
166+
167+
.deep-learning-form {
168+
.email-subscribe-form {
169+
.deep-learning-input {
170+
padding-left: .5rem;
171+
background-color: #f3f4f7;
172+
}
173+
}
174+
175+
#mce-error-response {
176+
color: $orange;
177+
}
178+
}
Binary file not shown.
Loading
105 KB
Loading

assets/main.scss

+1
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ $baseurl:"{{ site.baseurl }}";
3131
@import "hub-search";
3232
@import "compact";
3333
@import "mobile";
34+
@import "deep-learning";

0 commit comments

Comments
 (0)