This file contains 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
/** | |
* 议会席位分配 | |
* echarts source code: https://github.com/apache/echarts/commit/fa8db37e5e11b74cbe6e377399c1bb49b8847704 | |
* echarts issues: https://github.com/apache/echarts/issues/5850 | |
* Ovilia fix: http://zhangwenli.com/blog/2017/06/13/pie-percentage | |
* wiki 最大余数法: https://en.wikipedia.org/wiki/Largest_remainder_method | |
*/ | |
function getPercentWithPrecision(valueList = [], idx, precision) { | |
var sum = valueList.reduce((acc, val) => acc + val, 0) | |
if (sum === 0) return 0 |
This file contains 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
/** | |
* nested providers | |
* reference: https://x.com/mattpocockuk/status/1765780004040761395 | |
* TS Playground: https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgKQMoA0CiAbApiXAOxgGEJCBnGKAVwGMZoAaOAJVwEMGA5CAE1xwAvnABmUCCDgAiKJwbSA3AChlMAJ5hBvAJKFRuKAB4AKgD44AXjgBtEwF07cXAA8YRPhTgdC6uAH44AAY4AC44AEZ7FTVNQTJiDmBKEgALYGw+OUIrRGU4ODp0zOz-cPYuGAA6Cp5+XBUhGNEaQgZgcjgABQkAN2ABKFQYLgBrI3zuvoHDL1d3Qk9bSYKEkeSKNIysoiYVuCrDtaSU4p3CG3tJq7MACgRJsGnBij2Cou3svaFwh4KniD9F6-fY2UZwZJwUa4dQQURTQEzKAUezhGz7ApoLB4AjEBJUWgMaBGHqIl5g+xmN4FGkAeRAwBgRl0+kMJOeswpVJkHxKRGkZn20UmTUmvPO5XkMF4AkaAEo8gU8PBCPVcuLsjECqJoHBbnRyFRbKSgYYWACwCi4HC4ADTciFX8aaqBLl2WTDIhDlULRQhGYEC7cEIjAB6E1IswqApCVQFOQwGhQHJBxqqAR0bAcORiVrtTomVL4XARwa3X0ggowIsEcLSPjZ0bSOAAHxk2GAAHNUjAlGKztlJZUalKZQ1lEI5eEsVUcMXiCoM1mcy02jAOjkAKoUQylwzliSWytwGg7qA6PjhQg0EAAI0M0cKA6IQ4YI8qY-l04ws5xRBgMShqGcAAEKYAAYrSrCYKopg1iWHJQHA1bFpY9aNgKkxGNuu6ISeZ4XpYCARAATAAzP6AASuDYNgEBwAA6tAmQAIRhjhUB7lAgphoWxZcVGqhAXAACC4EmJgrCwVxwxjI8iEUER6I0ssKkFHxBBcdSKlOmpyHwXWDZQE22k0kIpn2KZyl |
This file contains 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
<script setup lang="ts"> | |
// Vue SFC Playground: https://play.vuejs.org/#eNqdV8tu4zYU/RWOFmMFcKUMgtm4itq0TdEp2k6QBOgiyoKRKFsJRap8OAk8/vdePvSM7ACjjSXe9+G5l/QuuGiaaKtJsAoSmYuqUUgSpRtEMVufZ4GSWZBmrKobLhTaIUFKtEel4DVagNmiE/3K68avR7H5MF5BnLGcM6lQLdfo3JgnUomKrdNw8QehlKN/uaDFh8VJxpLYZQDx4EORuqFYEfhCKNl8Snc762S/T2L4sqsVa7RC2x9qXhAK2YLcpmsMBIrdm83MvCdx5zNYQmWQWFmto0fJGZS/M8pZkIN2RYn42qgKEs+CFbISI8OQ7/Ofdk0JTZbter4h+dPM+qN8MWtZcCWIJGJLsqCTKSzWRDnx5c0/5AXeOyHUoyloHxFeE8mpNjk6tV80KyDtgZ7N9ovdHcD7Vl6+KMJkW5RJ1GjurX4WwG4ZoA6V3qd7Fp1Zu4ztAUUDF5f4gRIZa0kutOLX5D9NpIqUBFQ9O9RrQ4A914fYM0esjFmri6b6XbPkN6zwEl1hgWuJABDCCokwe727T4FXYRRFjZWtvM4JOk/RFbirJLHGllUVU0SUOAe3faa+3rZYynEBgP20Qg+cU4LBzCxzdqPznEgJgrAAhysT3obZ8qoAOPqUe9+wTZqqd7K/A1wSHyxdzlWc3hvn5MWCVWqWm4zRGPBjQUJXQ8lWs949Z7gDAgp8i07GTkbLM4WlHkDX8LsWSCiwxFSSZQ8h7PR5Gw19+9brrpyqYVfvSbiIf3XugCuhN4CxMVLVByocccRumk/WPOMA0RZTTcCgbZFWSWnBAMKBn15qnkhtCAuh1Sfu26cv/+PH/sMYTBwNwoFwLNtPg5YVg05/DcNpVe9UZ4Ge922ZPEjibuxiaWAGQoLa/ARoQx2fAHbmZMGP80Oglw6ayjt23DON49IctY9bSm5TANZm7YcADAY/DW7T0XC4 |
This file contains 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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
This file contains 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
/** | |
* @desc 贝塞尔曲线算法,包含了3阶贝塞尔 | |
*/ | |
class Bezier { | |
/** | |
* @desc 获取点,这里可以设置点的个数 | |
* @param {number} num 点个数 | |
* @param {Array} p1 点坐标 | |
* @param {Array} p2 点坐标 | |
* @param {Array} p3 点坐标 |
This file contains 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
.prefix-test { | |
-webkit-column-count: 3; | |
-moz-column-count: 3; | |
-ms-column-count: 3; | |
-o-column-count: 3; | |
column-count: 3; | |
-webkit-column-gap: 1.5em; | |
-moz-column-gap: 1.5em; | |
-ms-column-gap: 1.5em; | |
-o-column-gap: 1.5em; |
This file contains 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
@media only screen and (max-width: 767px) { | |
.hidden-xs-only { | |
display: none !important; | |
} | |
} | |
@media only screen and (min-width: 768px) { | |
.hidden-sm-and-up { | |
display: none !important; | |
} | |
} |
This file contains 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
@charset "UTF-8"; | |
/*-------------------------------- demo upload --------------------------*/ | |
.kfc-upload { | |
display: inline-block; | |
text-align: center; | |
cursor: pointer; | |
outline: none; | |
/* 照片墙模式 */ | |
} | |
.kfc-upload__input { |
This file contains 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 mediaJSON = { "categories" : [ { "name" : "Movies", | |
"videos" : [ | |
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ], | |
"subtitle" : "By Blender Foundation", | |
"thumb" : "images/BigBuckBunny.jpg", | |
"title" : "Big Buck Bunny" | |
}, | |
{ "description" : "The first Blender Open Movie from 2006", | |
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ], |
NewerOlder