-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
343ca86
commit 172a699
Showing
10 changed files
with
299 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
MD013: | ||
line_length: 120 | ||
MD033: | ||
allowed_elements: | ||
- "figure" | ||
- "figcaption" | ||
MD033: false | ||
MD046: false # Code block style errors interfere with admonitions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
nav: | ||
- Overview: index.md | ||
- index.md | ||
- getting-started | ||
- references |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Max rotation | ||
const MAX_ROTATION = 20; | ||
|
||
// Integrate with mkdocs instant loading | ||
document$.subscribe(function () { | ||
// Check light/dark mode | ||
let colorScheme = document.body.getAttribute("data-md-color-scheme"); | ||
// Get hero container | ||
const heroContainer = document.getElementById("cble-hero-container"); | ||
// Get hero image | ||
let heroImage = document.getElementById(`cble-hero-image-${colorScheme}`); | ||
|
||
// Update element selector based on light/dark mode | ||
document.querySelector("form[data-md-component=palette]").onchange = (e) => { | ||
// Check light/dark mode | ||
colorScheme = document.body.getAttribute("data-md-color-scheme"); | ||
// Get hero image | ||
heroImage = document.getElementById(`cble-hero-image-${colorScheme}`); | ||
}; | ||
|
||
heroContainer.onmousemove = (e) => { | ||
// Only run animation on large devices | ||
if (window.innerWidth < 1220) return; | ||
|
||
let x = e.pageX; | ||
let y = e.pageY; | ||
|
||
window.requestAnimationFrame(() => { | ||
let imgBox = heroImage.getBoundingClientRect(); | ||
let deltaX = x - (imgBox.x + imgBox.width / 2); | ||
let deltaY = y - (imgBox.y + imgBox.height / 2); | ||
let thetaY = (deltaX / (imgBox.x + imgBox.width / 2 + window.scrollX)) * MAX_ROTATION; | ||
let thetaX = (deltaY / (imgBox.y + imgBox.height / 2 + window.scrollY)) * -MAX_ROTATION; | ||
// console.log(x, y, imgBox.x + imgBox.width / 2, imgBox.y + imgBox.height / 2 + window.scrollY, deltaX, deltaY, thetaX, thetaY); | ||
heroImage.style.transform = `perspective(500px) rotateX(${thetaX}deg) rotateY(${thetaY}deg)`; | ||
}); | ||
}; | ||
|
||
// Return to center on mouse leave | ||
heroContainer.onmouseleave = (e) => { | ||
window.requestAnimationFrame(() => { | ||
heroImage.style.transform = `perspective(500px) rotateX(5deg) rotateY(-5deg)`; | ||
}); | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
.cble-container { | ||
min-height: calc(100dvh - 9em); | ||
/* padding-top: 1.25rem; */ | ||
/* background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1123 258'><path d='M1124,2c0,0 0,256 0,256l-1125,0l0,-48c0,0 16,5 55,5c116,0 197,-92 325,-92c121,0 114,46 254,46c140,0 214,-167 572,-166Z' style='fill: hsla(0, 0%, 100%, 1)' /></svg>") | ||
no-repeat bottom, | ||
linear-gradient(to bottom, var(--md-primary-fg-color), rgba(255, 255, 255, 0.25) 99%, var(--md-default-bg-color) 99%); */ | ||
/* background: linear-gradient(to bottom, var(--md-primary-fg-color), var(--md-accent-fg-color--transparent) 100%); */ | ||
} | ||
|
||
[data-md-color-scheme="slate"] .cble-container { | ||
background: linear-gradient(to bottom, var(--md-primary-fg-color), #fff0 100%); | ||
} | ||
|
||
[data-md-color-scheme="default"] .cble-container { | ||
background: linear-gradient(to bottom, var(--md-primary-fg-color), rgba(255, 255, 255, 0.15) 100%); | ||
} | ||
|
||
/* Landing page hero */ | ||
.cble-hero { | ||
height: calc(100dvh - 9em); | ||
width: 100%; | ||
margin: 0 1rem; | ||
/* color: var(--md-primary-bg-color); */ | ||
color: var(--md-typeset-color); | ||
} | ||
|
||
/* Hero headline */ | ||
.cble-hero h1 { | ||
margin-bottom: 1.25rem; | ||
font-weight: 700; | ||
color: var(--md-typeset-color); | ||
} | ||
|
||
[data-md-color-scheme="slate"] .cble-hero .cble-hero__content, | ||
[data-md-color-scheme="slate"] .cble-hero h1 { | ||
color: #fff !important; | ||
} | ||
|
||
/* Hero content */ | ||
.cble-hero .cble-hero__content { | ||
padding-bottom: 7.5rem; | ||
color: var(--md-typeset-color); | ||
} | ||
|
||
/* Hero image */ | ||
.cble-hero .cble-hero__image { | ||
height: 100%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
} | ||
|
||
.cble-hero .cble-hero__image img { | ||
transition: all 0.15s ease-out; | ||
transform: perspective(500px) rotateX(5deg) rotateY(-5deg); | ||
} | ||
|
||
.cble-hero .md-button { | ||
margin-top: 0.625rem; | ||
margin-right: 0.625rem; | ||
color: var(--md-primary-bg-color); | ||
} | ||
|
||
/* Button on focus/hover */ | ||
/* .cble-hero .md-button:is(:focus, :hover) { | ||
color: var(--md-accent-bg-color); | ||
background-color: var(--md-accent-fg-color); | ||
border-color: var(--md-accent-fg-color); | ||
} */ | ||
|
||
/* Primary button */ | ||
/* .cble-hero .md-button--primary { | ||
color: var(--md-accent-fg-color); | ||
background-color: var(--md-primary-bg-color); | ||
border-color: var(--md-primary-bg-color); | ||
} */ | ||
|
||
@media screen and (max-width: 479px) { | ||
.cble-hero h1 { | ||
font-size: 1.75rem; | ||
} | ||
} | ||
|
||
@media screen and (min-width: 960px) { | ||
.cble-hero { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: flex-end; | ||
} | ||
|
||
.cble-hero .cble-hero__content { | ||
padding-bottom: 3rem; | ||
} | ||
|
||
.cble-hero .cble-hero__image { | ||
order: 1; | ||
width: 50%; | ||
padding: 0 3rem; | ||
} | ||
} | ||
|
||
/* @media screen and (min-width: 1220px) { | ||
.cble-hero .cble-hero__image { | ||
transform: translateX(10rem); | ||
} | ||
} */ | ||
|
||
/* | ||
/// $break-devices: ( | ||
/// mobile: ( | ||
/// portrait: 220px 479px, | ||
/// landscape: 480px 719px | ||
/// ), | ||
/// tablet: ( | ||
/// portrait: 720px 959px, | ||
/// landscape: 960px 1219px | ||
/// ), | ||
/// screen: ( | ||
/// small: 1220px 1599px, | ||
/// medium: 1600px 1999px, | ||
/// large: 2000px | ||
/// ) | ||
/// ); | ||
/// | ||
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{% extends "main.html" %} {% block tabs %} {{ super() }} | ||
<style> | ||
.md-main__inner { | ||
margin: 0 auto; | ||
} | ||
.md-content { | ||
width: 100%; | ||
} | ||
@media screen and (min-width: 60em) { | ||
.md-sidebar--secondary { | ||
display: none; | ||
} | ||
} | ||
@media screen and (min-width: 76.25em) { | ||
.md-sidebar--primary { | ||
display: none; | ||
} | ||
} | ||
</style> | ||
<section class="cble-container" id="cble-hero-container"> | ||
<div class="md-grid md-typeset"> | ||
<div class="cble-hero"> | ||
<div class="cble-hero__image"> | ||
<img id="cble-hero-image-default" src="assets/images/cble_nodes_light.png#only-light" alt="" draggable="false" /> | ||
<img id="cble-hero-image-slate" src="assets/images/cble_nodes_dark.png#only-dark" alt="" draggable="false" /> | ||
</div> | ||
<div class="cble-hero__content"> | ||
<h1>Cloud-Based Lab Emulator (CBLE)</h1> | ||
<p>{{ config.site_description }} Set up in 10 minutes.</p> | ||
<a href="{{ page.next_page.url | url }}" title="{{ page.next_page.title | e }}" class="md-button md-button--primary"> | ||
Quick start <span class="twemoji">{% include ".icons/material/chevron-right.svg" %}</span> | ||
</a> | ||
<!-- <a href="{{ 'insiders/' | url }}" title="Material for MkDocs Insiders" class="md-button"> Get Insiders </a> --> | ||
</div> | ||
</div> | ||
</div> | ||
</section> | ||
{% endblock %} {% block content %} {{ super() }} {% endblock %} {% block footer %} {{ super() }} {% endblock %} {% block scripts %} | ||
<!-- Add scripts that need to run before here --> | ||
{{ super() }} | ||
<!-- Add scripts that need to run afterwards here --> | ||
<script src="{{ 'assets/javascripts/hero.js' | url }}" /> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
{% extends "base.html" %} | ||
|
||
<!-- Custom front matter --> | ||
{% block extrahead %} | ||
|
||
<!-- Extra style sheets (can't be set in mkdocs.yml due to content hash) --> | ||
<link | ||
rel="stylesheet" | ||
href="{{ 'assets/stylesheets/custom/layout/hero.css' | url }}" | ||
/> | ||
{% endblock %} | ||
|
||
{% block outdated %} | ||
You're not viewing the latest version. | ||
<a href="{{ '../' ~ base_url }}"> | ||
<strong>Click here to go to latest.</strong> | ||
</a> | ||
{% endblock %} | ||
{% endblock %} |