Skip to content

Commit

Permalink
Homepage: add sample section
Browse files Browse the repository at this point in the history
Added highlight JS
Update homepage
Resolves reactor#29
  • Loading branch information
oodamien committed Dec 3, 2018
1 parent 34835db commit 806b9f1
Show file tree
Hide file tree
Showing 7 changed files with 208 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/main/resources/static/assets/js/code.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright (c) 2011-2017 Pivotal Software Inc, All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

$(function(){

$('pre code').each(function(i, block) {
hljs.highlightBlock(block);
});

});
18 changes: 18 additions & 0 deletions src/main/resources/static/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,24 @@ <h1>Non blocking IO</h1>
</article>
</div>
</section>
<section id="code-sample">
<article>
<div class="code-sample">
<h1>Code Sample: <strong>lorem ipsum sit dolor</strong></h1>
<div class="colset">
<div class="left">
<pre><code class="java">Flux.range(5, 3)
.map(i -> i + 3)
.filter(i -> i % 2 == 0)
.buffer(3)</code></pre>
</div>
<div class="right">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
</div>
</div>
</div>
</article>
</section>
<section id="key-features">
<article class="turbo-message-passing">
<div>
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/static/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,9 @@ <h1 id="logo"><a href="/"><strong>Project Reactor</strong></a></h1>
-->

<script src="https://code.jquery.com/jquery-2.1.4.js"></script>
<script src="//cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>
<script src="assets/js/sidebar.js"></script>
<script src="assets/js/code.js"></script>
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
Expand Down
107 changes: 107 additions & 0 deletions src/main/sass/_highlight.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
/*
Railscasts-like style (c) Visoft, Inc. (Damien White)
*/

.hljs {
display: block;
overflow-x: auto;
padding: 0.5em 1em;
background: #232323;
color: #e6e1dc;
border-radius: 6px;
}

.hljs-comment,
.hljs-quote {
color: #bc9458;
font-style: italic;
}

.hljs-keyword,
.hljs-selector-tag {
color: #c26230;
}

.hljs-string,
.hljs-number,
.hljs-regexp,
.hljs-variable,
.hljs-template-variable {
color: #a5c261;
}

.hljs-subst {
color: #519f50;
}

.hljs-tag,
.hljs-name {
color: #e8bf6a;
}

.hljs-type {
color: #da4939;
}


.hljs-symbol,
.hljs-bullet,
.hljs-built_in,
.hljs-builtin-name,
.hljs-attr,
.hljs-link {
color: #6d9cbe;
}

.hljs-params {
color: #d0d0ff;
}

.hljs-attribute {
color: #cda869;
}

.hljs-meta {
color: #9b859d;
}

.hljs-title,
.hljs-section {
color: #ffc66d;
}

.hljs-addition {
background-color: #144212;
color: #e6e1dc;
display: inline-block;
width: 100%;
}

.hljs-deletion {
background-color: #600;
color: #e6e1dc;
display: inline-block;
width: 100%;
}

.hljs-selector-class {
color: #9b703f;
}

.hljs-selector-id {
color: #8b98ab;
}

.hljs-emphasis {
font-style: italic;
}

.hljs-strong {
font-weight: bold;
}

.hljs-link {
text-decoration: underline;
}
36 changes: 36 additions & 0 deletions src/main/sass/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -832,3 +832,39 @@ ul.nav-options {
}
}

section#code-sample {
background: #fff;
border-bottom: 1px solid #CCC;
article {
@extend .container;
h1 {
margin: 0;
font-family: $reactorFontSpecial;
font-size: 30px;
line-height: 30px;
font-weight: 400;
padding-bottom: 15px;
strong {
font-weight: normal;
color: $reactorPrimary
}
}
.code-sample {
margin: 0 auto;
max-width: 980px;
padding: 3.5em 10px;
}
.colset {
@include clearfix();
.left {
width: 47%;
float: left;
}
.right {
float: right;
width: 47%;
padding: 15px 0;
}
}
}
}
21 changes: 21 additions & 0 deletions src/main/sass/_responsive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,27 @@
}
}
}


section#code-sample {
article {
.code-sample {
padding: 2.5em 20px;
}
.colset {
.left {
width: 100%;
float: none;
}
.right {
width: 100%;
float: none;
padding: 0;
}
}
}
}

}

@media (max-width: 600px) {
Expand Down
1 change: 1 addition & 0 deletions src/main/sass/reactor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ $reactorFontSpecial3: "Varela Round",sans-serif;
@import "learn";
@import "responsive";
@import "button";
@import "highlight";

0 comments on commit 806b9f1

Please sign in to comment.