@everymatrix/casino-tournaments-thumbnail-controller 0.0.91 → 0.0.95

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6588,12 +6588,12 @@
6588
6588
 
6589
6589
  function get_each_context(ctx, list, i) {
6590
6590
  const child_ctx = ctx.slice();
6591
- child_ctx[28] = list[i];
6592
- child_ctx[30] = i;
6591
+ child_ctx[34] = list[i];
6592
+ child_ctx[36] = i;
6593
6593
  return child_ctx;
6594
6594
  }
6595
6595
 
6596
- // (101:2) {#if games}
6596
+ // (111:2) {#if games}
6597
6597
  function create_if_block$1(ctx) {
6598
6598
  let div0;
6599
6599
  let svg0;
@@ -6636,32 +6636,32 @@
6636
6636
  attr_dev(path0, "stroke-linejoin", "round");
6637
6637
  attr_dev(path0, "stroke-width", "2");
6638
6638
  attr_dev(path0, "d", "M15 19l-7-7 7-7");
6639
- add_location(path0, file$1, 103, 8, 3245);
6639
+ add_location(path0, file$1, 113, 8, 3422);
6640
6640
  attr_dev(svg0, "fill", "none");
6641
6641
  attr_dev(svg0, "stroke", "currentColor");
6642
6642
  attr_dev(svg0, "viewBox", "0 0 24 24");
6643
6643
  attr_dev(svg0, "xmlns", "http://www.w3.org/2000/svg");
6644
- add_location(svg0, file$1, 102, 6, 3142);
6644
+ add_location(svg0, file$1, 112, 6, 3319);
6645
6645
  attr_dev(div0, "class", "SliderNavButton");
6646
- toggle_class(div0, "disabled", /*atStart*/ ctx[3]);
6647
- add_location(div0, file$1, 101, 4, 3053);
6646
+ toggle_class(div0, "disabled", /*atStart*/ ctx[5]);
6647
+ add_location(div0, file$1, 111, 4, 3230);
6648
6648
  attr_dev(div1, "class", "items");
6649
6649
  set_style(div1, "transform", "translateX(" + /*offset*/ ctx[1] + "px)");
6650
- add_location(div1, file$1, 107, 6, 3384);
6651
- add_location(main, file$1, 106, 4, 3371);
6650
+ add_location(div1, file$1, 117, 6, 3561);
6651
+ add_location(main, file$1, 116, 4, 3548);
6652
6652
  attr_dev(path1, "stroke-linecap", "round");
6653
6653
  attr_dev(path1, "stroke-linejoin", "round");
6654
6654
  attr_dev(path1, "stroke-width", "2");
6655
6655
  attr_dev(path1, "d", "M9 5l7 7-7 7");
6656
- add_location(path1, file$1, 117, 8, 3898);
6656
+ add_location(path1, file$1, 128, 8, 4239);
6657
6657
  attr_dev(svg1, "fill", "none");
6658
6658
  attr_dev(svg1, "stroke", "currentColor");
6659
6659
  attr_dev(svg1, "viewBox", "0 0 24 24");
6660
6660
  attr_dev(svg1, "xmlns", "http://www.w3.org/2000/svg");
6661
- add_location(svg1, file$1, 116, 6, 3795);
6661
+ add_location(svg1, file$1, 127, 6, 4136);
6662
6662
  attr_dev(div2, "class", "SliderNavButton");
6663
- toggle_class(div2, "disabled", /*atEnd*/ ctx[4]);
6664
- add_location(div2, file$1, 115, 4, 3709);
6663
+ toggle_class(div2, "disabled", /*atEnd*/ ctx[6]);
6664
+ add_location(div2, file$1, 126, 4, 4050);
6665
6665
  },
6666
6666
  m: function mount(target, anchor) {
6667
6667
  insert_dev(target, div0, anchor);
@@ -6682,19 +6682,19 @@
6682
6682
 
6683
6683
  if (!mounted) {
6684
6684
  dispose = [
6685
- listen_dev(div0, "click", /*click_handler*/ ctx[11], false, false, false),
6686
- listen_dev(div2, "click", /*click_handler_2*/ ctx[13], false, false, false)
6685
+ listen_dev(div0, "click", /*click_handler*/ ctx[15], false, false, false),
6686
+ listen_dev(div2, "click", /*click_handler_2*/ ctx[19], false, false, false)
6687
6687
  ];
6688
6688
 
6689
6689
  mounted = true;
6690
6690
  }
6691
6691
  },
