Skip to content

Commit f27ee82

Browse files
authored
Merge pull request #1644 from adsingh14/resp-view
Resp view
2 parents 46241b6 + 0677be3 commit f27ee82

26 files changed

+518
-64
lines changed

app/assets/javascripts/application.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,3 +364,18 @@ var AboutContent = {
364364
});
365365
}
366366
}
367+
368+
// Scroll to Top
369+
$('#scrollToTop').removeClass('no-js');
370+
$(window).scroll(function() {
371+
$(this).scrollTop() > 150
372+
? $('#scrollToTop').fadeIn()
373+
: $('#scrollToTop').fadeOut();
374+
});
375+
$('#scrollToTop').click(function(e) {
376+
e.preventDefault();
377+
$("html, body").animate({
378+
scrollTop: 0
379+
}, "slow");
380+
return false;
381+
});

app/assets/stylesheets/application.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
code {
3131
display: inline;
3232
padding: 0 5px;
33+
word-break: break-all;
3334
}
3435

3536
pre {
@@ -44,3 +45,7 @@ pre {
4445
overflow: auto;
4546
padding: 10px 15px 13px;
4647
}
48+
49+
.d-flex{
50+
display: flex;
51+
}

app/assets/stylesheets/book.scss

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,18 @@ ol.book-toc {
150150
.switch a {
151151
color: #aaa;
152152
}
153+
154+
.book-wrapper {
155+
float:right;
156+
margin: -20px 40px 0 40px;
157+
}
158+
159+
@media (min-width: $mobile-m) {
160+
.book-toc {
161+
width: 60%
162+
}
163+
.book-wrapper {
164+
position: sticky;
165+
top: 2rem;
166+
}
167+
}

app/assets/stylesheets/forms.scss

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ form#search {
4848
@include border-radius(20px);
4949
width: 100%;
5050
height: 20px;
51-
margin-top: 5px;
52-
margin-bottom: 1px;
51+
margin-top: 4px;
52+
margin-bottom: 2px;
5353
line-height: 1em;
5454
color: $font-color;
5555
background-color: transparent;
@@ -61,3 +61,23 @@ form#search {
6161
background-color: #fff;
6262
}
6363
}
64+
65+
// Breakpoint ----------------
66+
@media (max-width: $default) {
67+
form#search{
68+
@include center-transformX;
69+
margin-top: 7px;
70+
top: unset;
71+
width: 92%;
72+
}
73+
}
74+
75+
// Mobile
76+
@media (max-width: $mobile-m) {
77+
form#search{
78+
width: 84%;
79+
#search-text {
80+
padding: 0.3rem 0.1rem;
81+
}
82+
}
83+
}

app/assets/stylesheets/front-page.scss

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,3 +331,87 @@ a.icon {
331331
@include background-image-2x("/images/icons/source-code", 25px, 20px, 0 6px);
332332
}
333333
}
334+
335+
336+
337+
// Breakpoint ----------------
338+
@media (max-width: $default) {
339+
#front-content {
340+
display: flex;
341+
#front-navigation {
342+
width: 50%;
343+
#front-nav {
344+
ul {
345+
padding: 0 1rem 0 0;
346+
li {
347+
margin-bottom: 1rem !important;
348+
margin-right: 0 !important;
349+
}
350+
}
351+
}
352+
#front-book {
353+
width: unset;
354+
}
355+
}
356+
#front-downloads {
357+
width: 50%;
358+
.monitor {
359+
@include center-transformX;
360+
}
361+
table{
362+
@include center-transformX;
363+
tbody, tr {
364+
display: flex;
365+
flex-direction: column;
366+
}
367+
td {
368+
margin-bottom: 1rem;
369+
a { padding-left: 2.3rem; }
370+
}
371+
}
372+
}
373+
}
374+
#companies-projects {
375+
ul {
376+
display: flex;
377+
flex-wrap: wrap;
378+
justify-content: center;
379+
}
380+
li {
381+
margin: 0.7rem 0.4rem;
382+
}
383+
}
384+
}
385+
386+
// Mobile
387+
@media (max-width: $mobile-m) {
388+
#front-content{
389+
flex-direction: column-reverse;
390+
#front-navigation, #front-downloads {
391+
width: 100%;
392+
border-right: none;
393+
}
394+
#front-navigation {
395+
#front-nav {
396+
ul {
397+
padding: 0 1rem;
398+
}
399+
}
400+
#front-book {
401+
@include flex-center;
402+
align-items: center;
403+
}
404+
}
405+
#front-downloads {
406+
border-bottom: 1px solid $base-border-color;
407+
margin-bottom: 2rem;
408+
padding-bottom: 1rem;
409+
.monitor, table {
410+
position: relative;
411+
}
412+
table {
413+
top: 0;
414+
}
415+
}
416+
}
417+
}

app/assets/stylesheets/layout.scss

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ aside {
9595

9696
img {
9797
max-width: 100%;
98+
height: auto;
9899
}
99100
}
100101

