Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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";
- const _ = (t) => (x("data-v-f3751c6b"), t = t(), z(), t), $ = { class: "lowest-layer" }, w = /* @__PURE__ */ _(() => /* @__PURE__ */ i("div", null, null, -1)), A = {
- key: 0,
- class: "coordinate"
- }, I = { key: 1 }, B = /* @__PURE__ */ _(() => /* @__PURE__ */ i("div", null, null, -1)), E = {
- key: 0,
- class: "coordinate"
- }, j = { key: 1 }, D = {
- key: 2,
- class: "coordinate"
- }, F = { key: 3 }, L = /* @__PURE__ */ _(() => /* @__PURE__ */ i("div", null, null, -1)), N = {
- key: 0,
- class: "coordinate"
- }, O = { key: 1 }, T = /* @__PURE__ */ _(() => /* @__PURE__ */ i("div", null, null, -1)), q = /* @__PURE__ */ y({
- __name: "ChessboardVue",
- props: {
- size: { default: 100 },
- reversed: { type: Boolean, default: !1 },
- background: { default: "#124589" },
- coordinatesVisible: { type: Boolean, default: !0 },
- coordinatesColor: { default: "yellow" },
- whiteCellsColor: { default: "navajowhite" },
- blackCellsColor: { default: "peru" }
- },
- setup(t) {
- S((d) => ({
- "48ba1e3a": C.value,
- 81291066: d.background,
- "4253e682": f.value,
- "412df85c": d.whiteCellsColor,
- "1fc52e9c": d.blackCellsColor,
- ec184162: v.value,
- "1c2d7987": d.coordinatesColor
- }));
- 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(
- () => `${c.value}px repeat(8, ${s.value}px) ${c.value}px / ${c.value}px repeat(8, ${s.value}px) ${c.value}px`
- ), m = g(), h = r(
- () => l.reversed ? [7, 6, 5, 4, 3, 2, 1, 0] : [0, 1, 2, 3, 4, 5, 6, 7]
- ), b = r(
- () => l.reversed ? [0, 1, 2, 3, 4, 5, 6, 7] : [7, 6, 5, 4, 3, 2, 1, 0]
- );
- return (d, J) => (e(), o("div", {
- class: "root",
- ref_key: "rootElement",
- ref: m
- }, [
- i("div", $, [
- w,
- (e(!0), o(a, null, u(h.value, (n) => (e(), o(a, null, [
- l.coordinatesVisible ? (e(), o("p", A, p(String.fromCharCode(65 + n)), 1)) : (e(), o("div", I))
- ], 64))), 256)),
- B,
- (e(!0), o(a, null, u(b.value, (n) => (e(), o(a, null, [
- l.coordinatesVisible ? (e(), o("p", E, p(String.fromCharCode(49 + n)), 1)) : (e(), o("div", j)),
- (e(!0), o(a, null, u(h.value, (k) => (e(), o("div", {
- class: V(["cell", (n + k) % 2 !== 0 ? "white" : "black"])
- }, null, 2))), 256)),
- l.coordinatesVisible ? (e(), o("p", D, p(String.fromCharCode(49 + n)), 1)) : (e(), o("div", F))
- ], 64))), 256)),
- L,
- (e(!0), o(a, null, u(h.value, (n) => (e(), o(a, null, [
- l.coordinatesVisible ? (e(), o("p", N, p(String.fromCharCode(65 + n)), 1)) : (e(), o("div", O))
- ], 64))), 256)),
- T
- ])
- ], 512));
- }
- }), G = (t, l) => {
- const s = t.__vccOpts || t;
- for (const [c, v] of l)
- s[c] = v;
- return s;
- }, H = /* @__PURE__ */ G(q, [["__scopeId", "data-v-f3751c6b"]]), M = {
- install(t) {
- t.component("ChessboardVue", H);
- }
- };
- export {
- M as default
- };
Advertisement
Add Comment
Please, Sign In to add comment