<html>
<head>
<meta name="description" content="らーめん屋シュミレータ">
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<h1>ラーメン屋シュミレータ</h1>
<ul>
<li>数字ボタンを押すと外で並んでいるグループ人数分着席します。
<li>nextボタンは、事態を1ターン進めます。
<li>clearボタンは、お客を全部外に追い出します。
</ul>
<!-- <button type="button" onClick="toggle();">toggle</button> -->
<div style="display : flex; width : 400px;">
<div style="flex-grow : 1"><button id="btn1" type="button" style="width : 100%" onClick="doProcess(1);"> 1 </button></div>
<div style="flex-grow : 1"><button id="btn2" type="button" style="width : 100%" onClick="doProcess(2);"> 2 </button></div>
<div style="flex-grow : 1"><button id="btn3" type="button" style="width : 100%" onClick="doProcess(3);"> 3 </button></div>
</div>
<div style="display : flex; width : 400px;">
<div style="flex-grow : 1"><button id="btn4" type="button" style="width : 100%" onClick="doProcess(4);"> 4 </button></div>
<div style="flex-grow : 1"><button id="btn5" type="button" style="width : 100%" onClick="doProcess(5);"> 5 </button></div>
<div style="flex-grow : 1"><button id="btn6" type="button" style="width : 100%" onClick="doProcess(6);"> 6 </button></div>
</div>
<div style="display : flex; width : 400px;">
<div style="flex-grow : 10"><button id="btn7" type="button" style="width : 100%" onClick="doProcess(7);"> 7 </button></div>
<div style="flex-grow : 9"><button type="button" style="width : 100%" onClick="next();"> next </button></div>
<div style="flex-grow : 9"><button type="button" style="width : 100%" onClick="clear1();"> clear </button></div>
</div>
<svg width="320" height="320">
<defs>
<circle id="empty" cx="160" cy="160" r="60" stroke-width="2" stroke="black" fill="white"/>
<circle id="sitdown" cx="160" cy="160" r="60" stroke-width="2" stroke="black" fill="black"/>
<g id="eating">
<circle cx="160" cy="160" r="60" stroke-width="2" stroke="black" fill="black"/>
<circle cx="160" cy="160" r="20" stroke-width="2" stroke="black" fill="white" transform="translate(0, 10)"/>
<circle cx="160" cy="160" r="20" stroke-width="2" stroke="black" fill="white" transform="translate(160, 160), scale(1.6, 0.9), translate(-160, -160)"/>
<circle cx="160" cy="160" r="20" stroke-width="2" stroke="black" fill="orange" transform="translate(160, 155), scale(1.3, 0.6), translate(-160, -160)"/>
<g fill="none">
<path d="M 20,120Q70,50,100,100T180,80" stroke="white" stroke-width="20" transform="translate(137, 150), rotate(90), scale(0.16), translate(-160, -160)"/>
<path d="M 20,120Q70,50,100,100T180,80" stroke="white" stroke-width="20" transform="translate(150, 150), rotate(90), scale(0.16), translate(-160, -160)"/>
<path d="M 20,120Q70,50,100,100T180,80" stroke="white" stroke-width="20" transform="translate(162, 150), rotate(90), scale(0.16), translate(-160, -160)"/>
</g>
</g>
<g id="rest">
<circle cx="160" cy="160" r="60" stroke-width="2" stroke="black" fill="black"/>
<circle cx="160" cy="160" r="20" stroke-width="2" stroke="black" fill="white" transform="translate(0, 10)"/>
<circle cx="160" cy="160" r="20" stroke-width="2" stroke="black" fill="white" transform="translate(160, 160), scale(1.6, 0.9), translate(-160, -160)"/>
<circle cx="160" cy="160" r="20" stroke-width="2" stroke="black" fill="white" transform="translate(160, 155), scale(1.3, 0.6), translate(-160, -160)"/>
</g>
</defs>
<g id="seats">
<use xlink:href="#empty" transform="translate(160, 70), scale(0.4), translate(-160, -160)"/>
<use xlink:href="#empty" transform="translate(225, 95), scale(0.4), translate(-160, -160)"/>
<use xlink:href="#empty" transform="translate(250, 160), scale(0.4), translate(-160, -160)"/>
<use xlink:href="#empty" transform="translate(225, 225), scale(0.4), translate(-160, -160)"/>
<use xlink:href="#empty" transform="translate(160, 250), scale(0.4), translate(-160, -160)"/>
<use xlink:href="#empty" transform="translate(95, 225), scale(0.4), translate(-160, -160)"/>
<use xlink:href="#empty" transform="translate(70, 160), scale(0.4), translate(-160, -160)"/>
<use xlink:href="#empty" transform="translate(95, 95), scale(0.4), translate(-160, -160)"/>
</g>
<circle cx="160" cy="160" r="60" stroke-width="2" stroke="black" fill="white"/>
</svg>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js"></script>
<script src="ramen.js"></script>
</body>
</html>
Output
You can jump to the latest bin by adding /latest
to your URL
Keyboard Shortcuts
Shortcut | Action |
---|---|
ctrl + [num] | Toggle nth panel |
ctrl + 0 | Close focused panel |
ctrl + enter | Re-render output. If console visible: run JS in console |
Ctrl + l | Clear the console |
ctrl + / | Toggle comment on selected lines |
ctrl + ] | Indents selected lines |
ctrl + [ | Unindents selected lines |
tab | Code complete & Emmet expand |
ctrl + shift + L | Beautify code in active panel |
ctrl + s | Save & lock current Bin from further changes |
ctrl + shift + s | Open the share options |
ctrl + y | Archive Bin |
Complete list of JS Bin shortcuts |
JS Bin URLs
URL | Action |
---|---|
/ | Show the full rendered output. This content will update in real time as it's updated from the /edit url. |
/edit | Edit the current bin |
/watch | Follow a Code Casting session |
/embed | Create an embeddable version of the bin |
/latest | Load the very latest bin (/latest goes in place of the revision) |
/[username]/last | View the last edited bin for this user |
/[username]/last/edit | Edit the last edited bin for this user |
/[username]/last/watch | Follow the Code Casting session for the latest bin for this user |
/quiet | Remove analytics and edit button from rendered output |
.js | Load only the JavaScript for a bin |
.css | Load only the CSS for a bin |
Except for username prefixed urls, the url may start with http://jsbin.com/abc and the url fragments can be added to the url to view it differently. |