功能: - 网站收藏管理(添加/编辑/删除/收藏) - 分类管理(支持自定义图标和颜色) - 搜索功能 - 点击统计 - 现代暗色主题 UI 技术栈: - 后端: Python Flask + MySQL - 前端: React + Vite + Tailwind CSS - 数据库: MySQL (192.168.8.160) - 端口: 后端 5003, 前端 5173
37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
Object.defineProperty(exports, "default", {
|
|
enumerable: true,
|
|
get: function() {
|
|
return negateValue;
|
|
}
|
|
});
|
|
function negateValue(value) {
|
|
value = `${value}`;
|
|
if (value === "0") {
|
|
return "0";
|
|
}
|
|
// Flip sign of numbers
|
|
if (/^[+-]?(\d+|\d*\.\d+)(e[+-]?\d+)?(%|\w+)?$/.test(value)) {
|
|
return value.replace(/^[+-]?/, (sign)=>sign === "-" ? "" : "-");
|
|
}
|
|
// What functions we support negating numeric values for
|
|
// var() isn't inherently a numeric function but we support it anyway
|
|
// The trigonometric functions are omitted because you'll need to use calc(…) with them _anyway_
|
|
// to produce generally useful results and that will be covered already
|
|
let numericFunctions = [
|
|
"var",
|
|
"calc",
|
|
"min",
|
|
"max",
|
|
"clamp"
|
|
];
|
|
for (const fn of numericFunctions){
|
|
if (value.includes(`${fn}(`)) {
|
|
return `calc(${value} * -1)`;
|
|
}
|
|
}
|
|
}
|