@@ -403,3 +404,181 @@ table.benchmarks {
403404
}
404405
}
405406
}
407+
// scrollToTop
408+
.scrollToTop {
409+
@include border-radius(50px);
410+
display: none;
411+
position: fixed;
412+
background-color: rgba(223, 221, 213, 0.33);
413+
right: 20px;
414+
bottom: 6.25rem;
415+
padding: 0.8rem;
416+
height: 20px;
417+
transition: background-color 0.2s;
418+
width: 20px;
419+
&:hover{
420+
background-color: rgba(250, 250, 250, 0.9);
421+
@include box-shadow(2px);
422+
&::before {
423+
@include center-transformX;
424+
width: 0;
425+
height: 0;
426+
color: var(--color-neutral-emphasis-plus);
427+
content: "";
428+
border: 6px solid transparent;
429+
border-color:$black-3 transparent transparent;
430+
top: -0.55rem;
431+
position: absolute;
432+
}
433+
&::after {
434+
@include center-transformX;
435+
top: -2rem;
436+
border-radius: 4px;
437+
position: absolute;
438+
content: attr(data-label);
439+
word-wrap: break-word;
440+
white-space: pre;
441+
padding: .5em .75em;
442+
color:$callout-color;
443+
background-color:$black-3;
444+
font: normal normal 11px/1.5 -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji;
445+
}
446+
}
447+
}
448+
.no-js{
449+
&.scrollToTop {
450+
display: block;
451+
}
452+
}
453+
454+
// Breakpoint ----------------
455+
@media (max-width: $default) {
456+
.responsive-table { overflow-x: auto; }
457+
.center img { height: 100%; }
458+
header{
459+
padding-bottom: 2.5rem;
460+
a, span {
461+
padding-left: 1rem;
462+
margin-bottom: 10px ;
463+
}
464+
}
465+
#home { .inner { > header { padding-bottom: 2rem; } } }
466+
#content { width: 100%; }
467+
.inner { width: 100%; }
468+
#content-wrapper { padding: 0.8rem; }
469+
470+
#masthead {
471+
height: unset;
472+
.inner {
473+
display: flex;
474+
margin-top: 1.8rem;
475+
div:first-of-type {
476+
padding:1rem;
477+
}
478+
.illustration-wrapper {
479+
display: flex;
480+
align-items: center;
481+
}
482+
p { width: unset; }
483+
img.illustration {
484+
position: unset;
485+
right: unset;
486+
top: unset;
487+
max-height: 100%;
488+
}
489+
}
490+
}
491+
footer {
492+
padding-left: 1rem;
493+
padding-right: 1rem;
494+
}
495+
}
496+
// Mobile
497+
@media (max-width: $mobile-m) {
498+
header {
499+
padding-bottom: 3rem;
500+
#tagline {
501+
font-size: 0.8rem;
502+
top: 0;
503+
padding-right: 1rem;
504+
}
505+
}
506+
#home { .inner { > header { padding-bottom: 2.5rem; } } }
507+
#masthead {
508+
.inner { flex-direction: column-reverse; }
509+
.illustration-wrapper {
510+
@include flex-center;
511+
overflow: hidden;
512+
.illustration {
513+
width: 80%;
514+
height: 100%;
515+
}
516+
}
517+
}
518+
#main {
519+
>.two-column {
520+
.column-right {
521+
position: relative;
522+
@include flex-center;
523+
}
524+
}
525+
.two-column {
526+
@include flex-column;
527+
.column-left, .column-right {
528+
width: 100%;
529+
}
530+
}
531+
}
532+
// Topics dropdown
533+
#book-chapters,
534+
#reference-version {
535+
.dropdown-panel {
536+
width: unset;
537+
.three-column {
538+
@include flex-column;
539+
height: 70vh;
540+
overflow-y: scroll;
541+
overflow-x: hidden;
542+
.column-left,
543+
.column-middle,
544+
.column-right {
545+
width: 100%;
546+
max-width: 300px;
547+
}
548+
.unstyled {
549+
a {
550+
padding: 0.15rem 0;
551+
display: block;
552+
}
553+
}
554+
.chapter{
555+
h2 {
556+
display: flex;
557+
align-items: center;
558+
a { padding-left: 5px; }
559+
}
560+
ol {
561+
li {
562+
display: flex;
563+
align-items: center;
564+
margin-bottom: 6px;
565+
padding: 0.45rem 0;
566+
a { padding-left: 5px;}
567+
}
568+
}
569+
}
570+
}
571+
}
572+
}
573+
footer {
574+
@include flex-center;
575+
flex-direction: column;
576+
align-items: center;
577+
.site-source {
578+
margin-bottom: 1rem;
579+
}
580+
}
581+
.scrollToTop {
582+
bottom: 6rem;
583+
}
584+
}

app/assets/stylesheets/lists.scss

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,23 @@ table.binaries {
169169
border: solid 1px transparent;
170170
}
171171
}
172+
// Breakpoint ----
173+
@media (max-width: $default){
174+
ol#about-nav {
175+
display: flex;
176+
flex-wrap: wrap;
177+
justify-content: space-between;
178+
}
179+
}
180+
181+
@media (max-width: $mobile-m){
182+
ol#about-nav {
183+
justify-content: unset;
184+
li {
185+
padding-right: 0;
186+
margin-right: 0.6rem;
187+
flex-basis: 29%;
188+
margin-bottom: 1rem;
189+
}
190+
}
191+
}

0 commit comments

Comments
 (0)