+18
| let size = 1.0; | ||
| const body = document.body | ||
| let zoom = { | ||
| setZooMax() { | ||
| size = size + 0.1; | ||
| this.set() | ||
| }, | ||
| setZooMin() { | ||
| size = size - 0.1; | ||
| this.set() | ||
| }, | ||
| set() { | ||
| body.style.zoom = size; | ||
| body.style.cssText += '; -moz-transform: scale(' + size + ');-moz-transform-origin: 0 0; '; | ||
| } | ||
| } | ||
| module.exports = zoom |
+2
-4
@@ -1,7 +0,5 @@ | ||
| import { time } from './lib/time' | ||
| import { copy } from './lib/copy' | ||
| import { zoom } from './lib/zoom' | ||
| let featched = { | ||
| getTime = time.getTime, | ||
| getCory = copy.copyToClipboard | ||
| zoom, | ||
| } | ||
@@ -8,0 +6,0 @@ |
+1
-1
| { | ||
| "name": "featched", | ||
| "version": "1.0.2", | ||
| "version": "1.0.3", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
| /** | ||
| * | ||
| * @param {*} text 复制内容 | ||
| */ | ||
| export function copyToClipboard(text) { | ||
| navigator.clipboard.writeText && navigator.clipboard.writeText(text) | ||
| } |
| const scrollToTop = (element) => | ||
| element.scrollIntoView({ behavior: "smooth", block: "start" }) | ||
| const scrollToBottom = (element) => | ||
| element.scrollIntoView({ behavior: "smooth", block: "end" }) |
-16
| /** | ||
| * | ||
| * @param {*} time 时间戳 | ||
| * @param {*} label 间隔字符 | ||
| * @returns 时间戳为10位需*1000,时间戳为13位的话不需乘1000 | ||
| */ | ||
| export function getTime(time, label) { | ||
| let date = new Date(time); | ||
| let Y = date.getFullYear() + label; | ||
| let M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + label; | ||
| let D = date.getDate() + ' '; | ||
| let h = date.getHours() + ':'; | ||
| let m = date.getMinutes() + ':'; | ||
| let s = date.getSeconds(); | ||
| return Y + M + D + h + m + s; | ||
| } |
897
-40.91%4
-33.33%20
-33.33%