fix(*): change fallback font to sans and optimize back to top

This commit is contained in:
ppoffice 2018-11-03 11:43:50 -04:00
parent abb1cf8904
commit a2a932f315
2 changed files with 21 additions and 3 deletions

View File

@ -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)

View File

@ -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() {