Skip to content

Instantly share code, notes, and snippets.

View KaiWedekind's full-sized avatar
:octocat:

Kai Wedekind KaiWedekind

:octocat:
  • IBM Deutschland GmbH
  • Germany
View GitHub Profile
@KaiWedekind
KaiWedekind / googlemail-markup.js
Created August 12, 2018 09:57
How Google Mail markup should look like.
<body>
<google-mail>
<mail-header></mail-header>
<mail-navigation></mail-navigation>
<mail-list>
<mail-thread id="74738ff5-5367-5958-9aee-98fffdcd1876">
<mail-content from="[email protected]" to="[email protected]">
<h2>Hi Jane</h2>
<article>
<p>...</p>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>My todos</title>
</head>
<body>
<my-todos></my-todos>
@KaiWedekind
KaiWedekind / my-todos.js
Last active August 12, 2018 06:19
Universal todo component built with custom elements v1 - Lifecycle methods
class MyTodos extends HTMLElement {
// called when the HTML parser sees the HTML tag
constructor () {
// always call super() first in your constructor to inherit from your parent class
super();
this.title = 'My todos';
}
// called when the element is inserted in the DOM
// immediately after constructor if the element is in the DOM already
@KaiWedekind
KaiWedekind / my-todos.js
Last active August 12, 2018 06:12
Universal todo component built with custom elements v1 - Class definition
class MyTodos extends HTMLElement {
constructor() {
// always call super() first in your constructor to inherit from your parent class
super();
}
}
// register new tag and associate it with the class
customElements.define('my-todos', MyTodos);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Speech Recording</title>
</head>
<body>
<script>