Nhúng bàn cờ vào web của bạn

Dán đoạn mã dưới đây vào nơi bạn muốn hiện bàn cờ (trang HTML, hoặc khối "HTML tùy chỉnh" của WordPress, Blogger, Wix...). Khung tự cao theo nội dung. Người chơi muốn lưu tên và xem bảng xếp hạng sẽ bấm link ở cuối bàn để sang MateMoves.

Cờ tướng

Khi mở bàn cờ:
<iframe src="https://matemoves.com/nhung/co-tuong/" title="Cờ tướng với máy" allow="fullscreen" style="width:100%;border:0;height:640px" loading="lazy"></iframe>
<script>
addEventListener("message", (e) => {
  if (e.origin !== "https://matemoves.com" || !e.data?.choicoCao) return;
  for (const f of document.querySelectorAll("iframe")) if (f.contentWindow === e.source) f.style.height = e.data.choicoCao + "px";
});
</script>

Xem bản nhúng ↗

Xem trước

Cờ úp

Khi mở bàn cờ:
<iframe src="https://matemoves.com/nhung/co-up/" title="Cờ úp với máy" allow="fullscreen" style="width:100%;border:0;height:640px" loading="lazy"></iframe>
<script>
addEventListener("message", (e) => {
  if (e.origin !== "https://matemoves.com" || !e.data?.choicoCao) return;
  for (const f of document.querySelectorAll("iframe")) if (f.contentWindow === e.source) f.style.height = e.data.choicoCao + "px";
});
</script>

Xem bản nhúng ↗

Xem trước

Cờ vua

Khi mở bàn cờ:
<iframe src="https://matemoves.com/nhung/co-vua/" title="Cờ vua với máy" allow="fullscreen" style="width:100%;border:0;height:640px" loading="lazy"></iframe>
<script>
addEventListener("message", (e) => {
  if (e.origin !== "https://matemoves.com" || !e.data?.choicoCao) return;
  for (const f of document.querySelectorAll("iframe")) if (f.contentWindow === e.source) f.style.height = e.data.choicoCao + "px";
});
</script>

Xem bản nhúng ↗

Xem trước

Cờ caro

Khi mở bàn cờ:
<iframe src="https://matemoves.com/nhung/caro/" title="Cờ caro với máy" allow="fullscreen" style="width:100%;border:0;height:640px" loading="lazy"></iframe>
<script>
addEventListener("message", (e) => {
  if (e.origin !== "https://matemoves.com" || !e.data?.choicoCao) return;
  for (const f of document.querySelectorAll("iframe")) if (f.contentWindow === e.source) f.style.height = e.data.choicoCao + "px";
});
</script>

Xem bản nhúng ↗

Xem trước

Ô ăn quan

Khi mở bàn cờ:
<iframe src="https://matemoves.com/nhung/o-an-quan/" title="Ô ăn quan với máy" allow="fullscreen" style="width:100%;border:0;height:640px" loading="lazy"></iframe>
<script>
addEventListener("message", (e) => {
  if (e.origin !== "https://matemoves.com" || !e.data?.choicoCao) return;
  for (const f of document.querySelectorAll("iframe")) if (f.contentWindow === e.source) f.style.height = e.data.choicoCao + "px";
});
</script>

Xem bản nhúng ↗

Xem trước

Cờ vây

Khi mở bàn cờ:
<iframe src="https://matemoves.com/nhung/co-vay/" title="Cờ vây với máy" allow="fullscreen" style="width:100%;border:0;height:640px" loading="lazy"></iframe>
<script>
addEventListener("message", (e) => {
  if (e.origin !== "https://matemoves.com" || !e.data?.choicoCao) return;
  for (const f of document.querySelectorAll("iframe")) if (f.contentWindow === e.source) f.style.height = e.data.choicoCao + "px";
});
</script>

Xem bản nhúng ↗

Xem trước

Cờ vây 13x13

Khi mở bàn cờ:
<iframe src="https://matemoves.com/nhung/co-vay/13/" title="Cờ vây 13x13 với máy" allow="fullscreen" style="width:100%;border:0;height:640px" loading="lazy"></iframe>
<script>
addEventListener("message", (e) => {
  if (e.origin !== "https://matemoves.com" || !e.data?.choicoCao) return;
  for (const f of document.querySelectorAll("iframe")) if (f.contentWindow === e.source) f.style.height = e.data.choicoCao + "px";
});
</script>

Xem bản nhúng ↗

Xem trước

Cờ vây 19x19

Khi mở bàn cờ:
<iframe src="https://matemoves.com/nhung/co-vay/19/" title="Cờ vây 19x19 với máy" allow="fullscreen" style="width:100%;border:0;height:640px" loading="lazy"></iframe>
<script>
addEventListener("message", (e) => {
  if (e.origin !== "https://matemoves.com" || !e.data?.choicoCao) return;
  for (const f of document.querySelectorAll("iframe")) if (f.contentWindow === e.source) f.style.height = e.data.choicoCao + "px";
});
</script>

Xem bản nhúng ↗

Xem trước