Skip to content

Instantly share code, notes, and snippets.

View unrealapex's full-sized avatar
🏳️‍⚧️
trans rights are human rights!

Erin unrealapex

🏳️‍⚧️
trans rights are human rights!
View GitHub Profile
<head>
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- jQuery ui -->
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
</head>
var hours = 12;
var suffix = hours <= 12 ? "PM" : "AM";
hours = ((hours + 11) % 12 + 1) + suffix;
console.log(hours);
var randomHexColor = () => "#" + Math.floor(Math.random()*16777215).toString(16);
// taken from here: https://developer.mozilla.org/en-US/docs/Web/API/Document/activeElement
function onMouseUp(e) {
const activeTextarea = document.activeElement;
const selection = activeTextarea.value.substring(
activeTextarea.selectionStart, activeTextarea.selectionEnd
);
}
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
// taken from Stack Overflow: https://stackoverflow.com/a/63695199/14111707
document.addEventListener("visibilitychange", (event) => {
if (document.visibilityState == "visible") {
console.log("tab is active")
} else {
console.log("tab is inactive")
}
});
/* The rgb gradient found in sections of the Steam Deck website: https://www.steamdeck.com/en/
https://www.steamdeck.com/public/css/global.css?v=OKFbGyMfa7Jk&_cdn=cloudflare */
.gradient {
background: linear-gradient(137.42deg, #1a75ff, #6a5df8, #c957e6, #d2486b, #bf44ac, #ab47d0, #9460f3, #46aced, #4ec4a3, #b8ba05, #d2486b);
background-size: 2200% 2200%;
-webkit-animation: DeckGradient 60s ease infinite;
-moz-animation: DeckGradient 60s ease infinite;
animation: DeckGradient 60s ease infinite;
}
<!-- code taken from here: https://css-tricks.com/emoji-as-a-favicon/ -->
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>🎯</text></svg>">
return string.split(/\s+/).length;