Skip to content

pcn-club/pcn_kids_procon

Repository files navigation

pcn_kids_procon

オープンデータ / opendata

サンプルアプリ / sample app

import { CBOR } from "https://js.sabae.cc/CBOR.js";
import { Bin } from "https://js.sabae.cc/Bin.js";
import { shuffle } from "https://js.sabae.cc/shuffle.js";
import { shuffleChildren } from "https://js.sabae.cc/shuffleChildren.js";

onload = async () => {
  const bin = await Bin.fetch("https://pcn-club.github.io/pcn_kids_procon/procon2022/procon2022list.cbor");
  const data = CBOR.decode(bin);
  shuffle(data);
  for (const d of data) {
    const div = document.createElement("div");
    div.style.backgroundImage = "url(" + Bin.toSrc(d.data) + ")";
    const title = document.createElement("div");
    title.textContent = d.id + ". " + d.title;
    div.appendChild(title);
    list.appendChild(div);
  }
  btnshuffle.onclick = () => shuffleChildren(list);
};

About

PCNこどもプロコンオープンデータ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published