Skip to content

Instantly share code, notes, and snippets.

;(function() {
const elems = document.querySelectorAll('[data-tooltip]')
const tip = document.createElement('div')
tip.classList.add('tooltip')
document.body.append(tip)
const mouseMove = (e) => {
let { clientX, clientY } = e
let current
elems.forEach(elem => {
;(function() {
const baseToggle = (target, fn = () => {}) => {
let button = target.closest('[data-tggl-button]')
if (!button) return
let hideClass = button.getAttribute('data-tggl-button') || 'hide'
let parent = button.closest('[data-tggl-parent]')
if (!parent) return
let items = parent.querySelectorAll('[data-tggl-item]')
window.onkeydown = function(e) {
if (e.keyCode == 27) {
var focused = document.activeElement;
if (focused.tagName == 'INPUT' || focused.tagName == 'TEXTAREA') {
focused['blur']()
}
}
}
git reset --soft HEAD^
const isMobile = {
android: () => navigator.userAgent.match(/Android/i),
blackberry: () => navigator.userAgent.match(/BlackBerry/i),
ios: () => navigator.userAgent.match(/iPhone|iPad|iPod/i),
opera: () => navigator.userAgent.match(/Opera Mini/i),
windows: () => navigator.userAgent.match(/IEMobile/i),
any: () => (
isMobile.android() ||
isMobile.blackberry() ||
isMobile.ios() ||
$gridPad: 20px
$gridColLen: 12
.g-row
display: flex
flex-wrap: wrap
width: calc(100% + #{$gridPad})
margin-left: -#{$gridPad / 2}
margin-right: -#{$gridPad / 2}
.g-col
@StrongerMyself
StrongerMyself / machine.js
Last active August 2, 2023 15:57
Generated by XState Viz: https://xstate.js.org/viz
const release = Machine( {
id: "release",
initial: "start",
context: {
level: "patch",
tag: "0.0.1",
fixVersion: "SSR_release_v0.0.1",
},
states: {
start: {