craft-nft

A standalone NFT implementation for real-world arts and crafts assets
Log | Files | Refs | README

index.html (3054B)


      1 <html>
      2 	<head>
      3 		<title>Manual test of Craft NFT using web3js, metamask</title>
      4 		<meta name="author" value="Louis Holbrook <dev@holbrook.no> (https://holbrook.no)" />
      5 		<meta name="generator" value="vim" />
      6 		<script src="node_modules/jssha/dist/sha256.js"></script>
      7 		<script src="dist/craft_nft.js"></script>
      8 		<script src="manual_test_browser.js"></script>
      9 		<script src="src/common.js"></script>
     10 		<script src="src/wala.js"></script>
     11 <style type='text/css'>
     12 
     13 #detail {
     14 	display: none;
     15 }
     16 
     17 #mint {
     18 	display: none;
     19 }
     20 
     21 a {
     22 	text-decoration: underline;
     23 	color: #0000ff;
     24 }
     25 
     26 a:hover {
     27 	cursor: pointer;
     28 }
     29 
     30 label:after {
     31 	content: '\a';
     32 	white-space: pre;
     33 }
     34 
     35 dt {
     36 	font-weight: 900;
     37 }
     38 
     39 </style>
     40 	</head>
     41 	<body>
     42 		<h1>Craft NFT Smart Contract</h1>
     43 		<dl id=data">
     44 			<dt>Signer account</dt>
     45 			<dd id="data_account"></dd>
     46 			<dt>Contract address</dt>
     47 			<dd id="data_contract"></dd>
     48 			<dt>name</dt>
     49 			<dd id="data_name"></dd>
     50 			<dt>symbol</dt>
     51 			<dd id="data_symbol"></dd>
     52 			<dt>supply</dt>
     53 			<dd id="data_supply"></dd>
     54 			<!--<dt>contract declaration</dt>
     55 			<dd id="data_declaration"></dd>-->
     56 		</dl>
     57 		<div id="interactive">
     58 			<h2>Allocate token</h2>
     59 			<form id="panel" action="#" onSubmit="return false;">
     60 				<input type="text" id="panel_title" name="title" />
     61 				<label for="panel_title">Title</label>
     62 				<textarea id="panel_description" name="description"></textarea>
     63 				<label for="panel_description">Description</label>
     64 				<input type="text" id="panel_amount" name="amount" />
     65 				<label for="panel_amount">Batch size (0 or empty for unique work)</label>
     66 				<input type="file" id="panel_thumb" name="thumb" onChange='fileChange();'; />
     67 				<label for="panel_thumb">Add image</label>
     68 				<ol id="panel_attachment_list">
     69 				</ol>
     70 				<button id="panel_submit" onClick='return false;'>allocate</button>
     71 			</form>
     72 		</div>
     73 		<div id="detail">
     74 			<h2>Token view</h2>
     75 			<a id="back_link" onClick="uiCreateToken();">back</a>
     76 			<dl>
     77 				<dt>token id</dt>
     78 				<dd id="token_id"></dd>
     79 				<dt>name</dt>
     80 				<dd id="token_name"></dd>
     81 				<dt>description</dt>
     82 				<dd id="token_description"></dd>
     83 				<dt>image</dt>
     84 				<dd id="token_image"></dd>
     85 				<dt>supply</dt>
     86 				<dd id="token_cap"></dd>
     87 				<dt class="token_batch_list">batches</dt>
     88 				<dd class="token_batch_list">
     89 					<ol id="token_batches"></ol>
     90 				</dd>
     91 			</dl>
     92 		</div>
     93 		<div id="mint">
     94 			<h2>Mint allocated token</h2>
     95 			<a id="back_link" onClick="uiCreateToken();">back</a>
     96 			<dl>
     97 				<dt>token id</dt>
     98 				<dd id="token_mint_id"></dd>
     99 				<dt>batch</dt>
    100 				<dd id="token_mint_batch"></dd>
    101 			</dl>
    102 			<form>
    103 				<input type="hidden" id="token_mint_typ" value="unique" />
    104 				<input type="text" id="token_mint_recipient" />
    105 				<label for="token_mint_recipient">Recipient</label>
    106 				<span id="mint_index">
    107 				<input type="text" id="token_mint_index" />
    108 				<label for="token_mint_number">Number</label>
    109 				</span>
    110 				<button id="mint_submit" onClick='return false;' >mint</button>
    111 			</form>
    112 		</div>
    113 		<h2>Tokens</h2>
    114 
    115 		<ul id="token_list"></ul>
    116 	</body>
    117 </html>