Skip to content

Instantly share code, notes, and snippets.

Jovey Zheng jovey-zheng

Block or report user

Report or block jovey-zheng

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jovey-zheng
jovey-zheng / autoLoading.js
Last active Apr 13, 2016
when user scroll some position then auto loading data ...
View autoLoading.js
handleAppend() {
const top = window.pageYOffset ||
document.documentElement.scrollTop ||
document.body.scrollTop;
if (!isEmpty(data)
&& (top + window.innerHeight) / document.body.scrollHeight > 0.9
&& !isloading // false
) {
//do something ...
@jovey-zheng
jovey-zheng / bgCover.css
Last active Mar 8, 2016
CSS: background fixed and cover.
View bgCover.css
.bg-cover {
background: url('xxx.jpg') no-repeat;
background-attachment: fixed;
background-size: cover;
}
@jovey-zheng
jovey-zheng / filereader.js
Last active Dec 30, 2015
FileReader() sample
View filereader.js
handleFileChoose() {
const fileReader = new FileReader();
const imgUrl = document.getElementById('openFile').files[0];
if (imgUrl) {
fileReader.readAsDataURL(imgUrl);
fileReader.onloadend = () => {
document.getElementById('avatarImg').src = fileReader.result;
}
}
}
View trello-css-guide.md

Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

This is where any fun you might have been having ends. Now it’s time to get serious and talk about rules.

Writing CSS is hard. Even if you know all the intricacies of position and float and overflow and z-index, it’s easy to end up with spaghetti code where you need inline styles, !important rules, unused cruft, and general confusion. This guide provides some architecture for writing CSS so it stays clean and ma

You can’t perform that action at this time.