-
-
Notifications
You must be signed in to change notification settings - Fork 319
/
react.sample.html
241 lines (225 loc) · 9.03 KB
/
react.sample.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
<html>
<head>
<title>zuck.js</title>
<link rel="icon" href="ICON.png" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=0"
/>
<!-- demo styles -->
<link rel="stylesheet" href="demo/style.css" />
<!-- lib styles -->
<link rel="stylesheet" href="dist/zuck.css" />
<!-- lib skins -->
<link rel="stylesheet" href="dist/skins/snapgram.css" />
<link rel="stylesheet" href="dist/skins/vemdezap.css" />
<link rel="stylesheet" href="dist/skins/facesnap.css" />
<link rel="stylesheet" href="dist/skins/snapssenger.css" />
</head>
<body>
<h1 id="header"> </h1>
<a
href="https://ramon.codes/projects/zuck.js"
target="_blank"
class="disclaimer"
>
<img src="ICON.png" alt="zuck.js logo" />
<p>
This a demonstration of <strong>zuck.js</strong> javascript library.
</p>
<p>Not associated with Facebook, Instagram, WhatsApp or Snapchat.</p>
</a>
<div id="root"></div>
<div class="skin">
Choose your theme:
<select
id="skin"
onchange="changeSkin(this.options[this.selectedIndex].value);"
>
<option value="Snapgram">Snapgram (without fullscreen)</option>
<option value="FaceSnap">FaceSnap (with fullscreen)</option>
<option value="VemDeZAP">VemDeZAP (timeline + arrows)</option>
<option value="Snapssenger">Snapssenger (with previews)</option>
</select>
</div>
<script src="https://unpkg.com/react@17/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script src="dist/zuck.js"></script>
<script src="demo/script.js"></script>
<script type="text/babel">
const Demo = () => {
const storiesEl = React.useRef(null);
const storiesFunc = React.useRef(null);
const currentSkin = getCurrentSkin();
React.useEffect(() => {
if (storiesEl.current && !storiesFunc.current) {
storiesFunc.current = Zuck(storiesEl.current, {
backNative: true,
previousTap: true,
skin: currentSkin['name'],
autoFullScreen: currentSkin['params']['autoFullScreen'],
avatars: currentSkin['params']['avatars'],
paginationArrows: currentSkin['params']['paginationArrows'],
list: currentSkin['params']['list'],
cubeEffect: currentSkin['params']['cubeEffect'],
localStorage: true,
stories: [
{
id: 'ramon',
photo:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/users/1.jpg',
name: 'Ramon',
time: timestamp(),
items: [
{
id: 'ramon-1',
type: 'photo',
length: 3,
src: 'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/1.jpg',
preview:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/1.jpg',
link: '',
linkText: false,
time: timestamp()
},
{
id: 'ramon-2',
type: 'video',
length: 0,
src: 'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/2.mp4',
preview:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/2.jpg',
link: '',
linkText: false,
time: timestamp()
},
{
id: 'ramon-3',
type: 'photo',
length: 3,
src: 'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/3.png',
preview:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/3.png',
link: 'https://ramon.codes',
linkText: 'Visit my Portfolio',
time: timestamp()
}
]
},
{
id: 'gorillaz',
photo:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/users/2.jpg',
name: 'Gorillaz',
time: timestamp(),
items: [
{
id: 'gorillaz-1',
type: 'video',
length: 0,
src: 'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/4.mp4',
preview:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/4.jpg',
link: '',
linkText: false,
time: timestamp()
},
{
id: 'gorillaz-2',
type: 'photo',
length: 3,
src: 'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/5.jpg',
preview:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/5.jpg',
link: '',
linkText: false,
time: timestamp()
}
]
},
{
id: 'ladygaga',
photo:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/users/3.jpg',
name: 'Lady Gaga',
time: timestamp(),
items: [
{
id: 'ladygaga-1',
type: 'photo',
length: 5,
src: 'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/6.jpg',
preview:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/6.jpg',
link: '',
linkText: false,
time: timestamp()
},
{
id: 'ladygaga-2',
type: 'photo',
length: 3,
src: 'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/7.jpg',
preview:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/7.jpg',
link: 'http://ladygaga.com',
linkText: false,
time: timestamp()
}
]
},
{
id: 'starboy',
photo:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/users/4.jpg',
name: 'The Weeknd',
time: timestamp(),
items: [
{
id: 'starboy-1',
type: 'photo',
length: 5,
src: 'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/8.jpg',
preview:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/8.jpg',
link: '',
linkText: false,
time: timestamp()
}
]
},
{
id: 'riversquomo',
photo:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/users/5.jpg',
name: 'Rivers Cuomo',
time: timestamp(),
items: [
{
id: 'riverscuomo-1',
type: 'photo',
length: 10,
src: 'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/9.jpg',
preview:
'https://raw.githubusercontent.com/ramonszo/assets/master/zuck.js/stories/9.jpg',
link: '',
linkText: false,
time: timestamp()
}
]
}
]
});
}
}, [storiesEl.current]);
return (
<div className="storiesWrapper" id="stories" ref={storiesEl}></div>
);
};
</script>
<script type="text/babel">
ReactDOM.render(<Demo />, document.getElementById('root'));
</script>
</body>
</html>