1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-12 01:50:52 +01:00

Added dynamic box shadow on header

This commit is contained in:
squidfunk 2017-01-26 22:58:24 +01:00
parent e9af74f3df
commit 25e1960511
9 changed files with 43 additions and 11 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -45,7 +45,7 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons"> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
{% endblock %} {% endblock %}
{% block styles %} {% block styles %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-d970c8bd45.css"> <link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-fe760eefaa.css">
{% if config.extra.palette %} {% if config.extra.palette %}
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-02ce7adcc2.palette.css"> <link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-02ce7adcc2.palette.css">
{% endif %} {% endif %}
@ -128,7 +128,7 @@
{% endblock %} {% endblock %}
</div> </div>
{% block scripts %} {% block scripts %}
<script src="{{ base_url }}/assets/javascripts/application-62dc17fe98.js"></script> <script src="{{ base_url }}/assets/javascripts/application-adb933686d.js"></script>
<script>var config={url:{base:"{{ base_url }}"}},app=new Application(config);app.initialize()</script> <script>var config={url:{base:"{{ base_url }}"}},app=new Application(config);app.initialize()</script>
{% for path in extra_javascript %} {% for path in extra_javascript %}
<script src="{{ path }}"></script> <script src="{{ path }}"></script>

View File

@ -36,6 +36,8 @@ theme_dir: material
# Options # Options
extra: extra:
feature:
tabs: true
palette: palette:
primary: indigo primary: indigo
accent: indigo accent: indigo

View File

@ -44,6 +44,22 @@ export default class Application {
*/ */
initialize() { initialize() {
// TODO: just a proof of concept
window.addEventListener("scroll", () => {
if (window.pageYOffset > 5) {
document.body.classList.add("bigger5")
} else {
document.body.classList.remove("bigger5")
}
if (window.pageYOffset > 48) {
document.body.classList.add("bigger48")
} else {
document.body.classList.remove("bigger48")
}
})
/* Initialize Modernizr and FastClick */ /* Initialize Modernizr and FastClick */
new Material.Event.Listener(document, "DOMContentLoaded", () => { new Material.Event.Listener(document, "DOMContentLoaded", () => {

View File

@ -23,3 +23,21 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// Nothing to see here, move along // Nothing to see here, move along
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
.md-tabs__list {
transition: opacity 0.1s;
}
.bigger5 {
.md-tabs__list {
opacity: 0;
}
}
.bigger48 {
.md-header {
@include z-depth(2);
transition: box-shadow 0.25s;
}
}

View File

@ -26,7 +26,7 @@
// Application header (stays always on top) // Application header (stays always on top)
.md-header { .md-header {
@include z-depth(2); // @include z-depth(2);
position: fixed; position: fixed;
top: 0; top: 0;

View File

@ -1,7 +1,7 @@
// TODO: proof of concept - needs refactor // TODO: proof of concept - needs refactor
.md-tabs { .md-tabs {
width: 100%; width: 100%;
background: mix($md-color-primary, $md-color-black, 75%); background: $md-color-primary; //mix($md-color-primary, $md-color-black, 75%);
overflow: scroll; overflow: scroll;
&__list { &__list {
@ -37,7 +37,3 @@
} }
} }
} }
.md-header {
box-shadow: none !important;
}