- Oct 2024
-
alexwlchan.net alexwlchan.net
-
For a long time, I thought of HTML as a tool for publishing on the web, a way to create websites that other people can look at. But all these websites I’m creating are my local, personal archives – just for me. I’m surprised it took me this long to realise HTML isn’t just for sharing on the web.
Yes. I use lots of small local html/php pages. Also webforms to search websites elsewhere, without going there. I had local pages to browse local image files in the 90s. I started writing html by hand in '93 and still do for local stuff. I do use a local on-device webserver though, as I include php.
-
https://web.archive.org/web/20241017043750/https://alexwlchan.net/2024/static-websites/
I like this idea of having static html as page to explore folders, I had that in the 90s to better search for image files. Author offers no clues as to how he uses the affordance it provides though, in terms of 'showing the metadata' they care for and the little bits of extra functionality. And I wonder about the effort involved when adding new files. Presumably new files are added manually too, otherwise it's not 'static html'. Stores files by year, type and first letter of file name. That makes no immediate sense to me in terms of finding things back. Then again I never understood why you would have folders for file types. It's like sorting items on the type of box it came in. Good example though of making your computer your own.
Tags
Annotators
URL
-
- Jul 2024
-
css-tricks.com css-tricks.com
-
For some reason, Microsoft decided to use the MS Word HTML rendering engine in Outlook 2007 to 2013 (desktop version) – this was even worse than the IE5/IE6 rendering engine which I believe was used in Outlook 2000, 2002 and 2003! As most large corporate businesses force their staff to use a version of desktop Outlook that hasn’t been updated in years, email is stuck in this hell of being held back in worse-than-IE6 web.
-
- Jun 2024
-
www.phpclasses.org www.phpclasses.org
-
-
This package can convert files between different document formats.
-
It provides several classes that can take files from one document format to another document format.
-
Currently, it can convert document files between:
-
Microsoft Excel to PDF
-
HTML to PDF
-
Image to PDF
-
Markdown to PDF
-
PDF to Microsoft Excel
-
PDF to HTML
-
PDF to Image
-
PDF to Markdown
-
PDF to RTF
-
PDF to Text
-
PDF Word
-
RTF to PDF
-
Text to PDF
-
-
- Apr 2024
-
html.spec.whatwg.org html.spec.whatwg.org
-
An example of the latter would be something like keeping track of the precise coordinate from which a popup div was made to animate, so that if the user goes back, it can be made to animate to the same location. Or alternatively, it could be used to keep a pointer into a cache of data that would be fetched from the server based on the information in the URL, so that when going back and forward, the information doesn't have to be fetched again.
"7.4.1.1 Session history entries" doesn't mention whether focus is saved, only scroll has dedicated "attributes" in a history entry, but what this paragraph seems to allude to is that focus can be saved too (and indeed it can).
(See
pushState
.)
-
- Nov 2023
-
devpractical.com devpractical.com
-
Autor wymienia 10 stron, przygotowanych w prostym języku HTML bez większego stylowania czy skryptowania.
Te 10 stron to: 1. First HTML Website(The WWW project) http://info.cern.ch/hypertext/WWW/TheProject.html 2. Berkshire Hathaway Inc. https://www.berkshirehathaway.com/ 3. X.COM http://x.com 4. The mother**website.com http://motherfuckingwebsite.com/ 5. Toad.com http://www.toad.com/ 6. Fluffbucket http://www.fluffbucket.co.uk/howto/htmlonlypg.htm 7.ACME Laboratories https://acme.com 8. Txti http://txti.es/ 9. Simplified Web Design https://jgthms.com/web-design-in-4-minutes/ 10. Personal Blog https://fatih-erikli.com
Nie wszystkie strony są aktywne czy warte uwagi. Według mnie warto zwrócić tylko na dwie z nich: - https://motherfuckingwebsite.com/ - https://jgthms.com/web-design-in-4-minutes/
-
-
www.theodinproject.com www.theodinproject.com
-
Validations allow us to set specific constraints or rules that determine what data users can enter into an input. When a user enters data that breaks the rules, a message will appear, providing feedback on what was wrong with the entered data and how to fix it.
HTML forms have an internal validation mechanism.
-
-
-
✅ We can actually use a neat trick which basically consists in making a CSS grid with a single grid item. All we really have to do then, is taking our grid-template-rows and make it transition from 0fr to 1fr: this way, our grid item will transition from 0 to its "natural" height. It's THAT simple:
```css .accordion - body { display: grid; grid - template - rows: 0 fr; transition: 250 ms grid - template - rows ease; }
.accordion: hover.accordion - body { grid - template - rows: 1 fr; }
.accordion - body>div { overflow: hidden; } ```
-
-
developer.mozilla.org developer.mozilla.org
-
Las acciones que se pueden realizar dentro de un formulario son definidas como form controls. El número de acciones es bastante grande y vale la pena revisar todas las posibilidades.
-
-
css-tricks.com css-tricks.com
-
I’m sure you can imagine, the ability to shift an element around based on its regular position is pretty useful. I find myself using this to line up form elements many times that have a tendency to not want to line up how I want them to.
-
-
gregorlove.com gregorlove.com
-
Tags
Annotators
URL
-
-
meyerweb.com meyerweb.com
-
I don't particularly recommend that you just use this in its unaltered state in your own projects. It should be tweaked, edited, extended, and otherwise tuned to match your specific reset baseline.
Aún cuando se trata de un reseteo completo de estilo CSS, proponentes de este método como es the Meyer's Reset recomiendan sobreescribir partes del reseteo con las preferencias personales del diseñador. Esto quiere decir que un reseteo no debe ser un reseteo en blanco, sino un reseteo hacia el estándar o base que el diseñador prefiera.
Tags
Annotators
URL
-
-
pencilandpaper.io pencilandpaper.io
-
Hay una serie de buenas prácticas en la fabricación de tablas que permiten una interacción más eficiente entre el usuario y la data que se busca comunicar. Una buena experiencia entre el usuario y las tablas dentro de una página web dependen en suma del diseño establecido. La fabricación de buenas tablas en la web solo requieren de conocimientos de HTML y CSS.
-
-
developer.mozilla.org developer.mozilla.org
-
To give you some interesting examples, in the case of a long table you could make the table header and footer repeat on every printed page, and you could make the table body display on a single page and have the contents available by scrolling up and down.
Las etiquetas
<thead>
,<tbody>
, and<tfoot>
proveen a las tablas HTML una fuerte capacidad de personalización a través de selectores CSS.
-
-
alan.norbauer.com alan.norbauer.com
Tags
Annotators
URL
-
-
developer.mozilla.org developer.mozilla.org
- Oct 2023
-
open-ui.org open-ui.orgHome1
Tags
Annotators
URL
-
-
developer.chrome.com developer.chrome.com
-
Now, you can add <hr> (horizontal rule) elements into the list of select options and they will appear as separators to help visually break up the options
<div itemscope itemtype="http://schema.org/Code"> ```html <label for="major-select">Please select a major:</label> <br/> <select name="majors" id="major-select"> <option value="">Select a major</option>
<option value="arth">Art History</option> <option value="finearts">Fine Arts</option> <option value="gdes">Graphic Design</option> <option value="lit">Literature</option> <option value="music">Music</option>
<option value="aeroeng">Aerospace Engineering</option> <option value="biochemeng">Biochemical Engineering</option> <option value="civileng">Civil Engineering</option> <option value="compeng">Computer Engineering</option> <option value="eleng">Electrical Engineering</option> <option value="mecheng">Mechanical Engineering</option> </select> ``` </div>
Tags
Annotators
URL
-
-
research.securitum.com research.securitum.com
-
www.w3.org www.w3.org
-
www.sitepoint.com www.sitepoint.com
Tags
Annotators
URL
-
-
pugjs.org pugjs.org
Tags
Annotators
URL
-
-
spec.commonmark.org spec.commonmark.org
-
commonmark.org commonmark.org
-
Tags
Annotators
URL
-
-
markdoc.dev markdoc.dev
-
-
-
- Sep 2023
-
docutils.sourceforge.io docutils.sourceforge.io
-
docutils.sourceforge.io docutils.sourceforge.io
-
docutils.sourceforge.io docutils.sourceforge.io
-
twitter.com twitter.com
-
Did you know you can now use streaming promises in SvelteKit? No need to import anything - it just works out of the box
Every property of an object returned by the
load
function can be a promise which itself can return an object that can have a promise as property, and so on.Can build a tree of promises based on data delivery priority.
-
- Aug 2023
-
Tags
Annotators
URL
-
-
web-platform-tests.org web-platform-tests.org
Tags
Annotators
URL
-
-
blog.logrocket.com blog.logrocket.com
-
kit.svelte.dev kit.svelte.dev
-
```js // CSP svelte.config.js
/* @type {import('@sveltejs/kit').Config} / const config = { kit: { csp: { directives: { 'script-src': ['self'] }, reportOnly: { 'script-src': ['self'] } } } };
export default config; ```
-
-
-
```js // Create a portal with the wikipedia page, and embed it // (like an iframe). You can also use the <portal> tag instead. portal = document.createElement('portal'); portal.src = 'https://en.wikipedia.org/wiki/World_Wide_Web'; portal.style = '...'; document.body.appendChild(portal);
// When the user touches the preview (embedded portal): // do fancy animation, e.g. expand … // and finish by doing the actual transition. // For the sake of simplicity, this snippet will navigate // on the
onload
event of the Portals element. portal.addEventListener('load', (evt) => { portal.activate(); });// Adding some styles with transitions const style = document.createElement('style'); style.innerHTML =
portal { position:fixed; width: 100%; height: 100%; opacity: 0; box-shadow: 0 0 20px 10px #999; transform: scale(0.4); transform-origin: bottom left; bottom: 20px; left: 20px; animation-name: fade-in; animation-duration: 1s; animation-delay: 2s; animation-fill-mode: forwards; } .portal-transition { transition: transform 0.4s; } @media (prefers-reduced-motion: reduce) { .portal-transition { transition: transform 0.001s; } } .portal-reveal { transform: scale(1.0) translateX(-20px) translateY(20px); } @keyframes fade-in { 0% { opacity: 0; } 100% { opacity: 1; } }
; const portal = document.createElement('portal'); // Let's navigate into the WICG Portals spec page portal.src = 'https://wicg.github.io/portals/'; // Add a class that defines the transition. Consider using //prefers-reduced-motion
media query to control the animation. // https://developers.google.com/web/updates/2019/03/prefers-reduced-motion portal.classList.add('portal-transition'); portal.addEventListener('click', (evt) => { // Animate the portal once user interacts portal.classList.add('portal-reveal'); }); portal.addEventListener('transitionend', (evt) => { if (evt.propertyName == 'transform') { // Activate the portal once the transition has completed portal.activate(); } }); document.body.append(style, portal); ``````js // Feature detection
if ('HTMLPortalElement' in window) { // If this is a platform that have Portals... const portal = document.createElement('portal'); ... } ```
js // Detect whether this page is hosted in a portal if (window.portalHost) { // Customize the UI when being embedded as a portal }
```js // Send message to the portal element const portal = document.querySelector('portal'); portal.postMessage({someKey: someValue}, ORIGIN);
// Receive message via window.portalHost window.portalHost.addEventListener('message', (evt) => { const data = evt.data.someKey; // handle the event }); ```
Tags
Annotators
URL
-
-
wicg.github.io wicg.github.ioPortals1
Tags
Annotators
URL
-
-
developer.mozilla.org developer.mozilla.org
-
```html
According to Mozilla's website, <q cite="https://www.mozilla.org/en-US/about/history/details/"> Firefox 1.0 was released in 2004 and became a big success. </q>
```
Tags
Annotators
URL
-
-
developer.mozilla.org developer.mozilla.org
-
```html
<style> kbd { background-color: #eee; border-radius: 3px; border: 1px solid #b4b4b4; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), 0 2px 0 0 rgba(255, 255, 255, 0.7) inset; color: #333; display: inline-block; font-size: 0.85em; font-weight: 700; line-height: 1; padding: 2px 4px; white-space: nowrap; } </style>Please press <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>R</kbd> to re-render an MDN page.
```
-
-
developer.mozilla.org developer.mozilla.org
-
```html
<title>HTML Standard</title>
<body> <hgroup id="document-title">HTML: Living Standard
Last Updated 12 July 2022
</hgroup>Some intro to the document.
Table of contents
-
…
First section
Some intro to the first section.
</body>```
-
-
developer.mozilla.org developer.mozilla.org
-
```html
<header>Movie website
<search> <form action="./search/"> <label for="movie">Find a Movie</label> <input type="search" id="movie" name="q" /> <button type="submit">Search</button> </form> </search> </header>```
```html <search> <label> Find and filter your query <input type="search" id="query" /> </label> <label> <input type="checkbox" id="exact-only" /> Exact matches only </label>
<section>Results:
</search> ```
-
-
cheatsheetseries.owasp.org cheatsheetseries.owasp.org
-
developers.cloudflare.com developers.cloudflare.com
-
stackoverflow.com stackoverflow.com
-
-
```html
<body style="visibility: hidden;"> <script>0</script> </body> <noscript> <style>body { visibility: visible; }</style> </noscript>```
-
- Jul 2023
-
kit.svelte.dev kit.svelte.dev
Tags
Annotators
URL
-
-
svelte.dev svelte.dev
-
-
gist.github.com gist.github.com
-
gist.github.com gist.github.com
-
```js / * twitter-entities.js * This function converts a tweet with "entity" metadata * from plain text to linkified HTML. * * See the documentation here: http://dev.twitter.com/pages/tweet_entities * Basically, add ?include_entities=true to your timeline call * * Copyright 2010, Wade Simmons * Licensed under the MIT license * http://wades.im/mons * * Requires jQuery /
function escapeHTML(text) { return $('<div/>').text(text).html() }
function linkify_entities(tweet) { if (!(tweet.entities)) { return escapeHTML(tweet.text) }
// This is very naive, should find a better way to parse this var index_map = {} $.each(tweet.entities.urls, function(i,entry) { index_map[entry.indices[0]] = [entry.indices[1], function(text) {return "<a href='"+escapeHTML(entry.url)+"'>"+escapeHTML(text)+"</a>"}] }) $.each(tweet.entities.hashtags, function(i,entry) { index_map[entry.indices[0]] = [entry.indices[1], function(text) {return "<a href='http://twitter.com/search?q="+escape("#"+entry.text)+"'>"+escapeHTML(text)+"</a>"}] }) $.each(tweet.entities.user_mentions, function(i,entry) { index_map[entry.indices[0]] = [entry.indices[1], function(text) {return "<a title='"+escapeHTML(entry.name)+"' href='http://twitter.com/"+escapeHTML(entry.screen_name)+"'>"+escapeHTML(text)+"</a>"}] }) var result = "" var last_i = 0 var i = 0 // iterate through the string looking for matches in the index_map for (i=0; i < tweet.text.length; ++i) { var ind = index_map[i] if (ind) { var end = ind[0] var func = ind[1] if (i > last_i) { result += escapeHTML(tweet.text.substring(last_i, i)) } result += func(tweet.text.substring(i, end)) i = end - 1 last_i = end } } if (i > last_i) { result += escapeHTML(tweet.text.substring(last_i, i)) } return result
} ```
Tags
Annotators
URL
-
-
stackoverflow.com stackoverflow.com
-
```html <img src="invalid_link" onerror="this.onerror=null;this.src='https://placeimg.com/200/300/animals';"
```
-
-
developers.google.com developers.google.com
-
stackoverflow.com stackoverflow.com
-
developer.chrome.com developer.chrome.com
-
firefox-source-docs.mozilla.org firefox-source-docs.mozilla.org
-
Tags
Annotators
URL
-
-
developer.mozilla.org developer.mozilla.org
-
www.w3.org www.w3.org
Tags
Annotators
URL
-
- Jun 2023
-
css-tricks.com css-tricks.com
-
sketch.systems sketch.systems
Tags
Annotators
URL
-
-
sketch.systems sketch.systems
-
realpython.com realpython.com
Tags
Annotators
URL
-
-
-
```html
<body> <div> {% for chat in chats %} <div>{{ chat.contents }}</div> <button id={{chat.id}} ✅ onClick=getId(id) ✅ > print this chat_id out </button> {% endfor %} </div> ... <script> function getId(id){ console.log(id) } </script> </body>```
-
-
jinja.palletsprojects.com jinja.palletsprojects.com
-
developer.mozilla.org developer.mozilla.org
-
Security considerations When inserting HTML into a page by using insertAdjacentHTML(), be careful not to use user input that hasn't been escaped.
```html <select id="position"> <br /> <option>beforebegin</option>
<option>afterbegin</option> <option>beforeend</option> <option>afterend</option></select>
<button id="insert">Insert HTML</button> <button id="reset">Reset</button>
Some text, with a
code-formatted element
inside it.```
```js const insert = document.querySelector("#insert"); insert.addEventListener("click", () => { const subject = document.querySelector("#subject"); const positionSelect = document.querySelector("#position"); subject.insertAdjacentHTML( positionSelect.value, "inserted text" ); });
const reset = document.querySelector("#reset"); reset.addEventListener("click", () => { document.location.reload(); });
```
-
-
stackoverflow.com stackoverflow.com
-
Use insertAdjacentHTML(). It works with all current browsers, even with IE11.
js var mylist = document.getElementById('mylist'); mylist.insertAdjacentHTML('beforeend', '<li>third</li>');
```html
- first
- second
```
-
HTML 5 introduced the <template> element which can be used for this purpose (as now described in the WhatWG spec and MDN docs). A <template> element is used to declare fragments of HTML that can be utilized in scripts. The element is represented in the DOM as a HTMLTemplateElement which has a .content property of DocumentFragment type, to provide access to the template's contents. This means that you can convert an HTML string to DOM elements by setting the innerHTML of a <template> element, then reaching into the template's .content property.
```js /* * @param {String} HTML representing a single element * @return {Element} / function htmlToElement(html) { var template = document.createElement('template'); html = html.trim(); // Never return a text node of whitespace as the result template.innerHTML = html; return template.content.firstChild; }
var td = htmlToElement('<td>foo</td>'), div = htmlToElement('<div><span>nested</span> <span>stuff</span></div>');
/* * @param {String} HTML representing any number of sibling elements * @return {NodeList} / function htmlToElements(html) { var template = document.createElement('template'); template.innerHTML = html; return template.content.childNodes; }
var rows = htmlToElements('<tr><td>foo</td></tr><tr><td>bar</td></tr>'); ```
-
-
johnresig.com johnresig.com
Tags
Annotators
URL
-
-
developer.mozilla.org developer.mozilla.org
-
developer.mozilla.org developer.mozilla.org
-
Tags
Annotators
URL
-
-
jasonformat.com jasonformat.com
Tags
Annotators
URL
-
-
astro.build astro.build
Tags
Annotators
URL
-
-
docs.astro.build docs.astro.build
Tags
Annotators
URL
-
- May 2023
-
markojs.com markojs.comMarko1
-
-
developer.chrome.com developer.chrome.com
-
developer.mozilla.org developer.mozilla.org
-
developer.mozilla.org developer.mozilla.org
-
developer.mozilla.org developer.mozilla.org
-
shaneosullivan.wordpress.com shaneosullivan.wordpress.com
- Apr 2023
-
www.unicode.org www.unicode.org
-
x.st x.st
Tags
Annotators
URL
-
-
developer.mozilla.org developer.mozilla.org
- Mar 2023
-
learn.microsoft.com learn.microsoft.com
-
blog.giantgeek.com blog.giantgeek.com
Tags
Annotators
URL
-
-
learn.microsoft.com learn.microsoft.com
-
learn.microsoft.com learn.microsoft.com
-
stackoverflow.com stackoverflow.com
-
workers.tools workers.tools
-
HTML templating and streaming response library for Worker Runtimes such as Cloudflare Workers.
js function handleRequest(event: FetchEvent) { return new HTMLResponse(pageLayout('Hello World!', html` <h1>Hello World!</h1> ${async () => { const timeStamp = new Date( await fetch('https://time.api/now').then(r => r.text()) ); return html`<p>The current time is ${timeEl(timeStamp)}.</p>` }} `)); }
Tags
Annotators
URL
-
-
www.mattstobbs.com www.mattstobbs.com
Tags
Annotators
URL
-
-
-
What could be happening is dates being parsed with a different timezone during SSR and CSR for example.
Tags
Annotators
URL
-
-
developer.mozilla.org developer.mozilla.org
-
```js function makeDocument() { let frame = document.getElementById("theFrame");
let doc = document.implementation.createHTMLDocument("New Document"); let p = doc.createElement("p"); p.textContent = "This is a new paragraph.";
try { doc.body.appendChild(p); } catch (e) { console.log(e); }
// Copy the new HTML document into the frame
let destDocument = frame.contentDocument; let srcNode = doc.documentElement; let newNode = destDocument.importNode(srcNode, true);
destDocument.replaceChild(newNode, destDocument.documentElement); } ```
-
-
blog.dwac.dev blog.dwac.dev
-
document.implementation.createHTMLDocument() which can stream dynamic HTML content directly into the page DOM
-
-
www.youtube.com www.youtube.com
-
-
linguinecode.com linguinecode.com
-
You can have multiple nested React.lazy components inside React.Suspense.
```js
const CatAvatar = React.lazy(() => import('./path/to/cat/avatar')); const ThorAvatar = React.lazy(() => import('./path/to/cat/thor-avatar'));
const AppContainer = () => ( <React.Suspense fallback="loading..."> <CatAvatar /> <ThorAvatar /> </React.Suspense> ); ```
-
-
Tags
Annotators
URL
-
-
remix.run remix.run
Tags
Annotators
URL
-
-
developer.mozilla.org developer.mozilla.org
-
developer.mozilla.org developer.mozilla.org
-
developer.mozilla.org developer.mozilla.org
-
CSS-generated content is not included in the DOM. Because of this, it will not be represented in the accessibility tree and certain assistive technology/browser combinations will not announce it. If the content conveys information that is critical to understanding the page's purpose, it is better to include it in the main document.
-
-
wiki.owasp.org wiki.owasp.org
-