From 00c341e2a9837eea74962940455576be370f7e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Thu, 30 Jul 2020 15:02:11 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=BE=E5=A4=A7=E8=B5=B0=E5=8A=BF=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/js/app.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8684e65..6022a14 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "io.yutent.gaystat", - "version": "1.4.0", + "version": "1.5.0", "description": "搞基数据", "main": "src/main.js", "scripts": { diff --git a/src/js/app.js b/src/js/app.js index 517f626..2908a0e 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -31,6 +31,7 @@ function getTableData(str) { var table = document.createElement('table') var list = [] var max = 0 + var min = 99 table.innerHTML = match[0] list = Array.from(table.children[0].children) @@ -39,13 +40,15 @@ function getTableData(str) { if (m > max) { max = m } + if (m < min) { + min = m + } return { m } }) .reverse() - max = Math.ceil(max) list.forEach(it => { - it.h = +((it.m * 30) / max).toFixed(2) + it.h = +(((it.m - min) * 25) / (max - min)).toFixed(2) }) return list }