mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2025-01-06 21:49:40 +02:00
Clean-up
This commit is contained in:
parent
ac6af2a4df
commit
bd7087a528
@ -42,7 +42,6 @@ p {
|
||||
max-height: 480px;
|
||||
overflow-x: hidden;
|
||||
overflow-y: scroll;
|
||||
/* padding-top: 60px; */
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
@ -67,9 +66,6 @@ p {
|
||||
border: 2px solid #0fbfcf;
|
||||
color: #0fbfcf !important;
|
||||
cursor: pointer;
|
||||
/* border-top: none; */
|
||||
/* border-top-left-radius: unset; */
|
||||
/* border-top-right-radius: unset; */
|
||||
}
|
||||
|
||||
#main .nerd-font-cheat-sheet .column:hover .codepoint {
|
||||
@ -120,22 +116,6 @@ p {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
|
||||
/* #main .nerd-font-cheat-sheet .glyph-popout-copy-clipboard {
|
||||
background: #585547;
|
||||
border: 2px solid #0fbfcf;
|
||||
border-bottom: none;
|
||||
display: block;
|
||||
position: absolute;
|
||||
bottom: 144px;
|
||||
border-top-right-radius: 5px;
|
||||
border-top-left-radius: 5px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
left: -2px;
|
||||
right: -2px;
|
||||
} */
|
||||
|
||||
#main .nerd-font-cheat-sheet .glyph-popout-copy-clipboard {
|
||||
background: #585547;
|
||||
border: 2px solid #0fbfcf;
|
||||
@ -150,9 +130,6 @@ p {
|
||||
}
|
||||
|
||||
#main .nerd-font-cheat-sheet span.glyph-popout-copy-clipboard span {
|
||||
/* font-size: 12px;
|
||||
font-weight: bold;
|
||||
display: block; */
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
display: block;
|
||||
@ -180,12 +157,6 @@ p {
|
||||
}
|
||||
|
||||
#main .nerd-font-cheat-sheet span.glyph-popout-copy-clipboard span:not(:first-child):hover {
|
||||
/* background: #767260;
|
||||
text-decoration: underline;
|
||||
border-radius: 2px;
|
||||
border-style: dashed;
|
||||
border-color: #0fbfcf;
|
||||
border-width: 2px; */
|
||||
background: #767260;
|
||||
text-decoration: underline;
|
||||
border-radius: 2px;
|
||||
@ -195,7 +166,6 @@ p {
|
||||
}
|
||||
|
||||
/* gitter chat tweaks */
|
||||
|
||||
.gitter-open-chat-button {
|
||||
border-color: white;
|
||||
border-width: 1px 1px 0px 1px;
|
||||
|
@ -15262,6 +15262,4 @@ page: cheat-sheet
|
||||
{% endhighlight %}
|
||||
<span class="nerd-fonts-example-usage">
|
||||
I really <i class="nf nf-fa-heart ow"></i> <i class="nf nf-custom-vim nfunc"></i>
|
||||
</div>
|
||||
|
||||
<!-- <div id="glyphCheatSheetCopyFrom"></div> -->
|
||||
</div>
|
59
site.js
59
site.js
@ -240,61 +240,6 @@ $(document).ready(function (){
|
||||
}
|
||||
}
|
||||
|
||||
/* document.getElementById('glyphCheatSheet').addEventListener('mouseover', function (event) {
|
||||
const target = event.target
|
||||
if (target.matches('.column') && target.children.length > 2 && !target.contains(target.querySelector('.glyph-popout-copy-clipboard'))) {
|
||||
console.log(target.value);
|
||||
const className = target.children[1].innerText;
|
||||
const codePoint = target.children[2].innerText;
|
||||
const unicodeChar = target.children[0].dataset.content && target.children[0].dataset.content.charAt(0);
|
||||
console.log('class', className, 'codepoint', codePoint, 'unicodeChar', unicodeChar);
|
||||
document.getElementById('glyphCheatSheetCopyFrom').innerText = className;
|
||||
|
||||
const newNode = document.createElement('span');
|
||||
const copyClassNode = document.createElement('span');
|
||||
const copyCodePoint = document.createElement('span');
|
||||
newNode.className = 'glyph-popout-copy-clipboard';
|
||||
copyClassNode.innerText = 'Copy Class';
|
||||
copyCodePoint.innerText = 'Copy Hex';
|
||||
newNode.appendChild(copyClassNode);
|
||||
newNode.appendChild(copyCodePoint);
|
||||
target.children[0].before(newNode);
|
||||
// copyToClipboard('foooo');
|
||||
//document.getElementById('glyphCheatSheet').insertBefore(newNode, target);
|
||||
}
|
||||
}); */
|
||||
|
||||
/* document.getElementById('glyphCheatSheet').addEventListener('click', function (event) {
|
||||
console.log('clicked');
|
||||
copyToClipboard('foooo copied');
|
||||
}); */
|
||||
|
||||
/* document.getElementById('glyphCheatSheet').addEventListener('mouseout', function (event) {
|
||||
const target = event.target;
|
||||
const e = event.toElement || event.relatedTarget;
|
||||
const isOriginalNodeEvent = e.parentNode == this || e == this; // avoid removal on child elements
|
||||
const doesToElementContainOriginalNode = e.contains(this);
|
||||
// no need to capture 'this' > it is always the #glyphCheatSheet
|
||||
console.log('mouse out', 'target', target, 'toElement', event.toElement, 'relatedTarget', event.relatedTarget);
|
||||
console.log('isOriginal', isOriginalNodeEvent, 'doesContain', doesToElementContainOriginalNode);
|
||||
console.log('target matches column', target.matches('.column'));
|
||||
if (isOriginalNodeEvent || doesToElementContainOriginalNode) {
|
||||
if (target.matches('.column')) {
|
||||
console.log('is .column');
|
||||
//target.querySelectorAll('.glyph-popout-copy-clipboard').forEach(el => el.remove()); // @TODO fix reliance on querySelectorAll and use of forEach
|
||||
target.querySelector('.glyph-popout-copy-clipboard').remove();
|
||||
}
|
||||
else if (target.parentNode.matches('.column') && target.parentNode.querySelector('.glyph-popout-copy-clipboard')) {
|
||||
console.log('is parent .column');
|
||||
target.parentNode.querySelector('.glyph-popout-copy-clipboard').remove();
|
||||
}
|
||||
else {
|
||||
console.log('is NOT original event', 'this', this, 'e', e, 'e.parentNode', e.parentNode);
|
||||
}
|
||||
}
|
||||
});
|
||||
*/
|
||||
|
||||
document.getElementById('glyphCheatSheet').addEventListener("mouseenter", function(e) {
|
||||
if(e.target.className === "column") {
|
||||
console.log("entered column");
|
||||
@ -341,15 +286,11 @@ $(document).ready(function (){
|
||||
textToCopy = event.target.parentNode.parentNode.querySelector('.codepoint').innerText;
|
||||
}
|
||||
else if (event.target.className === 'copy-glyph') {
|
||||
// console.log('copy glyph', event.target.parentNode.parentNode.querySelector('.nf'), event.target.parentNode.parentNode.querySelector('.nf').innerHTML);
|
||||
// textToCopy = event.target.parentNode.parentNode.querySelector('.nf').innerHTML;
|
||||
textToCopy = window.getComputedStyle(
|
||||
document.querySelector(`.${event.target.parentNode.parentNode.querySelector('.class-name').innerText}`), ':before'
|
||||
).getPropertyValue('content').replace(/"/g,'');
|
||||
}
|
||||
copyToClipboard(textToCopy);
|
||||
// console.log('clicked');
|
||||
// copyToClipboard('foooo copied');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user