Skip to content
Browse files

design update

  • Loading branch information...
1 parent 1ed254f commit a1be583a1d2e18fdc67e9e73c0c4e7d69f6756b9 @yiransheng committed
Showing with 51 additions and 11 deletions.
  1. +2 −1 home.html
  2. +6 −0 index.yaml
  3. +3 −3 static/css/home.css
  4. BIN static/imgs/bg0.jpg
  5. BIN static/imgs/bg0.png
  6. +39 −6 static/js/term.js
  7. +1 −1 templates/layout.html
View
3 home.html
@@ -9,6 +9,7 @@
</title>
<link href="/static/css/_normalize.css" rel="stylesheet" type="text/css" />
+<link href='http://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
<![if (lt IE 9)]>
<link href="/static/css/ie-home.css" rel="stylesheet" type="text/css" />
@@ -22,7 +23,7 @@
<link href='http://fonts.googleapis.com/css?family=Droid+Sans+Mono|Open+Sans+Condensed:700' rel='stylesheet' type='text/css'>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
-<script src="/static/js/hyphenator.min.js" type="text/javascript">
+<script src="http://yiranstatic/static/js/hyphenator.min.js" type="text/javascript">
</script>
<script src="/static/js/term.js" type="text/javascript">
</script>
View
6 index.yaml
@@ -9,3 +9,9 @@ indexes:
# manually, move them above the marker line. The index.yaml file is
# automatically uploaded to the admin console when you next deploy
# your application using appcfg.py.
+
+- kind: Post
+ properties:
+ - name: draft
+ - name: created_at
+ direction: desc
View
6 static/css/home.css
@@ -69,7 +69,7 @@ visibility: hidden;
}
iframe.hide{display: none;}
iframe, #widgets-area{
-top:20px; right: -90px;
+top:16px; right: -90px;
border: 0px solid #ffffff;
}
@@ -220,7 +220,7 @@ width: 527px;
padding: 20px;
height: 520px;
background: url(../imgs/bg3.png);
-font-family: monospace, serif;
+font-family: 'Inconsolata', monospace, sans-serif;
font-size: 13px;
color: #00ff00;
line-height: 150%;
@@ -240,7 +240,7 @@ outline: none;
width: 527px;
height: 21px;
color: #00ff00;
-font-family: monospace, serif;
+font-family: 'Inconsolata', monospace, sans-serif;
font-size: 14px;
line-height: 150%;
margin: 0;
View
BIN static/imgs/bg0.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN static/imgs/bg0.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
45 static/js/term.js
@@ -50,12 +50,16 @@ var play = {
return x
},
- recent: function(_type) {
+ recent: function(_type, quite) {
if (this.Recent) {
if (typeof _type !== "undefined"){
if (this.Recent[_type]){
- $(this.Recent[_type]).appendTo("#output");
- return "==========>"+_type
+ if (!quite) {
+ $(this.Recent[_type]).appendTo("#output");
+ return "==========>"+_type
+ } else {
+ return
+ }
} else {
this.Recent[_type] = "";
if (this[_type] instanceof Function) this[_type]();
@@ -70,6 +74,9 @@ var play = {
this.Recent = {all:""};
this.blog();
this.experiment();
+ this.research();
+
+ return "Now loading..."
},
experiment: function(quite) {
@@ -79,6 +86,14 @@ var play = {
dataType: "jsonp"});
},
+ research : function(quite) {
+ $.ajax("http://research.yiransheng.com/jsonp",
+ { success : _research,
+ crossDomain:true,
+ dataType: "jsonp"});
+ },
+
+
blog: function(quite) {
$.ajax("/recent", { success: function(res){
var x=0, p, o=$("<div><p>Recent Blog Posts</p></div>");
@@ -94,9 +109,9 @@ var play = {
}
play.Recent.blog = o.html();
play.Recent.all += o.html();
- $(o.html()).appendTo("#output");
+ play.recent("blog");
},
- crossDomain: true,
+ crossDomain: false,
dataType: "json"});
},
@@ -125,6 +140,23 @@ var play = {
},
+_research = function(res){
+ var x=0, p, o = $("<div><p>Recent Research</p></div>");
+ for (i in res){
+ item = res[i]
+ p = $("<p></p>")
+ $("<a></a>").text("[Research]"+item.title)
+ .attr("href", item.permlink)
+ .appendTo(p);
+ o.append(p);
+ x++;
+ if (x>4) {break}
+ }
+ play.Recent.research = o.html();
+ play.Recent.all += o.html();
+ play.recent("research");
+},
+
_jsonp = function(x) {
var res = x, x=0, p, o = $("<div><p>Recent Experiments</p></div>");
for (i in res.registered){
@@ -138,7 +170,8 @@ _jsonp = function(x) {
}
play.Recent.experiment = o.html();
play.Recent.all += o.html();
- $(o.html()).appendTo("#output");
+
+ play.recent("experiment");
},
tid = -1,
View
2 templates/layout.html
@@ -10,7 +10,7 @@
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="{{ url_for('static', filename='js/jsloader.min.js') }}" type="text/javascript"></script>
<script src="{{ url_for('static', filename='js/prettify.js') }}" type="text/javascript" async="async"></script>
- <script src="{{ url_for('static', filename='js/hyphenator.min.js') }}" type="text/javascript" async="async"></script>
+ <script src="http://yiranstatic.appspot.com/static/js/hyphenator.min.js" type="text/javascript"></script>
<link href="{{ url_for('feed') }}" rel="alternate" title="RSS" type="application/rss+xml" />
<link href="{{ url_for('static', filename='css/prettify.css') }}" rel="stylesheet" type="text/css">
<script type="text/javascript"

0 comments on commit a1be583

Please sign in to comment.
Something went wrong with that request. Please try again.