6692
6692
  p: function update(ctx, dirty) {
6693
- if (dirty & /*atStart*/ 8) {
6694
- toggle_class(div0, "disabled", /*atStart*/ ctx[3]);
6693
+ if (dirty[0] & /*atStart*/ 32) {
6694
+ toggle_class(div0, "disabled", /*atStart*/ ctx[5]);
6695
6695
  }
6696
6696
 
6697
- if (dirty & /*gameClicked, games*/ 65) {
6697
+ if (dirty[0] & /*gameClicked, games, enter, leave, hover, hoverIndex*/ 1433) {
6698
6698
  each_value = /*games*/ ctx[0];
6699
6699
  validate_each_argument(each_value);
6700
6700
  let i;
@@ -6718,12 +6718,12 @@
6718
6718
  each_blocks.length = each_value.length;
6719
6719
  }
6720
6720
 
6721
- if (dirty & /*offset*/ 2) {
6721
+ if (dirty[0] & /*offset*/ 2) {
6722
6722
  set_style(div1, "transform", "translateX(" + /*offset*/ ctx[1] + "px)");
6723
6723
  }
6724
6724
 
6725
- if (dirty & /*atEnd*/ 16) {
6726
- toggle_class(div2, "disabled", /*atEnd*/ ctx[4]);
6725
+ if (dirty[0] & /*atEnd*/ 64) {
6726
+ toggle_class(div2, "disabled", /*atEnd*/ ctx[6]);
6727
6727
  }
6728
6728
  },
6729
6729
  d: function destroy(detaching) {
@@ -6742,71 +6742,102 @@
6742
6742
  block,
6743
6743
  id: create_if_block$1.name,
6744
6744
  type: "if",
6745
- source: "(101:2) {#if games}",
6745
+ source: "(111:2) {#if games}",
6746
6746
  ctx
6747
6747
  });
6748
6748
 
6749
6749
  return block;
6750
6750
  }
6751
6751
 
6752
- // (109:8) {#each games as game, i}
6752
+ // (119:8) {#each games as game, i}
6753
6753
  function create_each_block(ctx) {
6754
6754
  let div;
6755
+ let span;
6756
+ let t0;
6757
+ let span_class_value;
6758
+ let t1;
6755
6759
  let img;
6756
6760
  let img_src_value;
6757
6761
  let img_alt_value;
6758
6762
  let img_title_value;
6759
- let t;
6763
+ let t2;
6760
6764
  let mounted;
6761
6765
  let dispose;
6762
6766
 
6763
6767
  function click_handler_1() {
6764
- return /*click_handler_1*/ ctx[12](/*game*/ ctx[28]);
6768
+ return /*click_handler_1*/ ctx[16](/*game*/ ctx[34]);
6769
+ }
6770
+
6771
+ function mouseenter_handler() {
6772
+ return /*mouseenter_handler*/ ctx[17](/*i*/ ctx[36]);
6765
6773
  }
6766
6774
 
6767
6775
  const block = {
6768
6776
  c: function create() {
6769
6777
  div = element("div");
6778
+ span = element("span");
6779
+ t0 = text("Play now");
6780
+ t1 = space();
6770
6781
  img = element("img");
6771
- t = space();
6772
- if (img.src !== (img_src_value = /*game*/ ctx[28].thumbnail)) attr_dev(img, "src", img_src_value);
6782
+ t2 = space();
6783
+
6784
+ attr_dev(span, "class", span_class_value = "PlayNowButton " + (/*hover*/ ctx[3] && /*hoverIndex*/ ctx[4] == /*i*/ ctx[36]
6785
+ ? "itemHover"
6786
+ : ""));
6787
+
6788
+ add_location(span, file$1, 120, 12, 3794);
6789
+ if (img.src !== (img_src_value = /*game*/ ctx[34].thumbnail)) attr_dev(img, "src", img_src_value);
6773
6790
  attr_dev(img, "width", "132px");
6774
6791
  attr_dev(img, "height", "100px");
6775
- attr_dev(img, "alt", img_alt_value = /*game*/ ctx[28].name);
6776
- attr_dev(img, "title", img_title_value = /*game*/ ctx[28].name);
6777
- add_location(img, file$1, 110, 12, 3556);
6792
+ attr_dev(img, "alt", img_alt_value = /*game*/ ctx[34].name);
6793
+ attr_dev(img, "title", img_title_value = /*game*/ ctx[34].name);
6794
+ add_location(img, file$1, 121, 12, 3897);
6778
6795
  attr_dev(div, "class", "item");
6779
- add_location(div, file$1, 109, 10, 3490);
6796
+ add_location(div, file$1, 119, 10, 3667);
6780
6797
  },
6781
6798
  m: function mount(target, anchor) {
6782
6799
  insert_dev(target, div, anchor);
6800
+ append_dev(div, span);
6801
+ append_dev(span, t0);
6802
+ append_dev(div, t1);
6783
6803
  append_dev(div, img);
6784
- append_dev(div, t);
6804
+ append_dev(div, t2);
6785
6805
 
6786
6806
  if (!mounted) {
6787
- dispose = listen_dev(div, "click", click_handler_1, false, false, false);
6807
+ dispose = [
6808
+ listen_dev(div, "click", click_handler_1, false, false, false),
6809
+ listen_dev(div, "mouseenter", mouseenter_handler, false, false, false),
6810
+ listen_dev(div, "mouseleave", /*mouseleave_handler*/ ctx[18], false, false, false)
6811
+ ];
6812
+
6788
6813
  mounted = true;
6789
6814
  }
6790
6815
  },
6791
6816
  p: function update(new_ctx, dirty) {
6792
6817
  ctx = new_ctx;
6793
6818
 
6794
- if (dirty & /*games*/ 1 && img.src !== (img_src_value = /*game*/ ctx[28].thumbnail)) {
6819
+ if (dirty[0] & /*hover, hoverIndex*/ 24 && span_class_value !== (span_class_value = "PlayNowButton " + (/*hover*/ ctx[3] && /*hoverIndex*/ ctx[4] == /*i*/ ctx[36]
6820
+ ? "itemHover"
6821
+ : ""))) {
6822
+ attr_dev(span, "class", span_class_value);
6823
+ }
6824
+
6825
+ if (dirty[0] & /*games*/ 1 && img.src !== (img_src_value = /*game*/ ctx[34].thumbnail)) {
6795
6826
  attr_dev(img, "src", img_src_value);
6796
6827
  }
6797
6828
 
6798
- if (dirty & /*games*/ 1 && img_alt_value !== (img_alt_value = /*game*/ ctx[28].name)) {
6829
+ if (dirty[0] & /*games*/ 1 && img_alt_value !== (img_alt_value = /*game*/ ctx[34].name)) {
6799
6830
  attr_dev(img, "alt", img_alt_value);
6800
6831
  }
6801
6832
 
6802
- if (dirty & /*games*/ 1 && img_title_value !== (img_title_value = /*game*/ ctx[28].name)) {
6833
+ if (dirty[0] & /*games*/ 1 && img_title_value !== (img_title_value = /*game*/ ctx[34].name)) {
6803
6834
  attr_dev(img, "title", img_title_value);
6804
6835
  }
6805
6836
  },
6806
6837
  d: function destroy(detaching) {
6807
6838
  if (detaching) detach_dev(div);
6808
6839
  mounted = false;
6809
- dispose();
6840
+ run_all(dispose);
6810
6841
  }
6811
6842
  };
6812
6843
 
@@ -6814,7 +6845,7 @@
6814
6845
  block,
6815
6846
  id: create_each_block.name,
6816
6847
  type: "each",
6817
- source: "(109:8) {#each games as game, i}",
6848
+ source: "(119:8) {#each games as game, i}",
6818
6849
  ctx
6819
6850
  });
6820
6851
 
@@ -6831,7 +6862,7 @@
6831
6862
  if (if_block) if_block.c();
6832
6863
  this.c = noop$1;
6833
6864
  attr_dev(div, "class", "TournamentsGamesSlider");
6834
- add_location(div, file$1, 99, 0, 2979);
6865
+ add_location(div, file$1, 109, 0, 3156);
6835
6866
  },
6836
6867
  l: function claim(nodes) {
6837
6868
  throw new Error("options.hydrate only works if the component was compiled with the `hydratable: true` option");
@@ -6839,9 +6870,9 @@
6839
6870
  m: function mount(target, anchor) {
6840
6871
  insert_dev(target, div, anchor);
6841
6872
  if (if_block) if_block.m(div, null);
6842
- /*div_binding*/ ctx[14](div);
6873
+ /*div_binding*/ ctx[20](div);
6843
6874
  },
6844
- p: function update(ctx, [dirty]) {
6875
+ p: function update(ctx, dirty) {
6845
6876
  if (/*games*/ ctx[0]) {
6846
6877
  if (if_block) {
6847
6878
  if_block.p(ctx, dirty);
@@ -6860,7 +6891,7 @@
6860
6891
  d: function destroy(detaching) {
6861
6892
  if (detaching) detach_dev(div);
6862
6893
  if (if_block) if_block.d();
6863
- /*div_binding*/ ctx[14](null);
6894
+ /*div_binding*/ ctx[20](null);
6864
6895
  }
6865
6896
  };
6866
6897
 
@@ -6894,6 +6925,18 @@
6894
6925
  let slider;
6895
6926
  let xDown = null;
6896
6927
  let yDown = null;
6928
+ let hover = false;
6929
+ let hoverIndex = "";
6930
+
6931
+ const enter = index => {
6932
+ $$invalidate(3, hover = true);
6933
+ $$invalidate(4, hoverIndex = index);
6934
+ };
6935
+
6936
+ const leave = () => {
6937
+ $$invalidate(3, hover = false);
6938
+ $$invalidate(4, hoverIndex = -1);
6939
+ };
6897
6940
 
6898
6941
  const getTouches = evt => {
6899
6942
  return evt.touches || evt.originalEvent.touches;
@@ -6986,6 +7029,8 @@
6986
7029
 
6987
7030
  const click_handler = () => move(-1);
6988
7031
  const click_handler_1 = game => gameClicked(game);
7032
+ const mouseenter_handler = i => enter(i);
7033
+ const mouseleave_handler = () => leave();
6989
7034
  const click_handler_2 = () => move(1);
6990
7035
 
6991
7036
  function div_binding($$value) {
@@ -6996,10 +7041,10 @@
6996
7041
  }
6997
7042
 
6998
7043
  $$self.$$set = $$props => {
6999
- if ("tournamenturl" in $$props) $$invalidate(7, tournamenturl = $$props.tournamenturl);
7000
- if ("scrollby" in $$props) $$invalidate(8, scrollby = $$props.scrollby);
7001
- if ("pagfactor" in $$props) $$invalidate(9, pagfactor = $$props.pagfactor);
7002
- if ("lang" in $$props) $$invalidate(10, lang = $$props.lang);
7044
+ if ("tournamenturl" in $$props) $$invalidate(11, tournamenturl = $$props.tournamenturl);
7045
+ if ("scrollby" in $$props) $$invalidate(12, scrollby = $$props.scrollby);
7046
+ if ("pagfactor" in $$props) $$invalidate(13, pagfactor = $$props.pagfactor);
7047
+ if ("lang" in $$props) $$invalidate(14, lang = $$props.lang);
7003
7048
  };
7004
7049
 
7005
7050
  $$self.$capture_state = () => ({
@@ -7019,6 +7064,10 @@
7019
7064
  slider,
7020
7065
  xDown,
7021
7066
  yDown,
7067
+ hover,
7068
+ hoverIndex,
7069
+ enter,
7070
+ leave,
7022
7071
  getTouches,
7023
7072
  handleTouchStart,
7024
7073
  handleTouchMove,
@@ -7032,10 +7081,10 @@
7032
7081
  });
7033
7082
 
7034
7083
  $$self.$inject_state = $$props => {
7035
- if ("tournamenturl" in $$props) $$invalidate(7, tournamenturl = $$props.tournamenturl);
7036
- if ("scrollby" in $$props) $$invalidate(8, scrollby = $$props.scrollby);
7037
- if ("pagfactor" in $$props) $$invalidate(9, pagfactor = $$props.pagfactor);
7038
- if ("lang" in $$props) $$invalidate(10, lang = $$props.lang);
7084
+ if ("tournamenturl" in $$props) $$invalidate(11, tournamenturl = $$props.tournamenturl);
7085
+ if ("scrollby" in $$props) $$invalidate(12, scrollby = $$props.scrollby);
7086
+ if ("pagfactor" in $$props) $$invalidate(13, pagfactor = $$props.pagfactor);
7087
+ if ("lang" in $$props) $$invalidate(14, lang = $$props.lang);
7039
7088
  if ("userAgent" in $$props) userAgent = $$props.userAgent;
7040
7089
  if ("items" in $$props) items = $$props.items;
7041
7090
  if ("totalPaginationPixels" in $$props) totalPaginationPixels = $$props.totalPaginationPixels;
@@ -7046,8 +7095,10 @@
7046
7095
  if ("slider" in $$props) $$invalidate(2, slider = $$props.slider);
7047
7096
  if ("xDown" in $$props) xDown = $$props.xDown;
7048
7097
  if ("yDown" in $$props) yDown = $$props.yDown;
7049
- if ("atStart" in $$props) $$invalidate(3, atStart = $$props.atStart);
7050
- if ("atEnd" in $$props) $$invalidate(4, atEnd = $$props.atEnd);
7098
+ if ("hover" in $$props) $$invalidate(3, hover = $$props.hover);
7099
+ if ("hoverIndex" in $$props) $$invalidate(4, hoverIndex = $$props.hoverIndex);
7100
+ if ("atStart" in $$props) $$invalidate(5, atStart = $$props.atStart);
7101
+ if ("atEnd" in $$props) $$invalidate(6, atEnd = $$props.atEnd);
7051
7102
  };
7052
7103
 
7053
7104
  if ($$props && "$$inject" in $$props) {
@@ -7055,19 +7106,19 @@
7055
7106
  }
7056
7107
 
7057
7108
  $$self.$$.update = () => {
7058
- if ($$self.$$.dirty & /*offset*/ 2) {
7059
- $$invalidate(3, atStart = offset === 0);
7109
+ if ($$self.$$.dirty[0] & /*offset*/ 2) {
7110
+ $$invalidate(5, atStart = offset === 0);
7060
7111
  }
7061
7112
 
7062
- if ($$self.$$.dirty & /*offset, pagfactor, games, scrollby*/ 771) {
7063
- $$invalidate(4, atEnd = offset <= parseInt(pagfactor, 10) * (games.length - parseInt(scrollby, 10)) * -1);
7113
+ if ($$self.$$.dirty[0] & /*offset, pagfactor, games, scrollby*/ 12291) {
7114
+ $$invalidate(6, atEnd = offset <= parseInt(pagfactor, 10) * (games.length - parseInt(scrollby, 10)) * -1);
7064
7115
  }
7065
7116
 
7066
- if ($$self.$$.dirty & /*tournamenturl*/ 128) {
7117
+ if ($$self.$$.dirty[0] & /*tournamenturl*/ 2048) {
7067
7118
  tournamenturl && fetchData();
7068
7119
  }
7069
7120
 
7070
- if ($$self.$$.dirty & /*slider*/ 4) {
7121
+ if ($$self.$$.dirty[0] & /*slider*/ 4) {
7071
7122
  // @TODO
7072
7123
  // $: scrollby && pagfactor && getTotalPixels();
7073
7124
  slider && addEventListeners();
@@ -7080,8 +7131,12 @@
7080
7131
  games,
7081
7132
  offset,
7082
7133
  slider,
7134
+ hover,
7135
+ hoverIndex,
7083
7136
  atStart,
7084
7137
  atEnd,
7138
+ enter,
7139
+ leave,
7085
7140
  move,
7086
7141
  gameClicked,
7087
7142
  tournamenturl,
@@ -7090,6 +7145,8 @@
7090
7145
  lang,
7091
7146
  click_handler,
7092
7147
  click_handler_1,
7148
+ mouseenter_handler,
7149
+ mouseleave_handler,
7093
7150
  click_handler_2,
7094
7151
  div_binding
7095
7152
  ];
@@ -7098,7 +7155,7 @@
7098
7155
  class CasinoTournamentsThumbnailGamesSlider extends SvelteElement {
7099
7156
  constructor(options) {
7100
7157
  super();
7101
- this.shadowRoot.innerHTML = `<style>*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:"Helvetica Neue", "Helvetica", sans-serif}.TournamentsGamesSlider{background:#0a0c19;color:#fff;display:flex;justify-content:center}.disabled{color:#3B3C47}.SliderNavButton{background:#0a0c19;border:0px;width:25px;display:flex;align-items:center;justify-content:center}main{width:95%;overflow:hidden}.items{display:flex;transition:transform 0.4s ease-in-out;transform:translateX(0px)}.item{min-width:119px;height:96px;margin:0 4px;background-color:#ef4322;color:white;display:flex;justify-content:center;align-items:center;font-weight:bold;font-size:10rem;user-select:none;overflow:hidden}.items .item:first-child{margin-left:0}.items .item:last-child{margin-right:0}</style>`;
7158
+ this.shadowRoot.innerHTML = `<style>*,*::before,*::after{margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:"Helvetica Neue", "Helvetica", sans-serif}.TournamentsGamesSlider{background:#0a0c19;color:#fff;display:flex;justify-content:center}.disabled{color:#3B3C47}.SliderNavButton{background:#0a0c19;border:0px;width:25px;display:flex;align-items:center;justify-content:center}main{width:95%;overflow:hidden}.items{display:flex;transition:transform 0.4s ease-in-out;transform:translateX(0px)}.item{min-width:119px;height:96px;margin:0 4px;background-color:#ef4322;color:white;display:flex;justify-content:center;align-items:center;font-weight:bold;font-size:10rem;user-select:none;overflow:hidden}.PlayNowButton{position:absolute;background:#28a745;display:block;box-sizing:border-box;padding:0.8rem .5rem;color:#fff;text-transform:uppercase;text-align:center;font-weight:600;font-size:0.7rem;cursor:pointer;transition:opacity .4s linear;opacity:0;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.itemHover{opacity:1}.items .item:first-child{margin-left:0}.items .item:last-child{margin-right:0}</style>`;
7102
7159
 
7103
7160
  init(
7104
7161
  this,
@@ -7111,11 +7168,12 @@
7111
7168
  create_fragment$1,
7112
7169
  safe_not_equal,
7113
7170
  {
7114
- tournamenturl: 7,
7115
- scrollby: 8,
7116
- pagfactor: 9,
7117
- lang: 10
7118
- }
7171
+ tournamenturl: 11,
7172
+ scrollby: 12,
7173
+ pagfactor: 13,
7174
+ lang: 14
7175
+ },
7176
+ [-1, -1]
7119
7177
  );
7120
7178
 
7121
7179
  if (options) {
@@ -7135,7 +7193,7 @@
7135
7193
  }
7136
7194
 
7137
7195
  get tournamenturl() {
7138
- return this.$$.ctx[7];
7196
+ return this.$$.ctx[11];
7139
7197
  }
7140
7198
 
7141
7199
  set tournamenturl(tournamenturl) {
@@ -7144,7 +7202,7 @@
7144
7202
  }
7145
7203
 
7146
7204
  get scrollby() {
7147
- return this.$$.ctx[8];
7205
+ return this.$$.ctx[12];
7148
7206
  }
7149
7207
 
7150
7208
  set scrollby(scrollby) {
@@ -7153,7 +7211,7 @@
7153
7211
  }
7154
7212
 
7155
7213
  get pagfactor() {
7156
- return this.$$.ctx[9];
7214
+ return this.$$.ctx[13];
7157
7215
  }
7158
7216
 
7159
7217
  set pagfactor(pagfactor) {
@@ -7162,7 +7220,7 @@
7162
7220
  }
7163
7221
 
7164
7222
  get lang() {
7165
- return this.$$.ctx[10];
7223
+ return this.$$.ctx[14];
7166
7224
  }
7167
7225
 
7168
7226
  set lang(lang) {