Skip to content

Instantly share code, notes, and snippets.

@edjw
edjw / main.js
Last active April 18, 2024 14:57
Laracasts Theatre Mode
// Laracasts Theatre Mode: Add YouTube style tap 'T' for toggle theatre mode
// https://github.com/uzairfarooq/arrive
// prettier-ignore
const Arrive = function (e, t, n) { "use strict"; function r(e, t, n) { l.addMethod(t, n, e.unbindEvent), l.addMethod(t, n, e.unbindEventWithSelectorOrCallback), l.addMethod(t, n, e.unbindEventWithSelectorAndCallback) } function i(e) { e.arrive = f.bindEvent, r(f, e, "unbindArrive"), e.leave = d.bindEvent, r(d, e, "unbindLeave") } if (e.MutationObserver && "undefined" != typeof HTMLElement) { var o = 0, l = function () { var t = HTMLElement.prototype.matches || HTMLElement.prototype.webkitMatchesSelector || HTMLElement.prototype.mozMatchesSelector || HTMLElement.prototype.msMatchesSelector; return { matchesSelector: function (e, n) { return e instanceof HTMLElement && t.call(e, n) }, addMethod: function (e, t, r) { var i = e[t]; e[t] = function () { return r.length == arguments.length ? r.apply(this, arguments) : "function" == typeof i ? i.apply(this, arguments) : n } }, ca
@edjw
edjw / css-naked-day.js
Created April 8, 2024 13:12
CSS Naked Day JS
const styleElements = document.querySelectorAll(
'link[rel="stylesheet"], style'
);
const inlineStyleElements = document.querySelectorAll("[style]");
for (const styleElement of styleElements) {
if (styleElement.parentNode) {
styleElement.parentNode.removeChild(styleElement);
}
}
@edjw
edjw / stmungos-doors.html
Last active November 28, 2023 20:20
stmungos-doors
<style type="text/css">
section#main::before {
background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
url("https://action.mungos.org/sites/stmungos/files/styles/full/public/christmas-background.jpg");
background-repeat: no-repeat;
background-size: cover;
content: "";
position: fixed; /* Fix position to cover whole area */
top: 0;
left: 0;
@edjw
edjw / fundraising-box-medeor-2023
Last active December 1, 2023 15:28
fundraising-box-medeor-nov-2023
// Also this in on-page CSS
// @keyframes fadeIn {
// 0% {opacity: 0;}
// 100% {opacity: 1;}
// }
// .fade-in {
// animation: fadeIn 1s;
// }
@edjw
edjw / ist-html-gist.html
Last active August 25, 2023 10:59
ist-html-gist
<p>hello from github html gist saved in gistpad</p>
@edjw
edjw / ist-js-gist.js
Last active August 25, 2023 10:35
ist-js-gist
console.log("hello from a github gist");
const title = document.querySelector(`h1#page-title`);
// Function to get the current time in HH:MM:SS format
function getCurrentTime() {
const now = new Date();
const hours = String(now.getHours()).padStart(2, '0');
const minutes = String(now.getMinutes()).padStart(2, '0');
const seconds = String(now.getSeconds()).padStart(2, '0');
return `${hours}:${minutes}:${seconds}`;
@edjw
edjw / ist-css-gist.css
Last active August 25, 2023 10:36
ist-css-gist
body {
background-color: salmon;
}
@edjw
edjw / load-github-gists.html
Last active August 29, 2023 13:25
load-github-gists
<script>
/**
* A script to fetch and apply JS and CSS from GitHub gists and GitLab snippets.
* Use with the Gistpad extension in VS Code for easy updating:
* https://marketplace.visualstudio.com/items?itemName=vsls-contrib.gistfs
*
* Note: For GitLab, it's likely the content fetch will fail due to CORS restrictions.
* With GitHub, rate limiting can be strict unless the gist is public.
*
* For html gists, specify the target using the html selector of an element on your page.
@edjw
edjw / iraiser_styles.css
Last active August 29, 2023 13:23
iraiser styles
/* Layout */
#type-b.arya.loaded #container {
display: flex !important;
flex-direction: column !important;
flex-wrap: wrap !important;
align-content: center !important;
}
#type-b.arya #container #main {
@edjw
edjw / iraiser_script.js
Last active September 4, 2023 14:20
iraiser script
$(document).ready(function () {
function getQueryParams() {
const params = new URLSearchParams(window.location.search);
return {
interval: params.get("interval"),
amount: params.get("amount"),
};
}
const params = getQueryParams();