Skip to content

Instantly share code, notes, and snippets.

View jdanyow's full-sized avatar
💭
Confirming my whereabouts

Jeremy Danyow jdanyow

💭
Confirming my whereabouts
View GitHub Profile
@jdanyow
jdanyow / form-behavior-element.ts
Last active May 10, 2021 22:32
<form-behavior> custom element example
import {
isValueElement,
normalizeInputValue,
toggleSubmitButtons
} from './form-utilities';
import {
clearValidationErrors,
displayServerValidationError,
validateForm
} from './form-validation';
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="https://unpkg.com/@primer/css@16.3.0/dist/primer.css" />
<style>
@media screen and (min-width: 560px) {
.productivity-layout {
import escape_html from 'escape-html';
export class TemplateResult {
constructor(
public readonly strings: TemplateStringsArray,
public readonly values: any[]
) {}
}
export function html(strings: TemplateStringsArray, ...values: any[]) {
@jdanyow
jdanyow / index.html
Created March 31, 2021 22:26
Duration formatting
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Hello world!</h1>
<pre id="outputPre"></pre>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<h1>Hello world!</h1>
<script>
@jdanyow
jdanyow / index.html
Last active February 6, 2021 21:01
color-scheme breaks iframe transparency
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- this breaks iframe transparency: -->
<meta name="color-scheme" content="light dark">
<!-- remove the line above and the iframe background becomes transparent as expected -->
<title>Demo</title>
@jdanyow
jdanyow / index.html
Created January 29, 2021 15:54
Stacks Editor
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Stacks Editor</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@stackoverflow/stacks@0.59.0/dist/css/stacks.min.css" integrity="sha256-nM5uyfIHDQ7kqN0TD0xRZKZ86IKqK4unu1hS7YuedNo=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@stackoverflow/stacks-editor@0.1.1/dist/styles.css" integrity="sha256-FCWPuq+Y8jQfi1k/YibDWTBHCZ5a7dQx78VwJrHsJzI=" crossorigin="anonymous">
</head>
<body>
<div id="editor-container"></div>
@jdanyow
jdanyow / index.html
Last active January 25, 2021 16:41
color-scheme demo
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello world</title>
<!-- site's preferred scheme first -->
<meta name="color-scheme" content="dark light">
@jdanyow
jdanyow / index.html
Last active January 17, 2021 03:42
Variable button/background colors
<!--
This is an experiment where adding a new brand color or semantic color is only
a matter of adding a class that assigns r,g,b variables:
.color-brand-office {
--r: 216;
--g: 59;
--b: 1;
}
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<style>
:root {
--lightness-threshold: 0.6;
--text: #000;