Advertisement
loloof64

Untitled

Apr 12th, 2024
831
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { defineComponent as y, useCssVars as S, computed as r, ref as g, openBlock as e, createElementBlock as o, createElementVNode as i, Fragment as a, renderList as u, toDisplayString as p, normalizeClass as V, pushScopeId as x, popScopeId as z } from "vue";
  2. const _ = (t) => (x("data-v-f3751c6b"), t = t(), z(), t), $ = { class: "lowest-layer" }, w = /* @__PURE__ */ _(() => /* @__PURE__ */ i("div", null, null, -1)), A = {
  3.   key: 0,
  4.   class: "coordinate"
  5. }, I = { key: 1 }, B = /* @__PURE__ */ _(() => /* @__PURE__ */ i("div", null, null, -1)), E = {
  6.   key: 0,
  7.   class: "coordinate"
  8. }, j = { key: 1 }, D = {
  9.   key: 2,
  10.   class: "coordinate"
  11. }, F = { key: 3 }, L = /* @__PURE__ */ _(() => /* @__PURE__ */ i("div", null, null, -1)), N = {
  12.   key: 0,
  13.   class: "coordinate"
  14. }, O = { key: 1 }, T = /* @__PURE__ */ _(() => /* @__PURE__ */ i("div", null, null, -1)), q = /* @__PURE__ */ y({
  15.   __name: "ChessboardVue",
  16.   props: {
  17.     size: { default: 100 },
  18.     reversed: { type: Boolean, default: !1 },
  19.     background: { default: "#124589" },
  20.     coordinatesVisible: { type: Boolean, default: !0 },
  21.     coordinatesColor: { default: "yellow" },
  22.     whiteCellsColor: { default: "navajowhite" },
  23.     blackCellsColor: { default: "peru" }
  24.   },
  25.   setup(t) {
  26.     S((d) => ({
  27.       "48ba1e3a": C.value,
  28.       81291066: d.background,
  29.       "4253e682": f.value,
  30.       "412df85c": d.whiteCellsColor,
  31.       "1fc52e9c": d.blackCellsColor,
  32.       ec184162: v.value,
  33.       "1c2d7987": d.coordinatesColor
  34.     }));
  35.     const l = t, s = r(() => l.size / 9), c = r(() => s.value * 0.5), v = r(() => `${s.value * 0.3}px`), C = r(() => `${l.size}px`), f = r(
  36.       () => `${c.value}px repeat(8, ${s.value}px) ${c.value}px / ${c.value}px repeat(8, ${s.value}px) ${c.value}px`
  37.     ), m = g(), h = r(
  38.       () => l.reversed ? [7, 6, 5, 4, 3, 2, 1, 0] : [0, 1, 2, 3, 4, 5, 6, 7]
  39.     ), b = r(
  40.       () => l.reversed ? [0, 1, 2, 3, 4, 5, 6, 7] : [7, 6, 5, 4, 3, 2, 1, 0]
  41.     );
  42.     return (d, J) => (e(), o("div", {
  43.       class: "root",
  44.       ref_key: "rootElement",
  45.       ref: m
  46.     }, [
  47.       i("div", $, [
  48.         w,
  49.         (e(!0), o(a, null, u(h.value, (n) => (e(), o(a, null, [
  50.           l.coordinatesVisible ? (e(), o("p", A, p(String.fromCharCode(65 + n)), 1)) : (e(), o("div", I))
  51.         ], 64))), 256)),
  52.         B,
  53.         (e(!0), o(a, null, u(b.value, (n) => (e(), o(a, null, [
  54.           l.coordinatesVisible ? (e(), o("p", E, p(String.fromCharCode(49 + n)), 1)) : (e(), o("div", j)),
  55.           (e(!0), o(a, null, u(h.value, (k) => (e(), o("div", {
  56.             class: V(["cell", (n + k) % 2 !== 0 ? "white" : "black"])
  57.           }, null, 2))), 256)),
  58.           l.coordinatesVisible ? (e(), o("p", D, p(String.fromCharCode(49 + n)), 1)) : (e(), o("div", F))
  59.         ], 64))), 256)),
  60.         L,
  61.         (e(!0), o(a, null, u(h.value, (n) => (e(), o(a, null, [
  62.           l.coordinatesVisible ? (e(), o("p", N, p(String.fromCharCode(65 + n)), 1)) : (e(), o("div", O))
  63.         ], 64))), 256)),
  64.         T
  65.       ])
  66.     ], 512));
  67.   }
  68. }), G = (t, l) => {
  69.   const s = t.__vccOpts || t;
  70.   for (const [c, v] of l)
  71.     s[c] = v;
  72.   return s;
  73. }, H = /* @__PURE__ */ G(q, [["__scopeId", "data-v-f3751c6b"]]), M = {
  74.   install(t) {
  75.     t.component("ChessboardVue", H);
  76.   }
  77. };
  78. export {
  79.   M as default
  80. };
  81.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement