1
0
mirror of https://github.com/minio/docs.git synced 2025-07-28 19:42:10 +03:00

Fix sidebars and add responsive support

This commit is contained in:
rushenn
2021-01-22 22:35:23 +05:30
committed by Ravind Kumar
parent f52f6abf03
commit d4c82ff57c
16 changed files with 688 additions and 6341 deletions

View File

@ -14,17 +14,18 @@ var paths = {
dir: 'source/_static/css',
main: 'source/_static/scss/main.css',
files: 'source/_static/scss/**/*.css',
dist: 'build/html/_static/css'
dist: 'build/master/html/_static/css'
},
dist: 'build/html'
js: {
dir: 'source/_static/js',
main: 'source/_static/js/main.js',
files: 'source/_static/js/**/*.js',
dist: 'build/master/html/_static/js',
},
dist: 'build/master/html'
}
// Compile SCSS
function handleStyle() {
}
gulp.task('handleStyle', function() {
return gulp.src (paths.scss.main)
.pipe($.sass ())
@ -39,7 +40,15 @@ gulp.task('handleStyle', function() {
.pipe(connect.reload());
});
// Minify and move JS
gulp.task('handleJs', function() {
return gulp.src (paths.js.main)
.pipe($.terser())
.pipe(gulp.dest (paths.js.dist))
.pipe(connect.reload());
});
// Live server
gulp.task('connect', function() {
connect.server({
root: paths.dist,
@ -50,8 +59,9 @@ gulp.task('connect', function() {
// Watch
gulp.task('watch', function () {
gulp.watch(paths.scss.files, gulp.series('handleStyle'))
gulp.watch(paths.scss.files, gulp.series('handleStyle'));
gulp.watch(paths.js.files, gulp.series('handleJs'));
});
// Build
gulp.task('default', gulp.series('connect', 'watch'));
gulp.task('default', gulp.series('handleStyle', 'handleJs', 'watch'));

6007
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -24,6 +24,7 @@
"gulp-load-plugins": "^2.0.4",
"gulp-rename": "^2.0.0",
"gulp-sass": "^4.1.0",
"gulp-terser": "^2.0.1",
"gulp-watch": "^5.0.1",
"gulp-webserver": "^0.9.1",
"node-sass": "^4.14.1"

View File

@ -208,25 +208,24 @@ h1, h2, h3, h4, h5 {
h1 > a.toc-backref, h2 > a.toc-backref, h3 > a.toc-backref, h4 > a.toc-backref, h5 > a.toc-backref {
color: #1C1C1C; }
div.admonition > p.admonition-title {
font-weight: bold;
font-family: "Mark", sans-serif;
font-size: 1.2rem; }
div.admonition.warning {
background-color: #FFF2F2;
border: none;
border-left: 4px solid #E54253; }
div.admonition.important {
background-color: #FFF9E6;
border: none;
border-left: 4px solid #EDBC39; }
div.admonition.note {
background-color: #EDF9FF;
border: none;
border-left: 4px solid #2592EF; }
div.admonition {
margin-top: 0; }
div.admonition > p.admonition-title {
font-weight: bold;
font-family: "Mark", sans-serif;
font-size: 1.2rem; }
div.admonition.warning {
background-color: #FFF2F2;
border: none;
border-left: 4px solid #E54253; }
div.admonition.important {
background-color: #FFF9E6;
border: none;
border-left: 4px solid #EDBC39; }
div.admonition.note {
background-color: #EDF9FF;
border: none;
border-left: 4px solid #2592EF; }
dl.minio {
margin: 10px 0 10px 0; }
@ -261,7 +260,7 @@ table.docutils {
.xref {
color: #C72C48; }
img {
.content__main img {
-webkit-box-shadow: 0px 0px 5px lightgray;
box-shadow: 0px 0px 5px lightgray; }
@ -271,7 +270,7 @@ img {
@media (max-width: 1199px) {
.content, .header {
padding: 0 1.5rem; } }
padding: 0 2rem; } }
.content {
overflow: auto;
@ -287,10 +286,15 @@ img {
-ms-flex: 1;
flex: 1;
min-width: 0;
padding: 1.5rem 3rem;
background-color: #ffffff;
-ms-flex-item-align: start;
align-self: flex-start; }
@media (min-width: 1200px) {
.content__main {
padding: 4rem; } }
@media (max-width: 1199px) {
.content__main {
padding: 2rem; } }
.content__right {
-ms-flex-negative: 0;
@ -308,14 +312,19 @@ img {
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
-webkit-box-shadow: 0 0 0.75rem rgba(0, 0, 0, 0.1);
box-shadow: 0 0 0.75rem rgba(0, 0, 0, 0.1);
width: 100%;
z-index: 10;
-ms-flex-negative: 0;
flex-shrink: 0;
display: flex;
align-items: center; }
@media (min-width: 992px) {
.header .toggle-icon {
display: none; } }
.header .toggle-icon--menu {
margin-left: auto; }
.logo {
-ms-flex-negative: 0;
@ -323,99 +332,219 @@ img {
display: -webkit-inline-box;
display: -ms-inline-flexbox;
display: inline-flex; }
@media (max-width: 991px) {
.logo {
margin-left: 1rem; } }
.logo > img {
height: 1.05rem; }
height: 1.05rem;
-webkit-box-shadow: none;
box-shadow: none; }
.nav {
margin-left: auto; }
.nav > a {
font-size: 0.95rem;
line-height: 100%;
padding: 0.4rem 1.2rem 0.55rem;
border-radius: 0.2rem; }
.nav > a, .nav > a:hover {
color: #4b4b4b; }
.nav > a:not(:last-child) > span {
position: relative; }
.nav > a:not(:last-child) > span::after {
content: '';
height: 1px;
width: 100%;
background-color: #4b4b4b;
bottom: -10px;
-webkit-transform: translateY(0);
transform: translateY(0);
left: 0;
position: absolute;
opacity: 0;
-webkit-transition: opacity 250ms, -webkit-transform 250ms;
transition: opacity 250ms, -webkit-transform 250ms;
transition: opacity 250ms, transform 250ms;
transition: opacity 250ms, transform 250ms, -webkit-transform 250ms;
pointer-events: none; }
.nav > a:not(:last-child).active > span::after, .nav > a:not(:last-child):hover > span::after {
-webkit-transform: translateY(-4px);
transform: translateY(-4px);
opacity: 1; }
.nav > a:last-child {
border: 1px solid #C72C48;
-webkit-transition: background-color 300ms, color 300ms;
transition: background-color 300ms, color 300ms; }
.nav > a:last-child:hover {
background-color: #C72C48;
color: #ffffff; }
@media (max-width: 991px) {
.nav {
position: fixed;
height: 100vh;
width: 18rem;
top: 0;
right: 0;
-webkit-transform: translate3d(18rem, 0, 0);
transform: translate3d(18rem, 0, 0);
opacity: 0;
-webkit-box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.1);
box-shadow: 0 0 0.8rem rgba(0, 0, 0, 0.1);
background-color: rgba(255, 255, 255, 0.9925);
pointer-events: none;
-webkit-transition: opacity 400ms, -webkit-transform 300ms;
transition: opacity 400ms, -webkit-transform 300ms;
transition: opacity 400ms, transform 300ms;
transition: opacity 400ms, transform 300ms, -webkit-transform 300ms;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-ms-flex-direction: column;
flex-direction: column;
padding: 1rem 2rem 2rem;
height: 100%;
overflow-y: auto; } }
.nav > .toggle-icon {
position: absolute;
top: 0.7rem;
right: 0.7rem;
z-index: 1; }
.sidebar-toggle {
.nav-toggled .nav {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
opacity: 1;
pointer-events: all; }
.nav__item {
position: relative;
width: 40px;
height: 40px;
margin: 0 1rem 0 -0.35rem;
font-size: 0.95rem;
line-height: 100%;
border-radius: 0.2rem;
cursor: pointer; }
.nav__item, .nav__item:hover {
color: #4b4b4b; }
@media (min-width: 992px) {
.nav__item {
padding: 0.4rem 1.2rem 0.55rem; }
.nav__item:hover .nav__dropdown {
opacity: 1;
pointer-events: all; } }
@media (max-width: 991px) {
.nav__item {
padding: 0.85rem 0; } }
.nav__item:last-child {
border: 1px solid #C72C48;
-webkit-transition: background-color 300ms, color 300ms;
transition: background-color 300ms, color 300ms;
text-align: center; }
.nav__item:last-child:hover {
background-color: #C72C48;
color: #ffffff; }
@media (max-width: 991px) {
.nav__item:last-child {
margin-top: 1rem; } }
a.nav__item:not(:last-child) > span {
position: relative;
cursor: pointer; }
a.nav__item:not(:last-child) > span:after {
left: 0;
bottom: -7px;
height: 1px;
width: 100%;
position: absolute;
content: "";
opacity: 0;
-webkit-transform: translateY(5px);
transform: translateY(5px);
-webkit-transition: opacity 250ms, -webkit-transform 250ms;
transition: opacity 250ms, -webkit-transform 250ms;
transition: opacity 250ms, transform 250ms;
transition: opacity 250ms, transform 250ms, -webkit-transform 250ms;
background-color: #4b4b4b; }
a.nav__item:not(:last-child).active > span::after, a.nav__item:not(:last-child):hover > span::after {
-webkit-transform: translateY(0);
transform: translateY(0);
opacity: 1; }
@media (min-width: 992px) {
span.nav__item:after {
left: 50%;
margin-left: -12px;
content: "";
width: 0;
height: 0;
border-style: solid;
border-width: 0 12px 10px;
border-color: transparent transparent #ffffff transparent;
position: absolute;
bottom: -3px;
opacity: 0;
-webkit-transition: opacity 200ms;
transition: opacity 200ms; }
span.nav__item:hover:after {
opacity: 1; } }
@media (min-width: 992px) {
.nav__dropdown {
background-color: #ffffff;
padding: 1.25rem;
border-radius: 0.4rem;
-webkit-box-shadow: 0 -1px 1.25rem rgba(0, 0, 0, 0.13);
box-shadow: 0 -1px 1.25rem rgba(0, 0, 0, 0.13);
margin-top: 0.3rem;
width: 24rem;
-webkit-transform: translateX(calc(-50% + 2.8rem));
transform: translateX(calc(-50% + 2.8rem));
position: absolute;
left: 0;
top: 86%;
opacity: 0;
-webkit-transition: opacity 200ms;
transition: opacity 200ms;
pointer-events: none;
max-height: calc(100vh - 5rem);
overflow-y: auto; } }
@media (max-width: 991px) {
.nav__dropdown {
margin: 1rem -2rem -0.8rem;
padding: 0.5rem 2rem;
background-color: #f9f9f9; } }
.nav__sub {
display: block;
text-align: left;
font-size: 1rem;
color: #000000;
position: relative; }
@media (min-width: 992px) {
.nav__sub {
padding: 1rem;
border-radius: 0.4rem;
-webkit-transition: background-color 300ms;
transition: background-color 300ms; }
.nav__sub:hover {
background-color: #f8f8f8;
color: #000000; } }
@media (max-width: 991px) {
.nav__sub {
padding: 0.75rem 0; } }
.nav__sub > small {
display: block;
font-size: 0.8rem;
color: #7f7f7f;
margin-top: 0.7rem;
line-height: 1.4; }
.nav__close {
position: absolute;
top: 1.25rem;
left: -2.7rem; }
.toggle-icon {
width: 2.5rem;
height: 2.5rem;
cursor: pointer;
border-radius: 0.2rem;
-webkit-transition: background-color 300ms;
transition: background-color 300ms;
-ms-flex-negative: 0;
flex-shrink: 0; }
@media (min-width: 992px) {
.sidebar-toggle {
display: none; } }
.sidebar-toggle:hover {
flex-shrink: 0;
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
flex-shrink: 0;
background-repeat: no-repeat;
background-position: center; }
.toggle-icon:hover {
background-color: rgba(199, 44, 72, 0.075); }
.sidebar-toggle::before, .sidebar-toggle::after {
content: '';
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 1;
background-position: center;
background-repeat: no-repeat;
opacity: 1;
-webkit-transition: opacity 250ms, -webkit-transform 250ms;
transition: opacity 250ms, -webkit-transform 250ms;
transition: opacity 250ms, transform 250ms;
transition: opacity 250ms, transform 250ms, -webkit-transform 250ms; }
.sidebar-toggle::before {
background-image: url(../img/icons/menu.svg);
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1); }
.sidebar-toggle::after {
background-image: url(../img/icons/arrow-back.svg);
opacity: 0;
-webkit-transform: scale(0.25);
transform: scale(0.25); }
.sidebar-toggled .sidebar-toggle::before {
opacity: 0;
-webkit-transform: scale(0.25);
transform: scale(0.25); }
.toggle-icon--docs {
background-image: url(../img/icons/docs.svg); }
.sidebar-toggled .sidebar-toggle::after {
opacity: 1;
-webkit-transform: scale(1);
transform: scale(1); }
.toggle-icon--close {
background-image: url(../img/icons/close-circle.svg); }
.toggle-icon--menu {
background-image: url(../img/icons/menu.svg); }
.toggle-icon--toc {
background-image: url(../img/icons/toc.svg); }
.sidebar {
width: 18rem;
@ -423,13 +552,11 @@ img {
position: -webkit-sticky;
top: 0;
background-color: #F9F9F9;
overflow-y: auto;
padding: 1.5rem 1.5rem 1.5rem 0;
-webkit-transition: opacity 400ms, -webkit-transform 300ms;
transition: opacity 400ms, -webkit-transform 300ms;
transition: opacity 400ms, transform 300ms;
transition: opacity 400ms, transform 300ms, -webkit-transform 300ms;
z-index: 9; }
padding: 2rem 2rem 2rem 0; }
@media (max-width: 991px) {
.sidebar {
position: fixed;
@ -437,25 +564,46 @@ img {
-webkit-transform: translate3d(-100%, 0, 0);
transform: translate3d(-100%, 0, 0);
height: 100%;
padding: 6.5rem 1.5rem 1.5rem;
-webkit-box-shadow: 3px 0 10px rgba(0, 0, 0, 0.1);
box-shadow: 3px 0 10px rgba(0, 0, 0, 0.1);
opacity: 0; } }
-webkit-box-shadow: 0 0 1.5rem rgba(0, 0, 0, 0.15);
box-shadow: 0 0 1.5rem rgba(0, 0, 0, 0.15);
opacity: 0;
z-index: 11;
pointer-events: none;
height: 100%;
overflow-y: auto;
padding-left: 2rem; } }
.sidebar > .toggle-icon {
position: absolute;
top: 0.7rem;
right: 0.7rem; }
@media (min-width: 992px) {
.sidebar > .toggle-icon {
display: none; } }
.index-link {
color: #1C1C1C;
font-size: .8rem;
text-transform: uppercase; }
.index-link:hover {
color: #1C1C1C; }
.sidebar__title {
margin: 0 0 1.5rem;
line-height: 100%; }
.sidebar__title > a {
line-height: 100%;
color: #1C1C1C;
font-size: 0.9rem;
text-transform: uppercase;
font-weight: 500; }
.sidebar__title > a:hover {
color: #1C1C1C; }
.sidebar-toggled .sidebar {
-webkit-transform: translate3d(0, 0, 0);
transform: translate3d(0, 0, 0);
opacity: 1; }
opacity: 1;
pointer-events: all; }
.search {
margin-bottom: 1rem; }
margin-bottom: 0.8rem; }
@media (max-width: 991px) {
.search {
margin-right: -1rem;
margin-left: -1rem; } }
.search__text {
-webkit-appearance: none;
@ -463,7 +611,6 @@ img {
appearance: none;
border: 1px solid #F0F0F0;
height: 2.65rem;
border-radius: 0.2rem;
background-color: #ffffff;
color: #555555;
font-size: 0.85rem;
@ -471,6 +618,9 @@ img {
padding: 0 1rem 0.1rem 2.6rem;
background: url(../img/icons/search.svg) no-repeat center left 1rem;
background-color: #ffffff; }
@media (min-width: 992px) {
.search__text {
border-radius: 0.2rem; } }
.search__text:focus {
border-color: #cacaca; }

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,43 @@
{
"Product": {
"Overview": {
"description": "Dive in to the features and architecture",
"link": "https://min.io/product/overview"
},
"Integrations": {
"description": "Browse our vast portfolio of integrations",
"link": "https://min.io/product/integrations"
},
"Reference Hardware": {
"description": "See recommended HW from our partners",
"link": "https://min.io/product/reference-hardware"
}
},
"Docs": "https://docs.min.io/",
"Solutions": {
"VMware": {
"description": "Discover how MinIO integrates with VMware across the portfolio from the Persistent Data platform to TKGI and how we support their Kubernetes ambitions.",
"link": "https://min.io/solutions/vmware"
},
"Splunk": {
"description": "Find out how MinIO is delivering performance at scale for Splunk SmartStores",
"link": "https://min.io/solutions/optimize-splunk-smartstore-performance"
},
"Veeam": {
"description": "Learn how MinIO and Veeam have partnered to drive performance and scalability for a variety of backup use cases.",
"link": "https://min.io/solutions/veeam"
},
"Azure to AWS S3 Gateway": {
"description": "Learn how MinIO allows Azure Blob to speak Amazons S3 API",
"link": "https://min.io/solutions/azure-s3-api-integration"
},
"Teradata": {
"description": "Discover why MinIO is the Native Object Store (NOS) of choice for at-scale Teradata deployments",
"link": "https://min.io/solutions/native-object-store-for-teradata"
}
},
"Resources": "https://min.io/resources",
"Blog": "https://blog.min.io/",
"Pricing": "https://min.io/pricing",
"Download": "https://min.io/download"
}

View File

@ -0,0 +1 @@
<svg width="26" height="26" xmlns="http://www.w3.org/2000/svg"><g transform="translate(1 1)" fill="none" fill-rule="evenodd"><circle stroke="#4B4B4B" stroke-width="1.5" cx="12" cy="12" r="11.357"/><path d="M16.721 7.279a.748.748 0 00-1.057 0L12 10.942 8.336 7.28A.748.748 0 007.28 8.336L10.942 12 7.28 15.664a.748.748 0 101.057 1.057L12 13.057l3.664 3.664a.748.748 0 101.057-1.057L13.057 12l3.664-3.664a.748.748 0 000-1.057z" fill="#4B4B4B" fill-rule="nonzero"/></g></svg>

After

Width:  |  Height:  |  Size: 472 B

View File

@ -0,0 +1 @@
<svg width="23" height="16" xmlns="http://www.w3.org/2000/svg"><g fill="#4B4B4B" fill-rule="evenodd"><rect width="2.5" height="16" rx="1.25"/><rect x="5" width="2.5" height="16" rx="1.25"/><rect x="10" width="2.5" height="16" rx="1.25"/><rect transform="rotate(-23 18.25 8)" x="17" width="2.5" height="16" rx="1.25"/></g></svg>

After

Width:  |  Height:  |  Size: 327 B

View File

@ -1,11 +1 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="22px" height="15px" viewBox="0 0 22 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Group</title>
<g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" stroke-linecap="round">
<g id="Group" transform="translate(1.000000, 1.500000)" stroke="#C72C48" stroke-width="1.25">
<line x1="-1.66533454e-16" y1="6" x2="20" y2="6" id="Line"></line>
<line x1="-1.66533454e-16" y1="0.5" x2="20" y2="0.5" id="Line"></line>
<line x1="-1.66533454e-16" y1="11.5" x2="20" y2="11.5" id="Line"></line>
</g>
</g>
</svg>
<svg width="22" height="15" xmlns="http://www.w3.org/2000/svg"><g fill="#4B4B4B" fill-rule="evenodd"><rect width="22" height="2.5" rx="1.25"/><rect y="6" width="22" height="2.5" rx="1.25"/><rect y="12" width="22" height="2.5" rx="1.25"/></g></svg>

Before

Width:  |  Height:  |  Size: 692 B

After

Width:  |  Height:  |  Size: 247 B

View File

@ -1,75 +1,65 @@
window.addEventListener('DOMContentLoaded', (event) => {
console.log('DOM fully loaded and parsed');
window.addEventListener("DOMContentLoaded", (event) => {
var topic = document.getElementById("table-of-contents");
if (topic != null) {
document
.getElementById("localtoc")
.appendChild(document.getElementById("table-of-contents"));
}
var topic = document.getElementById('table-of-contents');
if (topic != null) {
document.getElementById('localtoc').appendChild(
document.getElementById('table-of-contents')
);
console.log("moving local toc");
}
// Toggle Sidebars
$('body').on('click', '[data-toggle]', function() {
var target = $(this).attr('data-toggle');
target === 'sidebar' ? $('body').removeClass('nav-toggled') : $('body').removeClass('sidebar-toggled');
$('body').toggleClass(target + '-toggled');
});
// There's probably a better way to refine what sections are shown on screen.
// Experimenting with setting the `intersectionRatio` and such tends to stop
// this from working, especially if the 'section' is really long. Not sure
// how to resolve that.
// Render navigation menu
if($('#nav')[0]) {
var navData = '/_static/data/nav.json';
var nav = $('.nav');
// Removing this from the logic flow until we have better / cleaner logic.
$.getJSON( navData, function(data) {
var navToggle = $('<i class="toggle-icon toggle-icon--menu" />');
navToggle.attr('data-toggle', 'nav');
nav.after(navToggle);
// let options = {
// rootMargin: '-100px 0px 0px -100px'
// }
var navClose = $('<i />');
navClose.addClass('toggle-icon toggle-icon--close');
navClose.attr('data-toggle', 'nav');
nav.append(navClose);
// const observer = new IntersectionObserver(entries => {
// entries.forEach(entry => {
// const id = entry.target.getAttribute('id');
$.each(data, function(nav, navValue) {
var navElem = typeof navValue === 'object' ? '<span />' : '<a />';
// if (id == document.querySelector('.section[id]').getAttribute('id'))
// return 0
// if (entry.intersectionRatio > 0) {
var navLink = $(navElem);
navLink.addClass(nav === 'Docs' ? 'nav__item active' : 'nav__item');
navLink.html('<span>' + nav + '</span>');
if(navElem === '<a />') {
navLink.attr('href', navValue);
}
else {
var navDropdown = $('<div class="nav__dropdown" />');
// pElement = document.querySelector(`#on-this-page li a[href="#${id}"]`).parentElement;
// liElement = document.querySelector(`#on-this-page li a[href="#${id}"]`).parentElement.parentElement;
$.each(navValue, function(sub, subValue) {
var navSub = $('<a />');
navSub.addClass('nav__sub');
navSub.text(sub);
navSub.attr({
'href': subValue.link,
'target': '_blank',
'rel': 'noreferrer'
});
navSub.append('<small>' + subValue.description + '</small>');
navDropdown.append(navSub);
navLink.append(navDropdown)
});
}
// liElement.classList.add('active');
// pElement.classList.add('active-p');
$('#nav').append(navLink);
});
// liElementParent = liElement.parentElement.parentElement
// if (liElementParent.tagName == "LI") {
// //liElementParent.classList.remove("active")
// // Need to re-visit this logic
// }
// } else {
// document.querySelector(`#on-this-page li a[href="#${id}"]`).parentElement.parentElement.classList.remove('active');
// document.querySelector(`#on-this-page li a[href="#${id}"]`).parentElement.classList.remove('active-p');
// }
// });
// },options);
// // Track all sections that have an `id` applied
// document.querySelectorAll('.section[id]').forEach((section) => {
// observer.observe(section);
// });
const leftcolumn = document.querySelector('.left');
const centercolumn = document.querySelector('.center');
const rightcolumn = document.querySelector('.right');
const button = document.querySelector('.sphinxsidebarbutton');
const sidebarwrapper = document.querySelector('.sphinxsidebarwrapper');
const sidebarToggle = document.querySelector('.sidebar-toggle');
function toggleSidebar() {
document.body.classList.toggle('sidebar-toggled');
}
sidebarToggle.addEventListener( "click", toggleSidebar );
});
}
});

View File

@ -4,29 +4,48 @@
position: -webkit-sticky;
top: 0;
background-color: $sidebar-bg;
overflow-y: auto;
padding: 1.5rem 1.5rem 1.5rem 0;
transition: opacity 400ms, transform 300ms;
z-index: $z-index-header - 1;
padding: $content-padding-sm $content-padding-sm $content-padding-sm 0;
@include breakpoint-max(breakpoints(lg)) {
position: fixed;
left: 0;
transform: translate3d(-100%, 0, 0);
height: 100%;
padding: ($header-height + $content-padding-sm) $content-padding-sm $content-padding-sm;
box-shadow: 3px 0 10px rgba($black, 0.1);
box-shadow: 0 0 1.5rem rgba($black, 0.15);
opacity: 0;
z-index: $z-index-header + 1;
pointer-events: none;
height: 100%;
overflow-y: auto;
padding-left: $content-padding-sm;
}
& > .toggle-icon {
@include breakpoint-min(breakpoints(lg)) {
display: none;
}
position: absolute;
top: 0.7rem;
right: 0.7rem;
}
}
.index-link {
color: $docs-item-main-color;
font-size: .8rem;
text-transform: uppercase;
.sidebar__title {
margin: 0 0 1.5rem;
line-height: 100%;
&:hover {
& > a {
line-height: 100%;
color: $docs-item-main-color;
font-size: 0.9rem;
text-transform: uppercase;
font-weight: $font-weight-medium;
&:hover {
color: $docs-item-main-color;
}
}
}
@ -34,18 +53,23 @@
.sidebar {
transform: translate3d(0, 0, 0);
opacity: 1;
pointer-events: all;
}
}
.search {
margin-bottom: 1rem;
margin-bottom: 0.8rem;
@include breakpoint-max(breakpoints(lg)) {
margin-right: -1rem;
margin-left: -1rem;
}
}
.search__text {
appearance: none;
border: 1px solid $search-border-color;
height: $search-height;
border-radius: $border-radius-sm;
background-color: $white;
color: $search-color;
font-size: 0.85rem;
@ -54,6 +78,10 @@
background: $search-icon no-repeat center left 1rem;
background-color: $search-bg;
@include breakpoint-min(breakpoints(lg)) {
border-radius: $border-radius-sm;
}
&:focus {
border-color: $search-focus-border-color
}

View File

@ -43,6 +43,8 @@ h1, h2, h3, h4, h5 {
}
div.admonition {
margin-top: 0;
& > p.admonition-title {
font-weight: bold;
font-family: $font-family-base;
@ -115,6 +117,8 @@ table.docutils {
color: $theme-red;
}
img {
box-shadow: 0px 0px 5px lightgray;
.content__main {
img {
box-shadow: 0px 0px 5px lightgray;
}
}

View File

@ -3,7 +3,7 @@
background-color: $header-bg;
display: flex;
align-items: center;
box-shadow: 0 0 10px rgba($black, 0.1);
box-shadow: 0 0 0.75rem rgba($black, 0.1);
width: 100%;
z-index: $z-index-header;
flex-shrink: 0;
@ -11,130 +11,261 @@
align-items: center;
@extend %content-padding;
.toggle-icon {
@include breakpoint-min(breakpoints(lg)) {
display: none;
}
}
.toggle-icon--menu {
margin-left: auto;
}
}
.logo {
flex-shrink: 0;
display: inline-flex;
& > img {
@include breakpoint-max(breakpoints(lg)) {
margin-left: 1rem;
}
&>img {
height: $logo-height;
box-shadow: none;
}
}
.nav {
margin-left: auto;
& > a {
&, &:hover {
color: $nav-color;
}
@include breakpoint-max(breakpoints(lg)) {
position: fixed;
height: 100vh;
width: $sidebar-width;
top: 0;
right: 0;
transform: translate3d($sidebar-width, 0, 0);
opacity: 0;
box-shadow: 0 0 0.8rem rgba($black, 0.1);
background-color: rgba($white, 0.9925);
pointer-events: none;
transition: opacity 400ms, transform 300ms;
display: flex;
flex-direction: column;
padding: 1rem 2rem 2rem;
height: 100%;
overflow-y: auto;
}
font-size: 0.95rem;
line-height: 100%;
& > .toggle-icon {
position: absolute;
top: 0.7rem;
right: 0.7rem;
z-index: 1;
}
}
.nav-toggled {
.nav {
transform: translate3d(0, 0, 0);
opacity: 1;
pointer-events: all;
}
}
.nav__item {
position: relative;
font-size: 0.95rem;
line-height: 100%;
border-radius: $border-radius-sm;
cursor: pointer;
&,
&:hover {
color: $nav-color;
}
@include breakpoint-min(breakpoints(lg)) {
padding: 0.4rem 1.2rem 0.55rem;
border-radius: $border-radius-sm;
&:not(:last-child) {
& > span {
position: relative;
&::after {
content: '';
height: 1px;
width: 100%;
background-color: $nav-border-color;
bottom: -10px;
transform: translateY(0);
left: 0;
position: absolute;
opacity: 0;
transition: opacity 250ms, transform 250ms;
pointer-events: none;
}
&:hover {
.nav__dropdown {
opacity: 1;
pointer-events: all;
}
}
}
&.active,
&:hover {
& > span {
&::after {
transform: translateY(-4px);
opacity: 1;
}
}
@include breakpoint-max(breakpoints(lg)) {
padding: 0.85rem 0;
}
&:last-child {
border: 1px solid $theme-red;
transition: background-color 300ms, color 300ms;
text-align: center;
&:hover {
background-color: $theme-red;
color: $white;
}
@include breakpoint-max(breakpoints(lg)) {
margin-top: 1rem;
}
}
}
a.nav__item {
&:not(:last-child) {
&>span {
position: relative;
cursor: pointer;
&:after {
left: 0;
bottom: -7px;
height: 1px;
width: 100%;
position: absolute;
content: "";
opacity: 0;
transform: translateY(5px);
transition: opacity 250ms, transform 250ms;
background-color: $nav-border-color;
}
}
&:last-child {
border: 1px solid $theme-red;
transition: background-color 300ms, color 300ms;
&:hover {
background-color: $theme-red;
color: $white;
&.active,
&:hover {
&>span {
&::after {
transform: translateY(0);
opacity: 1;
}
}
}
}
}
.sidebar-toggle {
span.nav__item {
@include breakpoint-min(breakpoints(lg)) {
&:after {
left: 50%;
margin-left: -12px;
content: "";
width: 0;
height: 0;
border-style: solid;
border-width: 0 12px 10px;
border-color: transparent transparent $white transparent;
position: absolute;
bottom: -3px;
opacity: 0;
transition: opacity 200ms;
}
&:hover {
&:after {
opacity: 1;
}
}
}
}
.nav__dropdown {
@include breakpoint-min(breakpoints(lg)) {
background-color: $white;
padding: 1.25rem;
border-radius: $border-radius;
box-shadow: 0 -1px 1.25rem rgba($black, 0.13);
margin-top: 0.3rem;
width: 24rem;
transform: translateX(calc(-50% + 2.8rem));
position: absolute;
left: 0;
top: 86%;
opacity: 0;
transition: opacity 200ms;
pointer-events: none;
max-height: calc(100vh - 5rem);
overflow-y: auto;
}
@include breakpoint-max(breakpoints(lg)) {
margin: 1rem (-$content-padding-sm) -0.8rem;
padding: 0.5rem $content-padding-sm;
background-color: $nav-dropdown-mobile-bg;
}
}
.nav__sub {
display: block;
text-align: left;
font-size: 1rem;
color: $black;
position: relative;
width: 40px;
height: 40px;
margin: 0 1rem 0 -0.35rem;
@include breakpoint-min(breakpoints(lg)) {
padding: 1rem;
border-radius: $border-radius;
transition: background-color 300ms;
&:hover {
background-color: $nav-sub-hover-bg;
color: $black;
}
}
@include breakpoint-max(breakpoints(lg)) {
padding: 0.75rem 0;
}
&>small {
display: block;
font-size: 0.8rem;
color: lighten($text-muted-color, 5%);
margin-top: 0.7rem;
line-height: 1.4;
}
}
.nav__close {
position: absolute;
top: 1.25rem;
left: -2.7rem;
}
.toggle-icon {
width: 2.5rem;
height: 2.5rem;
cursor: pointer;
border-radius: $border-radius-sm;
transition: background-color 300ms;
flex-shrink: 0;
@include breakpoint-min(breakpoints(lg)) {
display: none;
}
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
background-repeat: no-repeat;
background-position: center;
&:hover {
background-color: $sidebar-toggle-hover-bg;
}
&::before,
&::after {
content: '';
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 1;
background-position: center;
background-repeat: no-repeat;
opacity: 1;
transition: opacity 250ms, transform 250ms;
}
&::before {
background-image: $sidebar-toggle-icon;
opacity: 1;
transform: scale(1);
}
&::after {
background-image: $sidebar-toggle-collapse-icon;
opacity: 0;
transform: scale(0.25);
background-color: $toggle-icon-hover-bg;
}
}
.sidebar-toggled {
.sidebar-toggle {
&::before {
opacity: 0;
transform: scale(0.25);
$toggleIcons: (
docs: 'docs.svg',
close: 'close-circle.svg',
menu: 'menu.svg',
toc: 'toc.svg'
);
}
&::after {
opacity: 1;
transform: scale(1);
}
@each $name, $icon in $toggleIcons {
.toggle-icon--#{$name} {
background-image: url(../img/icons/#{$icon});
}
}

View File

@ -22,9 +22,16 @@
.content__main {
flex: 1;
min-width: 0;
padding: 1.5rem 3rem;
background-color: $content-bg;
align-self: flex-start;
@include breakpoint-min(breakpoints(xl)) {
padding: $content-padding;
}
@include breakpoint-max(breakpoints(xl)) {
padding: $content-padding-sm;
}
}
.content__right {

View File

@ -4,7 +4,6 @@ $black: #000000;
$theme-red: #C72C48;
$theme-hover-bg: rgb(245, 245, 245);
// Breakpoints
$breakpoints: (
xs: 0,
@ -29,11 +28,17 @@ $body-color: #4b4b4b;
$body-bg: #F9F9F9;
// Text
$text-color: #4b4b4b;
$text-hover-color: darken($text-color, 20%);
$text-muted-color: #727272;
// Layout
$container-width: 95%;
$content-bg: $white;
$content-padding: 4rem;
$content-padding-sm: 1.5rem;
$content-padding-sm: 2rem;
// Font weight
@ -87,12 +92,12 @@ $docs-item-admonition-note-border: #2592EF;
$docs-item-table-border: #e6e6e6;
// Sidebar toggle
$sidebar-toggle-collapse-icon: url(../img/icons/arrow-back.svg);
$sidebar-toggle-icon: url(../img/icons/menu.svg);
$sidebar-toggle-hover-bg: rgba($theme-red, 0.075);
// Toggle icon
$toggle-icon-hover-bg: rgba($theme-red, 0.075);
// Nav
$nav-color: $body-color;
$nav-border-color: #4b4b4b;
$nav-sub-hover-bg: #f8f8f8;
$nav-dropdown-mobile-bg: lighten($theme-hover-bg, 1.5%);

View File

@ -58,7 +58,7 @@
{%- block header %}
<header class="header">
<i class="sidebar-toggle"></i>
<i class="toggle-icon toggle-icon--docs" data-toggle="sidebar"></i>
<a
class="logo"
href="https://min.io"
@ -69,27 +69,20 @@
/>
</a>
<nav class="nav">
<a href="https://min.io/product/overview"><span>Product</span></a>
<a class="active" href="/"><span>Docs</span></a>
<a href="https://min.io/solutions/vmware"><span>Solutions</span></a>
<a href="https://min.io/resources"><span>Resources</span></a>
<a href="https://blog.min.io/"><span>Blog</span></a>
<a href="https://min.io/pricing"><span>Pricing</span></a>
<a href="https://min.io/download"><span>Download</span></a>
</nav>
<nav id="nav" class="nav"></nav>
</header>
{%- endblock %}
{%- block content %}
<section class="content">
<aside class="sidebar">
<div>
<h3>
<a class="index-link" href="{{ pathto('index') }}">{{ shorttitle}} </a>
</h3>
{{ miniosidebar() }}
</div>
<i class="toggle-icon toggle-icon--close" data-toggle="sidebar"></i>
<h3 class="sidebar__title">
<a href="{{ pathto('index') }}">{{ shorttitle}} </a>
</h3>
{{ miniosidebar() }}
</aside>
<div class="content__main">
{% block alertbar -%}