Repository: sciooga/Keyboard-launch
Branch: master
Commit: 0c1d18e5deaf
Files: 5
Total size: 12.3 KB
Directory structure:
gitextract_nid99y7k/
├── LICENSE
├── README.md
└── web/
├── index.html
├── main.css
└── main.js
================================================
FILE CONTENTS
================================================
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2017
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
# Keyboard-launch
Simple and useful, one key to launch, so beautiful.
简单与实用,一键直达,很是优雅。
http://i.huguotao.com
感谢 [ldong](https://github.com/ldong) 将其发布至 Chrome webstore ,下载连接:[Keyboard-launch](https://chrome.google.com/webstore/detail/keyboard-launch/oocaffggffdbbefcmjbgkpbgehpnbadh)
================================================
FILE: web/index.html
================================================
<!DOCTYPE html>
<html lang="zh-Hans-CN">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="/main.css" />
<title>新标签页</title>
</head>
<body tabindex="2">
<input id="search" type="text" placeholder="Tab 键切换至搜索框 输入设置打开设置" tabindex="1">
<div id="keyboard">
<ul>
<li data-key="49"><span>1</span></li>
<li data-key="50"><span>2</span></li>
<li data-key="51"><span>3</span></li>
<li data-key="52"><span>4</span></li>
<li data-key="53"><span>5</span></li>
<li data-key="54"><span>6</span></li>
<li data-key="55"><span>7</span></li>
<li data-key="56"><span>8</span></li>
<li data-key="57"><span>9</span></li>
<li data-key="48"><span>0</span></li>
</ul>
<ul>
<li data-key="81"><span>Q</span></li>
<li data-key="87"><span>W</span></li>
<li data-key="69"><span>E</span></li>
<li data-key="82"><span>R</span></li>
<li data-key="84"><span>T</span></li>
<li data-key="89"><span>Y</span></li>
<li data-key="85"><span>U</span></li>
<li data-key="73"><span>I</span></li>
<li data-key="79"><span>O</span></li>
<li data-key="80"><span>P</span></li>
</ul>
<ul>
<li data-key="65"><span>A</span></li>
<li data-key="83"><span>S</span></li>
<li data-key="68"><span>D</span></li>
<li data-key="70"><span>F</span></li>
<li data-key="71"><span>G</span></li>
<li data-key="72"><span>H</span></li>
<li data-key="74"><span>J</span></li>
<li data-key="75"><span>K</span></li>
<li data-key="76"><span>L</span></li>
</ul>
<ul>
<li data-key="90"><span>Z</span></li>
<li data-key="88"><span>X</span></li>
<li data-key="67"><span>C</span></li>
<li data-key="86"><span>V</span></li>
<li data-key="66"><span>B</span></li>
<li data-key="78"><span>N</span></li>
<li data-key="77"><span>M</span></li>
</ul>
</div>
<div id="setting">
<div align="right"><span class="close">ㄨ</span></div>
<table>
<tr>
<td>新窗口打开网页</td>
<td><span id="newWindow" class="slideSwitch"></span></td>
</tr>
<tr>
<td>搜索引擎</td>
<td>
<select id="searchEngine">
<option value="https://www.google.com/search?q=">Google</option>
<option value="https://www.baidu.com/s?wd=">Baidu</option>
<option value="https://www.bing.com/search?q=">Bing</option>
</select>
</td>
</tr>
<tr>
<td>默认设置</td>
<td><input type="button" value="恢复" onclick="localStorage.clear() || location.reload()"></td>
</tr>
<tr>
<td colspan="2" style="text-align:center">鼠标点击按键即可设置对应网址</td>
</tr>
<tr>
<td colspan="2" style="text-align:center"><a href="https://huguotao.com">SCIOOGA</a><a> ∙ </a><a href="https://github.com/sciooga/Keyboard-launch">GITHUB</a></td>
</tr>
</table>
</div>
<script src="/main.js"></script>
</body>
</html>
================================================
FILE: web/main.css
================================================
body {
margin: 0;
padding: 0;
overflow: hidden;
background-color: #f2f2f2;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
font-family: Sans-serif;
}
/*-----------SEARCH-----------*/
#search {
height: 40px;
width: 500px;
font-size: 1em;
padding: 0 10px;
position: absolute;
top: 20%;
left: 50%;
margin-left: -250px;
box-sizing: border-box;
}
#search:focus {
outline: 1px solid #eee;
}
#search::-ms-input-placeholder {
text-align: center;
}
#search::-webkit-input-placeholder {
text-align: center;
}
/*-----------KEYBOARD-----------*/
#keyboard {
width: 860px;
position: absolute;
bottom: 20%;
left: 50%;
margin-left: -430px;
}
#keyboard ul {
padding: 0px;
margin: 16px;
height: 50px;
text-align: center;
display: block;
}
#keyboard ul li {
cursor: pointer;
position: relative;
display: inline-block;
margin: 0 4px;
height: 54px;
border-radius: 10px;
-webkit-box-shadow: inset 0 0 1px 0px #eee;
-moz-box-shadow: inset 0 0 1px 0px #eee;
box-shadow: inset 0 0 1px 0px #eee;
}
#keyboard ul span {
height: 16px;
width: 16px;
margin: 0px 2px;
padding: 16px 22px;
background: #999;
color: #333;
border-radius: 8px;
display: inline-block;
list-style: none;
border-top: 1px solid #fff;
background: #fff;
-webkit-box-shadow: inset 0 0 36px #ddd, 0 3px 0 #ddd, 0 4px 2px #666;
-moz-box-shadow: inset 0 0 36px #ddd, 0 3px 0 #ddd, 0 4px 2px #666;
box-shadow: inset 0 0 36px #ddd, 0 3px 0 #ddd, 0 4px 2px #666;
}
#keyboard ul li:hover, #keyboard ul li.keyDownLi {
margin: 0px 5px;
border-bottom: 3px solid #fff;
box-shadow: inset 0 0px 8px #333;
-moz-box-shadow: inset 0 0px 8px #333;
-webkit-box-shadow: inset 0 0px 8px #333;
}
#keyboard ul li:hover span, #keyboard ul li span.keyDownSpan {
padding: 15px 20px 16px;
margin: 1px 3px 0px;
border-top: 1px solid #fafafa;
-webkit-box-shadow: inset 0 0 28px 5px #d2d2d2;
-moz-box-shadow: inset 0 0 28px 5px #d2d2d2;
box-shadow: inset 0 0 28px 5px #d2d2d2;
-webkit-transform: scale(.98);
-moz-transform: scale(.98);
-o-transform: scale(.98);
}
.fav {
width: 16px;
height: 16px;
position: absolute;
left: 8px;
bottom: 8px;
opacity: .4;
}
/*-----------KEYBOARD-----------*/
#setting {
position: absolute;
bottom: -320px;
height: 320px;
width: 100%;
box-sizing: border-box;
padding: 20px 20%;
color: #666;
background: #fff;
box-shadow: 0 0 12px #ccc;
transition: bottom .3s;
}
#setting .slideSwitch {
display: inline-block;
vertical-align: bottom;
background: #e4e4e4;
height: 20px;
width: 38px;
border-radius: 10px;
cursor: pointer;
}
#setting .slideSwitch:after {
content: "";
display: block;
position: relative;
top: 2px;
left: 2px;
background: #fff;
height: 16px;
width: 16px;
border-radius: 8px;
transition: all .2s;
box-shadow: 0 2px 1px rgba(0,0,0,0.4);
}
#setting .slideSwitch.active {
background: #4bd863;
}
#setting .slideSwitch.active:after {
left: 20px;
}
#setting .close {
display: inline-block;
text-align: center;
border: 1px solid #ccc;
line-height: 40px;
height: 40px;
width: 40px;
border-radius: 40px;
cursor: pointer;
}
#setting .close:hover {
border: 1px solid #999;
color: #222;
}
#setting table {
width: 100%;
}
#setting table td {
width: 50%;
padding: 10px 22px;
}
#setting table td:first-child {
text-align: right;
}
#setting a {
font-size: 12px;
color: #999;
text-decoration: none;
}
================================================
FILE: web/main.js
================================================
;(function() {
var version = '1.0.0',
keys = {},
$search = document.querySelector('#search'),
$keyboard = document.querySelector('#keyboard'),
$keys = document.querySelectorAll('#keyboard li'),
$setting = document.querySelector('#setting'),
$close = document.querySelector('.close'),
$newWindow = document.querySelector('#newWindow'),
$searchEngine = document.querySelector('#searchEngine')
// init
if (localStorage.version != version) {
localStorage.version = version
localStorage.newWindow = 0
localStorage.searchEngine = 'https://www.baidu.com/s?wd='
localStorage[67] = 'https://www.coding.net'
localStorage[72] = 'https://huguotao.com'
localStorage[84] = 'https://www.taobao.com'
localStorage[86] = 'https://www.v2ex.com'
localStorage[87] = 'https://www.weibo.com'
}
for (var i in $keys) {
if (!$keys.hasOwnProperty(i)) continue
keys[$keys[i].dataset.key] = {
'li': $keys[i],
'span': $keys[i].firstElementChild
}
}
// set favicon
for (var i = 48; i < 91; i++) {
var url = localStorage[i]
if (url) addFavicon(keys[i]['li'], getFavicon(url))
}
// read settings
if (~~localStorage.newWindow) {
$newWindow.classList.add('active')
} else {
$newWindow.classList.remove('active')
}
$searchEngine.value = localStorage.searchEngine
function getFavicon(url) {
return url.split('/').slice(0,3).join('/') + "/favicon.ico"
}
function addFavicon($li, src) {
var img = document.createElement('img')
img.src = src
img.className = 'fav'
$li.appendChild(img)
}
function keyDown(key) {
if (!key) return
keys[key]['span'].classList.add('keyDownSpan')
keys[key]['li'].classList.add('keyDownLi')
}
function keyUp(key) {
if (!key) return
keys[key]['span'].classList.remove('keyDownSpan')
keys[key]['li'].classList.remove('keyDownLi')
}
function openUrl(url) {
if (~~localStorage.newWindow) {
window.open(url)
} else {
location.href = url
}
}
$search.onkeyup = function(e) {
if (e.target.value == '设置') return $setting.style.bottom = 0
var key = e.which || e.keyCode || 0;
if (key == 13) openUrl(localStorage.searchEngine + e.target.value)
}
$close.onclick = function() {
$setting.style.bottom = '-320px'
}
var keyCache = 0
document.onkeydown = function(e) {
var key = e.which || e.keyCode || 0
keyCache = key
if (key == 9) {
window.event ? window.event.returnValue = false : e.preventDefault()
if (document.activeElement == $search) {
$search.blur()
} else {
$search.focus()
}
}
keyDown(key)
}
document.onkeyup = function(e) {
var key = e.which || e.keyCode || 0,
url = localStorage[key]
keyUp(key)
if (url && key == keyCache && document.activeElement != $search) openUrl(url)
keyCache = 0
}
$keyboard.onclick = function(e) {
if (e.target.tagName != 'SPAN') return
var name = e.target.innerText,
key = e.target.parentElement.dataset.key || 0,
url = prompt("请输入按键 " + name + " 对应的网址", localStorage[key] || '')
if (url === null) return
if (url && url.indexOf('http') != 0) url = 'http://' + url
localStorage[key] = url
location.reload()
}
$newWindow.onclick = function() {
this.classList.toggle('active')
localStorage.newWindow = +!!!~~localStorage.newWindow
}
$searchEngine.onchange = function(e) {
localStorage.searchEngine = e.target.value
}
})()
gitextract_nid99y7k/
├── LICENSE
├── README.md
└── web/
├── index.html
├── main.css
└── main.js
SYMBOL INDEX (5 symbols across 1 files)
FILE: web/main.js
function getFavicon (line 47) | function getFavicon(url) {
function addFavicon (line 51) | function addFavicon($li, src) {
function keyDown (line 58) | function keyDown(key) {
function keyUp (line 64) | function keyUp(key) {
function openUrl (line 70) | function openUrl(url) {
Condensed preview — 5 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (14K chars).
[
{
"path": "LICENSE",
"chars": 1057,
"preview": "MIT License\n\nCopyright (c) 2017 \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this s"
},
{
"path": "README.md",
"chars": 288,
"preview": "# Keyboard-launch\nSimple and useful, one key to launch, so beautiful.\n\n简单与实用,一键直达,很是优雅。\n\nhttp://i.huguotao.com\n\n感谢 [ldon"
},
{
"path": "web/index.html",
"chars": 3513,
"preview": "<!DOCTYPE html>\n<html lang=\"zh-Hans-CN\">\n <head>\n <meta charset=\"UTF-8\">\n <link rel=\"stylesheet\" type=\""
},
{
"path": "web/main.css",
"chars": 3795,
"preview": "body {\n margin: 0;\n padding: 0;\n overflow: hidden;\n background-color: #f2f2f2;\n\n -webkit-user-select: non"
},
{
"path": "web/main.js",
"chars": 3948,
"preview": ";(function() {\n var version = '1.0.0',\n keys = {},\n $search = document.querySelector('#search'),\n "
}
]
About this extraction
This page contains the full source code of the sciooga/Keyboard-launch GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 5 files (12.3 KB), approximately 3.8k tokens, and a symbol index with 5 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.