-
Notifications
You must be signed in to change notification settings - Fork 0
/
testSection.html
131 lines (127 loc) · 6.46 KB
/
testSection.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/recommend-section-sdk-cafe24.css">
<link rel="stylesheet" href="/global.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-K6R9Z9D8EP"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', 'G-K6R9Z9D8EP', { 'debug_mode': true });
</script>
<!-- Google Tag Manager -->
<script>(function (w, d, s, l, i) {
w[l] = w[l] || []; w[l].push({
'gtm.start':
new Date().getTime(), event: 'gtm.js'
}); var f = d.getElementsByTagName(s)[0],
j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : ''; j.async = true; j.src =
'https://www.googletagmanager.com/gtm.js?id=' + i + dl; f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', 'GTM-5VRNPTQW');</script>
<!-- End Google Tag Manager -->
<title>Document</title>
</head>
<body>
<script>
// (function (global, document) {var w = global;if (w.GentooIO) {return w.console.error("GentooIO script included twice");};var rs = null;var ge = function () {grs.c(arguments);};grs.q = [];grs.c = function (args) {grs.q.push(args)};grs.process = function (args) {var method = args[0];var params = args[1];if (method === 'boot') {rs = new w.FloatingButton(params);} else if (method === 'update') {rs.updateParameter(params);};};w.GentooIO = ge;function l() {if (w.GentooIOInitialized) {return};w.GentooIOInitialized = true;var s = document.createElement("script");s.type = "text/javascript";s.async = true;s.src = "/floating-button-sdk.js";s.onload = () => {while(grs.q.length) {var args = grs.q.shift();grs.process(args);};var sc = document.getElementById('gentoo-sc');if (sc) {sc.addEventListener("scroll", handleScroll)};};var x = document.getElementsByTagName("script")[0];if (x.parentNode) {x.parentNode.insertBefore(s, x)};};function handleScroll() {var sc = document.getElementById('gentoo-sc');var st = sc.scrollTop;var dh = sc.scrollHeight - sc.clientHeight;var sp = st / dh;if (sp >= 0.6) {console.log('sp >= 0.6', st, dh, sp);grs.process(['update', {type: 'needs'}]);sc.removeEventListener('scroll', handleScroll);}};if (document.readyState === "complete") {l();} else {w.addEventListener("DOMContentLoaded", l);w.addEventListener("load", l);};}) (window, document);
(
function (global, document) {
var w = global;
if (w.GentooRS) {
return w.console.error("GentooRS script included twice");
};
var rs = null;
var grs = function () {
grs.c(arguments);
};
grs.q = [];
grs.c = function (args) {
grs.q.push(args)
};
grs.process = function (args) {
var method = args[0];
var params = args[1];
if (method === 'boot') {
rs = new w.RecommendSection(params);
} else if (method === 'update') {
rs.updateParameter(params);
} else if (method === 'unmount') {
rs.destroy();
}
};
w.GentooRS = grs;
function l() {
if (w.GentooIOInitialized) { return };
w.GentooIOInitialized = true;
var s = document.createElement("script");
s.type = "text/javascript";
s.async = true;
s.src = "/recommend-section-sdk-cafe24.js";
s.onload = () => {
while (grs.q.length) {
var args = grs.q.shift();
grs.process(args);
};
// var sl = () => {handleScroll(w, sl)}
// w.addEventListener("scroll", sl)
w.addEventListener("message", ()=>{})
};
var x = document.getElementsByTagName("script")[0];
if (x.parentNode) {
x.parentNode.insertBefore(s, x)
};
};
if (document.readyState === "complete") {
l();
} else {
w.addEventListener("DOMContentLoaded", l);
w.addEventListener("load", l);
};
}
)(window, document);
// GentooIO('boot', {
// clientId: 'dlst',
// udid: 'd02a7e31-3727-4e72-8768-88d06d313eed',
// authCode: 'Token 65ca7bbe5995ac373b06bf3a2c09962a65403245',
// itemId: '31900',
// })
// GentooIO('unmount', {});
</script>
<div>
<div id='gentoo-sc'>
<div style="display: flex; flex-direction: column; align-items: stretch; height: 100%;">
<div style="width: 100%; height: 400px; background: skyblue;">
box1
</div>
<div id="gentoo-recommend-section">
<script>
GentooRS('boot', {
clientId: 'dlst',
udid: 'd02a7e31-3727-4e72-8768-88d06d313eed',
authCode: 'Token 65ca7bbe5995ac373b06bf3a2c09962a65403245',
itemId: '31900',
container: 'gentoo-recommend-section',
})
</script>
</div>
<div style="display: flex; width: 100%; height: fit-content";>
<div style="flex: 1; height: 300px; background: cornflowerblue;">
box2
</div>
<div style="flex: 1; height: 300px; background: cornsilk;">
box3
</div>
</div>
<div style="width: 100%; height: 800px; background: skyblue;">
box4
</div>
</div>
</div>
</div>
</body>
</html>