<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<div class="accordion-box">
<input id="ac00" type="checkbox">
<label for="ac00"></label>
<div class="accordion-container">
<h3>タイトル</h3>
<p>世界中どこを探してもなかったので作りました。</p>
<p>jsを使っていないのでコンフリクトすることはありません。</p>
<p>スマホにも対応。iPhone4くらいの小さい画面でも大丈夫です。</p>
<p>閉じるボタンは要らないときは「.accordion-box input:checked + label」のdisplay:noneを有効にしてください。</p>
</div><!— accordion-container -->
</div><!— accordion-box -->
</body>
</html>
.accordion-box {
position: relative;
}
.accordion-box label {
height: 140px; /* グラデーションの高さ */
cursor: pointer;
text-align: center;
font-size: 12px;
position: absolute;
bottom: 0;
width: 100%;
/* 以下グラデーションは「背景が白」に併せて設定しています */
background: linear-gradient(top, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 90%);
background: linear-gradient(top, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 90%);
background: linear-gradient(top, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 90%);
background: linear-gradient(top, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 90%);
background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.95) 90%);
}
.accordion-box input:checked + label {
background: inherit; /* 開いた時には背景グラデーションを消す */
}
.accordion-box label:after {
content: "続きをよむ"; /* ラベルの文字 */
letter-spacing: .05em;
line-height: 2.5rem;
position: absolute;
bottom: 20px;
left: 50%;
transform: translate(-50%, 0);
transform: translate(-50%, 0);
color: #fff;
background-color: #000;
width: 18.75rem;
border-radius: 20px;
border-radius: 20px;
border-radius: 20px;
}
.accordion-box label:before {
content: "↓";
font-weight: 700;
position: absolute;
bottom: 30px;
left: 50%;
transform: translate(-140px, 0);
transform: translate(-140px, 0);
background-color: #fff;
z-index: 1;
border-radius: 100%;
border-radius: 100%;
border-radius: 100%;
width: 20px;
height: 20px;
line-height: 20px;
}
.accordion-box input {
display: none;
}
.accordion-box .accordion-container {
overflow: hidden;
height: 200px; /* 開く前に見えている部分の高さ */
transition: all 0.1s;
transition: all 0.1s;
transition: all 0.1s;
transition: all 0.1s;
transition: all 0.1s;
}
.accordion-box input:checked + label {
/* display: none ; 閉じるボタンは要らないとき */
}
.accordion-box input:checked + label:after {
content: "閉じる";
}
.accordion-box input:checked + label:before {
content: "↑";
}
.accordion-box input:checked ~ .accordion-container {
height: auto;
padding-bottom: 80px; /* 閉じるボタンのbottomからの位置 */
transition: all 0.1s;
transition: all 0.1s;
transition: all 0.1s;
transition: all 0.1s;
transition: all 0.1s;
}
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. |