Repository navigation
Expand file tree
/
Copy pathcrearningtool.html
More file actions
413 lines (368 loc) · 17.1 KB
/
Copy pathcrearningtool.html
File metadata and controls
413 lines (368 loc) · 17.1 KB
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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
<!DOCTYPE html>
<html>
<head>
<title>Creator</title>
<link rel="stylesheet" type="text/css" href="css/main.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/regular.min.css" integrity="sha512-WidMaWaNmZqjk3gDE6KBFCoDpBz9stTsTZZTeocfq/eDNkLfpakEd7qR0bPejvy/x0iT0dvzIq4IirnBtVer5A==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<link rel="shortcut icon" href="svg/favicon.svg" type="image/x-icon">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-M2C1G7D2PW"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-M2C1G7D2PW');
</script>
<style>
.forecast-earning .circle {
position: absolute;
width: 20px;
height: 20px;
background: rgba(118, 76, 194, 0.49);
border-radius: 50%;
}
.forecast-earning .our-forecast {
margin-left: 25px;
font-family: 'Inter';
font-style: normal;
font-weight: 400;
font-size: 16px;
line-height: 140.5%;
color: #565656;
}
.forecast-description {
font-family: 'Inter';
font-style: normal;
font-weight: 400;
font-size: 14px;
line-height: 148.5%;
color: #565656;
width: 600px;
padding: 0px 20px;
}
.result-with-text .total-earning {
font-family: 'Inter';
font-style: normal;
font-weight: 500;
font-size: 24px;
line-height: 29px;
text-transform: capitalize;
color: #764CC2;
position: relative;
left: 15px;
}
.video-count {
font-family: 'Inter';
font-style: normal;
font-size: 12px;
/* line-height: 140.5%; */
color: #565656;
width: 60%;
font-weight: 600;
margin-top: 11px;
}
input::-webkit-inner-spin-button {
display: none;
}
#video-count {
width: 60%;
height: 24px;
position: relative;
top: 8px;
left: -20px;
}
.videos-earnings {
font-family: 'Inter';
font-style: normal;
font-weight: 500;
font-size: 13px;
line-height: 29px;
text-transform: capitalize;
/* color: #764CC2; */
position: absolute;
left: 40px;
}
.cr-common-section.cr-tool .card-header button {
font-size: 22px;
}
@media only screen and (max-width: 900px) {
.cstm-collapse {
height: 100%;
min-height: 520px;
}
.forecast-description {
width: 100%;
font-size: 12px;
}
.forecast-earning {
padding: 0 16px;
}
.no-of-videos-upload {
width: 90%;
margin: 0 16px;
}
.forecast-earning .circlecast-earning .our-forecast {
width: 16px;
height: 16px;
}
.forecast-earning .circlecast-earning .our-forecast {
position: relative;
top: -6px;
font-size: 12px;
}
.rs-transparent-rectangle {
width: 162px;
left: -72px;
}
.cr-common-section.cr-tool .card-header button {
font-size: 18px;
position: relative;
left: 6px;
}
.result-with-text {
width: 200px;
}
.result-with-text .total-earning {
font-size: 16px;
text-align: center;
width: 120px;
left: 0;
}
.videos-earnings {
font-size: 12px;
width: 100px;
text-align: center;
left: 8px;
}
.result-with-text span {
margin-left: 15px;
}
span.activePointer::before {
left: 3px !important;
}
}
</style>
</head>
<body>
<header style="height: 67px;">
<nav class="navbar navbar-expand-lg navbar-light bg-light" style="height: 67px; border-bottom: 1px solid #000000;">
<div class="container">
<a class="navbar-brand" href="index.html">aBit</a>
<!-- <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button> -->
<div class="expand navbar-expand" id="navbarTogglerDemo02">
<ul class="navbar-nav ml-auto mt-lg-0 ">
<li class="nav-item active">
<a class="nav-link nav-item-creator" href="creatorpage.html" style="text-decoration-color: #b497ea;">Are you a creator? <span class="sr-only">(current)</span></a>
</li>
</ul>
<!-- <button class="btn abit-outline-purple my-2 my-sm-0" data-toggle="modal" data-target="#registerModal">Login / Signup</button> -->
</div>
</div>
</nav>
</header>
<div class="container mt-5 cr-common-section cr-tool">
<!-- <h3>Range Slider</h3>
<div class="form-group">
<label for="audienceEarnings">Audience Earnings:</label>
<input type="text" class="form-control" id="audienceEarnings" readonly>
</div> -->
<div id="accordion2" class="mt-5 cstm-accordian">
<div class="card mb-5 cstm-card" style="width: 80%;">
<div class="card-header crearning-tool text-left" id="headingOne" tool="true">
<h5 class="mb-0">
<button class="btn p-0 shadow-none" data-toggle="collapsse" data-target="#" aria-expanded="true" aria-controls="collapseOne">
aBit gains
</button>
<img src="svg/icons/plus-circle-icon.svg" alt="plusicon" class="float-right plus-icon d-none toggle-icon">
<img src="svg/icons/minus-icon.svg" alt="minuscon" class="float-right minus-icon toggle-icon d-none">
</h5>
</div>
<div id="collapseOne2s" class="collapse show cstm-collapse" aria-labelledby="headfingOne" data-parent="#accorddion" style="height: 480px;">
<div class="row">
<div class="col-md-7">
<div class="forecast-description" >Looks like we have your attention! :)</div>
<div class="forecast-description" > You can use the following tool to predict your monthly earnings with aBit!</div>
<div class="forecast-description pt-2"> Pen down, how many videos do you upload in a month? </div>
<div class="forecast-description" >
Use the slider to indicate how much you earn per video:
</div>
<!-- <div class="forecast-earning" style="padding: 0px 20px;">
<span class="circle"></span><span class="our-forecast"><i>Our Forecast</i></span>
</div> -->
<div class="form-group mt-4 row" style="margin-left: 24px;">
<label for="video-count" class="video-count col-md-4 pl-0 col-6">Monthly Video Uploads:</label>
<input type="number" class="form-control col-md-3 col-4" id="video-count" value="1" step="1" min="0" required style="border: 1px solid #ced4da;">
<div class="invalid-feedback">Maximum 4 videos allowed.</div>
</div>
</div>
<!-- <div class="col-md-4 no-of-videos-upload">
<div class="form-group">
<label for="video-count" class="video-count">Number of Videos Uploaded:</label>
<input type="number" class="form-control" id="video-count" value="4" step="1" min="0" required style="border: 1px solid #ced4da;">
<div class="invalid-feedback">Maximum 4 videos allowed.</div>
</div>
</div> -->
</div>
<div class="card-body pt-0" style="position: relative; top: 120px;">
<div class="result-with-text"></div>
<div class="slider-container" style="width: 80%; margin: 0 auto;">
<input type="text" id="slider2" class="slider" />
</div>
<div class="text-center pt-2" style="font-size: 12px; margin-top: -15px;">
Avg. Video Earnings($)
</div>
</div>
</div>
</div>
</div>
</div>
<footer class="mt-4 section-footer border-top">
<div class="container" style="margin-top: 76px;">
<div class="row">
<div class="col-lg-6 col-md-6 col-xs-4 col-sm-5 col-6">
<!-- <h3 class="heading">aBit</h3> -->
<p class="description">Own <span class="heading">aBit</span> of your favourite videos.</p>
</div>
<div class="col-lg-6 col-md-6 col-sm-7 col-6">
<ul class="list-group border-left float-right">
<a href="index.html"><li class="list-group-item border-0">Home</li></a>
<a href="creatorpage.html"><li class="list-group-item border-0">Are you a creator?</li></a>
<!-- <li class="list-group-item border-0">Support</li> -->
</ul>
</div>
</div>
</div>
</footer>
<script src="js/rSlider.js"></script>
<script src="js/loadExtLibrary.js"></script>
<script src="js/main.js"></script>
<script>
(function () {
'use strict';
var init = function () {
function generateArray(start, end, step) {
const array = [];
for (var i = start; i <= end; i += step) {
if(i == 20000) {
i = convertIntoK(i)
}
array.push("$" + i);
}
return array;
}
const startValue = 100;
const endValue = 20000;
const stepSize = 10;
const resultArray = generateArray(startValue, endValue, stepSize);
console.log(resultArray);
function convertIntoK(value) {
// if(value == 20000) {
let valueInK = "20000".slice(0, -3) + 'k';
return valueInK;
//console.log(str2);
// }
}
var slider2 = new rSlider({
target: '#slider2',
values:resultArray, //['$10', '$500', '$1000', '$1500', '$2000', '$2500', '$3000', '$3500', '$4000', '$4500', '50000'],
range: false,
set: ["$10000"],
tooltip: false,
labels: false,
scale: false,
onChange: function (vals, activePointer) {
console.log(vals);
// let activeSpan = $('.rs-scale').find("span")[activePointer];
// $('.rs-scale').find("span").removeClass("activePointer");
// $('.rs-scale').find("span .rs-transparent-rectangle").remove();
// // $(activeSpan).append(`<div class="rs-transparent-rectangle"></div>`);
// $(activeSpan).addClass("activePointer");
// let pos;
// if ($(window).width() < 460) {
// pos = ($(activeSpan).position().left) - 30;
// } else {
// pos = ($(activeSpan).position().left + 25);
// }
// $(activeSpan).attr("data-earnings", 4.80);
let pos;
if ($(window).width() <= 390) {
pos = ($(".rs-pointer").position().left) - 15;
} else if(($(window).width() > 390) && ($(window).width() < 500)) {
pos = ($(".rs-pointer").position().left) - 8;
} else if(($(window).width() >= 768) && ($(window).width() < 991)) {
pos = ($(".rs-pointer").position().left) + 20;
}
else {
pos = ($(".rs-pointer").position().left) + 38;
}
$('.result-with-text').css({
'position': 'relative',
'left': pos, //($(activeSpan).position().left + 25 ),
'top': '-100px'
})
calculateEarnings();
//calculateAudienceEarnings(activeSpan);
},
onDrag: function() {
var valueInDollar = $('#slider2').val();
var videosEarning = parseInt(valueInDollar.split("$")[1]); //* 1000;
if(videosEarning == 20) {
videosEarning = videosEarning * 1000;
}
$(".videos-earning").html(videosEarning);
},
onMove: function() {
let pos;
if ($(window).width() < 460) {
pos = ($(".rs-pointer").position().left) - 8;
} else {
pos = ($(".rs-pointer").position().left) + 38;
}
$('.result-with-text').css({
'position': 'relative',
'left': pos, //($(activeSpan).position().left + 25 ),
'top': '-100px'
})
calculateEarnings();
}
});
let x = slider2.getValue();
console.log(x)
};
window.onload = init;
var videoCountInput = document.getElementById('video-count');
videoCountInput.addEventListener('keyup', function () {
calculateEarnings();
});
function calculateEarnings() {
// validateVideoCount();
var valueInDollar = $('#slider2').val();
var videosEarning = parseInt(valueInDollar.split("$")[1]); //* 1000;
if(videosEarning == 20) {
videosEarning = videosEarning * 1000;
}
// var adRevenue = parseFloat(document.getElementById('ad-revenue').value);
var videoCount = parseInt(document.getElementById('video-count').value);
if (videoCount <= 4) {
var earnings = (videosEarning * videoCount * 3).toFixed(0);
earnings = seperateNumerWithComma(earnings);
$('.result-with-text').html(`<div class="total-earning">$${earnings}</div><span>Monthly aBit Payouts.</span><div class="videos-earnings">$${seperateNumerWithComma(videosEarning)}</div>`);
// document.getElementById('earnings').textContent = 'Creator Earnings: $' + earnings;
} else {
var earnings = (videosEarning * 4 * 3).toFixed(0);
$('.result-with-text').html(`<div class="total-earning">$${parseFloat(earnings).toFixed(0)}</div><span>Monthly aBit Payouts.</span><div class="videos-earnings">$${seperateNumerWithComma(videosEarning)}</div>`);
}
}
function seperateNumerWithComma(num) {
// let n = 234234234;
num = Number(parseFloat(num).toFixed(0))
let str = num.toLocaleString("en-US");
return str;
}
})();
</script>
</body>
</html>