Mouse Clock 1.3.0: glow and font size options; editor fields and neon preset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3241c06114
commit
32aaf8a191
3 files changed
+72
-20
No files matched your search
@@ -100,6 +100,10 @@ Medium、方格子、Notion、Facebook 這類平台不允許文章放自己的 J
|
|||||||
| `data-speed` | `0.3` | 跟隨速度 0~1,越小拖得越長(原版是 0.6) |
|
| `data-speed` | `0.3` | 跟隨速度 0~1,越小拖得越長(原版是 0.6) |
|
||||||
| `data-date-speed` | `0.015` | 日期環旋轉速度(原版是 0.06) |
|
| `data-date-speed` | `0.015` | 日期環旋轉速度(原版是 0.06) |
|
||||||
| `data-lang` | `zh-TW` | 日期語言:`zh-TW`(2026年 十一月 20日 星期五)或 `en`(FRIDAY 20 NOVEMBER 2026) |
|
| `data-lang` | `zh-TW` | 日期語言:`zh-TW`(2026年 十一月 20日 星期五)或 `en`(FRIDAY 20 NOVEMBER 2026) |
|
||||||
|
| `data-font-size` | `10` | 1.3.0 起。鐘面數字與日期的字大小(px) |
|
||||||
|
| `data-hand-size` | `16` | 1.3.0 起。指針(點)的字大小(px) |
|
||||||
|
| `data-glow-color` | (無) | 1.3.0 起。字的外光暈顏色,例如 `#00e5ff`;不填就不加光暈 |
|
||||||
|
| `data-glow-size` | `0` | 1.3.0 起。外光暈範圍(px),`0` 就不加;要和 `data-glow-color` 一起設定 |
|
||||||
| `data-z-index` | `9999` | 疊放順序;時鐘被網站的選單蓋住時調大 |
|
| `data-z-index` | `9999` | 疊放順序;時鐘被網站的選單蓋住時調大 |
|
||||||
| `data-reduced-motion` | `hide` | 使用者在系統開啟「減少動態」時:`hide` 不顯示,`show` 照常顯示 |
|
| `data-reduced-motion` | `hide` | 使用者在系統開啟「減少動態」時:`hide` 不顯示,`show` 照常顯示 |
|
||||||
| `data-container` | (無) | 1.2.0 起。填 CSS 選擇器(例如 `#clock-box`)時,時鐘只在那個區塊裡顯示、不會跑出區塊,滑鼠或手指在區塊裡才會跟著動,離開後停在原地。不填就是跟著整個頁面(一般用法)。線上編輯器的試玩區就是用這個 |
|
| `data-container` | (無) | 1.2.0 起。填 CSS 選擇器(例如 `#clock-box`)時,時鐘只在那個區塊裡顯示、不會跑出區塊,滑鼠或手指在區塊裡才會跟著動,離開後停在原地。不填就是跟著整個頁面(一般用法)。線上編輯器的試玩區就是用這個 |
|
||||||
|
|||||||
+46
-9
@@ -136,6 +136,22 @@
|
|||||||
<div id="colors"></div>
|
<div id="colors"></div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend>外光暈</legend>
|
||||||
|
<div class="row color">
|
||||||
|
<label for="f-glowColor">光暈顏色</label>
|
||||||
|
<input type="color" id="f-glowColor-pick" aria-label="光暈顏色取色器" data-key="glowColor">
|
||||||
|
<input type="text" id="f-glowColor" data-key="glowColor" maxlength="7" spellcheck="false" autocomplete="off" placeholder="空白=不加">
|
||||||
|
</div>
|
||||||
|
<div id="numbersGlow"></div>
|
||||||
|
<p class="note">範圍設 0 或顏色留空就不加光暈。深色網站搭配亮色光暈最明顯。</p>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend>字大小</legend>
|
||||||
|
<div id="numbersFont"></div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>大小與速度</legend>
|
<legend>大小與速度</legend>
|
||||||
<div id="numbersMain"></div>
|
<div id="numbersMain"></div>
|
||||||
@@ -215,7 +231,7 @@
|
|||||||
<a href="https://code.tsdylab.com/tangsongdayo/mouse-clock">原始碼與授權</a> ・ <span id="ver"></span>
|
<a href="https://code.tsdylab.com/tangsongdayo/mouse-clock">原始碼與授權</a> ・ <span id="ver"></span>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<script src="mouse-clock.js?v=1.2.0" data-manual></script>
|
<script src="mouse-clock.js?v=1.3.0" data-manual></script>
|
||||||
<script>
|
<script>
|
||||||
(function () {
|
(function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
@@ -232,6 +248,13 @@
|
|||||||
['speed', '跟隨速度', 0.05, 1, 0.05, ''],
|
['speed', '跟隨速度', 0.05, 1, 0.05, ''],
|
||||||
['dateSpeed', '日期環轉速', 0, 0.1, 0.005, '']
|
['dateSpeed', '日期環轉速', 0, 0.1, 0.005, '']
|
||||||
],
|
],
|
||||||
|
numbersGlow: [
|
||||||
|
['glowSize', '光暈範圍(px)', 0, 20, 1, '']
|
||||||
|
],
|
||||||
|
numbersFont: [
|
||||||
|
['fontSize', '數字與日期', 6, 30, 1, 'px'],
|
||||||
|
['handSize', '指針', 8, 40, 1, 'px']
|
||||||
|
],
|
||||||
numbersMouse: [
|
numbersMouse: [
|
||||||
['offsetX', '水平', -300, 300, 1, 'px'],
|
['offsetX', '水平', -300, 300, 1, 'px'],
|
||||||
['offsetY', '垂直', -300, 300, 1, 'px']
|
['offsetY', '垂直', -300, 300, 1, 'px']
|
||||||
@@ -246,9 +269,11 @@
|
|||||||
['柔和', { dateColor: '#999999', faceColor: '#555555', hourColor: '#b5532f', minuteColor: '#33568b', secondColor: '#3f8f57' }],
|
['柔和', { dateColor: '#999999', faceColor: '#555555', hourColor: '#b5532f', minuteColor: '#33568b', secondColor: '#3f8f57' }],
|
||||||
['夜光(深色網站)', { dateColor: '#8fa3b8', faceColor: '#e8e4d8', hourColor: '#ff8a65', minuteColor: '#7fb0ff', secondColor: '#9be38f' }],
|
['夜光(深色網站)', { dateColor: '#8fa3b8', faceColor: '#e8e4d8', hourColor: '#ff8a65', minuteColor: '#7fb0ff', secondColor: '#9be38f' }],
|
||||||
['糖果', { dateColor: '#c58bd9', faceColor: '#ff7eb6', hourColor: '#ff5c8a', minuteColor: '#5cc8ff', secondColor: '#ffc24b' }],
|
['糖果', { dateColor: '#c58bd9', faceColor: '#ff7eb6', hourColor: '#ff5c8a', minuteColor: '#5cc8ff', secondColor: '#ffc24b' }],
|
||||||
['墨色', { dateColor: '#888888', faceColor: '#333333', hourColor: '#111111', minuteColor: '#444444', secondColor: '#9b452e' }]
|
['墨色', { dateColor: '#888888', faceColor: '#333333', hourColor: '#111111', minuteColor: '#444444', secondColor: '#9b452e' }],
|
||||||
|
['霓虹(深色網站)', { dateColor: '#ff6ec7', faceColor: '#e0fbff', hourColor: '#ff3b6b', minuteColor: '#39c6ff', secondColor: '#b6ff3b', glowColor: '#00e5ff', glowSize: 6 }]
|
||||||
];
|
];
|
||||||
var NUM_KEYS = ['size', 'offsetX', 'offsetY', 'touchOffsetX', 'touchOffsetY', 'speed', 'dateSpeed', 'zIndex'];
|
var NUM_KEYS = ['size', 'offsetX', 'offsetY', 'touchOffsetX', 'touchOffsetY', 'speed', 'dateSpeed', 'zIndex', 'fontSize', 'handSize', 'glowSize'];
|
||||||
|
var LOOK_KEYS = COLORS.map(function (c) { return c[0]; }).concat(['glowColor', 'glowSize']); // 預設配色會換掉的項目
|
||||||
|
|
||||||
var state = {};
|
var state = {};
|
||||||
var mode = 'tag';
|
var mode = 'tag';
|
||||||
@@ -271,7 +296,8 @@
|
|||||||
for (k in input || {}) {
|
for (k in input || {}) {
|
||||||
if (!(k in DEF)) continue;
|
if (!(k in DEF)) continue;
|
||||||
v = input[k];
|
v = input[k];
|
||||||
if (/Color$/.test(k)) { v = normColor(v); if (v) o[k] = v; }
|
if (k === 'glowColor' && String(v).trim() === '') o[k] = '';
|
||||||
|
else if (/Color$/.test(k)) { v = normColor(v); if (v) o[k] = v; }
|
||||||
else if (NUM_KEYS.indexOf(k) >= 0) { v = Number(v); if (isFinite(v) && String(input[k]).trim() !== '') o[k] = k === 'zIndex' ? Math.max(0, Math.min(2147483647, Math.round(v))) : round(v); }
|
else if (NUM_KEYS.indexOf(k) >= 0) { v = Number(v); if (isFinite(v) && String(input[k]).trim() !== '') o[k] = k === 'zIndex' ? Math.max(0, Math.min(2147483647, Math.round(v))) : round(v); }
|
||||||
else if (k === 'lang') { if (v === 'en' || v === 'zh-TW') o[k] = v; }
|
else if (k === 'lang') { if (v === 'en' || v === 'zh-TW') o[k] = v; }
|
||||||
else if (k === 'reducedMotion') { if (v === 'hide' || v === 'show') o[k] = v; }
|
else if (k === 'reducedMotion') { if (v === 'hide' || v === 'show') o[k] = v; }
|
||||||
@@ -311,7 +337,7 @@
|
|||||||
b.innerHTML = '<span class="swatch" aria-hidden="true">' + COLORS.map(function (x) { return '<i style="background:' + c[x[0]] + '"></i>'; }).join('') + '</span>' + p[0];
|
b.innerHTML = '<span class="swatch" aria-hidden="true">' + COLORS.map(function (x) { return '<i style="background:' + c[x[0]] + '"></i>'; }).join('') + '</span>' + p[0];
|
||||||
b.addEventListener('click', function () {
|
b.addEventListener('click', function () {
|
||||||
var next = clone(state);
|
var next = clone(state);
|
||||||
COLORS.forEach(function (x) { next[x[0]] = c[x[0]]; });
|
LOOK_KEYS.forEach(function (x) { next[x] = c[x]; });
|
||||||
apply(next, true);
|
apply(next, true);
|
||||||
say('已套用「' + p[0] + '」配色');
|
say('已套用「' + p[0] + '」配色');
|
||||||
});
|
});
|
||||||
@@ -322,7 +348,7 @@
|
|||||||
document.querySelectorAll('[data-key]').forEach(function (el) {
|
document.querySelectorAll('[data-key]').forEach(function (el) {
|
||||||
var k = el.getAttribute('data-key');
|
var k = el.getAttribute('data-key');
|
||||||
if (el === document.activeElement && el.type !== 'color' && el.type !== 'range' && el.tagName !== 'SELECT') return;
|
if (el === document.activeElement && el.type !== 'color' && el.type !== 'range' && el.tagName !== 'SELECT') return;
|
||||||
el.value = state[k];
|
el.value = (el.type === 'color' && !state[k]) ? '#ffffff' : state[k];
|
||||||
el.removeAttribute('aria-invalid');
|
el.removeAttribute('aria-invalid');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -347,7 +373,10 @@
|
|||||||
var k = el.getAttribute('data-key');
|
var k = el.getAttribute('data-key');
|
||||||
el.addEventListener('input', function () {
|
el.addEventListener('input', function () {
|
||||||
var v = el.value, next = clone(state);
|
var v = el.value, next = clone(state);
|
||||||
if (/Color$/.test(k)) {
|
if (k === 'glowColor' && el.type === 'text' && v.trim() === '') {
|
||||||
|
el.removeAttribute('aria-invalid');
|
||||||
|
next[k] = '';
|
||||||
|
} else if (/Color$/.test(k)) {
|
||||||
var c = normColor(v);
|
var c = normColor(v);
|
||||||
if (!c) { el.setAttribute('aria-invalid', 'true'); return; }
|
if (!c) { el.setAttribute('aria-invalid', 'true'); return; }
|
||||||
el.removeAttribute('aria-invalid');
|
el.removeAttribute('aria-invalid');
|
||||||
@@ -357,9 +386,17 @@
|
|||||||
el.removeAttribute('aria-invalid');
|
el.removeAttribute('aria-invalid');
|
||||||
next[k] = Number(v);
|
next[k] = Number(v);
|
||||||
} else next[k] = v;
|
} else next[k] = v;
|
||||||
|
// 光暈:選了顏色但範圍是 0 → 給預設範圍;調了範圍但沒有顏色 → 給白色
|
||||||
|
if (k === 'glowColor' && next.glowColor && !(Number(next.glowSize) > 0)) next.glowSize = 6;
|
||||||
|
if (k === 'glowSize' && Number(next.glowSize) > 0 && !next.glowColor) next.glowColor = '#ffffff';
|
||||||
|
var prev = state;
|
||||||
state = sanitize(next);
|
state = sanitize(next);
|
||||||
// 同步同一個設定的另一個輸入框
|
// 同步其他輸入框(包含連動改到的光暈欄位)
|
||||||
document.querySelectorAll('[data-key="' + k + '"]').forEach(function (o) { if (o !== el) o.value = state[k]; });
|
document.querySelectorAll('[data-key]').forEach(function (o) {
|
||||||
|
var kk = o.getAttribute('data-key');
|
||||||
|
if (o === el || (kk !== k && state[kk] === prev[kk])) return;
|
||||||
|
o.value = (o.type === 'color' && !state[kk]) ? '#ffffff' : state[kk];
|
||||||
|
});
|
||||||
save(); render();
|
save(); render();
|
||||||
clearTimeout(startTimer);
|
clearTimeout(startTimer);
|
||||||
startTimer = setTimeout(restart, 30);
|
startTimer = setTimeout(restart, 30);
|
||||||
|
|||||||
+22
-11
@@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* 滑鼠立體時鐘 Mouse Clock 1.2.0
|
* 滑鼠立體時鐘 Mouse Clock 1.3.0
|
||||||
* https://code.tsdylab.com/tangsongdayo/mouse-clock
|
* https://code.tsdylab.com/tangsongdayo/mouse-clock
|
||||||
*
|
*
|
||||||
* 原作:Silly Clock 3 by Kurt Grigg
|
* 原作:Silly Clock 3 by Kurt Grigg
|
||||||
@@ -25,6 +25,10 @@
|
|||||||
dateSpeed: 0.015, // 日期環旋轉速度(原版 0.06)
|
dateSpeed: 0.015, // 日期環旋轉速度(原版 0.06)
|
||||||
lang: 'zh-TW', // 日期語言:'zh-TW' 或 'en'
|
lang: 'zh-TW', // 日期語言:'zh-TW' 或 'en'
|
||||||
zIndex: 9999,
|
zIndex: 9999,
|
||||||
|
fontSize: 10, // 1.3.0:鐘面數字與日期的字大小(px)
|
||||||
|
handSize: 16, // 1.3.0:指針(點)的字大小(px)
|
||||||
|
glowColor: '', // 1.3.0:字的外光暈顏色,空白=不加
|
||||||
|
glowSize: 0, // 1.3.0:外光暈範圍(px),0=不加
|
||||||
reducedMotion: 'hide', // 使用者系統設定「減少動態」時:'hide' 不顯示、'show' 照常顯示
|
reducedMotion: 'hide', // 使用者系統設定「減少動態」時:'hide' 不顯示、'show' 照常顯示
|
||||||
container: null // 1.2.0:只在這個元素(或 CSS 選擇器)裡顯示,時鐘不會跑出它的範圍
|
container: null // 1.2.0:只在這個元素(或 CSS 選擇器)裡顯示,時鐘不會跑出它的範圍
|
||||||
};
|
};
|
||||||
@@ -49,12 +53,13 @@
|
|||||||
var o = {}, k;
|
var o = {}, k;
|
||||||
for (k in DEFAULTS) o[k] = DEFAULTS[k];
|
for (k in DEFAULTS) o[k] = DEFAULTS[k];
|
||||||
for (k in (options || {})) if (options[k] !== undefined && options[k] !== '') o[k] = options[k];
|
for (k in (options || {})) if (options[k] !== undefined && options[k] !== '') o[k] = options[k];
|
||||||
['size', 'offsetX', 'offsetY', 'touchOffsetX', 'touchOffsetY', 'speed', 'dateSpeed', 'zIndex'].forEach(function (key) { o[key] = Number(o[key]); });
|
['size', 'offsetX', 'offsetY', 'touchOffsetX', 'touchOffsetY', 'speed', 'dateSpeed', 'zIndex', 'fontSize', 'handSize', 'glowSize'].forEach(function (key) { o[key] = Number(o[key]); });
|
||||||
|
|
||||||
if (o.reducedMotion === 'hide' && window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
if (o.reducedMotion === 'hide' && window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!/^[#a-zA-Z0-9(),.%\s]*$/.test(String(o.glowColor || ''))) o.glowColor = ''; // 只接受顏色寫法
|
||||||
var box = o.container;
|
var box = o.container;
|
||||||
if (typeof box === 'string') box = document.querySelector(box);
|
if (typeof box === 'string') box = document.querySelector(box);
|
||||||
if (box && box.nodeType !== 1) box = null;
|
if (box && box.nodeType !== 1) box = null;
|
||||||
@@ -65,10 +70,15 @@
|
|||||||
var H = '...'.split(''), M = '....'.split(''), S = '.....'.split('');
|
var H = '...'.split(''), M = '....'.split(''), S = '.....'.split('');
|
||||||
var Face = '1 2 3 4 5 6 7 8 9 10 11 12'.split(' ');
|
var Face = '1 2 3 4 5 6 7 8 9 10 11 12'.split(' ');
|
||||||
var n = Face.length, Split = 360 / n, Dsplit = 360 / D.length;
|
var n = Face.length, Split = 360 / n, Dsplit = 360 / D.length;
|
||||||
var R = o.size, HandLen = R / 4.5, HandY = -7, HandX = -2.5;
|
var R = o.size, HandLen = R / 4.5;
|
||||||
|
var F = o.fontSize > 0 ? o.fontSize : 10, HS = o.handSize > 0 ? o.handSize : 16;
|
||||||
|
// 字放大時維持各字的中心位置(預設 10/16px 時與原版相同:FO=0、HandX=-2.5、HandY=-7)
|
||||||
|
var FO = (10 - F) / 2, HandX = 5 - HS * 0.46875, HandY = 5 - HS * 0.75;
|
||||||
var xmouse = window.innerWidth / 2, ymouse = window.innerHeight / 2, currStep = 0;
|
var xmouse = window.innerWidth / 2, ymouse = window.innerHeight / 2, currStep = 0;
|
||||||
// 容器模式:時鐘所有字(含日期環、字寬)與容器邊緣的距離
|
// 容器模式:時鐘所有字(含日期環、字寬)與容器邊緣的距離
|
||||||
var padL = Math.max(R * 1.5, R + 7) + 4, padR = Math.max(R * 1.5 + 10, R + 16) + 4;
|
var reach = 4 * HandLen; // 最長的秒針(5 個點)離中心的距離
|
||||||
|
var padL = Math.max(R * 1.5 - FO, reach - Math.min(HandX, HandY)) + 4;
|
||||||
|
var padR = Math.max(R * 1.5 + FO + F, reach + Math.max(HandX, HandY) + HS) + 4;
|
||||||
var oldPosition = null;
|
var oldPosition = null;
|
||||||
if (box) {
|
if (box) {
|
||||||
if (getComputedStyle(box).position === 'static') { oldPosition = box.style.position; box.style.position = 'relative'; }
|
if (getComputedStyle(box).position === 'static') { oldPosition = box.style.position; box.style.position = 'relative'; }
|
||||||
@@ -93,8 +103,9 @@
|
|||||||
css.textContent =
|
css.textContent =
|
||||||
'.mouse-clock>div{position:' + (box ? 'absolute' : 'fixed') + ';top:0;left:0;pointer-events:none;text-align:center;line-height:1;' +
|
'.mouse-clock>div{position:' + (box ? 'absolute' : 'fixed') + ';top:0;left:0;pointer-events:none;text-align:center;line-height:1;' +
|
||||||
'will-change:transform;z-index:' + o.zIndex + ';margin:0;padding:0;}' +
|
'will-change:transform;z-index:' + o.zIndex + ';margin:0;padding:0;}' +
|
||||||
'.mouse-clock .mc-face,.mouse-clock .mc-date{width:10px;height:10px;font:10px Arial,sans-serif;}' +
|
'.mouse-clock .mc-face,.mouse-clock .mc-date{width:' + F + 'px;height:' + F + 'px;font:' + F + 'px Arial,sans-serif;}' +
|
||||||
'.mouse-clock .mc-hand{width:16px;height:16px;font:bold 16px Arial,sans-serif;}';
|
'.mouse-clock .mc-hand{width:' + HS + 'px;height:' + HS + 'px;font:bold ' + HS + 'px Arial,sans-serif;}' +
|
||||||
|
(o.glowColor && o.glowSize > 0 ? '.mouse-clock>div{text-shadow:0 0 ' + o.glowSize + 'px ' + o.glowColor + ',0 0 ' + (o.glowSize * 2) + 'px ' + o.glowColor + ';}' : '');
|
||||||
root.appendChild(css);
|
root.appendChild(css);
|
||||||
if (box) root.style.cssText = 'position:absolute;inset:0;overflow:hidden;pointer-events:none;';
|
if (box) root.style.cssText = 'position:absolute;inset:0;overflow:hidden;pointer-events:none;';
|
||||||
|
|
||||||
@@ -149,8 +160,8 @@
|
|||||||
var min = -1.57 + Math.PI * t.getMinutes() / 30;
|
var min = -1.57 + Math.PI * t.getMinutes() / 30;
|
||||||
var hrs = -1.575 + Math.PI * t.getHours() / 6 + Math.PI * t.getMinutes() / 360;
|
var hrs = -1.575 + Math.PI * t.getHours() / 6 + Math.PI * t.getMinutes() / 360;
|
||||||
for (i = 0; i < n; i++)
|
for (i = 0; i < n; i++)
|
||||||
place(elFace[i], y[i] + R * Math.sin(-1.0471 + i * Split * Math.PI / 180),
|
place(elFace[i], y[i] + FO + R * Math.sin(-1.0471 + i * Split * Math.PI / 180),
|
||||||
x[i] + R * Math.cos(-1.0471 + i * Split * Math.PI / 180));
|
x[i] + FO + R * Math.cos(-1.0471 + i * Split * Math.PI / 180));
|
||||||
for (i = 0; i < H.length; i++)
|
for (i = 0; i < H.length; i++)
|
||||||
place(elH[i], y[i] + HandY + (i * HandLen) * Math.sin(hrs), x[i] + HandX + (i * HandLen) * Math.cos(hrs));
|
place(elH[i], y[i] + HandY + (i * HandLen) * Math.sin(hrs), x[i] + HandX + (i * HandLen) * Math.cos(hrs));
|
||||||
for (i = 0; i < M.length; i++)
|
for (i = 0; i < M.length; i++)
|
||||||
@@ -158,8 +169,8 @@
|
|||||||
for (i = 0; i < S.length; i++)
|
for (i = 0; i < S.length; i++)
|
||||||
place(elS[i], y[i] + HandY + (i * HandLen) * Math.sin(sec), x[i] + HandX + (i * HandLen) * Math.cos(sec));
|
place(elS[i], y[i] + HandY + (i * HandLen) * Math.sin(sec), x[i] + HandX + (i * HandLen) * Math.cos(sec));
|
||||||
for (i = 0; i < D.length; i++)
|
for (i = 0; i < D.length; i++)
|
||||||
place(elDate[i], Dy[i] + R * 1.5 * Math.sin(currStep + i * Dsplit * Math.PI / 180),
|
place(elDate[i], Dy[i] + FO + R * 1.5 * Math.sin(currStep + i * Dsplit * Math.PI / 180),
|
||||||
Dx[i] + R * 1.5 * Math.cos(currStep + i * Dsplit * Math.PI / 180));
|
Dx[i] + FO + R * 1.5 * Math.cos(currStep + i * Dsplit * Math.PI / 180));
|
||||||
currStep -= o.dateSpeed;
|
currStep -= o.dateSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -208,7 +219,7 @@
|
|||||||
var current = document.currentScript;
|
var current = document.currentScript;
|
||||||
// 1.1.0:在載入前設定 window.MouseClockOptions = {...} 也可以調整(data-* 屬性優先)
|
// 1.1.0:在載入前設定 window.MouseClockOptions = {...} 也可以調整(data-* 屬性優先)
|
||||||
var preset = window.MouseClockOptions;
|
var preset = window.MouseClockOptions;
|
||||||
window.MouseClock = { version: '1.2.0', start: start, stop: function () { if (running) running.stop(); }, defaults: DEFAULTS };
|
window.MouseClock = { version: '1.3.0', start: start, stop: function () { if (running) running.stop(); }, defaults: DEFAULTS };
|
||||||
|
|
||||||
// 加上 data-manual 就不自動啟動,改由 MouseClock.start({...}) 啟動
|
// 加上 data-manual 就不自動啟動,改由 MouseClock.start({...}) 啟動
|
||||||
if (!(current && current.dataset && current.dataset.manual !== undefined)) {
|
if (!(current && current.dataset && current.dataset.manual !== undefined)) {
|
||||||
|
|||||||
Reference in new issue
Block a user