-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
145 lines (121 loc) · 4.48 KB
/
index.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
<!doctype html>
<html lang="en-GB">
<head>
<title>index.html</title>
<meta charset="utf-8">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;900&display=swap" rel="stylesheet">
<style>
body {
background: #fff;
font-family: 'Roboto', sans-serif;
}
div#master,
div#detail {
background: #fff;
margin: 1em 1em;
padding: 1em 1em;
text-align: center;
}
h1 {
font-weight: 300;
letter-spacing: 0.1em;
margin-bottom: 2em;
color: #999;
}
select#selectVariant {
margin-bottom: 3em;
}
happ-ui-exp01,
happ-ui-exp02,
happ-ui-exp03a,
happ-ui-exp03b,
happ-ui-exp04 {
width: 20%; height: 20%;
}
.thelogo {
padding: 0 1em 1em 0;
}
div#footer,
div#footer a {
font-weight: 300;
line-height: 1.5em;
color: #999;
text-align: center;
margin: 4em 0 10em 0;
}
</style>
</head>
<body>
<div id="master">
<h1>HappUI</h1>
<happ-ui-exp01 title="Color Wheel Exp 01" class="thelogo"
sentir="0.65" connaitre="0.65" comprendre="0.65"></happ-ui-exp01>
<happ-ui-exp02 title="Color Wheel Exp 02" class="thelogo"
sentir="0.65" connaitre="0.65" comprendre="0.65"></happ-ui-exp02>
<happ-ui-exp03a title="Color Wheel Exp 03A" class="thelogo"
sentir="0.65" connaitre="0.65" comprendre="0.65"></happ-ui-exp03a>
<happ-ui-exp03b title="Color Wheel Exp 03B" class="thelogo"
sentir="0.65" connaitre="0.65" comprendre="0.65"></happ-ui-exp03b>
<happ-ui-exp04 title="Color Wheel Exp 04" class="thelogo"
sentir="0.65" connaitre="0.65" comprendre="0.65"></happ-ui-exp04>
<happ-sliders
sentir="0.8" connaitre="0.45" comprendre="0.57"></happ-sliders>
</div>
<div id="detail">
<select id="selectVariant">
<option value="" selected disabled hidden>Select variant</option>
<option value="exp01" >Exp01</option>
<option value="exp02" >Exp02</option>
<option value="exp03A">Exp03A</option>
<option value="exp03B">Exp03B</option>
<option value="exp04" >Exp04</option>
</select>
<happ-contact-sheet id="contactSheet" variant="exp01">
</happ-contact-sheet>
</div>
<script type="module">
import { HappUiExp01 } from './src/HappUiExp01.js';
window.customElements.define('happ-ui-exp01', HappUiExp01);
import { HappUiExp02 } from './src/HappUiExp02.js';
window.customElements.define('happ-ui-exp02', HappUiExp02);
import { HappUiExp03A } from './src/HappUiExp03A.js';
window.customElements.define('happ-ui-exp03a', HappUiExp03A);
import { HappUiExp03B } from './src/HappUiExp03B.js';
window.customElements.define('happ-ui-exp03b', HappUiExp03B);
import { HappUiExp04 } from './src/HappUiExp04.js';
window.customElements.define('happ-ui-exp04', HappUiExp04);
import { HappSlider } from './src/HappSlider.js';
window.customElements.define('happ-slider', HappSlider);
import { HappSliders } from './src/HappSliders.js';
window.customElements.define('happ-sliders', HappSliders);
import { HappContactSheet } from './src/HappContactSheet.js';
window.customElements.define('happ-contact-sheet', HappContactSheet);
let happUIElements;
window.addEventListener( "DOMContentLoaded", function( e) {
happUIElements = [
...document.querySelectorAll( "happ-ui-exp01"),
...document.querySelectorAll( "happ-ui-exp02"),
...document.querySelectorAll( "happ-ui-exp03a"),
...document.querySelectorAll( "happ-ui-exp03b"),
...document.querySelectorAll( "happ-ui-exp04")
];
const contactSheetElt = document.getElementById( "contactSheet");
document.getElementById( "selectVariant").addEventListener( "change", (e) => {
const newVariant = e.target.value;
console.log( "new variant: " + newVariant);
contactSheetElt.setAttribute( "variant", newVariant);
});
});
window.addEventListener( "sliders-change", handleSlidersChange);
function handleSlidersChange( e) {
const { sentir, connaitre, comprendre } = e.detail.value;
happUIElements.forEach( function( elt) {
elt.sentir = sentir;
elt.connaitre = connaitre;
elt.comprendre = comprendre;
});
}
</script>
<div id="footer">Copyright 2020 Enrique Pardo, Rudi Farkas & Olivier Lange<br />A <a href="http://gongfu.io">gongfu.io</a> and <a href="https://happui.org/info">Happui Labs</a> playground</div>
</body>
</html>