Skip to content

Commit

Permalink
Design for new webpage.
Browse files Browse the repository at this point in the history
Design template append for new revamped webpage 2023-10-31
  • Loading branch information
kimjmin committed Oct 31, 2023
1 parent 3bf2098 commit e58f7c0
Show file tree
Hide file tree
Showing 22 changed files with 7,823 additions and 0 deletions.
7,476 changes: 7,476 additions & 0 deletions docs/_static/css/customTheme.css

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file added docs/_static/css/fonts/OxygenMono-Regular.ttf
Binary file not shown.
Binary file added docs/_static/css/fonts/Poppins-Medium.ttf
Binary file not shown.
Binary file added docs/_static/css/fonts/Poppins-Regular.ttf
Binary file not shown.
Binary file added docs/_static/css/fonts/Poppins-SemiBold.ttf
Binary file not shown.
Binary file added docs/_static/css/fonts/Pretendard-Regular.woff
Binary file not shown.
3 changes: 3 additions & 0 deletions docs/_static/icons/icon-arrow-close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/_static/icons/icon-arrow-open.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/_static/icons/icon-backward.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/_static/icons/icon-exclamation.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/_static/icons/icon-facebook.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/_static/icons/icon-folder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions docs/_static/icons/icon-frontward.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions docs/_static/icons/icon-github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/_static/icons/icon-linkedin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/_static/icons/icon-search.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions docs/_static/icons/icon-youtube.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
244 changes: 244 additions & 0 deletions docs/_static/js/custom.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,244 @@
function addHeader() {
const headerWrapper = document.createElement('div');

const link = document.createElement('a');
link.href = 'https://backend.ai';
link.className = 'backend-ai-link';

const logoWrapper = document.createElement('div');
logoWrapper.className = 'backend-ai-logo';

const logo = document.createElement('img');

logoWrapper.append(logo);

link.append(logoWrapper);

headerWrapper.append(link);

headerWrapper.id = 'backend-ai-header';

const referenceNode = document.querySelector('.wy-grid-for-nav');

referenceNode.prepend(headerWrapper);
}

function addSearchElementInDocument() {

const element = document.getElementById('rtd-search-form');

element.setAttribute('className', 'custom-rtd-search-form');

const searchDiv = document.createElement('div');

const input = element.querySelector('[name="q"]');

input.placeholder = 'Search';

searchDiv.className = 'customized-search-bar';

searchDiv.append(element);

const imageWrapper = document.createElement('div');
imageWrapper.id = 'search-icon-wrapper';

const imageTag = document.createElement('img');
imageTag.className = 'search-icon';
imageTag.alt = '';

imageWrapper.append(imageTag);

searchDiv.append(imageWrapper);

const referenceNode = document.querySelector('.rst-content');

referenceNode.prepend(searchDiv);

const newSearchForm = element.cloneNode(true);

newSearchForm.id = 'rtd-search-form-desktop';

const searchDivInDesktop = document.createElement('div');

searchDivInDesktop.className = 'customized-search-bar-in-desktop';

searchDivInDesktop.append(newSearchForm);

const imageWrapperInDesktopSearchForm = document.createElement('div');
imageWrapperInDesktopSearchForm.id = 'search-icon-wrapper-in-desktop';

const imageTagInDesktop = document.createElement('img');
imageTagInDesktop.className = 'search-icon';
imageTagInDesktop.alt = '';

imageWrapperInDesktopSearchForm.append(imageTagInDesktop);

searchDivInDesktop.append(imageWrapperInDesktopSearchForm);

const bar = document.querySelector('[aria-label="Mobile navigation menu"]');

bar.append(searchDivInDesktop);
}

function changeNavigationTitle() {
const navigationElement = document.querySelector('.wy-nav-top');

const linkElement = navigationElement.getElementsByTagName('a');

linkElement[0].textContent = 'Documentation';
}

function addDimmedLayer() {
const dimmedLayer = document.createElement('div');

dimmedLayer.id = 'dimmed-layer';

const referenceNode = document.querySelector('.wy-nav-content');

referenceNode.prepend(dimmedLayer);
}

function addSnsLinks() {
const urls = [
'https://www.facebook.com/lablupInc',
'https://www.youtube.com/c/lablupinc',
'https://linkedin.com/company/lablup',
'https://github.com/lablup'
];

const wrapper = document.createElement('div');

wrapper.id = 'sns-section';

urls.forEach((url) => {
const linkElement = document.createElement('a');

linkElement.href = url;
linkElement.target = '_blank';

const imageWrapper = document.createElement('div');

const imageTag = document.createElement('img');

imageTag.className = 'sns-logo';

imageWrapper.append(imageTag);

linkElement.append(imageWrapper);

wrapper.append(linkElement);
})

const referenceNode = document.querySelector('[role=contentinfo]');

referenceNode.prepend(wrapper);
}

function getCurrentPageTitle() {
const titleBar = document.querySelector(".wy-nav-top");

const link = titleBar.getElementsByTagName('a')

const elementToChange = link[0];

elementToChange.href = "#";

const breadcrumbs = document.querySelector('.wy-breadcrumbs');

const breadcrumbItems = breadcrumbs.querySelectorAll('.breadcrumb-item');

const root = breadcrumbItems[0];

if (breadcrumbItems.length > 1) {

const link = root.getElementsByTagName('*');

const text = link[0].textContent;

elementToChange.textContent = text;

return;
}

elementToChange.textContent = root.textContent;
}

function moveFooterButtons() {
const newButtonWrapper = document.createElement('div');

newButtonWrapper.id = 'customized-rst-footer-buttons';

const buttons = document.querySelector('.rst-footer-buttons');

const next = buttons.querySelector('[rel=next]');

const prev = buttons.querySelector('[rel=prev]');

if (next && prev) {
newButtonWrapper.append(buttons);

const referenceNode = document.querySelector('[itemtype="http://schema.org/Article"]');

referenceNode.insertAdjacentElement("afterend", newButtonWrapper);

return;
}

if (prev) {
const emptyDiv = document.createElement('div');

emptyDiv.className = 'empty-right-div';

buttons.append(emptyDiv);

newButtonWrapper.append(buttons);

const referenceNode = document.querySelector('[itemtype="http://schema.org/Article"]');

referenceNode.insertAdjacentElement("afterend", newButtonWrapper);

return;
}

if (next) {
const emptyDiv = document.createElement('div');

emptyDiv.className = 'empty-left-div';

buttons.prepend(emptyDiv);

newButtonWrapper.append(buttons);

const referenceNode = document.querySelector('[itemtype="http://schema.org/Article"]');

referenceNode.insertAdjacentElement("afterend", newButtonWrapper);

return;
}
return;
}

function defineFlyoutMenu() {
const readTheDocsDiv = document.createElement('div');

readTheDocsDiv.id = 'readthedocs-embed-flyout';

// const referenceNode = document.querySelector('.wy-grid-for-nav');

// referenceNode.insertAdjacentElement("afterend", readTheDocsDiv);

const referenceNode = document.querySelector('.wy-nav-side')

referenceNode.append(readTheDocsDiv);
}

window.onload = function() {
addHeader();
addSearchElementInDocument();
changeNavigationTitle();
addDimmedLayer();
addSnsLinks();
moveFooterButtons();
getCurrentPageTitle();
defineFlyoutMenu();
}
Loading

0 comments on commit e58f7c0

Please sign in to comment.