/
webcomponent-test.html
110 lines (98 loc) · 3.02 KB
/
webcomponent-test.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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Webcomponent Test</title>
<script id="custom-elements-es5-adapter-loader">
if (window.customElements) {
var src, currTag, script;
src = '//gotw-int.uefa.com/js/custom-elements-es5-adapter.js';
currTag = document.getElementById('custom-elements-es5-adapter-loader');
script = document.createElement('script');
script.src = src;
currTag.parentNode.insertBefore(script, currTag.nextSibling);
}
</script>
<script async type="text/javascript" src="//gotw-int.uefa.com/js/webcomponents-loader.js"></script>
<!-- <link async rel="import" href="//gotw-int.uefa.com/static.card.html"> -->
<script async type="text/javascript" src="//gotw-int.uefa.com/static/js/static.card.js"></script>
<style>
.gotw-card-container-small-small-square {
width: 204px;
height: 204px;
resize: both;
overflow: auto;
}
.gotw-card-container-small-square {
width: 249px;
height: 249px;
resize: both;
overflow: auto;
}
.gotw-card-container-square {
width: 375px;
height: 375px;
resize: both;
overflow: auto;
}
.gotw-card-container-wide {
width: 388px;
height: 184px;
resize: both;
overflow: auto;
}
.gotw-card-container-wide-big {
width: 476px;
height: 220px;
resize: both;
overflow: hidden;
}
</style>
<!-- <script>
let observer = new MutationObserver(function(mutations) {
console.log('mutations:', mutations);
var event = document.createEvent('HTMLEvents');
event.initEvent('resize', true, false);
window.dispatchEvent(event);
});
setTimeout(function(){
let child = document.querySelector(".gotw-card-container-small-square");
observer.observe(child, { attributes: true });
}, 1000);
</script> -->
</head>
<body>
<h3>STATIC CARD - SMALL SMALL SQUARE</h3>
<div class="gotw-card-container-small-small-square">
<gotw-static-card class="card"></gotw-static-card>
</div>
<h3>STATIC CARD - SMALL SQUARE</h3>
<div class="gotw-card-container-small-square">
<gotw-static-card class="card"></gotw-static-card>
</div>
<h3>STATIC CARD - SQUARE</h3>
<div class="gotw-card-container-square">
<gotw-static-card class="card"></gotw-static-card>
</div>
<h3>STATIC CARD - WIDE</h3>
<div class="gotw-card-container-wide">
<gotw-static-card class="card"></gotw-static-card>
</div>
<h3>STATIC CARD - WIDE BIG</h3>
<div class="gotw-card-container-wide-big">
<gotw-static-card class="card"></gotw-static-card>
</div>
<script>
const searchParams = new URL(window.location).searchParams;
const pollId = searchParams.get('pollId');
const language = searchParams.get('language') ?? 'en';
if (pollId) {
Array.from(document.querySelectorAll('.card')).forEach(e => {
e.setAttribute('pollId', pollId)
e.setAttribute('language', language)
});
}
</script>
</body>
</html>