This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.motto-disturb { | |
position: relative; | |
} | |
@keyframes noise-anim { | |
0% { | |
clip: rect(55px, 9999px, 9px, 0); | |
} | |
5% { | |
clip: rect(12px, 9999px, 60px, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var throttle = function(fn, delay){ | |
var timer = null; | |
return function(){ | |
var context = this, args = arguments; | |
clearTimeout(timer); | |
timer = setTimeout(function(){ | |
fn.apply(context, args); | |
}, delay); | |
}; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Ripple</title> | |
<style> | |
.ripple-effect { | |
position: relative; | |
background-color: red; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ele.getBoundingClientRect().top > window.innerHeight // 元素在当前屏下面 | |
ele.getBoundingClientRect().bottom < 0 // 元素在当前屏上面 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var scrollFunc = function (e) { | |
var direct = 0 | |
e = e || window.event | |
if (e.wheelDelta) { //判断浏览器IE,谷歌滑轮事件 | |
if (e.wheelDelta > 0) { //当滑轮向上滚动时 | |
console.log("滑轮向上滚动") | |
} | |
if (e.wheelDelta < 0) { //当滑轮向下滚动时 | |
console.log("滑轮向下滚动") | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 发送ajax请求,允许传入一个配置对象和一个回调函数 | |
* | |
* @param {Object} config 配置对象 | |
* 举例:var config = { | |
method: 'GET', | |
url: 'url', | |
params: {number: 1, price: 10}, | |
async: true | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*::-webkit-scrollbar { | |
display: block; | |
width: 5px; | |
background: #FAFAFA; | |
} | |
*::-webkit-scrollbar-thumb { | |
border-radius: 5px; | |
background: #E0E0E0; | |
} | |
*::-webkit-scrollbar-thumb:hover { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
let pic = fs.readFileSync(`${__dirname}/dog.jpg`) | |
let readStream = fs.createReadStream(`${__dirname}/dog.jpg`) | |
for (let i = 0; i < 400; i++) { | |
readStream.pipe(fs.createWriteStream(`${__dirname}/输出目录/dog-${i}.jpg`)) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rand(min, max) { | |
return (Math.random() * (max - min)) + min; | |
} | |
export default class Bubble { | |
constructor(canvas) { | |
this.colors = [ | |
'255, 255, 255' | |
]; | |
// adds gradient to particles on true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bs4 import BeautifulSoup | |
import requests | |
import os | |
def visit_page(url): | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.108 Safari/537.36' | |
} | |
r = requests.get(url, headers = headers) |
OlderNewer