-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslide-6.html
153 lines (135 loc) · 7.01 KB
/
slide-6.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<meta name="description" content="Houdini talk about the power of web components for Enterprise frontend"/>
<meta name="theme-color" content="#ffffff">
<title>Houdini talk</title>
<script type="module" src="./src/scri-pt.js"></script>
<script type="module">let e={},t=[(e,t)=>e[t],(e,t)=>e.hasAttribute(t),(e,t)=>e.getAttribute(t),e=>1];class s extends WeakMap{use=(e,t={})=>this.get(e)||this.set(e,t).get(e)}let i={},n=new s,a=new s,l=new s,r=(e,t)=>"number"===t?0|e:e;class h{#e;#t=[];#s=0;constructor(e){this.#e=e}#i=()=>1==++this.#s&&queueMicrotask((()=>{this.#t.map((e=>e())),this.#s=0}));get value(){return this.#e}set value(e){this.#e=e,this.#i()}onChange(e,t){t&&e(this.#e),this.#t.push((()=>e(this.#e)))}when(e,t=[]){let s=new h(e(this.#e));return this.onChange((t=>s.value=e(t))),t.map((e=>e.onChange(this.#i))),s}}let o={},u={};class c extends HTMLElement{#n=(e,t=this)=>t.getAttribute(e);#a=(e,s)=>{let i=e[0],n=e.slice(1),l=this.#n(e,s),r=".?!@".indexOf(i);if(r>=0){let i=t[r](s,n);a.use(s)[e]={init:i,name:l},queueMicrotask((()=>s.removeAttribute(e)))}};static Signal=h;static hydrate=(t,s,r)=>{let h="string"==typeof t?i[t]:t.map((e=>document.querySelector(e).shadowRoot));for(let t of h)if(!t.h){t.h=1;let i=l.get(t)||e;for(let l in s){let h=n.get(t)[l],u=a.get(h);if(u){let t=s[l];for(let s in t){let n=t[s];s in o&&(n=o[s](n));let{name:a,init:l}=u[s.toLowerCase()]||e,{signal:c,type:d,id:g}=a&&i[a]||e;r instanceof Object&&g&&c&&(r[g]=c);let m=s.slice(1),f=e=>n({type:d,name:m,signal:c,signals:i,init:l,domNode:h,e:e});a&&(s.startsWith("@")?h.addEventListener(m,f):queueMicrotask(f))}}}}};static plugin=(e,t)=>(o[e]=t)&&u[e]&&u[e]();static usable=(e,t=[])=>{for(let s of e)o[s]||t.push(new Promise((e=>u[s]=e)));return Promise.all(t)};static render=e=>({domNode:t,name:s})=>t[s]="function"==typeof e?e():e;static rerender=(e,t=!0)=>e.signal.onChange((t=>c.render(t)(e)),t);connectedCallback(){let e=this[this.#n("for")||"parentNode"],t=this.getRootNode(),s=this.#n("new"),a=s||this.#n("ref")||crypto.randomUUID(),o=this.#n("type"),{id:u,textContent:c}=this;(i[a]=i[a]||[]).push(t),n.use(t)[a]=e,s&&(l.use(t)[a]={signal:new h(r(c,o)),type:o,id:u});for(let t of e.getAttributeNames())this.#a(t,e);null!==this.#n("hydrate")&&(new Function(`let{hydrate,render,rerender}=customElements.get('sig-nal');hydrate('${a}',${c})`)(),c=""),this.className||this.replaceWith(c)}}customElements.define("sig-nal",c);
</script>
<style>
:root {
--bg-color: #615946;
--fg-color: #ffdcb4;
}
body {
position: relative;
margin: 0;
padding: 0;
background-image: url(houdini.webp);
background-size: cover;
background-repeat: no-repeat;
background-blend-mode: color-burn;
background-color: var(--bg-color);
width: 100%;
height: 100vh;
overflow: hidden;
color: var(--fg-color);
font-family: monospace;
font-size: 24px;
}
select#language {
position: fixed;
top: 1em;
right: 1em;
outline: none;
background: transparent;
color: var(--fg-color);
border-color: var(--fg-color);
}
h1 {
width: 80%;
margin: .5em auto 0 auto;
text-align: center;
font-size: 3em;
}
h5 {
margin: 5em auto 0 auto;
text-align: center;
font-size: .5em;
}
img {
height: 80%;
display: block;
margin: 1em auto;
}
ul {
display: flex;
flex-direction: column;
margin-left: 3em;
font-size: 2em;
}
li {
color: #b571f4;
margin-bottom: 1em
}
li:first-child {
margin-top: 1em
}
blockquote p {
margin: 1em auto;
width: fit-content;
font-size: 1.5em
}
.tag {
color: #f08d49
}
svg {
position: absolute;
top: 4em;
right: 0;
width: 30%;
}
:root {
--li-color: #b571f4;
}
li {
color: var(--li-color)
}
</style>
</head>
<body onkeydown="let offset=(event.keyCode===32||event.keyCode===39)?1:event.keyCode===37?-1:0;if(!offset)return;let p=location.pathname;let prefix=p.slice(0,p.lastIndexOf('/')+1);let nr=(p.replace(/\D/g,'')|0)+offset;if(nr<0||nr>35)return;location.pathname=`${prefix}slide-${nr}.html`">
<script>if(location.search)document.body.style.fontSize=location.search.replace(/\D/g,'')+'px';if(location.hash)document.documentElement.style.setProperty('--li-color',location.hash.slice(1).replace(/\+/g,' '));</script>
<select aria-label="select language" id="language" onchange="document.documentElement.setAttribute('lang', this.value)">
<option selected value="en">EN</option>
<option value="de">DE</option>
</select>
<scri-pt when="idle">
<template>
<script type="module" src="./src/trans-late.js"></script>
<link rel="stylesheet" href="./styles.css"/>
</template>
</scri-pt>
<h1>The Magic Trick</h1>
<blockquote><p>„write a web component!”</p></blockquote>
<ul>
<li><span class="tag"><web-component></span> is HTML</li>
<li>always a dash in the name</li>
<li>define it <i>yourself</i> with a little JavaScript</li>
<li>all major browsers support them</li>
</ul>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512.7 400.4">
<defs>
<filter id="a" color-interpolation-filters="sRGB">
<feGaussianBlur stdDeviation="6.3"/>
</filter>
</defs>
<path fill-opacity=".5" fill-rule="evenodd" d="m315 299.8 69.4 52.6-38.2-91.6 100.1 22.9L387 232h110.7l-102.8-31.5 91-40-76.6-16L449 95.1l-62.6 9.2 23-62.7-59.6 38.9-14-57.8-42.3 51.8c0-3.6-24.9-51-26.2-51s-25.6 50-25.6 50l-44.4-46.2-11.1 54.4-41.6-46.6s-.9 52-3.5 52c-2.7 0-63-32.2-63-32.2s14.5 59.2 14.5 60.7c0 1.4-65.4-10.3-65.4-10.3L81.1 148 24 167.6s47.8 36.2 46.5 37.7S28.2 243 28.2 243l71.8-1.8c-.2 1.2-69.9 54.5-69.9 56s75.8-19.1 75.8-19.1l-51 74.5 85.2-60.4-18 65.6 50.2-41.2 2.7 44 48.8-39.5 29 64.2 18.9-62.5 35 27 8.3-50.1z" filter="url(#a)"/>
<path fill="#ffdcb4" fill-rule="evenodd" stroke="#000" stroke-linejoin="round" stroke-width="10" d="m296 282 69.4 52.6-38.2-91.6 100.1 22.9-59.3-51.6h110.7l-102.8-31.5 91-40-76.6-16L430 77.3l-62.6 9.2 23-62.7-59.6 38.9-14-57.8-42.3 51.8c0-3.6-24.9-51-26.2-51-1.3 0-25.6 50-25.6 50L178.3 9.6 167.2 64l-41.6-46.6s-.9 52-3.5 52c-2.7 0-63-32.2-63-32.2s14.5 59.2 14.5 60.7c0 1.4-65.4-10.3-65.4-10.3l53.9 42.7L5 149.8s47.9 36.2 46.5 37.7c-1.3 1.4-42.3 37.8-42.3 37.8l71.8-1.8c-.2 1.2-69.9 54.5-69.9 56S87 260.4 87 260.4l-51.1 74.5 85.2-60.4-18 65.6 50.2-41.2 2.8 44 48.7-39.5 30.5 54.4 17.4-52.7 35 27L296 282z"/>
<text x="100" y="140">
Houdini's escape
</text>
<text x="100" y="180">
<tspan font-weight="bold" fill="red">2024 edition!</tspan>
</text>
<style>
text{
dominant-baseline: hanging;
font: 28px monospace;
}
</style>
</svg>
</body>
</html>