mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Added dynamic box shadow on header
This commit is contained in:
parent
e9af74f3df
commit
25e1960511
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
material/assets/stylesheets/application-fe760eefaa.css
Normal file
1
material/assets/stylesheets/application-fe760eefaa.css
Normal file
File diff suppressed because one or more lines are too long
@ -45,7 +45,7 @@
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
|
||||
{% endblock %}
|
||||
{% 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 %}
|
||||
<link rel="stylesheet" href="{{ base_url }}/assets/stylesheets/application-02ce7adcc2.palette.css">
|
||||
{% endif %}
|
||||
@ -128,7 +128,7 @@
|
||||
{% endblock %}
|
||||
</div>
|
||||
{% 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>
|
||||
{% for path in extra_javascript %}
|
||||
<script src="{{ path }}"></script>
|
||||
|
@ -36,6 +36,8 @@ theme_dir: material
|
||||
|
||||
# Options
|
||||
extra:
|
||||
feature:
|
||||
tabs: true
|
||||
palette:
|
||||
primary: indigo
|
||||
accent: indigo
|
||||
|
@ -44,6 +44,22 @@ export default class Application {
|
||||
*/
|
||||
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 */
|
||||
new Material.Event.Listener(document, "DOMContentLoaded", () => {
|
||||
|
||||
|
@ -23,3 +23,21 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
// Application header (stays always on top)
|
||||
.md-header {
|
||||
@include z-depth(2);
|
||||
// @include z-depth(2);
|
||||
|
||||
position: fixed;
|
||||
top: 0;
|
||||
|
@ -1,7 +1,7 @@
|
||||
// TODO: proof of concept - needs refactor
|
||||
.md-tabs {
|
||||
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;
|
||||
|
||||
&__list {
|
||||
@ -37,7 +37,3 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.md-header {
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user