fix(*): change fallback font to sans and optimize back to top
This commit is contained in:
parent
abb1cf8904
commit
a2a932f315
|
@ -1,4 +1,4 @@
|
|||
family-serif = "Ubuntu", "Roboto", "Open Sans", "Microsoft YaHei", serif
|
||||
family-sans = "Ubuntu", "Roboto", "Open Sans", "Microsoft YaHei", sans-serif
|
||||
family-mono = "Source Code Pro", monospace, "Microsoft YaHei"
|
||||
|
||||
/* ---------------------------------
|
||||
|
@ -8,7 +8,7 @@ html
|
|||
font-size: 14px
|
||||
|
||||
body
|
||||
font-family: family-serif
|
||||
font-family: family-sans
|
||||
background-color: #f7f7f7
|
||||
|
||||
@media screen and (min-width: 1280px)
|
||||
|
|
|
@ -7,7 +7,7 @@ $(document).ready(function () {
|
|||
var lastScrollTop = 0;
|
||||
var rightMargin = 20;
|
||||
var bottomMargin = 20;
|
||||
|
||||
var lastState = null;
|
||||
var state = {
|
||||
base: {
|
||||
classname: 'card has-text-centered',
|
||||
|
@ -36,7 +36,24 @@ $(document).ready(function () {
|
|||
classname: state['mobile-hidden'].classname + ' rise-up',
|
||||
});
|
||||
|
||||
function isStateEquals(prev, next) {
|
||||
for (var prop in prev) {
|
||||
if (!next.hasOwnProperty(prop) || next[prop] !== prev[prop]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (var prop in next) {
|
||||
if (!prev.hasOwnProperty(prop) || prev[prop] !== prev[prop]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function applyState(state) {
|
||||
if (lastState !== null && isStateEquals(lastState, state)) {
|
||||
return;
|
||||
}
|
||||
$button.attr('class', state.classname);
|
||||
for (let prop in state) {
|
||||
if (prop === 'classname') {
|
||||
|
@ -44,6 +61,7 @@ $(document).ready(function () {
|
|||
}
|
||||
$button.css(prop, state[prop]);
|
||||
}
|
||||
lastState = state;
|
||||
}
|
||||
|
||||
function isDesktop() {
|
||||
|
|
Loading…
Reference in New Issue