Skip to content

Instantly share code, notes, and snippets.

@Leolik
Leolik / App.js
Created June 17, 2020 17:41 — forked from XiongJingzhi/App.js
nprogress with react-router in create-react-app
import React from 'react'
import { BrowserRouter as Router, Switch } from 'react-router-dom'
import routes from './routes'
import FancyRoute from './components/tools/FancyRoute'
const App = props =>
<Router>
<Switch>
{routes.map((route, i) =>
<FancyRoute key={i} {...route} />
@Leolik
Leolik / App.js
Created June 17, 2020 15:19 — forked from shelldandy/App.js
nprogress with react-router in create-react-app
import React from 'react'
import { BrowserRouter as Router, Switch } from 'react-router-dom'
import routes from './routes'
import FancyRoute from './components/tools/FancyRoute'
const App = props =>
<Router>
<Switch>
{routes.map((route, i) =>
<FancyRoute key={i} {...route} />
@Leolik
Leolik / dabblet.css
Last active April 18, 2019 14:55
Untitled
.table {
width: 100px;
border-collapse: collapse;
border: solid 1px #000;
}
.table td {
padding: 10px;
border: 1px solid #000;
word-break: break-all;
}
@Leolik
Leolik / scrollTop.js
Last active August 27, 2018 19:03
scrollTop js
function scrollTo(to = 0, duration= 1000) {
const start = window.pageYOffset;
const change = to - start;
const increment = 20;
let currentTime = 0;
const animateScroll = (() => {
currentTime += increment;
const val = Math.easeInOutQuad(currentTime, start, change, duration);
var box = document.querySelector('.box');
var message = document.querySelector('.message');
var player = box.animate([
{
transform: 'translateX(0)',
opacity: 0
},
{
transform: 'translateX(100px)',
@Leolik
Leolik / dabblet.css
Last active January 12, 2016 00:33
Untitled
body {
background: cyan;
min-height: 100%;
}
li {
display: inline-block;
list-style: none;
overflow: hidden;
}
li:first-child a {
@Leolik
Leolik / dabblet.css
Created August 13, 2015 12:37
Untitled
.fright, .fleft {
border: 1px solid #000;
width: 100%;
}
.fright {
float: left;
clear: both;
}
.fleft {
float: right;
@Leolik
Leolik / dabblet.css
Last active August 29, 2015 14:23
Untitled
table {
width: 100%;
border: 1px solid #000;
border-collapse: collapse;
}
table th,
table td {
border-top: 1px solid #000;
border-left: 1px solid #000;
padding: 10px;
@Leolik
Leolik / dabblet.css
Created February 4, 2015 23:44 — forked from anonymous/dabblet.css
Attempt for Chrome-style progress-indicator with SVG and CSS animations
/**
* Attempt for Chrome-style progress-indicator with SVG and CSS animations
*/
@keyframes spin {
0% {
stroke: #00aeef
}
37.5% {
stroke: #ed1c24;
@Leolik
Leolik / dabblet.css
Created February 4, 2015 23:43 — forked from anonymous/dabblet.css
Attempt for Chrome-style progress-indicator with SVG and CSS animations
/**
* Attempt for Chrome-style progress-indicator with SVG and CSS animations
*/
@keyframes spin {
to {
stroke-dashoffset: -264;
}
}