This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Github PR checklist | |
// @namespace ClearPoint Strategy | |
// @version 1.0 | |
// @description PR checklist | |
// @author Ian Gornall | |
// @match https://github.com/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let drag = document.querySelector('.drag'); | |
drag.ondragstart = event => { | |
event.dataTransfer.setData("dragElement", event.currentTarget); | |
event.effectAllowed = "copyMove"; | |
} | |
let dropElements = document.querySelectorAll('.drop'); | |
for (let dropElement of dropElements){ | |
dropElement.ondrop = event => { | |
console.log(event.dataTransfer.getData("dragElement")); | |
dropElement.appendChild(drag); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
coverElement.addEventListener('click', () => { | |
if (event.currentTarget === event.target) { | |
coverElement.classList.add('hide'); | |
modalElement.classList.add('hide'); | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.cover { | |
position: absolute; | |
top: 0; | |
left: 0; | |
width: 100%; | |
height: 100%; | |
background: #000; | |
opacity: 0.7; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.element { | |
opacity: 1; | |
transition: opacity 300ms; | |
} | |
.hide { | |
opacity: 0; | |
pointer-events: none; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.element { | |
opacity: 1; | |
transition: opacity 300ms; | |
} | |
.hide { | |
opacity: 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var showModal = function(i) { | |
... | |
modalContainers[i].classList.add('show'); | |
... | |
} | |
var showLastModal = function() { | |
hideModal(); | |
showModal((gummiData.length + currentI - 1) % gummiData.length); | |
} | |
var showNextModal = function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cover.addEventListener('click', () => { | |
if (event.target == event.currentTarget){ | |
hideCard(); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gummiData = [{likes: 1, | |
comments: ['this', 'that', 'another'], | |
caption: 'Gummi Bins', | |
url: 'https://someimagesite.com/someimage.png'}, {another...}, ...] |
NewerOlder