<html>
<head>
<link href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.4.0/animate.min.css" rel="stylesheet">
<!-- ScarletsFrame framework -->
<script src='https://cdn.jsdelivr.net/npm/scarletsframe@0.34.0/dist/scarletsframe.min.js'></script>
</head>
<body class="body">
<sf-m name="todo-app" class="container">
<!-- Bind the html content -->
<div class="today">
{{ todayMessage }}
</div>
<div class="row">
<ul class="todo-list">
<!-- Bind array from the model -->
<li sf-each="x in list">
<div class="checkbox">
<label>{{ x.text }}</label>
</div>
</li>
</ul>
</div>
</sf-m>
<a href="https://www.npmjs.com/package/scarletsframe" target="_blank">ScarletsFrame</a>
</body>
.body {
background: #1d1d1d;
font: 14px 'Nunito', sans-serif;
}
.today{
font-size: 22px;
}
a{
color:white;
position:fixed;
bottom:20px;
opacity:0.2;
text-decoration: none;
}
.animated.bounceIn, .animated.bounceOut, .animated.flipOutX, .animated.flipOutY {
font-size: 13px;
}
.container {
padding-top: 75px;
}
.todo-list {
margin: 20px 0;
}
.todo-list li {
background: #fff;
border-radius: 5px;
margin-bottom: 7px;
position: relative;
word-break: break-word;
}
.todo-list li.danger {
background: rgb(85, 41, 220);
}
.todo-list li.danger label {
text-decoration: line-through;
color: #fff;
}
.todo-list li.danger label .checkbox-mask {
border-color: transparent;
}
.todo-list li.danger label .checkbox-mask:after {
content: '\f00c';
font-family: 'FontAwesome';
display: block;
position: absolute;
top: -3px;
left: 0;
}
.todo-list li .checkbox {
margin: 0;
padding: 10px 15px;
border-radius: 5px;
}
.todo-list li label {
display: block;
padding-right: 10px;
}
.todo-list li label input[type="checkbox"] {
visibility: hidden;
}
.todo-list li label .checkbox-mask {
display: block;
border: 2px solid #666;
width: 12px;
height: 12px;
border-radius: 2.5px;
position: absolute;
margin-left: -20px;
margin-top: 4px;
}
.todo-list li .close {
display: none;
position: absolute;
width: 12px;
height: 16px;
top: 50%;
margin-top: -8px;
right: 10px;
font-size: 16px;
}
.todo-list li .close .fa {
line-height: 16px;
}
.todo-list li:hover .close {
display: block;
}
.has-feedback .fa {
line-height: 35px;
cursor: pointer;
pointer-events: auto;
z-index: 10;
display: block;
color: #666;
transition: color 0.15s linear;
transition: color 0.15s linear;
}
.has-feedback .fa:hover {
color: #999;
}
.add-control {
margin-top: 20px;
position: relative;
}
.add-control .form-control {
padding-right: 25px;
}
.add-control .refresh {
position: absolute;
top: 8px;
right: 0;
font-size: 14px;
transform: translateX(100%);
transform: translateX(100%);
margin-right: -10px;
cursor: pointer;
color: #9da1af;
transition: color 0.15s linear;
transition: color 0.15s linear;
}
.add-control .refresh:hover {
color: #666;
}
.form-control,
.form-control:focus,
.form-control:active,
.form-control:active:focus {
border: none;
padding: 10px 15px;
outline: none;
}
.form-control {
box-shadow: none;
box-shadow: none;
transition: all 0.2s linear;
transition: all 0.2s linear;
}
.form-control:focus {
box-shadow: 0 0 15px rgba(0,0,0,0.2);
box-shadow: 0 0 15px rgba(0,0,0,0.2);
}
.separator {
margin: 15px auto;
width: 50%;
height: 1px;
}
.animated {
animation-duration: 0.45s;
animation-duration: 0.45s;
animation-fill-mode: both;
animation-fill-mode: both;
}
.animated.fast {
animation-duration: 0.25s;
animation-duration: 0.25s;
}
.today{
text-align: center;
color: #fff;
}
.zero{
top: 8px;
right: 0;
font-size: 14px;
transform: translateX(100%);
transform: translateX(100%);
margin-right: -10px;
cursor: pointer;
color: #9da1af;
transition: color 0.15s linear;
transition: color 0.15s linear;
}
$c-gray: #8d959b;
$c-light: #f9f9f9;
$c-dark: #404060;
$c-red: #e96575;
$c-blue: #4b96f0;
// Base Classes
.group:after {
content: "";
display: table;
clear: both;
}
.btn_wrapper {
@extend .group;
max-width: 250px;
margin: 0 auto;
}
button {
font-size: 16px;
color: #ffffff;
background: #fff0;
padding: 10px 20px;
transition: all 0.3s;
outline: none;
border-color: #FFF;
border-radius: 35px;
margin-left: 5px;
margin-right: 5px;
}
}
button[disabled] {
color: $c-gray !important;
background: #fff !important;
}
.output {
padding-bottom: 10px;
button {
color: $c-blue;
&:hover,
&:focus {
transform: scale(1.5);
background: transparent;
}
}
}
#start {
background: #6200ff;
border: none;
border-radius: 20px;
padding-left: 35px;
padding-right: 35px;
}
#start:hover {
box-shadow: 0 0 25px 0 #452579;
color: white;
}
#inc{
border: none;
font-size: 40px;
border-radius: 20px;
padding-left: 35px;
padding-right: 35px;
}
#dec{
border: none;
font-size: 40px;
border-radius: 20px;
padding-left: 35px;
padding-right: 35px;
}
#reset {
color: $c-red;
&:hover,
&:focus {
background-color: $c-red;
color: #fff;
border-radius: 20px;
padding-left: 35px;
padding-right: 35px;
}
}
.pomodoro {
text-align: center;
}
p {
margin: 15px 0 10px;
font-size: 46px;
font-weight: 700;
color: #FFF;
}
.fa-ban:before {
content: "\f05e";
color: #8c8c8c;
font-size: 29px;
}
.logo {
text-align: center;
margin-top: 30px;
margin-bottom: -50px;
}
.h4, h4 {
font-size: 16px;
color: #fff;
text-align: center;
margin-top: 40px;
}
a:focus, a:hover {
color: #fbfbfb;
text-decoration: none;
}
.fa-remove:before, .fa-close:before, .fa-times:before {
content: "\f00d";
color: #000;
}
@media (max-width: 768px){
.col-xs-offset-3 {
margin-left: 10%;
}
}
@media (max-width: 768px){
.col-xs-6 {
width: 80%;
}
}
@viewport {
width: device-width;
zoom: 1;
}
@media (min-width: 992px){
.container {
width: 100%;
max-width: 1150PX;
}
}
@media (max-width: 680px){
svg {
width: 70px;
height: 70px;
}
}
.todo-list input[type="checkbox"] {
opacity: 0;
}
ul{
list-style: none;
width: 80vw;
}
// ======== Type on the console ========
// test.list.push({text:'Hello world'});
// test.todayMessage = "What's up 😜";
var $ = sf.$;
var test = sf.model('todo-app', function(My){
My.todayMessage = 'Greetings 😜';
My.list = [];
// Listener when the 'self.list' was changed
My.on$list = {
remove:function(elem, remove){
$(elem).animateKey('bounceOutLeft', {duration:1}, function(){
remove();
});
// Avoid instant element remove
return true;
},
create:function(elem){
$(elem).animateKey('flipInX', {duration:1});
}
};
// Run only when <sf-m> element was initialized
My.init = function(){
My.list.push({text:"Heya all"});
}
});
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. |