Spaces:
Running
Running
kwabs22
commited on
Commit
·
4877a54
1
Parent(s):
f718238
Dot position and Collision in svelte working
Browse files
README.md
CHANGED
@@ -7,6 +7,6 @@ sdk: static
|
|
7 |
pinned: false
|
8 |
---
|
9 |
|
10 |
-
Svelte with build command to test non-docker version - index.html points js and css to bundles generated - app.svelte used as index file in this case
|
11 |
|
12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
7 |
pinned: false
|
8 |
---
|
9 |
|
10 |
+
Svelte with build command to test non-docker version - index.html points js and css to bundles generated - app.svelte used as index file in this case and main.js points to app.svelte
|
11 |
|
12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
bundle.js
CHANGED
@@ -42,6 +42,21 @@ var app = (function () {
|
|
42 |
function is_empty(obj) {
|
43 |
return Object.keys(obj).length === 0;
|
44 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
function create_slot(definition, ctx, $$scope, fn) {
|
46 |
if (definition) {
|
47 |
const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
|
@@ -202,6 +217,9 @@ var app = (function () {
|
|
202 |
else if (node.getAttribute(attribute) !== value)
|
203 |
node.setAttribute(attribute, value);
|
204 |
}
|
|
|
|
|
|
|
205 |
function children(element) {
|
206 |
return Array.from(element.childNodes);
|
207 |
}
|
@@ -335,6 +353,34 @@ var app = (function () {
|
|
335 |
function onDestroy(fn) {
|
336 |
get_current_component().$$.on_destroy.push(fn);
|
337 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
338 |
// TODO figure out if we still want to support
|
339 |
// shorthand events, or if we want to implement
|
340 |
// a real bubbling mechanism
|
@@ -890,7 +936,7 @@ var app = (function () {
|
|
890 |
|
891 |
/* src\VideoGradioComponentBrainstorming.svelte generated by Svelte v3.59.2 */
|
892 |
|
893 |
-
const { console: console_1$
|
894 |
const file$c = "src\\VideoGradioComponentBrainstorming.svelte";
|
895 |
|
896 |
function get_each_context$3(ctx, list, i) {
|
@@ -1195,7 +1241,7 @@ var app = (function () {
|
|
1195 |
const writable_props = [];
|
1196 |
|
1197 |
Object.keys($$props).forEach(key => {
|
1198 |
-
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$
|
1199 |
});
|
1200 |
|
1201 |
function canvas_1_binding($$value) {
|
@@ -1753,6 +1799,54 @@ var app = (function () {
|
|
1753 |
}
|
1754 |
}
|
1755 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1756 |
/* src\MovingDotPortfromReact.svelte generated by Svelte v3.59.2 */
|
1757 |
const file$a = "src\\MovingDotPortfromReact.svelte";
|
1758 |
|
@@ -1765,7 +1859,7 @@ var app = (function () {
|
|
1765 |
attr_dev(div, "class", "MovingDot svelte-12o76ak");
|
1766 |
set_style(div, "left", /*position*/ ctx[0].x + "px");
|
1767 |
set_style(div, "top", /*position*/ ctx[0].y + "px");
|
1768 |
-
add_location(div, file$a,
|
1769 |
},
|
1770 |
l: function claim(nodes) {
|
1771 |
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
@@ -1807,6 +1901,23 @@ var app = (function () {
|
|
1807 |
validate_slots('MovingDotPortfromReact', slots, []);
|
1808 |
let { position = { x: 0, y: 0 } } = $$props;
|
1809 |
let { boundaries = { minX: 0, maxX: 100, minY: 0, maxY: 100 } } = $$props;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1810 |
|
1811 |
const handleKeyPress = e => {
|
1812 |
e.preventDefault();
|
@@ -1828,11 +1939,10 @@ var app = (function () {
|
|
1828 |
break;
|
1829 |
}
|
1830 |
|
1831 |
-
|
1832 |
-
|
1833 |
-
|
1834 |
-
|
1835 |
-
};
|
1836 |
|
1837 |
onMount(() => {
|
1838 |
window.addEventListener('keydown', handleKeyPress);
|
@@ -1855,9 +1965,12 @@ var app = (function () {
|
|
1855 |
|
1856 |
$$self.$capture_state = () => ({
|
1857 |
onMount,
|
|
|
1858 |
position,
|
1859 |
boundaries,
|
1860 |
step,
|
|
|
|
|
1861 |
handleKeyPress
|
1862 |
});
|
1863 |
|
@@ -2008,26 +2121,28 @@ var app = (function () {
|
|
2008 |
}
|
2009 |
|
2010 |
/* src\MovingDotSpacePortfromReact.svelte generated by Svelte v3.59.2 */
|
|
|
|
|
2011 |
const file$8 = "src\\MovingDotSpacePortfromReact.svelte";
|
2012 |
|
2013 |
function get_each_context$1(ctx, list, i) {
|
2014 |
const child_ctx = ctx.slice();
|
2015 |
-
child_ctx[
|
2016 |
return child_ctx;
|
2017 |
}
|
2018 |
|
2019 |
-
// (
|
2020 |
function create_each_block$1(key_1, ctx) {
|
2021 |
let first;
|
2022 |
let target;
|
2023 |
let t0;
|
2024 |
let span;
|
2025 |
-
let t1_value = /*target*/ ctx[
|
2026 |
let t1;
|
2027 |
let current;
|
2028 |
|
2029 |
target = new MovingDotTargetPortfromReact({
|
2030 |
-
props: { position: /*target*/ ctx[
|
2031 |
$$inline: true
|
2032 |
});
|
2033 |
|
@@ -2041,9 +2156,9 @@ var app = (function () {
|
|
2041 |
span = element("span");
|
2042 |
t1 = text(t1_value);
|
2043 |
set_style(span, "position", "absolute");
|
2044 |
-
set_style(span, "left", /*target*/ ctx[
|
2045 |
-
set_style(span, "top", /*target*/ ctx[
|
2046 |
-
add_location(span, file$8,
|
2047 |
this.first = first;
|
2048 |
},
|
2049 |
m: function mount(target$1, anchor) {
|
@@ -2056,6 +2171,18 @@ var app = (function () {
|
|
2056 |
},
|
2057 |
p: function update(new_ctx, dirty) {
|
2058 |
ctx = new_ctx;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2059 |
},
|
2060 |
i: function intro(local) {
|
2061 |
if (current) return;
|
@@ -2078,14 +2205,14 @@ var app = (function () {
|
|
2078 |
block,
|
2079 |
id: create_each_block$1.name,
|
2080 |
type: "each",
|
2081 |
-
source: "(
|
2082 |
ctx
|
2083 |
});
|
2084 |
|
2085 |
return block;
|
2086 |
}
|
2087 |
|
2088 |
-
// (
|
2089 |
function create_if_block$5(ctx) {
|
2090 |
const block = { c: noop, m: noop, d: noop };
|
2091 |
|
@@ -2093,7 +2220,7 @@ var app = (function () {
|
|
2093 |
block,
|
2094 |
id: create_if_block$5.name,
|
2095 |
type: "if",
|
2096 |
-
source: "(
|
2097 |
ctx
|
2098 |
});
|
2099 |
|
@@ -2103,27 +2230,34 @@ var app = (function () {
|
|
2103 |
function create_fragment$8(ctx) {
|
2104 |
let div1;
|
2105 |
let div0;
|
|
|
|
|
2106 |
let t1;
|
2107 |
-
let canvas_1;
|
2108 |
let t2;
|
2109 |
-
let
|
2110 |
let t3;
|
|
|
|
|
|
|
|
|
|
|
2111 |
let each_blocks = [];
|
2112 |
let each_1_lookup = new Map();
|
2113 |
-
let
|
2114 |
let current;
|
2115 |
|
2116 |
movingdot = new MovingDotPortfromReact({
|
2117 |
props: {
|
2118 |
-
position:
|
2119 |
-
boundaries: /*boundaries*/ ctx[
|
2120 |
},
|
2121 |
$$inline: true
|
2122 |
});
|
2123 |
|
2124 |
-
|
|
|
2125 |
validate_each_argument(each_value);
|
2126 |
-
const get_key = ctx => /*target*/ ctx[
|
2127 |
validate_each_keys(ctx, each_value, get_each_context$1, get_key);
|
2128 |
|
2129 |
for (let i = 0; i < each_value.length; i += 1) {
|
@@ -2132,34 +2266,37 @@ var app = (function () {
|
|
2132 |
each_1_lookup.set(key, each_blocks[i] = create_each_block$1(key, child_ctx));
|
2133 |
}
|
2134 |
|
2135 |
-
let if_block = /*isModalOpen*/ ctx[
|
2136 |
|
2137 |
const block = {
|
2138 |
c: function create() {
|
2139 |
div1 = element("div");
|
2140 |
div0 = element("div");
|
2141 |
-
|
2142 |
-
t1 =
|
2143 |
-
canvas_1 = element("canvas");
|
2144 |
t2 = space();
|
|
|
|
|
|
|
|
|
2145 |
create_component(movingdot.$$.fragment);
|
2146 |
-
|
2147 |
|
2148 |
for (let i = 0; i < each_blocks.length; i += 1) {
|
2149 |
each_blocks[i].c();
|
2150 |
}
|
2151 |
|
2152 |
-
|
2153 |
if (if_block) if_block.c();
|
2154 |
attr_dev(div0, "id", "overlayText");
|
2155 |
attr_dev(div0, "class", "svelte-e0peue");
|
2156 |
-
add_location(div0, file$8,
|
2157 |
attr_dev(canvas_1, "width", "100%");
|
2158 |
attr_dev(canvas_1, "height", "100%");
|
2159 |
attr_dev(canvas_1, "tabindex", "0");
|
2160 |
-
add_location(canvas_1, file$8,
|
2161 |
-
attr_dev(div1, "style", /*spaceStyle*/ ctx[
|
2162 |
-
add_location(div1, file$8,
|
2163 |
},
|
2164 |
l: function claim(nodes) {
|
2165 |
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
@@ -2167,12 +2304,16 @@ var app = (function () {
|
|
2167 |
m: function mount(target, anchor) {
|
2168 |
insert_dev(target, div1, anchor);
|
2169 |
append_dev(div1, div0);
|
2170 |
-
append_dev(
|
|
|
|
|
|
|
|
|
2171 |
append_dev(div1, canvas_1);
|
2172 |
-
/*canvas_1_binding*/ ctx[
|
2173 |
-
append_dev(div1,
|
2174 |
mount_component(movingdot, div1, null);
|
2175 |
-
append_dev(div1,
|
2176 |
|
2177 |
for (let i = 0; i < each_blocks.length; i += 1) {
|
2178 |
if (each_blocks[i]) {
|
@@ -2180,19 +2321,36 @@ var app = (function () {
|
|
2180 |
}
|
2181 |
}
|
2182 |
|
2183 |
-
append_dev(div1,
|
2184 |
if (if_block) if_block.m(div1, null);
|
2185 |
current = true;
|
2186 |
},
|
2187 |
p: function update(ctx, [dirty]) {
|
2188 |
-
if (dirty &
|
2189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
2190 |
validate_each_argument(each_value);
|
2191 |
group_outros();
|
2192 |
validate_each_keys(ctx, each_value, get_each_context$1, get_key);
|
2193 |
-
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div1, outro_and_destroy_block, create_each_block$1,
|
2194 |
check_outros();
|
2195 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2196 |
},
|
2197 |
i: function intro(local) {
|
2198 |
if (current) return;
|
@@ -2215,7 +2373,7 @@ var app = (function () {
|
|
2215 |
},
|
2216 |
d: function destroy(detaching) {
|
2217 |
if (detaching) detach_dev(div1);
|
2218 |
-
/*canvas_1_binding*/ ctx[
|
2219 |
destroy_component(movingdot);
|
2220 |
|
2221 |
for (let i = 0; i < each_blocks.length; i += 1) {
|
@@ -2237,41 +2395,142 @@ var app = (function () {
|
|
2237 |
return block;
|
2238 |
}
|
2239 |
|
2240 |
-
function checkCollision() {
|
2241 |
-
|
2242 |
-
} // Collision logic
|
2243 |
-
// To open modal or adjust positions, update isModalOpen or dotPosition accordingly
|
2244 |
-
|
2245 |
function instance$8($$self, $$props, $$invalidate) {
|
|
|
|
|
2246 |
let { $$slots: slots = {}, $$scope } = $$props;
|
2247 |
validate_slots('MovingDotSpacePortfromReact', slots, []);
|
2248 |
let canvas;
|
2249 |
-
let dotPosition = { x: 900, y: 450 };
|
|
|
|
|
2250 |
|
2251 |
-
let targets = [
|
2252 |
-
{
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2256 |
|
|
|
|
|
2257 |
let boundaries = { maxX: 1885, maxY: 900, minX: 0, minY: 0 };
|
2258 |
let isModalOpen = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2259 |
const spaceStyle = `position: relative; width: 100%; height: 100vh; border: 1px solid black; overflow: hidden; background-image: url('/AutoGameBackgrounds/1stGameLoc123.png'); background-size: cover; background-position: center;`;
|
2260 |
const writable_props = [];
|
2261 |
|
2262 |
Object.keys($$props).forEach(key => {
|
2263 |
-
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot')
|
2264 |
});
|
2265 |
|
2266 |
function canvas_1_binding($$value) {
|
2267 |
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
2268 |
canvas = $$value;
|
2269 |
-
$$invalidate(
|
2270 |
});
|
2271 |
}
|
2272 |
|
|
|
|
|
2273 |
$$self.$capture_state = () => ({
|
2274 |
onMount,
|
|
|
2275 |
MovingDot: MovingDotPortfromReact,
|
2276 |
Target: MovingDotTargetPortfromReact,
|
2277 |
canvas,
|
@@ -2279,30 +2538,45 @@ var app = (function () {
|
|
2279 |
targets,
|
2280 |
boundaries,
|
2281 |
isModalOpen,
|
|
|
2282 |
checkCollision,
|
2283 |
-
|
|
|
|
|
|
|
2284 |
});
|
2285 |
|
2286 |
$$self.$inject_state = $$props => {
|
2287 |
-
if ('canvas' in $$props) $$invalidate(
|
2288 |
-
if ('dotPosition' in $$props) $$invalidate(
|
2289 |
-
if ('targets' in $$props) $$invalidate(
|
2290 |
-
if ('boundaries' in $$props) $$invalidate(
|
2291 |
-
if ('isModalOpen' in $$props) $$invalidate(
|
2292 |
};
|
2293 |
|
2294 |
if ($$props && "$$inject" in $$props) {
|
2295 |
$$self.$inject_state($$props.$$inject);
|
2296 |
}
|
2297 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2298 |
return [
|
|
|
2299 |
canvas,
|
|
|
|
|
2300 |
dotPosition,
|
2301 |
targets,
|
2302 |
boundaries,
|
2303 |
-
|
2304 |
spaceStyle,
|
2305 |
-
canvas_1_binding
|
|
|
2306 |
];
|
2307 |
}
|
2308 |
|
@@ -4552,7 +4826,7 @@ var app = (function () {
|
|
4552 |
let t7;
|
4553 |
let div1;
|
4554 |
let t8;
|
4555 |
-
let t9_value = /*currentTime*/ ctx[
|
4556 |
let t9;
|
4557 |
let t10;
|
4558 |
let t11;
|
@@ -4563,34 +4837,36 @@ var app = (function () {
|
|
4563 |
let t14;
|
4564 |
let t15;
|
4565 |
let t16;
|
|
|
|
|
4566 |
let button0;
|
4567 |
-
let
|
4568 |
let button1;
|
4569 |
-
let t20;
|
4570 |
let t21;
|
4571 |
let t22;
|
4572 |
-
let t23_value = /*timestamps*/ ctx[7].length + "";
|
4573 |
let t23;
|
|
|
4574 |
let t24;
|
|
|
4575 |
let button2;
|
4576 |
-
let t26;
|
4577 |
-
let button3;
|
4578 |
let t27;
|
|
|
|
|
4579 |
let button3_class_value;
|
4580 |
let button3_disabled_value;
|
4581 |
-
let t28;
|
4582 |
-
let button4;
|
4583 |
let t29;
|
|
|
|
|
4584 |
let button4_class_value;
|
4585 |
let button4_disabled_value;
|
4586 |
-
let t30;
|
4587 |
let t31;
|
4588 |
let t32;
|
4589 |
-
let t33_value = /*userTimestamps*/ ctx[1].length + "";
|
4590 |
let t33;
|
|
|
4591 |
let t34;
|
4592 |
-
let br1;
|
4593 |
let t35;
|
|
|
|
|
4594 |
let mounted;
|
4595 |
let dispose;
|
4596 |
|
@@ -4618,83 +4894,88 @@ var app = (function () {
|
|
4618 |
t10 = text(" seconds");
|
4619 |
t11 = space();
|
4620 |
div2 = element("div");
|
4621 |
-
t12 = text(/*line*/ ctx[
|
4622 |
t13 = space();
|
4623 |
br0 = element("br");
|
4624 |
t14 = space();
|
4625 |
-
t15 = text(/*currentWord*/ ctx[
|
4626 |
t16 = space();
|
|
|
|
|
4627 |
button0 = element("button");
|
4628 |
button0.textContent = "Previous Auto Timestamp";
|
4629 |
-
|
4630 |
button1 = element("button");
|
4631 |
button1.textContent = "Next Auto Timestamp";
|
4632 |
-
|
4633 |
-
|
4634 |
-
|
4635 |
-
|
4636 |
-
|
4637 |
button2 = element("button");
|
4638 |
button2.textContent = "Add Timestamp";
|
4639 |
-
|
4640 |
button3 = element("button");
|
4641 |
-
|
4642 |
-
|
4643 |
button4 = element("button");
|
4644 |
-
|
4645 |
-
|
4646 |
-
|
4647 |
-
|
4648 |
-
|
4649 |
-
|
4650 |
br1 = element("br");
|
4651 |
-
|
4652 |
-
add_location(h1, file$1, 166, 0,
|
4653 |
attr_dev(input0, "type", "text");
|
4654 |
-
add_location(input0, file$1, 170, 4,
|
4655 |
attr_dev(input1, "type", "checkbox");
|
4656 |
-
add_location(input1, file$1, 172, 4,
|
4657 |
attr_dev(textarea0, "id", "ytvideoids");
|
4658 |
attr_dev(textarea0, "cols", "40");
|
4659 |
attr_dev(textarea0, "rows", "1");
|
4660 |
attr_dev(textarea0, "placeholder", "Put video ids to learn here");
|
4661 |
-
add_location(textarea0, file$1, 174, 4,
|
4662 |
attr_dev(textarea1, "id", "ytmusicids");
|
4663 |
attr_dev(textarea1, "cols", "40");
|
4664 |
attr_dev(textarea1, "rows", "1");
|
4665 |
attr_dev(textarea1, "placeholder", "Put song ids to learn here");
|
4666 |
-
add_location(textarea1, file$1, 176, 4,
|
4667 |
-
add_location(label, file$1, 168, 0,
|
4668 |
attr_dev(div0, "id", "youtube-player");
|
4669 |
set_style(div0, "height", "90vh");
|
4670 |
set_style(div0, "width", "90%");
|
4671 |
-
add_location(div0, file$1, 180, 4,
|
4672 |
set_style(div1, "position", "absolute");
|
4673 |
set_style(div1, "top", "0%");
|
4674 |
set_style(div1, "left", "40%");
|
4675 |
set_style(div1, "color", "white");
|
4676 |
set_style(div1, "background-color", "rgba(0, 0, 0, 0.5)");
|
4677 |
-
add_location(div1, file$1, 181, 4,
|
4678 |
-
add_location(br0, file$1, 185, 15,
|
4679 |
set_style(div2, "position", "absolute");
|
4680 |
set_style(div2, "top", "50%");
|
4681 |
set_style(div2, "left", "20%");
|
4682 |
set_style(div2, "color", "white");
|
4683 |
set_style(div2, "background-color", "rgba(0, 0, 0, 0.5)");
|
4684 |
set_style(div2, "font-size", "100px");
|
4685 |
-
add_location(div2, file$1, 184, 4,
|
4686 |
set_style(div3, "position", "relative");
|
4687 |
-
add_location(div3, file$1, 179, 0,
|
4688 |
-
|
4689 |
-
|
4690 |
-
add_location(
|
4691 |
-
|
|
|
|
|
|
|
4692 |
button3.disabled = button3_disabled_value = /*currentuserIndex*/ ctx[0] <= 0;
|
4693 |
-
add_location(button3, file$1,
|
4694 |
-
attr_dev(button4, "class", button4_class_value = "" + (null_to_empty(/*nextButtonClass*/ ctx[
|
4695 |
button4.disabled = button4_disabled_value = /*currentuserIndex*/ ctx[0] >= /*userTimestamps*/ ctx[1].length - 1;
|
4696 |
-
add_location(button4, file$1,
|
4697 |
-
add_location(br1, file$1,
|
4698 |
},
|
4699 |
l: function claim(nodes) {
|
4700 |
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
@@ -4705,10 +4986,10 @@ var app = (function () {
|
|
4705 |
insert_dev(target, label, anchor);
|
4706 |
append_dev(label, t2);
|
4707 |
append_dev(label, input0);
|
4708 |
-
set_input_value(input0, /*currentvideoId*/ ctx[
|
4709 |
append_dev(label, t3);
|
4710 |
append_dev(label, input1);
|
4711 |
-
input1.checked = /*isUpdating*/ ctx[
|
4712 |
append_dev(label, t4);
|
4713 |
append_dev(label, textarea0);
|
4714 |
append_dev(label, t5);
|
@@ -4729,77 +5010,86 @@ var app = (function () {
|
|
4729 |
append_dev(div2, t14);
|
4730 |
append_dev(div2, t15);
|
4731 |
insert_dev(target, t16, anchor);
|
|
|
|
|
|
|
4732 |
insert_dev(target, button0, anchor);
|
4733 |
-
insert_dev(target,
|
4734 |
insert_dev(target, button1, anchor);
|
4735 |
-
insert_dev(target, t20, anchor);
|
4736 |
insert_dev(target, t21, anchor);
|
4737 |
insert_dev(target, t22, anchor);
|
4738 |
insert_dev(target, t23, anchor);
|
4739 |
insert_dev(target, t24, anchor);
|
|
|
4740 |
insert_dev(target, button2, anchor);
|
4741 |
-
insert_dev(target,
|
4742 |
insert_dev(target, button3, anchor);
|
4743 |
-
append_dev(button3,
|
4744 |
-
insert_dev(target,
|
4745 |
insert_dev(target, button4, anchor);
|
4746 |
-
append_dev(button4,
|
4747 |
-
insert_dev(target, t30, anchor);
|
4748 |
insert_dev(target, t31, anchor);
|
4749 |
insert_dev(target, t32, anchor);
|
4750 |
insert_dev(target, t33, anchor);
|
4751 |
insert_dev(target, t34, anchor);
|
4752 |
-
insert_dev(target, br1, anchor);
|
4753 |
insert_dev(target, t35, anchor);
|
|
|
|
|
4754 |
|
4755 |
if (!mounted) {
|
4756 |
dispose = [
|
4757 |
-
listen_dev(input0, "input", /*input0_input_handler*/ ctx[
|
4758 |
-
listen_dev(input1, "change", /*input1_change_handler*/ ctx[
|
4759 |
-
listen_dev(input1, "click", /*toggleUpdate*/ ctx[
|
4760 |
-
listen_dev(
|
4761 |
-
listen_dev(
|
4762 |
-
listen_dev(
|
4763 |
-
listen_dev(
|
4764 |
-
listen_dev(
|
|
|
4765 |
];
|
4766 |
|
4767 |
mounted = true;
|
4768 |
}
|
4769 |
},
|
4770 |
-
p: function update(ctx,
|
4771 |
-
if (dirty & /*currentvideoId*/
|
4772 |
-
set_input_value(input0, /*currentvideoId*/ ctx[
|
4773 |
}
|
4774 |
|
4775 |
-
if (dirty & /*isUpdating*/
|
4776 |
-
input1.checked = /*isUpdating*/ ctx[
|
4777 |
}
|
4778 |
|
4779 |
-
if (dirty & /*currentTime*/
|
4780 |
-
if (dirty & /*line*/
|
4781 |
-
if (dirty & /*currentWord*/
|
4782 |
-
if (dirty & /*currentIndex*/ 64) set_data_dev(t21, /*currentIndex*/ ctx[6]);
|
4783 |
-
if (dirty & /*timestamps*/ 128 && t23_value !== (t23_value = /*timestamps*/ ctx[7].length + "")) set_data_dev(t23, t23_value);
|
4784 |
|
4785 |
-
if (dirty & /*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4786 |
attr_dev(button3, "class", button3_class_value);
|
4787 |
}
|
4788 |
|
4789 |
-
if (dirty & /*currentuserIndex*/ 1 && button3_disabled_value !== (button3_disabled_value = /*currentuserIndex*/ ctx[0] <= 0)) {
|
4790 |
prop_dev(button3, "disabled", button3_disabled_value);
|
4791 |
}
|
4792 |
|
4793 |
-
if (dirty & /*nextButtonClass*/
|
4794 |
attr_dev(button4, "class", button4_class_value);
|
4795 |
}
|
4796 |
|
4797 |
-
if (dirty & /*currentuserIndex, userTimestamps*/ 3 && button4_disabled_value !== (button4_disabled_value = /*currentuserIndex*/ ctx[0] >= /*userTimestamps*/ ctx[1].length - 1)) {
|
4798 |
prop_dev(button4, "disabled", button4_disabled_value);
|
4799 |
}
|
4800 |
|
4801 |
-
if (dirty & /*currentuserIndex*/ 1) set_data_dev(
|
4802 |
-
if (dirty & /*userTimestamps*/ 2 &&
|
4803 |
},
|
4804 |
i: noop,
|
4805 |
o: noop,
|
@@ -4810,26 +5100,28 @@ var app = (function () {
|
|
4810 |
if (detaching) detach_dev(t6);
|
4811 |
if (detaching) detach_dev(div3);
|
4812 |
if (detaching) detach_dev(t16);
|
|
|
|
|
4813 |
if (detaching) detach_dev(button0);
|
4814 |
-
if (detaching) detach_dev(
|
4815 |
if (detaching) detach_dev(button1);
|
4816 |
-
if (detaching) detach_dev(t20);
|
4817 |
if (detaching) detach_dev(t21);
|
4818 |
if (detaching) detach_dev(t22);
|
4819 |
if (detaching) detach_dev(t23);
|
4820 |
if (detaching) detach_dev(t24);
|
|
|
4821 |
if (detaching) detach_dev(button2);
|
4822 |
-
if (detaching) detach_dev(
|
4823 |
if (detaching) detach_dev(button3);
|
4824 |
-
if (detaching) detach_dev(
|
4825 |
if (detaching) detach_dev(button4);
|
4826 |
-
if (detaching) detach_dev(t30);
|
4827 |
if (detaching) detach_dev(t31);
|
4828 |
if (detaching) detach_dev(t32);
|
4829 |
if (detaching) detach_dev(t33);
|
4830 |
if (detaching) detach_dev(t34);
|
4831 |
-
if (detaching) detach_dev(br1);
|
4832 |
if (detaching) detach_dev(t35);
|
|
|
|
|
4833 |
mounted = false;
|
4834 |
run_all(dispose);
|
4835 |
}
|
@@ -4846,8 +5138,6 @@ var app = (function () {
|
|
4846 |
return block;
|
4847 |
}
|
4848 |
|
4849 |
-
const interval = 10; // Define your interval
|
4850 |
-
|
4851 |
function getRandomWord(line) {
|
4852 |
let words = line.split(" ");
|
4853 |
return words[Math.floor(Math.random() * words.length)];
|
@@ -4859,6 +5149,7 @@ var app = (function () {
|
|
4859 |
let { $$slots: slots = {}, $$scope } = $$props;
|
4860 |
validate_slots('YoutubeIframeAPICustomInterface', slots, []);
|
4861 |
let player;
|
|
|
4862 |
let currentTime = 0;
|
4863 |
let timeUpdateInterval;
|
4864 |
|
@@ -4924,7 +5215,7 @@ var app = (function () {
|
|
4924 |
generatedTimestamps.push(i);
|
4925 |
}
|
4926 |
|
4927 |
-
$$invalidate(
|
4928 |
} // Do something with the timestamps
|
4929 |
//console.log("Generated Timestamps: ", generatedTimestamps);
|
4930 |
|
@@ -4942,12 +5233,12 @@ var app = (function () {
|
|
4942 |
? curr
|
4943 |
: prev);
|
4944 |
|
4945 |
-
$$invalidate(
|
4946 |
}
|
4947 |
|
4948 |
function updateCurrentTime() {
|
4949 |
if (player && player.getCurrentTime) {
|
4950 |
-
$$invalidate(
|
4951 |
}
|
4952 |
}
|
4953 |
|
@@ -4957,34 +5248,34 @@ var app = (function () {
|
|
4957 |
|
4958 |
function updateWord() {
|
4959 |
if (isUpdating) {
|
4960 |
-
$$invalidate(
|
4961 |
-
$$invalidate(
|
4962 |
}
|
4963 |
}
|
4964 |
|
4965 |
function toggleUpdate() {
|
4966 |
-
$$invalidate(
|
4967 |
|
4968 |
if (isUpdating) {
|
4969 |
updateWord(); // Immediately update once
|
4970 |
updateInterval = setInterval(updateWord, 3000); // Update every 3 seconds
|
4971 |
} else {
|
4972 |
clearInterval(updateInterval);
|
4973 |
-
$$invalidate(
|
4974 |
-
$$invalidate(
|
4975 |
}
|
4976 |
}
|
4977 |
|
4978 |
function goToNextAutoTimestamp() {
|
4979 |
if (currentIndex < timestamps.length - 1) {
|
4980 |
-
$$invalidate(
|
4981 |
player.seekTo(timestamps[currentIndex], true);
|
4982 |
}
|
4983 |
}
|
4984 |
|
4985 |
function goToPreviousAutoTimestamp() {
|
4986 |
if (currentIndex > 0) {
|
4987 |
-
$$invalidate(
|
4988 |
player.seekTo(timestamps[currentIndex], true);
|
4989 |
}
|
4990 |
}
|
@@ -5022,12 +5313,17 @@ var app = (function () {
|
|
5022 |
|
5023 |
function input0_input_handler() {
|
5024 |
currentvideoId = this.value;
|
5025 |
-
$$invalidate(
|
5026 |
}
|
5027 |
|
5028 |
function input1_change_handler() {
|
5029 |
isUpdating = this.checked;
|
5030 |
-
$$invalidate(
|
|
|
|
|
|
|
|
|
|
|
5031 |
}
|
5032 |
|
5033 |
$$self.$capture_state = () => ({
|
@@ -5067,21 +5363,22 @@ var app = (function () {
|
|
5067 |
|
5068 |
$$self.$inject_state = $$props => {
|
5069 |
if ('player' in $$props) player = $$props.player;
|
5070 |
-
if ('
|
|
|
5071 |
if ('timeUpdateInterval' in $$props) timeUpdateInterval = $$props.timeUpdateInterval;
|
5072 |
if ('transcript' in $$props) transcript = $$props.transcript;
|
5073 |
if ('lines' in $$props) lines = $$props.lines;
|
5074 |
-
if ('currentWord' in $$props) $$invalidate(
|
5075 |
-
if ('line' in $$props) $$invalidate(
|
5076 |
-
if ('isUpdating' in $$props) $$invalidate(
|
5077 |
if ('updateInterval' in $$props) updateInterval = $$props.updateInterval;
|
5078 |
-
if ('currentIndex' in $$props) $$invalidate(
|
5079 |
if ('currentuserIndex' in $$props) $$invalidate(0, currentuserIndex = $$props.currentuserIndex);
|
5080 |
-
if ('timestamps' in $$props) $$invalidate(
|
5081 |
if ('userTimestamps' in $$props) $$invalidate(1, userTimestamps = $$props.userTimestamps);
|
5082 |
-
if ('currentvideoId' in $$props) $$invalidate(
|
5083 |
-
if ('previousButtonClass' in $$props) $$invalidate(
|
5084 |
-
if ('nextButtonClass' in $$props) $$invalidate(
|
5085 |
};
|
5086 |
|
5087 |
if ($$props && "$$inject" in $$props) {
|
@@ -5089,20 +5386,21 @@ var app = (function () {
|
|
5089 |
}
|
5090 |
|
5091 |
$$self.$$.update = () => {
|
5092 |
-
if ($$self.$$.dirty & /*currentuserIndex, userTimestamps*/ 3) {
|
5093 |
-
$$invalidate(
|
5094 |
? 'button-at-end'
|
5095 |
: 'button');
|
5096 |
}
|
5097 |
|
5098 |
-
if ($$self.$$.dirty & /*currentuserIndex*/ 1) {
|
5099 |
-
$$invalidate(
|
5100 |
}
|
5101 |
};
|
5102 |
|
5103 |
return [
|
5104 |
currentuserIndex,
|
5105 |
userTimestamps,
|
|
|
5106 |
currentTime,
|
5107 |
currentWord,
|
5108 |
line,
|
@@ -5119,14 +5417,15 @@ var app = (function () {
|
|
5119 |
goToNextUserTimestamp,
|
5120 |
goToPreviousUserTimestamp,
|
5121 |
input0_input_handler,
|
5122 |
-
input1_change_handler
|
|
|
5123 |
];
|
5124 |
}
|
5125 |
|
5126 |
class YoutubeIframeAPICustomInterface extends SvelteComponentDev {
|
5127 |
constructor(options) {
|
5128 |
super(options);
|
5129 |
-
init(this, options, instance$1, create_fragment$1, safe_not_equal, {});
|
5130 |
|
5131 |
dispatch_dev("SvelteRegisterComponent", {
|
5132 |
component: this,
|
|
|
42 |
function is_empty(obj) {
|
43 |
return Object.keys(obj).length === 0;
|
44 |
}
|
45 |
+
function validate_store(store, name) {
|
46 |
+
if (store != null && typeof store.subscribe !== 'function') {
|
47 |
+
throw new Error(`'${name}' is not a store with a 'subscribe' method`);
|
48 |
+
}
|
49 |
+
}
|
50 |
+
function subscribe(store, ...callbacks) {
|
51 |
+
if (store == null) {
|
52 |
+
return noop;
|
53 |
+
}
|
54 |
+
const unsub = store.subscribe(...callbacks);
|
55 |
+
return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;
|
56 |
+
}
|
57 |
+
function component_subscribe(component, store, callback) {
|
58 |
+
component.$$.on_destroy.push(subscribe(store, callback));
|
59 |
+
}
|
60 |
function create_slot(definition, ctx, $$scope, fn) {
|
61 |
if (definition) {
|
62 |
const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);
|
|
|
217 |
else if (node.getAttribute(attribute) !== value)
|
218 |
node.setAttribute(attribute, value);
|
219 |
}
|
220 |
+
function to_number(value) {
|
221 |
+
return value === '' ? null : +value;
|
222 |
+
}
|
223 |
function children(element) {
|
224 |
return Array.from(element.childNodes);
|
225 |
}
|
|
|
353 |
function onDestroy(fn) {
|
354 |
get_current_component().$$.on_destroy.push(fn);
|
355 |
}
|
356 |
+
/**
|
357 |
+
* Creates an event dispatcher that can be used to dispatch [component events](/docs#template-syntax-component-directives-on-eventname).
|
358 |
+
* Event dispatchers are functions that can take two arguments: `name` and `detail`.
|
359 |
+
*
|
360 |
+
* Component events created with `createEventDispatcher` create a
|
361 |
+
* [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent).
|
362 |
+
* These events do not [bubble](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Events#Event_bubbling_and_capture).
|
363 |
+
* The `detail` argument corresponds to the [CustomEvent.detail](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/detail)
|
364 |
+
* property and can contain any type of data.
|
365 |
+
*
|
366 |
+
* https://svelte.dev/docs#run-time-svelte-createeventdispatcher
|
367 |
+
*/
|
368 |
+
function createEventDispatcher() {
|
369 |
+
const component = get_current_component();
|
370 |
+
return (type, detail, { cancelable = false } = {}) => {
|
371 |
+
const callbacks = component.$$.callbacks[type];
|
372 |
+
if (callbacks) {
|
373 |
+
// TODO are there situations where events could be dispatched
|
374 |
+
// in a server (non-DOM) environment?
|
375 |
+
const event = custom_event(type, detail, { cancelable });
|
376 |
+
callbacks.slice().forEach(fn => {
|
377 |
+
fn.call(component, event);
|
378 |
+
});
|
379 |
+
return !event.defaultPrevented;
|
380 |
+
}
|
381 |
+
return true;
|
382 |
+
};
|
383 |
+
}
|
384 |
// TODO figure out if we still want to support
|
385 |
// shorthand events, or if we want to implement
|
386 |
// a real bubbling mechanism
|
|
|
936 |
|
937 |
/* src\VideoGradioComponentBrainstorming.svelte generated by Svelte v3.59.2 */
|
938 |
|
939 |
+
const { console: console_1$3 } = globals;
|
940 |
const file$c = "src\\VideoGradioComponentBrainstorming.svelte";
|
941 |
|
942 |
function get_each_context$3(ctx, list, i) {
|
|
|
1241 |
const writable_props = [];
|
1242 |
|
1243 |
Object.keys($$props).forEach(key => {
|
1244 |
+
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$3.warn(`<VideoGradioComponentBrainstorming> was created with unknown prop '${key}'`);
|
1245 |
});
|
1246 |
|
1247 |
function canvas_1_binding($$value) {
|
|
|
1799 |
}
|
1800 |
}
|
1801 |
|
1802 |
+
const subscriber_queue = [];
|
1803 |
+
/**
|
1804 |
+
* Create a `Writable` store that allows both updating and reading by subscription.
|
1805 |
+
* @param {*=}value initial value
|
1806 |
+
* @param {StartStopNotifier=} start
|
1807 |
+
*/
|
1808 |
+
function writable(value, start = noop) {
|
1809 |
+
let stop;
|
1810 |
+
const subscribers = new Set();
|
1811 |
+
function set(new_value) {
|
1812 |
+
if (safe_not_equal(value, new_value)) {
|
1813 |
+
value = new_value;
|
1814 |
+
if (stop) { // store is ready
|
1815 |
+
const run_queue = !subscriber_queue.length;
|
1816 |
+
for (const subscriber of subscribers) {
|
1817 |
+
subscriber[1]();
|
1818 |
+
subscriber_queue.push(subscriber, value);
|
1819 |
+
}
|
1820 |
+
if (run_queue) {
|
1821 |
+
for (let i = 0; i < subscriber_queue.length; i += 2) {
|
1822 |
+
subscriber_queue[i][0](subscriber_queue[i + 1]);
|
1823 |
+
}
|
1824 |
+
subscriber_queue.length = 0;
|
1825 |
+
}
|
1826 |
+
}
|
1827 |
+
}
|
1828 |
+
}
|
1829 |
+
function update(fn) {
|
1830 |
+
set(fn(value));
|
1831 |
+
}
|
1832 |
+
function subscribe(run, invalidate = noop) {
|
1833 |
+
const subscriber = [run, invalidate];
|
1834 |
+
subscribers.add(subscriber);
|
1835 |
+
if (subscribers.size === 1) {
|
1836 |
+
stop = start(set) || noop;
|
1837 |
+
}
|
1838 |
+
run(value);
|
1839 |
+
return () => {
|
1840 |
+
subscribers.delete(subscriber);
|
1841 |
+
if (subscribers.size === 0 && stop) {
|
1842 |
+
stop();
|
1843 |
+
stop = null;
|
1844 |
+
}
|
1845 |
+
};
|
1846 |
+
}
|
1847 |
+
return { set, update, subscribe };
|
1848 |
+
}
|
1849 |
+
|
1850 |
/* src\MovingDotPortfromReact.svelte generated by Svelte v3.59.2 */
|
1851 |
const file$a = "src\\MovingDotPortfromReact.svelte";
|
1852 |
|
|
|
1859 |
attr_dev(div, "class", "MovingDot svelte-12o76ak");
|
1860 |
set_style(div, "left", /*position*/ ctx[0].x + "px");
|
1861 |
set_style(div, "top", /*position*/ ctx[0].y + "px");
|
1862 |
+
add_location(div, file$a, 47, 0, 1709);
|
1863 |
},
|
1864 |
l: function claim(nodes) {
|
1865 |
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
|
1901 |
validate_slots('MovingDotPortfromReact', slots, []);
|
1902 |
let { position = { x: 0, y: 0 } } = $$props;
|
1903 |
let { boundaries = { minX: 0, maxX: 100, minY: 0, maxY: 100 } } = $$props;
|
1904 |
+
const dispatch = createEventDispatcher();
|
1905 |
+
|
1906 |
+
function moveDot(newX, newY) {
|
1907 |
+
// Calculate new position here
|
1908 |
+
let newPosition = { x: newX, y: newY };
|
1909 |
+
|
1910 |
+
// Update position with a new object for Svelte reactivity
|
1911 |
+
let boundedX = Math.max(boundaries.minX, Math.min(newX, boundaries.maxX));
|
1912 |
+
|
1913 |
+
let boundedY = Math.max(boundaries.minY, Math.min(newY, boundaries.maxY));
|
1914 |
+
|
1915 |
+
// Update position
|
1916 |
+
$$invalidate(0, position = { x: boundedX, y: boundedY });
|
1917 |
+
|
1918 |
+
// Dispatch the move event with the new position
|
1919 |
+
dispatch('move', newPosition);
|
1920 |
+
}
|
1921 |
|
1922 |
const handleKeyPress = e => {
|
1923 |
e.preventDefault();
|
|
|
1939 |
break;
|
1940 |
}
|
1941 |
|
1942 |
+
moveDot(newX, newY);
|
1943 |
+
}; // // Restrict movement within boundaries
|
1944 |
+
// if (newX >= boundaries.minX && newX <= boundaries.maxX) position.x = newX;
|
1945 |
+
// if (newY >= boundaries.minY && newY <= boundaries.maxY) position.y = newY;
|
|
|
1946 |
|
1947 |
onMount(() => {
|
1948 |
window.addEventListener('keydown', handleKeyPress);
|
|
|
1965 |
|
1966 |
$$self.$capture_state = () => ({
|
1967 |
onMount,
|
1968 |
+
createEventDispatcher,
|
1969 |
position,
|
1970 |
boundaries,
|
1971 |
step,
|
1972 |
+
dispatch,
|
1973 |
+
moveDot,
|
1974 |
handleKeyPress
|
1975 |
});
|
1976 |
|
|
|
2121 |
}
|
2122 |
|
2123 |
/* src\MovingDotSpacePortfromReact.svelte generated by Svelte v3.59.2 */
|
2124 |
+
|
2125 |
+
const { console: console_1$2 } = globals;
|
2126 |
const file$8 = "src\\MovingDotSpacePortfromReact.svelte";
|
2127 |
|
2128 |
function get_each_context$1(ctx, list, i) {
|
2129 |
const child_ctx = ctx.slice();
|
2130 |
+
child_ctx[13] = list[i];
|
2131 |
return child_ctx;
|
2132 |
}
|
2133 |
|
2134 |
+
// (70:4) {#each $targets as target (target.name)}
|
2135 |
function create_each_block$1(key_1, ctx) {
|
2136 |
let first;
|
2137 |
let target;
|
2138 |
let t0;
|
2139 |
let span;
|
2140 |
+
let t1_value = /*target*/ ctx[13].name + "";
|
2141 |
let t1;
|
2142 |
let current;
|
2143 |
|
2144 |
target = new MovingDotTargetPortfromReact({
|
2145 |
+
props: { position: /*target*/ ctx[13] },
|
2146 |
$$inline: true
|
2147 |
});
|
2148 |
|
|
|
2156 |
span = element("span");
|
2157 |
t1 = text(t1_value);
|
2158 |
set_style(span, "position", "absolute");
|
2159 |
+
set_style(span, "left", /*target*/ ctx[13].x + "px");
|
2160 |
+
set_style(span, "top", /*target*/ ctx[13].y + "px");
|
2161 |
+
add_location(span, file$8, 71, 8, 3555);
|
2162 |
this.first = first;
|
2163 |
},
|
2164 |
m: function mount(target$1, anchor) {
|
|
|
2171 |
},
|
2172 |
p: function update(new_ctx, dirty) {
|
2173 |
ctx = new_ctx;
|
2174 |
+
const target_changes = {};
|
2175 |
+
if (dirty & /*$targets*/ 8) target_changes.position = /*target*/ ctx[13];
|
2176 |
+
target.$set(target_changes);
|
2177 |
+
if ((!current || dirty & /*$targets*/ 8) && t1_value !== (t1_value = /*target*/ ctx[13].name + "")) set_data_dev(t1, t1_value);
|
2178 |
+
|
2179 |
+
if (!current || dirty & /*$targets*/ 8) {
|
2180 |
+
set_style(span, "left", /*target*/ ctx[13].x + "px");
|
2181 |
+
}
|
2182 |
+
|
2183 |
+
if (!current || dirty & /*$targets*/ 8) {
|
2184 |
+
set_style(span, "top", /*target*/ ctx[13].y + "px");
|
2185 |
+
}
|
2186 |
},
|
2187 |
i: function intro(local) {
|
2188 |
if (current) return;
|
|
|
2205 |
block,
|
2206 |
id: create_each_block$1.name,
|
2207 |
type: "each",
|
2208 |
+
source: "(70:4) {#each $targets as target (target.name)}",
|
2209 |
ctx
|
2210 |
});
|
2211 |
|
2212 |
return block;
|
2213 |
}
|
2214 |
|
2215 |
+
// (76:4) {#if isModalOpen}
|
2216 |
function create_if_block$5(ctx) {
|
2217 |
const block = { c: noop, m: noop, d: noop };
|
2218 |
|
|
|
2220 |
block,
|
2221 |
id: create_if_block$5.name,
|
2222 |
type: "if",
|
2223 |
+
source: "(76:4) {#if isModalOpen}",
|
2224 |
ctx
|
2225 |
});
|
2226 |
|
|
|
2230 |
function create_fragment$8(ctx) {
|
2231 |
let div1;
|
2232 |
let div0;
|
2233 |
+
let t0;
|
2234 |
+
let t1_value = /*$dotPosition*/ ctx[0].x + "";
|
2235 |
let t1;
|
|
|
2236 |
let t2;
|
2237 |
+
let t3_value = /*$dotPosition*/ ctx[0].y + "";
|
2238 |
let t3;
|
2239 |
+
let t4;
|
2240 |
+
let canvas_1;
|
2241 |
+
let t5;
|
2242 |
+
let movingdot;
|
2243 |
+
let t6;
|
2244 |
let each_blocks = [];
|
2245 |
let each_1_lookup = new Map();
|
2246 |
+
let t7;
|
2247 |
let current;
|
2248 |
|
2249 |
movingdot = new MovingDotPortfromReact({
|
2250 |
props: {
|
2251 |
+
position: /*$dotPosition*/ ctx[0],
|
2252 |
+
boundaries: /*boundaries*/ ctx[6]
|
2253 |
},
|
2254 |
$$inline: true
|
2255 |
});
|
2256 |
|
2257 |
+
movingdot.$on("move", /*move_handler*/ ctx[10]);
|
2258 |
+
let each_value = /*$targets*/ ctx[3];
|
2259 |
validate_each_argument(each_value);
|
2260 |
+
const get_key = ctx => /*target*/ ctx[13].name;
|
2261 |
validate_each_keys(ctx, each_value, get_each_context$1, get_key);
|
2262 |
|
2263 |
for (let i = 0; i < each_value.length; i += 1) {
|
|
|
2266 |
each_1_lookup.set(key, each_blocks[i] = create_each_block$1(key, child_ctx));
|
2267 |
}
|
2268 |
|
2269 |
+
let if_block = /*isModalOpen*/ ctx[2] && create_if_block$5(ctx);
|
2270 |
|
2271 |
const block = {
|
2272 |
c: function create() {
|
2273 |
div1 = element("div");
|
2274 |
div0 = element("div");
|
2275 |
+
t0 = text("Minor Game Events Log for player ||| Position for Developer ");
|
2276 |
+
t1 = text(t1_value);
|
|
|
2277 |
t2 = space();
|
2278 |
+
t3 = text(t3_value);
|
2279 |
+
t4 = space();
|
2280 |
+
canvas_1 = element("canvas");
|
2281 |
+
t5 = space();
|
2282 |
create_component(movingdot.$$.fragment);
|
2283 |
+
t6 = space();
|
2284 |
|
2285 |
for (let i = 0; i < each_blocks.length; i += 1) {
|
2286 |
each_blocks[i].c();
|
2287 |
}
|
2288 |
|
2289 |
+
t7 = space();
|
2290 |
if (if_block) if_block.c();
|
2291 |
attr_dev(div0, "id", "overlayText");
|
2292 |
attr_dev(div0, "class", "svelte-e0peue");
|
2293 |
+
add_location(div0, file$8, 66, 4, 3145);
|
2294 |
attr_dev(canvas_1, "width", "100%");
|
2295 |
attr_dev(canvas_1, "height", "100%");
|
2296 |
attr_dev(canvas_1, "tabindex", "0");
|
2297 |
+
add_location(canvas_1, file$8, 67, 4, 3273);
|
2298 |
+
attr_dev(div1, "style", /*spaceStyle*/ ctx[8]);
|
2299 |
+
add_location(div1, file$8, 65, 0, 3115);
|
2300 |
},
|
2301 |
l: function claim(nodes) {
|
2302 |
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
|
2304 |
m: function mount(target, anchor) {
|
2305 |
insert_dev(target, div1, anchor);
|
2306 |
append_dev(div1, div0);
|
2307 |
+
append_dev(div0, t0);
|
2308 |
+
append_dev(div0, t1);
|
2309 |
+
append_dev(div0, t2);
|
2310 |
+
append_dev(div0, t3);
|
2311 |
+
append_dev(div1, t4);
|
2312 |
append_dev(div1, canvas_1);
|
2313 |
+
/*canvas_1_binding*/ ctx[9](canvas_1);
|
2314 |
+
append_dev(div1, t5);
|
2315 |
mount_component(movingdot, div1, null);
|
2316 |
+
append_dev(div1, t6);
|
2317 |
|
2318 |
for (let i = 0; i < each_blocks.length; i += 1) {
|
2319 |
if (each_blocks[i]) {
|
|
|
2321 |
}
|
2322 |
}
|
2323 |
|
2324 |
+
append_dev(div1, t7);
|
2325 |
if (if_block) if_block.m(div1, null);
|
2326 |
current = true;
|
2327 |
},
|
2328 |
p: function update(ctx, [dirty]) {
|
2329 |
+
if ((!current || dirty & /*$dotPosition*/ 1) && t1_value !== (t1_value = /*$dotPosition*/ ctx[0].x + "")) set_data_dev(t1, t1_value);
|
2330 |
+
if ((!current || dirty & /*$dotPosition*/ 1) && t3_value !== (t3_value = /*$dotPosition*/ ctx[0].y + "")) set_data_dev(t3, t3_value);
|
2331 |
+
const movingdot_changes = {};
|
2332 |
+
if (dirty & /*$dotPosition*/ 1) movingdot_changes.position = /*$dotPosition*/ ctx[0];
|
2333 |
+
movingdot.$set(movingdot_changes);
|
2334 |
+
|
2335 |
+
if (dirty & /*$targets*/ 8) {
|
2336 |
+
each_value = /*$targets*/ ctx[3];
|
2337 |
validate_each_argument(each_value);
|
2338 |
group_outros();
|
2339 |
validate_each_keys(ctx, each_value, get_each_context$1, get_key);
|
2340 |
+
each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value, each_1_lookup, div1, outro_and_destroy_block, create_each_block$1, t7, get_each_context$1);
|
2341 |
check_outros();
|
2342 |
}
|
2343 |
+
|
2344 |
+
if (/*isModalOpen*/ ctx[2]) {
|
2345 |
+
if (if_block) ; else {
|
2346 |
+
if_block = create_if_block$5(ctx);
|
2347 |
+
if_block.c();
|
2348 |
+
if_block.m(div1, null);
|
2349 |
+
}
|
2350 |
+
} else if (if_block) {
|
2351 |
+
if_block.d(1);
|
2352 |
+
if_block = null;
|
2353 |
+
}
|
2354 |
},
|
2355 |
i: function intro(local) {
|
2356 |
if (current) return;
|
|
|
2373 |
},
|
2374 |
d: function destroy(detaching) {
|
2375 |
if (detaching) detach_dev(div1);
|
2376 |
+
/*canvas_1_binding*/ ctx[9](null);
|
2377 |
destroy_component(movingdot);
|
2378 |
|
2379 |
for (let i = 0; i < each_blocks.length; i += 1) {
|
|
|
2395 |
return block;
|
2396 |
}
|
2397 |
|
|
|
|
|
|
|
|
|
|
|
2398 |
function instance$8($$self, $$props, $$invalidate) {
|
2399 |
+
let $dotPosition;
|
2400 |
+
let $targets;
|
2401 |
let { $$slots: slots = {}, $$scope } = $$props;
|
2402 |
validate_slots('MovingDotSpacePortfromReact', slots, []);
|
2403 |
let canvas;
|
2404 |
+
let dotPosition = writable({ x: 900, y: 450 });
|
2405 |
+
validate_store(dotPosition, 'dotPosition');
|
2406 |
+
component_subscribe($$self, dotPosition, value => $$invalidate(0, $dotPosition = value));
|
2407 |
|
2408 |
+
let targets = writable([
|
2409 |
+
{
|
2410 |
+
name: "Target 1",
|
2411 |
+
x: 50,
|
2412 |
+
y: 50,
|
2413 |
+
collisionType: "alert",
|
2414 |
+
collisiontext: "First Test"
|
2415 |
+
},
|
2416 |
+
{
|
2417 |
+
name: "Target 2",
|
2418 |
+
x: 100,
|
2419 |
+
y: 100,
|
2420 |
+
collisionType: "",
|
2421 |
+
collisiontext: ""
|
2422 |
+
},
|
2423 |
+
{
|
2424 |
+
name: "Entrance",
|
2425 |
+
x: 995,
|
2426 |
+
y: 660,
|
2427 |
+
collisionType: "",
|
2428 |
+
collisiontext: ""
|
2429 |
+
},
|
2430 |
+
// Add more targets as needed
|
2431 |
+
{
|
2432 |
+
name: "Market Stall",
|
2433 |
+
x: 200,
|
2434 |
+
y: 300,
|
2435 |
+
collisionType: "",
|
2436 |
+
collisiontext: ""
|
2437 |
+
},
|
2438 |
+
{
|
2439 |
+
name: "Inn Entrance", // A market stall in the bustling market area.
|
2440 |
+
x: 400,
|
2441 |
+
y: 450,
|
2442 |
+
collisionType: "",
|
2443 |
+
collisiontext: ""
|
2444 |
+
},
|
2445 |
+
{
|
2446 |
+
name: "Town Hall", // The entrance to the inn for rest or information.
|
2447 |
+
x: 600,
|
2448 |
+
y: 350,
|
2449 |
+
collisionType: "",
|
2450 |
+
collisiontext: ""
|
2451 |
+
},
|
2452 |
+
{
|
2453 |
+
name: "Fountain", // The entrance to the town hall for quests.
|
2454 |
+
x: 500,
|
2455 |
+
y: 500,
|
2456 |
+
collisionType: "",
|
2457 |
+
collisiontext: ""
|
2458 |
+
},
|
2459 |
+
{
|
2460 |
+
name: "Bridge", // A fountain in the town square as a meeting point.
|
2461 |
+
x: 1100,
|
2462 |
+
y: 700,
|
2463 |
+
collisionType: "",
|
2464 |
+
collisiontext: ""
|
2465 |
+
},
|
2466 |
+
{
|
2467 |
+
name: "Waterfall", // A bridge in the mystical forest area.
|
2468 |
+
x: 1300,
|
2469 |
+
y: 800,
|
2470 |
+
collisionType: "",
|
2471 |
+
collisiontext: ""
|
2472 |
+
},
|
2473 |
+
{
|
2474 |
+
name: "Mountain Peak", // A waterfall that could hide secrets or treasures.
|
2475 |
+
x: 1500,
|
2476 |
+
y: 100,
|
2477 |
+
collisionType: "",
|
2478 |
+
collisiontext: ""
|
2479 |
+
}
|
2480 |
+
]);
|
2481 |
|
2482 |
+
validate_store(targets, 'targets');
|
2483 |
+
component_subscribe($$self, targets, value => $$invalidate(3, $targets = value));
|
2484 |
let boundaries = { maxX: 1885, maxY: 900, minX: 0, minY: 0 };
|
2485 |
let isModalOpen = false;
|
2486 |
+
|
2487 |
+
function updateDotPosition(newX, newY) {
|
2488 |
+
dotPosition.set({ x: newX, y: newY });
|
2489 |
+
}
|
2490 |
+
|
2491 |
+
// Collision check function
|
2492 |
+
const checkCollision = dotPos => {
|
2493 |
+
$targets.forEach(target => {
|
2494 |
+
if (dotPos.x < target.x + 10 && dotPos.x + 10 > target.x && dotPos.y < target.y + 10 && dotPos.y + 10 > target.y) {
|
2495 |
+
handleCollision(target);
|
2496 |
+
}
|
2497 |
+
});
|
2498 |
+
};
|
2499 |
+
|
2500 |
+
// Handle collision based on the target object
|
2501 |
+
const handleCollision = target => {
|
2502 |
+
switch (target.collisionType) {
|
2503 |
+
case "":
|
2504 |
+
console.log("Nothing Happenedddd");
|
2505 |
+
break;
|
2506 |
+
case "alert":
|
2507 |
+
alert(target.collisiontext);
|
2508 |
+
break;
|
2509 |
+
case "modal":
|
2510 |
+
$$invalidate(2, isModalOpen = true);
|
2511 |
+
break;
|
2512 |
+
} // Handle other permanent UI elements here
|
2513 |
+
}; // ...
|
2514 |
+
|
2515 |
const spaceStyle = `position: relative; width: 100%; height: 100vh; border: 1px solid black; overflow: hidden; background-image: url('/AutoGameBackgrounds/1stGameLoc123.png'); background-size: cover; background-position: center;`;
|
2516 |
const writable_props = [];
|
2517 |
|
2518 |
Object.keys($$props).forEach(key => {
|
2519 |
+
if (!~writable_props.indexOf(key) && key.slice(0, 2) !== '$$' && key !== 'slot') console_1$2.warn(`<MovingDotSpacePortfromReact> was created with unknown prop '${key}'`);
|
2520 |
});
|
2521 |
|
2522 |
function canvas_1_binding($$value) {
|
2523 |
binding_callbacks[$$value ? 'unshift' : 'push'](() => {
|
2524 |
canvas = $$value;
|
2525 |
+
$$invalidate(1, canvas);
|
2526 |
});
|
2527 |
}
|
2528 |
|
2529 |
+
const move_handler = e => updateDotPosition(e.detail.x, e.detail.y);
|
2530 |
+
|
2531 |
$$self.$capture_state = () => ({
|
2532 |
onMount,
|
2533 |
+
writable,
|
2534 |
MovingDot: MovingDotPortfromReact,
|
2535 |
Target: MovingDotTargetPortfromReact,
|
2536 |
canvas,
|
|
|
2538 |
targets,
|
2539 |
boundaries,
|
2540 |
isModalOpen,
|
2541 |
+
updateDotPosition,
|
2542 |
checkCollision,
|
2543 |
+
handleCollision,
|
2544 |
+
spaceStyle,
|
2545 |
+
$dotPosition,
|
2546 |
+
$targets
|
2547 |
});
|
2548 |
|
2549 |
$$self.$inject_state = $$props => {
|
2550 |
+
if ('canvas' in $$props) $$invalidate(1, canvas = $$props.canvas);
|
2551 |
+
if ('dotPosition' in $$props) $$invalidate(4, dotPosition = $$props.dotPosition);
|
2552 |
+
if ('targets' in $$props) $$invalidate(5, targets = $$props.targets);
|
2553 |
+
if ('boundaries' in $$props) $$invalidate(6, boundaries = $$props.boundaries);
|
2554 |
+
if ('isModalOpen' in $$props) $$invalidate(2, isModalOpen = $$props.isModalOpen);
|
2555 |
};
|
2556 |
|
2557 |
if ($$props && "$$inject" in $$props) {
|
2558 |
$$self.$inject_state($$props.$$inject);
|
2559 |
}
|
2560 |
|
2561 |
+
$$self.$$.update = () => {
|
2562 |
+
if ($$self.$$.dirty & /*$dotPosition*/ 1) {
|
2563 |
+
// Reactive statement to check collision whenever dotPosition changes
|
2564 |
+
$dotPosition && checkCollision($dotPosition);
|
2565 |
+
}
|
2566 |
+
};
|
2567 |
+
|
2568 |
return [
|
2569 |
+
$dotPosition,
|
2570 |
canvas,
|
2571 |
+
isModalOpen,
|
2572 |
+
$targets,
|
2573 |
dotPosition,
|
2574 |
targets,
|
2575 |
boundaries,
|
2576 |
+
updateDotPosition,
|
2577 |
spaceStyle,
|
2578 |
+
canvas_1_binding,
|
2579 |
+
move_handler
|
2580 |
];
|
2581 |
}
|
2582 |
|
|
|
4826 |
let t7;
|
4827 |
let div1;
|
4828 |
let t8;
|
4829 |
+
let t9_value = /*currentTime*/ ctx[3].toFixed(2) + "";
|
4830 |
let t9;
|
4831 |
let t10;
|
4832 |
let t11;
|
|
|
4837 |
let t14;
|
4838 |
let t15;
|
4839 |
let t16;
|
4840 |
+
let input2;
|
4841 |
+
let t17;
|
4842 |
let button0;
|
4843 |
+
let t19;
|
4844 |
let button1;
|
|
|
4845 |
let t21;
|
4846 |
let t22;
|
|
|
4847 |
let t23;
|
4848 |
+
let t24_value = /*timestamps*/ ctx[8].length + "";
|
4849 |
let t24;
|
4850 |
+
let t25;
|
4851 |
let button2;
|
|
|
|
|
4852 |
let t27;
|
4853 |
+
let button3;
|
4854 |
+
let t28;
|
4855 |
let button3_class_value;
|
4856 |
let button3_disabled_value;
|
|
|
|
|
4857 |
let t29;
|
4858 |
+
let button4;
|
4859 |
+
let t30;
|
4860 |
let button4_class_value;
|
4861 |
let button4_disabled_value;
|
|
|
4862 |
let t31;
|
4863 |
let t32;
|
|
|
4864 |
let t33;
|
4865 |
+
let t34_value = /*userTimestamps*/ ctx[1].length + "";
|
4866 |
let t34;
|
|
|
4867 |
let t35;
|
4868 |
+
let br1;
|
4869 |
+
let t36;
|
4870 |
let mounted;
|
4871 |
let dispose;
|
4872 |
|
|
|
4894 |
t10 = text(" seconds");
|
4895 |
t11 = space();
|
4896 |
div2 = element("div");
|
4897 |
+
t12 = text(/*line*/ ctx[5]);
|
4898 |
t13 = space();
|
4899 |
br0 = element("br");
|
4900 |
t14 = space();
|
4901 |
+
t15 = text(/*currentWord*/ ctx[4]);
|
4902 |
t16 = space();
|
4903 |
+
input2 = element("input");
|
4904 |
+
t17 = space();
|
4905 |
button0 = element("button");
|
4906 |
button0.textContent = "Previous Auto Timestamp";
|
4907 |
+
t19 = space();
|
4908 |
button1 = element("button");
|
4909 |
button1.textContent = "Next Auto Timestamp";
|
4910 |
+
t21 = text("\r\nAuto Timestamps: ");
|
4911 |
+
t22 = text(/*currentIndex*/ ctx[7]);
|
4912 |
+
t23 = text(" / ");
|
4913 |
+
t24 = text(t24_value);
|
4914 |
+
t25 = text(" ||| \r\n");
|
4915 |
button2 = element("button");
|
4916 |
button2.textContent = "Add Timestamp";
|
4917 |
+
t27 = space();
|
4918 |
button3 = element("button");
|
4919 |
+
t28 = text("Previous User Timestamp");
|
4920 |
+
t29 = space();
|
4921 |
button4 = element("button");
|
4922 |
+
t30 = text("Next User Timestamp");
|
4923 |
+
t31 = text("\r\nUser Timestamps: ");
|
4924 |
+
t32 = text(/*currentuserIndex*/ ctx[0]);
|
4925 |
+
t33 = text(" / ");
|
4926 |
+
t34 = text(t34_value);
|
4927 |
+
t35 = space();
|
4928 |
br1 = element("br");
|
4929 |
+
t36 = text("A list of one messes up the logic for the counter in conjuction with the user timestamp button reactivity");
|
4930 |
+
add_location(h1, file$1, 166, 0, 5475);
|
4931 |
attr_dev(input0, "type", "text");
|
4932 |
+
add_location(input0, file$1, 170, 4, 5604);
|
4933 |
attr_dev(input1, "type", "checkbox");
|
4934 |
+
add_location(input1, file$1, 172, 4, 5685);
|
4935 |
attr_dev(textarea0, "id", "ytvideoids");
|
4936 |
attr_dev(textarea0, "cols", "40");
|
4937 |
attr_dev(textarea0, "rows", "1");
|
4938 |
attr_dev(textarea0, "placeholder", "Put video ids to learn here");
|
4939 |
+
add_location(textarea0, file$1, 174, 4, 5778);
|
4940 |
attr_dev(textarea1, "id", "ytmusicids");
|
4941 |
attr_dev(textarea1, "cols", "40");
|
4942 |
attr_dev(textarea1, "rows", "1");
|
4943 |
attr_dev(textarea1, "placeholder", "Put song ids to learn here");
|
4944 |
+
add_location(textarea1, file$1, 176, 4, 5896);
|
4945 |
+
add_location(label, file$1, 168, 0, 5538);
|
4946 |
attr_dev(div0, "id", "youtube-player");
|
4947 |
set_style(div0, "height", "90vh");
|
4948 |
set_style(div0, "width", "90%");
|
4949 |
+
add_location(div0, file$1, 180, 4, 6046);
|
4950 |
set_style(div1, "position", "absolute");
|
4951 |
set_style(div1, "top", "0%");
|
4952 |
set_style(div1, "left", "40%");
|
4953 |
set_style(div1, "color", "white");
|
4954 |
set_style(div1, "background-color", "rgba(0, 0, 0, 0.5)");
|
4955 |
+
add_location(div1, file$1, 181, 4, 6116);
|
4956 |
+
add_location(br0, file$1, 185, 15, 6436);
|
4957 |
set_style(div2, "position", "absolute");
|
4958 |
set_style(div2, "top", "50%");
|
4959 |
set_style(div2, "left", "20%");
|
4960 |
set_style(div2, "color", "white");
|
4961 |
set_style(div2, "background-color", "rgba(0, 0, 0, 0.5)");
|
4962 |
set_style(div2, "font-size", "100px");
|
4963 |
+
add_location(div2, file$1, 184, 4, 6295);
|
4964 |
set_style(div3, "position", "relative");
|
4965 |
+
add_location(div3, file$1, 179, 0, 6007);
|
4966 |
+
set_style(input2, "width", "30px");
|
4967 |
+
attr_dev(input2, "type", "number");
|
4968 |
+
add_location(input2, file$1, 190, 0, 6487);
|
4969 |
+
add_location(button0, file$1, 191, 0, 6553);
|
4970 |
+
add_location(button1, file$1, 192, 0, 6632);
|
4971 |
+
add_location(button2, file$1, 194, 0, 6764);
|
4972 |
+
attr_dev(button3, "class", button3_class_value = "" + (null_to_empty(/*previousButtonClass*/ ctx[10]) + " svelte-1g3vo12"));
|
4973 |
button3.disabled = button3_disabled_value = /*currentuserIndex*/ ctx[0] <= 0;
|
4974 |
+
add_location(button3, file$1, 195, 0, 6824);
|
4975 |
+
attr_dev(button4, "class", button4_class_value = "" + (null_to_empty(/*nextButtonClass*/ ctx[11]) + " svelte-1g3vo12"));
|
4976 |
button4.disabled = button4_disabled_value = /*currentuserIndex*/ ctx[0] >= /*userTimestamps*/ ctx[1].length - 1;
|
4977 |
+
add_location(button4, file$1, 196, 0, 6964);
|
4978 |
+
add_location(br1, file$1, 197, 62, 7178);
|
4979 |
},
|
4980 |
l: function claim(nodes) {
|
4981 |
throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
|
|
|
4986 |
insert_dev(target, label, anchor);
|
4987 |
append_dev(label, t2);
|
4988 |
append_dev(label, input0);
|
4989 |
+
set_input_value(input0, /*currentvideoId*/ ctx[9]);
|
4990 |
append_dev(label, t3);
|
4991 |
append_dev(label, input1);
|
4992 |
+
input1.checked = /*isUpdating*/ ctx[6];
|
4993 |
append_dev(label, t4);
|
4994 |
append_dev(label, textarea0);
|
4995 |
append_dev(label, t5);
|
|
|
5010 |
append_dev(div2, t14);
|
5011 |
append_dev(div2, t15);
|
5012 |
insert_dev(target, t16, anchor);
|
5013 |
+
insert_dev(target, input2, anchor);
|
5014 |
+
set_input_value(input2, /*interval*/ ctx[2]);
|
5015 |
+
insert_dev(target, t17, anchor);
|
5016 |
insert_dev(target, button0, anchor);
|
5017 |
+
insert_dev(target, t19, anchor);
|
5018 |
insert_dev(target, button1, anchor);
|
|
|
5019 |
insert_dev(target, t21, anchor);
|
5020 |
insert_dev(target, t22, anchor);
|
5021 |
insert_dev(target, t23, anchor);
|
5022 |
insert_dev(target, t24, anchor);
|
5023 |
+
insert_dev(target, t25, anchor);
|
5024 |
insert_dev(target, button2, anchor);
|
5025 |
+
insert_dev(target, t27, anchor);
|
5026 |
insert_dev(target, button3, anchor);
|
5027 |
+
append_dev(button3, t28);
|
5028 |
+
insert_dev(target, t29, anchor);
|
5029 |
insert_dev(target, button4, anchor);
|
5030 |
+
append_dev(button4, t30);
|
|
|
5031 |
insert_dev(target, t31, anchor);
|
5032 |
insert_dev(target, t32, anchor);
|
5033 |
insert_dev(target, t33, anchor);
|
5034 |
insert_dev(target, t34, anchor);
|
|
|
5035 |
insert_dev(target, t35, anchor);
|
5036 |
+
insert_dev(target, br1, anchor);
|
5037 |
+
insert_dev(target, t36, anchor);
|
5038 |
|
5039 |
if (!mounted) {
|
5040 |
dispose = [
|
5041 |
+
listen_dev(input0, "input", /*input0_input_handler*/ ctx[18]),
|
5042 |
+
listen_dev(input1, "change", /*input1_change_handler*/ ctx[19]),
|
5043 |
+
listen_dev(input1, "click", /*toggleUpdate*/ ctx[12], false, false, false, false),
|
5044 |
+
listen_dev(input2, "input", /*input2_input_handler*/ ctx[20]),
|
5045 |
+
listen_dev(button0, "click", /*goToPreviousAutoTimestamp*/ ctx[14], false, false, false, false),
|
5046 |
+
listen_dev(button1, "click", /*goToNextAutoTimestamp*/ ctx[13], false, false, false, false),
|
5047 |
+
listen_dev(button2, "click", /*addUserTimestamp*/ ctx[15], false, false, false, false),
|
5048 |
+
listen_dev(button3, "click", /*goToPreviousUserTimestamp*/ ctx[17], false, false, false, false),
|
5049 |
+
listen_dev(button4, "click", /*goToNextUserTimestamp*/ ctx[16], false, false, false, false)
|
5050 |
];
|
5051 |
|
5052 |
mounted = true;
|
5053 |
}
|
5054 |
},
|
5055 |
+
p: function update(ctx, dirty) {
|
5056 |
+
if (dirty[0] & /*currentvideoId*/ 512 && input0.value !== /*currentvideoId*/ ctx[9]) {
|
5057 |
+
set_input_value(input0, /*currentvideoId*/ ctx[9]);
|
5058 |
}
|
5059 |
|
5060 |
+
if (dirty[0] & /*isUpdating*/ 64) {
|
5061 |
+
input1.checked = /*isUpdating*/ ctx[6];
|
5062 |
}
|
5063 |
|
5064 |
+
if (dirty[0] & /*currentTime*/ 8 && t9_value !== (t9_value = /*currentTime*/ ctx[3].toFixed(2) + "")) set_data_dev(t9, t9_value);
|
5065 |
+
if (dirty[0] & /*line*/ 32) set_data_dev(t12, /*line*/ ctx[5]);
|
5066 |
+
if (dirty[0] & /*currentWord*/ 16) set_data_dev(t15, /*currentWord*/ ctx[4]);
|
|
|
|
|
5067 |
|
5068 |
+
if (dirty[0] & /*interval*/ 4 && to_number(input2.value) !== /*interval*/ ctx[2]) {
|
5069 |
+
set_input_value(input2, /*interval*/ ctx[2]);
|
5070 |
+
}
|
5071 |
+
|
5072 |
+
if (dirty[0] & /*currentIndex*/ 128) set_data_dev(t22, /*currentIndex*/ ctx[7]);
|
5073 |
+
if (dirty[0] & /*timestamps*/ 256 && t24_value !== (t24_value = /*timestamps*/ ctx[8].length + "")) set_data_dev(t24, t24_value);
|
5074 |
+
|
5075 |
+
if (dirty[0] & /*previousButtonClass*/ 1024 && button3_class_value !== (button3_class_value = "" + (null_to_empty(/*previousButtonClass*/ ctx[10]) + " svelte-1g3vo12"))) {
|
5076 |
attr_dev(button3, "class", button3_class_value);
|
5077 |
}
|
5078 |
|
5079 |
+
if (dirty[0] & /*currentuserIndex*/ 1 && button3_disabled_value !== (button3_disabled_value = /*currentuserIndex*/ ctx[0] <= 0)) {
|
5080 |
prop_dev(button3, "disabled", button3_disabled_value);
|
5081 |
}
|
5082 |
|
5083 |
+
if (dirty[0] & /*nextButtonClass*/ 2048 && button4_class_value !== (button4_class_value = "" + (null_to_empty(/*nextButtonClass*/ ctx[11]) + " svelte-1g3vo12"))) {
|
5084 |
attr_dev(button4, "class", button4_class_value);
|
5085 |
}
|
5086 |
|
5087 |
+
if (dirty[0] & /*currentuserIndex, userTimestamps*/ 3 && button4_disabled_value !== (button4_disabled_value = /*currentuserIndex*/ ctx[0] >= /*userTimestamps*/ ctx[1].length - 1)) {
|
5088 |
prop_dev(button4, "disabled", button4_disabled_value);
|
5089 |
}
|
5090 |
|
5091 |
+
if (dirty[0] & /*currentuserIndex*/ 1) set_data_dev(t32, /*currentuserIndex*/ ctx[0]);
|
5092 |
+
if (dirty[0] & /*userTimestamps*/ 2 && t34_value !== (t34_value = /*userTimestamps*/ ctx[1].length + "")) set_data_dev(t34, t34_value);
|
5093 |
},
|
5094 |
i: noop,
|
5095 |
o: noop,
|
|
|
5100 |
if (detaching) detach_dev(t6);
|
5101 |
if (detaching) detach_dev(div3);
|
5102 |
if (detaching) detach_dev(t16);
|
5103 |
+
if (detaching) detach_dev(input2);
|
5104 |
+
if (detaching) detach_dev(t17);
|
5105 |
if (detaching) detach_dev(button0);
|
5106 |
+
if (detaching) detach_dev(t19);
|
5107 |
if (detaching) detach_dev(button1);
|
|
|
5108 |
if (detaching) detach_dev(t21);
|
5109 |
if (detaching) detach_dev(t22);
|
5110 |
if (detaching) detach_dev(t23);
|
5111 |
if (detaching) detach_dev(t24);
|
5112 |
+
if (detaching) detach_dev(t25);
|
5113 |
if (detaching) detach_dev(button2);
|
5114 |
+
if (detaching) detach_dev(t27);
|
5115 |
if (detaching) detach_dev(button3);
|
5116 |
+
if (detaching) detach_dev(t29);
|
5117 |
if (detaching) detach_dev(button4);
|
|
|
5118 |
if (detaching) detach_dev(t31);
|
5119 |
if (detaching) detach_dev(t32);
|
5120 |
if (detaching) detach_dev(t33);
|
5121 |
if (detaching) detach_dev(t34);
|
|
|
5122 |
if (detaching) detach_dev(t35);
|
5123 |
+
if (detaching) detach_dev(br1);
|
5124 |
+
if (detaching) detach_dev(t36);
|
5125 |
mounted = false;
|
5126 |
run_all(dispose);
|
5127 |
}
|
|
|
5138 |
return block;
|
5139 |
}
|
5140 |
|
|
|
|
|
5141 |
function getRandomWord(line) {
|
5142 |
let words = line.split(" ");
|
5143 |
return words[Math.floor(Math.random() * words.length)];
|
|
|
5149 |
let { $$slots: slots = {}, $$scope } = $$props;
|
5150 |
validate_slots('YoutubeIframeAPICustomInterface', slots, []);
|
5151 |
let player;
|
5152 |
+
let interval = 10; // Define your interval
|
5153 |
let currentTime = 0;
|
5154 |
let timeUpdateInterval;
|
5155 |
|
|
|
5215 |
generatedTimestamps.push(i);
|
5216 |
}
|
5217 |
|
5218 |
+
$$invalidate(8, timestamps = generatedTimestamps);
|
5219 |
} // Do something with the timestamps
|
5220 |
//console.log("Generated Timestamps: ", generatedTimestamps);
|
5221 |
|
|
|
5233 |
? curr
|
5234 |
: prev);
|
5235 |
|
5236 |
+
$$invalidate(7, currentIndex = timestamps.indexOf(closest));
|
5237 |
}
|
5238 |
|
5239 |
function updateCurrentTime() {
|
5240 |
if (player && player.getCurrentTime) {
|
5241 |
+
$$invalidate(3, currentTime = player.getCurrentTime());
|
5242 |
}
|
5243 |
}
|
5244 |
|
|
|
5248 |
|
5249 |
function updateWord() {
|
5250 |
if (isUpdating) {
|
5251 |
+
$$invalidate(5, line = lines[Math.floor(Math.random() * lines.length)]);
|
5252 |
+
$$invalidate(4, currentWord = getRandomWord(line));
|
5253 |
}
|
5254 |
}
|
5255 |
|
5256 |
function toggleUpdate() {
|
5257 |
+
$$invalidate(6, isUpdating = !isUpdating);
|
5258 |
|
5259 |
if (isUpdating) {
|
5260 |
updateWord(); // Immediately update once
|
5261 |
updateInterval = setInterval(updateWord, 3000); // Update every 3 seconds
|
5262 |
} else {
|
5263 |
clearInterval(updateInterval);
|
5264 |
+
$$invalidate(5, line = '');
|
5265 |
+
$$invalidate(4, currentWord = '');
|
5266 |
}
|
5267 |
}
|
5268 |
|
5269 |
function goToNextAutoTimestamp() {
|
5270 |
if (currentIndex < timestamps.length - 1) {
|
5271 |
+
$$invalidate(7, currentIndex += 1);
|
5272 |
player.seekTo(timestamps[currentIndex], true);
|
5273 |
}
|
5274 |
}
|
5275 |
|
5276 |
function goToPreviousAutoTimestamp() {
|
5277 |
if (currentIndex > 0) {
|
5278 |
+
$$invalidate(7, currentIndex -= 1);
|
5279 |
player.seekTo(timestamps[currentIndex], true);
|
5280 |
}
|
5281 |
}
|
|
|
5313 |
|
5314 |
function input0_input_handler() {
|
5315 |
currentvideoId = this.value;
|
5316 |
+
$$invalidate(9, currentvideoId);
|
5317 |
}
|
5318 |
|
5319 |
function input1_change_handler() {
|
5320 |
isUpdating = this.checked;
|
5321 |
+
$$invalidate(6, isUpdating);
|
5322 |
+
}
|
5323 |
+
|
5324 |
+
function input2_input_handler() {
|
5325 |
+
interval = to_number(this.value);
|
5326 |
+
$$invalidate(2, interval);
|
5327 |
}
|
5328 |
|
5329 |
$$self.$capture_state = () => ({
|
|
|
5363 |
|
5364 |
$$self.$inject_state = $$props => {
|
5365 |
if ('player' in $$props) player = $$props.player;
|
5366 |
+
if ('interval' in $$props) $$invalidate(2, interval = $$props.interval);
|
5367 |
+
if ('currentTime' in $$props) $$invalidate(3, currentTime = $$props.currentTime);
|
5368 |
if ('timeUpdateInterval' in $$props) timeUpdateInterval = $$props.timeUpdateInterval;
|
5369 |
if ('transcript' in $$props) transcript = $$props.transcript;
|
5370 |
if ('lines' in $$props) lines = $$props.lines;
|
5371 |
+
if ('currentWord' in $$props) $$invalidate(4, currentWord = $$props.currentWord);
|
5372 |
+
if ('line' in $$props) $$invalidate(5, line = $$props.line);
|
5373 |
+
if ('isUpdating' in $$props) $$invalidate(6, isUpdating = $$props.isUpdating);
|
5374 |
if ('updateInterval' in $$props) updateInterval = $$props.updateInterval;
|
5375 |
+
if ('currentIndex' in $$props) $$invalidate(7, currentIndex = $$props.currentIndex);
|
5376 |
if ('currentuserIndex' in $$props) $$invalidate(0, currentuserIndex = $$props.currentuserIndex);
|
5377 |
+
if ('timestamps' in $$props) $$invalidate(8, timestamps = $$props.timestamps);
|
5378 |
if ('userTimestamps' in $$props) $$invalidate(1, userTimestamps = $$props.userTimestamps);
|
5379 |
+
if ('currentvideoId' in $$props) $$invalidate(9, currentvideoId = $$props.currentvideoId);
|
5380 |
+
if ('previousButtonClass' in $$props) $$invalidate(10, previousButtonClass = $$props.previousButtonClass);
|
5381 |
+
if ('nextButtonClass' in $$props) $$invalidate(11, nextButtonClass = $$props.nextButtonClass);
|
5382 |
};
|
5383 |
|
5384 |
if ($$props && "$$inject" in $$props) {
|
|
|
5386 |
}
|
5387 |
|
5388 |
$$self.$$.update = () => {
|
5389 |
+
if ($$self.$$.dirty[0] & /*currentuserIndex, userTimestamps*/ 3) {
|
5390 |
+
$$invalidate(11, nextButtonClass = currentuserIndex >= userTimestamps.length - 1
|
5391 |
? 'button-at-end'
|
5392 |
: 'button');
|
5393 |
}
|
5394 |
|
5395 |
+
if ($$self.$$.dirty[0] & /*currentuserIndex*/ 1) {
|
5396 |
+
$$invalidate(10, previousButtonClass = currentuserIndex <= 0 ? 'button-at-end' : 'button');
|
5397 |
}
|
5398 |
};
|
5399 |
|
5400 |
return [
|
5401 |
currentuserIndex,
|
5402 |
userTimestamps,
|
5403 |
+
interval,
|
5404 |
currentTime,
|
5405 |
currentWord,
|
5406 |
line,
|
|
|
5417 |
goToNextUserTimestamp,
|
5418 |
goToPreviousUserTimestamp,
|
5419 |
input0_input_handler,
|
5420 |
+
input1_change_handler,
|
5421 |
+
input2_input_handler
|
5422 |
];
|
5423 |
}
|
5424 |
|
5425 |
class YoutubeIframeAPICustomInterface extends SvelteComponentDev {
|
5426 |
constructor(options) {
|
5427 |
super(options);
|
5428 |
+
init(this, options, instance$1, create_fragment$1, safe_not_equal, {}, null, [-1, -1]);
|
5429 |
|
5430 |
dispatch_dev("SvelteRegisterComponent", {
|
5431 |
component: this,
|