Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Rei Kitajima authored and Rei Kitajima committed Jul 4, 2020
1 parent 4a3435a commit 795d169
Show file tree
Hide file tree
Showing 4 changed files with 124 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
Icon?
*~
node_modules/
docs/
package-lock.json
npm-debug.log
58 changes: 58 additions & 0 deletions docs/craft-widget-calendar-design-1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

var CalendarStyle = {
calendar : `
* { box-sizing:border-box; margin:0; padding:0; }
:host {
}
.root {
box-sizing: border-box;
width: 100%;
height: 100%;
background-color: #fff;
}
.header { width:350px; margin-top:22px; margin-left:auto; margin-right:auto; }
.month { width:350px; margin-top:11px; margin-left:auto; margin-right:auto; }
.navi { width:350px; margin-top: 11px; padding-bottom:22px; margin-left:auto; margin-right:auto; display:flex; }
.prev { margin-left:15px; cursor:pointer; text-align:right; }
.next { margin-right:15px; cursor:pointer; margin-left:auto; text-align:left; }
`,
month : `
* { box-sizing:border-box; margin:0; padding:0; }
:host {
width: 350px;
}
.root {
display: flex;
flex-direction: row;
flex-wrap: wrap;
width: 350px;
}
`,
day : `
* { box-sizing:border-box; margin:0; padding:0; }
:host {
width: 50px;
height: 50px;
}
.root {
width: 50px;
text-align: center;
line-height: 50px;
cursor: pointer;
}
.root:hover {
background-color: yellowgreen;
}
.weekday0 { color: #f00; }
.weekday1 { color: #555; }
.weekday2 { color: #555; }
.weekday3 { color: #555; }
.weekday4 { color: #555; }
.weekday5 { color: #555; }
.weekday6 { color: #00f; }
.prev_month { pointer-events: none; opacity: 0.5; }
.this_month { pointer-events: all; }
.next_month { pointer-events: none; opacity: 0.5; }
.today { background-color: #0f0; }
`
};
66 changes: 66 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, viewport-fit=cover"/>

<title>CraftKit Playground</title>
<style>
* { margin:0; padding:0; }
html,body {
background-color: #fff;
background-image: url('/logo.gif');
background-position: center center;
background-repeat: no-repeat;
background-attachment: fixed;
font-family: "Meiryo"
}
</style>

<script src="https://unpkg.com/@craftkit/craft-uikit/dist/craft-uikit.min.dev.js"></script>
<script>
window.load_module = function(url){
var http = new XMLHttpRequest();
http.onload = function(e){
let script = document.createElement('script');
script.type = 'text/javascript';
script.text = this.responseText;
script.async = false;
document.head.appendChild(script);
console.log('loaded: '+url);
};
http.onerror = function(e){ alert('cannot call api'); };
http.ontimeout = function(){ alert('timeout'); };
http.open('GET',url);
http.send();
};
window.load_css = function(url){
let link = document.createElement('link');
link.rel = 'stylesheet';
link.href = url;
document.head.appendChild(link);
console.log('loaded: '+url);
};
window.onload = function(){
console.log(" ");
console.log("🛺 Welcome to CraftKit Playground");
console.log(" ");
console.log(" Check:");
console.log(" https://github.com/craftkit/craftkit-playground");
console.log(" ");
console.log(" Copy and paste tutorial snippet in here");
console.log(" Enjoy!");
console.log(" ");
Craft.Core.Bootstrap.boot({
router : Craft.Core.HashRouter,
didBootApplication : function(){
Craft.Core.Defaults.BASE_DIV_NAME = 'CraftRoot';
Craft.Core.Defaults.ALLOW_COMPONENT_SHORTCUT = true;
}
});
};
</script>
</head>
<body id="CraftRoot">
</body>
</html>
Binary file added docs/logo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 795d169

Please sign in to comment.