forked from blinry/wikidata-cardgame
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
49 lines (37 loc) · 2.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Wikidata Card Game Generator</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Lobster" rel="stylesheet">
<script src="cardgame.js"></script>
</head>
<body>
<h1>Wikidata Card Game Generator</h1>
<p id="subtitle">“Ludicrously cool!” <span class="soft">@draemmli@chaos.social</span> “It's awesome!” <span class="soft">@Auregann</span> “Superb” <span class="soft">@umblaetterer</span></p>
<p>Generate your own card game, suitable for playing <a href="https://en.wikipedia.org/wiki/Top_Trumps">Top Trumps</a>, using Wikidata!</p>
<p>Think of a topic, and type its singular form into the search box over at <a href="https://www.wikidata.org" target="_blank">Wikidata</a>. Then, look for the <em>entity ID</em> near the top, which starts with Q. For example, the ID of <a href="https://www.wikidata.org/wiki/Q11344">chemical element</a> is <em>Q11344</em>. Paste it in this box, and click <em>Generate</em>:</p>
<form onsubmit="return submitQuery(event)">
<input id="topic" type="text" name="topic" placeholder="topic QID">
<select id="lang" name="lang"></select>
<input type="submit" value="Generate">
</form>
<p>Here are some other topics you can try:
<a href="?Q5119">capital</a>,
<a href="?Q5503">metro system</a>,
<a href="?Q6256">country</a>,
<a href="?Q6999">astronomical body</a>,
<a href="?Q23442">island</a>,
<a href="?Q1032372">hackerspace</a>,
<a href="?Q55990535">computer model</a>,
<a href="?Q35273">telescope</a>,
<a href="?Q142714">card game</a>.
</p>
<p>How does this work? We fetch items from Wikidata which are instances of arbitrary subclasses of the topic provided in the URL. We'll then find the properties which occur most often, and select the 32 cards which have as many of these as possible filled in. If your card is missing data or images, why don't you <a href="https://www.wikidata.org/wiki/Wikidata:Introduction">add that information</a> to Wikidata? :)</p>
<p>Made for the <a href="https://de.wikipedia.org/wiki/Wikipedia:Wikidata-Workshop-Ulm-2019">Wikidata-Workshop 2019</a> in Ulm by <a href="https://www.bleeptrack.de">bleeptrack</a> and <a href="https://morr.cc">blinry</a>. Source code is <a href="https://github.com/blinry/wikidata-cardgame">on GitHub</a>, feel free to suggest ideas or report bugs!</p>
<p id="status"></p>
<div id="cards">
</div>
</body>
</html>