Skip to content

Instantly share code, notes, and snippets.

View verekia's full-sized avatar

Verekia verekia

View GitHub Profile
function loadController(controllerName){
require(['Controllers/' + controllerName], function(controller){
controller.start();
});
}
define(function(){
var routes = [{hash:'#list', controller:'ListController'},
{hash:'#add', controller:'AddController'}];
var defaultRoute = '#list';
var currentHash = '';
function startRouting(){
window.location.hash = window.location.hash || defaultRoute;
setInterval(hashCheck, 100);
require(['Models/User', 'Router'], function(User, Router){
var users = [new User('Barney'),
new User('Cartman'),
new User('Sheldon')];
localStorage.users = JSON.stringify(users);
Router.startRouting();
});
require(['Controllers/ListController'], function(ListController){
ListController.start();
});
window.location.hash = '#list';
<!doctype html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="shape" id="shape1"></div>
<div class="shape" id="shape2"></div>
<div class="shape" id="shape3"></div>
</body>
</html>
.shape{
display:inline-block;
width:200px;
height:200px;
background:#ddf;
margin:20px;
}
@lightBlue:#ddf;
.shape{
display:inline-block;
width:200px;
height:200px;
background:@lightBlue;
margin:20px;
}
@lightRed: #fdd;
@lightGreen: #dfd;
@lightBlue: #ddf;
@defaultThemeColor:@lightGreen;
.shape{
display:inline-block;
width:200px;
height:200px;
#shape1{
border-radius:9999px;
}