アラーム k

Execute UserScript

// ==UserScript==
// @name        アラーム k
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  Execute UserScript
// @author       Your Name
// @match       https://*
// @grant       none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';
    
    document.addEventListener('keydown', (e) => {
        
                if (e.key === 'k') {
                    javascript:(function(){var existing=document.getElementById("alarm-bookmarklet-container");if(existing){existing.parentNode.removeChild(existing);return;}var container=document.createElement("div");container.id="alarm-bookmarklet-container";container.style.position="fixed";container.style.top="50%";container.style.left="50%";container.style.transform="translate(-50%, -50%)";container.style.zIndex=9999;container.style.padding="15px";container.style.borderRadius="8px";container.style.backgroundColor="#283593";container.style.border="2px solid #ffab00";container.style.color="#ffab00";container.style.fontFamily="sans-serif";var header=document.createElement("div");header.style.textAlign="right";var closeBtn=document.createElement("button");closeBtn.textContent="☒";closeBtn.style.background="none";closeBtn.style.border="none";closeBtn.style.color="#ffab00";closeBtn.style.fontSize="16px";closeBtn.style.cursor="pointer";closeBtn.addEventListener("click",function(){container.parentNode.removeChild(container);});header.appendChild(closeBtn);container.appendChild(header);function createInput(placeholder,width){var input=document.createElement("input");input.type="number";input.placeholder=placeholder;input.style.margin="3px";input.style.width=width||"50px";input.style.backgroundColor="#5c6bc0";input.style.color="#ffcc80";input.style.border="1px solid #ffab00";input.style.borderRadius="3px";input.style.textAlign="center";return input;}var timerSection=document.createElement("div");timerSection.style.marginBottom="10px";var timerTitle=document.createElement("div");timerTitle.textContent="タイマー";timerTitle.style.fontWeight="bold";timerSection.appendChild(timerTitle);var timerHour=createInput("時間","60px");var timerMin=createInput("分","60px");var timerSec=createInput("秒","60px");timerSection.appendChild(timerHour);timerSection.appendChild(timerMin);timerSection.appendChild(timerSec);container.appendChild(timerSection);var alarmSection=document.createElement("div");alarmSection.style.marginBottom="10px";var alarmTitle=document.createElement("div");alarmTitle.textContent="アラーム";alarmTitle.style.fontWeight="bold";alarmSection.appendChild(alarmTitle);var todayLabel=document.createElement("label");todayLabel.style.marginRight="10px";var todayChk=document.createElement("input");todayChk.type="checkbox";todayChk.id="todayChk";todayLabel.appendChild(todayChk);todayLabel.appendChild(document.createTextNode("今日"));alarmSection.appendChild(todayLabel);var tomorrowLabel=document.createElement("label");tomorrowLabel.style.marginRight="10px";var tomorrowChk=document.createElement("input");tomorrowChk.type="checkbox";tomorrowChk.id="tomorrowChk";tomorrowLabel.appendChild(tomorrowChk);tomorrowLabel.appendChild(document.createTextNode("明日"));alarmSection.appendChild(tomorrowLabel);todayChk.addEventListener("click",function(){if(todayChk.checked){tomorrowChk.checked=false;}});tomorrowChk.addEventListener("click",function(){if(tomorrowChk.checked){todayChk.checked=false;}});var alarmHour=createInput("時","60px");var alarmMin=createInput("分","60px");var alarmSec=createInput("秒","60px");alarmSection.appendChild(alarmHour);alarmSection.appendChild(alarmMin);alarmSection.appendChild(alarmSec);container.appendChild(alarmSection);var geminiBtn=document.createElement("button");geminiBtn.textContent="Geminiへ";geminiBtn.style.padding="5px 10px";geminiBtn.style.marginTop="10px";geminiBtn.style.border="1px solid #ffab00";geminiBtn.style.backgroundColor="#5c6bc0";geminiBtn.style.color="#ffcc80";geminiBtn.style.cursor="pointer";geminiBtn.style.borderRadius="4px";geminiBtn.addEventListener("click",function(){var lines=[];var th=timerHour.value.trim();var tm=timerMin.value.trim();var ts=timerSec.value.trim();if(th||tm||ts){var timerText="";if(th)timerText+=th+"時間";if(tm)timerText+=tm+"分";if(ts)timerText+=ts+"秒";timerText+="後にアラームをセットしてください";lines.push(timerText);}var ah=alarmHour.value.trim();var am=alarmMin.value.trim();var asec=alarmSec.value.trim();if(ah||am||asec){var prefix="";if(todayChk.checked){prefix="今日の";}else if(tomorrowChk.checked){prefix="次の曜日の";}var alarmText=prefix;if(ah)alarmText+=ah+"時";if(am)alarmText+=am+"分";if(asec)alarmText+=asec+"秒";alarmText+="にアラームをセットしてください";lines.push(alarmText);}var finalText=lines.join("\n");if(finalText===""){alert("タイマーまたはアラームの入力値を設定してください。");return;}var ta=document.createElement("textarea");ta.value=finalText;document.body.appendChild(ta);ta.select();try{if(document.execCommand("copy")){window.location.href="intent://#Intent;package=com.google.android.apps.bard;end";}else{alert("コピーに失敗しました。");}}catch(e){alert("コピーエラー: "+e);}document.body.removeChild(ta);container.parentNode.removeChild(container);});container.appendChild(geminiBtn);document.body.appendChild(container);})();
                }
            
    });
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址