Skip to content

Instantly share code, notes, and snippets.

View SSShooter's full-sized avatar
👓
JavaScripting

DJJo SSShooter

👓
JavaScripting
View GitHub Profile
@SSShooter
SSShooter / money-input.vue
Last active November 17, 2019 03:48
money-input
<template>
<div>
<input @input="handleInput"
@blur="handleChange"
@change="handleChange"
@focus="handleFocus"
v-model="val" />
{{val}}
{{origin}}
</div>
@SSShooter
SSShooter / selectNCopy.js
Created October 8, 2019 06:25
selectNCopy extremly convenient
document.addEventListener('mouseup',e=>{
let select = window.getSelection().toString()
document.addEventListener('copy',e=>{
e.clipboardData.setData('text', select);
},{once:true})
document.execCommand("copy")
})
document.addEventListener('scroll',e=>{
let list = Array.from(document.querySelectorAll('h2,h3,h4,h5,h6'))
for(item of list){
let top = item.getBoundingClientRect().top
let bottom = item.getBoundingClientRect().bottom
if(top < 0 && bottom > 0){
console.log(top,bottom,item,'here')
}
}
})
@SSShooter
SSShooter / utatenCopy.js
Created March 28, 2019 09:35
now you can copy lyric in utaten
(function() { function R(a){ona = "on"+a; if(window.addEventListener) window.addEventListener(a, function (e) { for(var n=e.originalTarget; n; n=n.parentNode) n[ona]=null; }, true); window[ona]=null; document[ona]=null; if(document.body) document.body[ona]=null; } R("contextmenu"); R("click"); R("mousedown"); R("mouseup"); R("selectstart");
document.body.contentEditable='true';
var sheet = document.createElement('style')
sheet.innerHTML = ".rt {display:none !important;}";
document.body.appendChild(sheet);})()
function getParams(){
let query = location.search
query = query.slice(1)
let params = {}
query.split('&').map(val => {
let temp = val.split('=')
params[temp[0]] = decodeURI(temp[1])
})
return params
}
@SSShooter
SSShooter / setting.json
Last active November 5, 2018 06:03
vscode setting
{
"prettier.semi": false,
"prettier.singleQuote": true,
"git.autofetch": true,
"javascript.implicitProjectConfig.experimentalDecorators": true,
"html.format.wrapAttributes": "force",
"vetur.format.defaultFormatter.html": "js-beautify-html",
"editor.tabSize": 2,
"files.eol": "\n",
"vetur.format.defaultFormatterOptions": {