',minLength:1,scrollHeight:0,autoSelect:!0,afterSelect:a.noop,delay:0,addItem:!1},a.fn.typeahead.Constructor=b,a.fn.typeahead.noConflict=function(){return a.fn.typeahead=c,this},a(document).on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(){var b=a(this);b.data("typeahead")||b.typeahead(b.data())})});
--------------------------------------------------------------------------------
/about/js/modernizr.custom.js:
--------------------------------------------------------------------------------
1 | /* Modernizr 2.6.2 (Custom Build) | MIT & BSD
2 | * Build: http://modernizr.com/download/#-shiv-cssclasses-load
3 | */
4 | ;window.Modernizr=function(a,b,c){function u(a){j.cssText=a}function v(a,b){return u(prefixes.join(a+";")+(b||""))}function w(a,b){return typeof a===b}function x(a,b){return!!~(""+a).indexOf(b)}function y(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:w(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m={},n={},o={},p=[],q=p.slice,r,s={}.hasOwnProperty,t;!w(s,"undefined")&&!w(s.call,"undefined")?t=function(a,b){return s.call(a,b)}:t=function(a,b){return b in a&&w(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(q.call(arguments)))};return e});for(var z in m)t(m,z)&&(r=z.toLowerCase(),e[r]=m[z](),p.push((e[r]?"":"no-")+r));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)t(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},u(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+p.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return"[object Function]"==o.call(a)}function e(a){return"string"==typeof a}function f(){}function g(a){return!a||"loaded"==a||"complete"==a||"uninitialized"==a}function h(){var a=p.shift();q=1,a?a.t?m(function(){("c"==a.t?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){"img"!=a&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l=b.createElement(a),o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};1===y[c]&&(r=1,y[c]=[]),"object"==a?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),"img"!=a&&(r||2===y[c]?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i("c"==b?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),1==p.length&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&"[object Opera]"==o.call(a.opera),l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return"[object Array]"==o.call(a)},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f
50 | #include
51 | #include
52 |
53 | //宏定义打印函数,使用方法 LOGI("hello") 或者 LOGI("money %d",15)
54 | #define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "native", __VA_ARGS__))
55 | #define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "native", __VA_ARGS__))
56 |
57 | const char key[] = "abcdefghijklmnop"; //16个字符
58 | int len = 0;
59 |
60 | //计算字符对应的byte值
61 | unsigned char getByteNumber(unsigned char first, unsigned char end) {
62 | int firstPosition = 0, endPosition = 0;
63 | int position = 0;
64 | for (; position < 16; position++) {
65 | if (key[position] == first) {
66 | firstPosition = position;
67 | }
68 | if (key[position] == end) {
69 | endPosition = position;
70 | }
71 | }
72 | return (firstPosition << 4) | (endPosition);
73 | }
74 |
75 | //加密函数
76 | void encrypt(unsigned char p[], unsigned char res[]) {
77 | int i = 0;
78 | for (; i < len; i++) {
79 | res[2 * i] = key[p[i] / 16];
80 | res[2 * i + 1] = key[p[i] % 16];
81 | }
82 | }
83 |
84 | //解密函数
85 | void decrypt(unsigned char p[], char res[]) {
86 | int i;
87 | for (i = 0; i < len; i++) {
88 | res[i] = getByteNumber(p[i * 2], p[i * 2 + 1]);
89 | }
90 | }
91 |
92 | //java中生命的native函数,函数名称格式Java_包名(点换下划线)_类名_函数名
93 | //前两个参数JNIEnv *env, jclass this比较固定,其中第二个参数jclass代表方法是静态的,仅仅是个表示,如果方法不是静态的话,jclass换成jobject
94 | //后续的参数是函数要传进来的参数
95 | //java中的byte数组对应jni中的jbyteArray,jni中的jbyteArray可以通过jni中的函数转换为char数组
96 | jstring Java_me_codeboy_encrypt_EncryptUtil_encrypt(JNIEnv *env, jclass this,
97 | jbyteArray src) {
98 | unsigned char *buff = (char*) (*env)->GetByteArrayElements(env, src, NULL);
99 | len = (*env)->GetArrayLength(env, src);
100 | //加密后长度变为原先的2倍
101 | unsigned char res[len * 2];
102 | encrypt(buff, res);
103 | //此步骤很重要,标志结束
104 | res[len * 2] = '\0';
105 |
106 | //使用完毕释放src数组,因为src数组的存在jvm中
107 | (*env)->ReleaseByteArrayElements(env, src, buff, 0);
108 |
109 | //jni中函数将char数组转变为字符串,jni中字符串为jstring,对应java中的String
110 | jstring resStr = (*env)->NewStringUTF(env, res);
111 | return resStr;
112 | }
113 |
114 | //和加密类似
115 | jstring Java_me_codeboy_encrypt_EncryptUtil_decrypt(JNIEnv *env, jclass this,
116 | jbyteArray src) {
117 | unsigned char *buff = (char*) (*env)->GetByteArrayElements(env, src, NULL);
118 | len = (*env)->GetArrayLength(env, src);
119 | //解密后长度变为原先的1/2
120 | len = len / 2;
121 | signed char res[len];
122 | decrypt(buff, res);
123 | //此步骤很重要,标志结束
124 | res[len] = '\0';
125 |
126 | //使用完毕释放src数组,因为src数组的存在jvm中
127 | (*env)->ReleaseByteArrayElements(env, src, buff, 0);
128 |
129 | jstring resStr = (*env)->NewStringUTF(env, res);
130 | return resStr;
131 | }
132 |
133 | 这样我们的ndk相关的文件就写好了,下面在终端下切换到AndroidNDK目录下,运行命令即可:
134 |
135 | ../ndk-build
136 |
137 | 运行结果如下:
138 |
139 | mac:AndroidNDK YD$ ../ndk-build
140 | Android NDK: WARNING: APP_PLATFORM android-21 is larger than android:minSdkVersion 14 in ./AndroidManifest.xml
141 | [armeabi] Compile thumb : codeboy_encrypt <= encrypt.c
142 | [armeabi] SharedLibrary : libcodeboy_encrypt.so
143 | [armeabi] Install : libcodeboy_encrypt.so => libs/armeabi/libcodeboy_encrypt.so
144 | [armeabi-v7a] Compile thumb : codeboy_encrypt <= encrypt.c
145 | [armeabi-v7a] SharedLibrary : libcodeboy_encrypt.so
146 | [armeabi-v7a] Install : libcodeboy_encrypt.so => libs/armeabi-v7a/libcodeboy_encrypt.so
147 |
148 | 执行完成后,我们可以看一下libs文件夹,多了一些so文件,如下:
149 |
150 | mac:AndroidNDK YD$ tree libs
151 | libs
152 | ├── android-support-v4.jar
153 | ├── armeabi
154 | │ └── libcodeboy_encrypt.so
155 | └── armeabi-v7a
156 | └── libcodeboy_encrypt.so
157 |
158 | 2 directories, 3 files
159 |
160 |
161 | 下面我们就开始写对应的java代码了,将调用c函数的加解密函数抽象到一个类中即可
162 |
163 | **EncryptUtil.java**
164 |
165 | package me.codeboy.encrypt;
166 |
167 | public class EncryptUtil {
168 | public native static String encrypt(byte[] src); // 加密函数
169 |
170 | public native static String decrypt(byte[] src); // 解密函数
171 |
172 | static {
173 | System.loadLibrary("codeboy_encrypt");
174 | }
175 |
176 | /**
177 | * 加密函数
178 | *
179 | * @param src
180 | * @return
181 | */
182 | public static String encrypt(String src) {
183 | return encrypt(src.getBytes());
184 | }
185 |
186 | /**
187 | * 解密函数
188 | *
189 | * @param src
190 | * @return
191 | */
192 | public static String decrypt(String src) {
193 | return decrypt(src.getBytes());
194 | }
195 | }
196 |
197 | 注意C语言中的函数名称中的包名类名函数名要与该类统一,还有对应的链接库名称。
198 |
199 | 做好了这些以后,我们就可以使用了。在我们的Activity中简单的定义一个按钮,点击后对一个字符串进行加密打印,之后进行解密打印,Activity中的代码如下:
200 |
201 | package me.codeboy.ndk.ui;
202 |
203 | import me.codeboy.encrypt.EncryptUtil;
204 | import me.codeboy.ndk.R;
205 | import android.app.Activity;
206 | import android.os.Bundle;
207 | import android.view.View;
208 | import android.view.View.OnClickListener;
209 | import android.widget.Button;
210 |
211 | public class MainActivity extends Activity {
212 | @Override
213 | protected void onCreate(Bundle savedInstanceState) {
214 | setContentView(R.layout.main_ui);
215 | super.onCreate(savedInstanceState);
216 |
217 | Button btn = (Button) findViewById(R.id.btn);
218 | btn.setOnClickListener(new OnClickListener() {
219 |
220 | @Override
221 | public void onClick(View v) {
222 | String src = "我是玄恒,欢迎访问我的网站codeboy.me";
223 | String res = EncryptUtil.encrypt(src);
224 | System.out.println("------>" + res);
225 | res = EncryptUtil.decrypt(res);
226 | System.out.println("--->" + res);
227 | }
228 | });
229 | }
230 | }
231 |
232 |
233 | 点击按钮后可以看到点击button打印的结果:
234 |
235 | --->ogiijbogjikpohioieogibjcoplmimogkmkcoilpiooikolpojjhkoogiijbohjkieohlnjbohkljjgdgpgegfgcgphjcogngf
236 | --->我是玄恒,欢迎访问我的网站codeboy.me
237 |
238 | 这样下来我们就完成了简单的加解密操作,也对ndk有了一个初步的了解。
239 |
240 |
241 | > 如有任何知识产权、版权问题或理论错误,还请指正。
242 | >
243 | > 转载请注明原作者及以上信息。
244 |
--------------------------------------------------------------------------------
/_posts/2015-06-28-android-context.md:
--------------------------------------------------------------------------------
1 | ---
2 | layout: post
3 | title: 'Context, What Context?'
4 | date: '2015-06-28'
5 | header-img: "img/post-bg-android.jpg"
6 | tags:
7 | - android
8 | author: 'Codeboy'
9 | ---
10 | Android中有各种各样的context,不同context有不同的用途,不仅仅生命周期不同,同时能够实现的操作也不相同,下面看一篇外国朋友总结的文章:
11 |
12 | **Context is probably the most used element in Android application, it may also be the most misused.**
13 |
14 | Context objects are so common, and get passed around so frequently, it can be easy to create a situation you didn’t intend. Loading resources, launching a new Activity, obtaining a system service, getting internal file paths, and creating views all require a Context (and that’s not even getting started on the full list!) to accomplish the task. What I’d like to do is provide for you some insights on how Context works alongside some tips that will (hopefully) allow you to leverage it more effectively in your applications.
15 |
16 | Context Types
17 | ----
18 | Not all Context instances are created equal. Depending on the Android application component, the Contextyou have access to varies slightly:
19 |
20 | **Application** – is a singleton instance running in your application process. It can be accessed via methods like getApplication() from an Activity or Service, and getApplicationContext() from any other object that inherits from Context. Regardless of where or how it is accessed, you will always receive the same instance from within your process.
21 |
22 | **Activity/Service** – inherit from ContextWrapper which implements the same API, but proxies all of its method calls to a hidden internal Context instance, also known as its base context. Whenever the framework creates a new Activity or Service instance, it also creates a new ContextImpl instance to do all of the heavy lifting that either component will wrap. Each Activity or Service, and their corresponding base context, are unique per-instance.
23 |
24 | **BroadcastReceiver** – is not a Context in and of itself, but the framework passes a Context to it in onReceive() each time a new broadcast event comes in. This instance is a ReceiverRestrictedContext with two main functions disabled; calling registerReceiver() and bindService(). These two functions are not allowed from within an existing BroadcastReceiver.onReceive(). Each time a receiver processes a broadcast, the Contexthanded to it is a new instance.
25 |
26 | **ContentProvider** – is also not a Context but is given one when created that can be accessed via getContext(). If the ContentProvider is running local to the caller (i.e. same application process), then this will actually return the same Application singleton. However, if the two are in separate processes, this will be a newly created instance representing the package the provider is running in.
27 |
28 | Saved References
29 | ----
30 | The first issue we need to address comes from saving a reference to a Context in an object or class that has a lifecycle that extends beyond that of the instance you saved. For example, creating a custom singleton that requires a Context to load resources or access a ContentProvider, and saving a reference to the current Activity or Service in that singleton.
31 |
32 | **Bad Singleton**
33 |
34 | public class CustomManager {
35 | private static CustomManager sInstance;
36 |
37 | public static CustomManager getInstance(Context context) {
38 | if (sInstance == null) {
39 | sInstance = new CustomManager(context);
40 | }
41 |
42 | return sInstance;
43 | }
44 |
45 | private Context mContext;
46 |
47 | private CustomManager(Context context) {
48 | mContext = context;
49 | }
50 | }
51 |
52 | The problem here is we don’t know where that Context came from, and it is not safe to hold a reference to the object if it ends up being an Activity or a Service. This is a problem because a singleton is managed by a single static reference inside the enclosing class. This means that our object, and ALL the other objects referenced by it, will never be garbage collected. If this Context were an Activity, we would effectively hold hostage in memory all the views and other potentially large objects associated with it; creating a leak.
53 |
54 | To protect against this, we modify the singleton to always reference the application context:
55 |
56 | **Better Singleton**
57 |
58 | public class CustomManager {
59 | private static CustomManager sInstance;
60 |
61 | public static CustomManager getInstance(Context context) {
62 | if (sInstance == null) {
63 | //Always pass in the Application Context
64 | sInstance = new CustomManager(context.getApplicationContext());
65 | }
66 |
67 | return sInstance;
68 | }
69 |
70 | private Context mContext;
71 |
72 | private CustomManager(Context context) {
73 | mContext = context;
74 | }
75 | }
76 |
77 | Now it doesn’t matter where our Context came from, because the reference we are holding is safe. The application context is itself a singleton, so we aren’t leaking anything by creating another static reference to it. Another great example of places where this can crop up is saving references to a Context from inside a running background thread or a pending Handler.
78 |
79 | So why can’t we always just reference the application context? Take the middleman out of the equation, as it were, and never have to worry about creating leaks? The answer, as I alluded to in the introduction, is because one Context is not equal to another.
80 |
81 | Context Capabilities
82 | ----
83 | The common actions you can safely take with a given Context object depends on where it came from originally. Below is a table of the common places an application will receive a Context, and in each case what it is useful for:
84 |
85 | FUNCTION |APPLICATION |ACTIVITY| SERVICE| CONTENTPROVIDER| BROADCASTRECEIVER
86 | ---|---|---|---|---|---
87 | Show a Dialog| NO| YES |NO| NO| NO
88 | Start an Activity| NO①| YES |NO①| NO①| NO①
89 | Layout Inflation| NO②| YES| NO②| NO②| NO②
90 | Start a Service| YES| YES| YES| YES| YES
91 | Bind to a Service| YES |YES| YES| YES| NO
92 | Send a Broadcast| YES |YES| YES |YES |YES
93 | Register BroadcastReceiver| YES |YES| YES| YES| NO③
94 | Load Resource Values| YES |YES| YES| YES| YES
95 |
96 | > ① An application CAN start an Activity from here, but it requires that a new task be created. This may fit specific use cases, but can create non-standard back stack behaviors in your application and is generally not recommended or considered good practice.
97 | >
98 | > ② This is legal, but inflation will be done with the default theme for the system on which you are running, not what’s defined in your application.
99 | >
100 | > ③ Allowed if the receiver is null, which is used for obtaining the current value of a sticky broadcast, on Android 4.2 and above.
101 |
102 | User Interface
103 | ----
104 | You can see from looking at the previous table that there are a number of functions the application context is not properly suited to handle; all of them related to working with the UI. In fact, the only implementation equipped to handle all tasks associated with the UI is Activity; the other instances fare pretty much the same in all categories.
105 |
106 | Luckily, these three actions are things an application doesn’t really have any place doing outside the scope of an Activity; it’s almost like the framework was designed that way on purpose. Attempting to show a Dialogthat was created with a reference to the application context, or starting an Activity from the application context will throw an exception and crash your application…a strong indicator something has gone wrong.
107 |
108 | The less obvious issue is inflating layouts. If you read my last piece on layout inflation, you already know that it can be a slightly mysterious process with some hidden behaviors; using the right Context is linked to another one of those behaviors. While the framework will not complain and will return a perfectly good view hierarchy from a LayoutInflater created with the application context, the themes and styles from your app will not be considered in the process. This is because Activity is the only Context on which the themes defined in your manifest are actually attached. Any other instance will use the system default theme to inflate your views, leading to a display output you probably didn’t expect.
109 |
110 | The Intersection of these Rules
111 | -----
112 |
113 | Invariably, someone will arrive at the conclusion that these two rules conflict. There is a case in the application’s current design where a long-term reference must be saved and we must save an Activity because the tasks we want to accomplish include manipulation of the UI. If that is the case, I would urge you to reconsider your design, as this would be a textbook instance of fighting the framework.
114 |
115 | The Rule of Thumb
116 | ----
117 | In most cases, use the Context directly available to you from the enclosing component you’re working within. You can safely hold a reference to it as long as that reference does not extend beyond the lifecycle of that component. As soon as you need to save a reference to a Context from an object that lives beyond your Activity or Service, even temporarily, switch that reference you save over to the application context.
118 |
119 | *转自: https://possiblemobile.com/2013/06/context/*
120 |
121 |
122 | > 如有任何知识产权、版权问题或理论错误,还请指正。
123 | >
124 | > 转载请注明原作者及以上信息。
125 |
--------------------------------------------------------------------------------
/css/codeboy.min.css:
--------------------------------------------------------------------------------
1 | body{font-family:"Helvetica Neue",Arial,"Hiragino Sans GB","STHeiti","Microsoft YaHei","WenQuanYi Micro Hei",SimSun,sans-serif;line-height:1.7;font-size:16px;color:#404040;overflow-x:hidden}p{margin:30px 0}h1,h2,h3,h4,h5,h6{font-family:"Helvetica Neue",Arial,"Hiragino Sans GB","STHeiti","Microsoft YaHei","WenQuanYi Micro Hei",SimSun,sans-serif;line-height:1.7;line-height:1.1;font-weight:800}h1{font-family:'Open Sans','Helvetica Neue',Helvetica,Arial,sans-serif}h4{font-size:20px}a{color:#404040}a:hover,a:focus{color:#0085a1}a img:hover,a img:focus{cursor:zoom-in}article{overflow-x:hidden}blockquote{color:gray;font-style:italic;font-size:.95em;margin:20px 0 20px}blockquote p{margin:0}.table th,.table td{border:1px solid #eee !important}hr.small{max-width:100px;margin:15px auto;border-width:4px;border-color:white}@media screen and (max-width:500px){pre code{display:block;width:500px}}.post-container a{color:#337ab7}.post-container a:hover,.post-container a:focus{color:#0085a1}.post-container ul,.post-container ol{margin-bottom:40px}.post-container ol ol,.post-container ol ul,.post-container ul ol,.post-container ul ul{margin-bottom:5px}.post-container li p{margin:0;margin-bottom:5px}.post-container li h1,.post-container li h2,.post-container li h3,.post-container li h4,.post-container li h5,.post-container li h6{line-height:2;margin-top:20px}.navbar-custom{background:white;position:absolute;top:0;left:0;width:100%;z-index:3;font-family:"Helvetica Neue",Arial,"Hiragino Sans GB","STHeiti","Microsoft YaHei","WenQuanYi Micro Hei",SimSun,sans-serif;line-height:1.7}.navbar-custom .navbar-brand{font-weight:800}.navbar-custom .nav li a{text-transform:uppercase;font-size:16px;font-weight:800;letter-spacing:1px}@media only screen and (min-width:768px){.navbar-custom{background:transparent;border-bottom:1px solid transparent}.navbar-custom body{font-size:20px}.navbar-custom .navbar-brand{color:white;padding:20px}.navbar-custom .navbar-brand:hover,.navbar-custom .navbar-brand:focus{color:rgba(255,255,255,0.8)}.navbar-custom .nav li a{font-size:18px;color:white;padding:20px}.navbar-custom .nav li a:hover,.navbar-custom .nav li a:focus{color:rgba(255,255,255,0.8)}}@media only screen and (min-width:1170px){.navbar-custom{-webkit-transition:background-color .3s;-moz-transition:background-color .3s;transition:background-color .3s;-webkit-transform:translate3d(0,0,0);-moz-transform:translate3d(0,0,0);-ms-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-backface-visibility:hidden;backface-visibility:hidden}.navbar-custom.is-fixed{position:fixed;top:-61px;background-color:rgba(255,255,255,0.9);border-bottom:1px solid #f2f2f2;-webkit-transition:-webkit-transform .3s;-moz-transition:-moz-transform .3s;transition:transform .3s}.navbar-custom.is-fixed .navbar-brand{color:#404040}.navbar-custom.is-fixed .navbar-brand:hover,.navbar-custom.is-fixed .navbar-brand:focus{color:#0085a1}.navbar-custom.is-fixed .nav li a{color:#404040}.navbar-custom.is-fixed .nav li a:hover,.navbar-custom.is-fixed .nav li a:focus{color:#0085a1}.navbar-custom.is-visible{-webkit-transform:translate3d(0,100%,0);-moz-transform:translate3d(0,100%,0);-ms-transform:translate3d(0,100%,0);-o-transform:translate3d(0,100%,0);transform:translate3d(0,100%,0)}}.intro-header{background:no-repeat center center;background-color:gray;background-attachment:scroll;-webkit-background-size:cover;-moz-background-size:cover;background-size:cover;-o-background-size:cover;margin-bottom:0}@media only screen and (min-width:768px){.intro-header{margin-bottom:20px}}.intro-header .site-heading,.intro-header .post-heading,.intro-header .page-heading{padding:100px 0 50px;color:white}@media only screen and (min-width:768px){.intro-header .site-heading,.intro-header .post-heading,.intro-header .page-heading{padding:150px 0}}.intro-header .site-heading,.intro-header .page-heading{text-align:center}.intro-header .site-heading h1,.intro-header .page-heading h1{margin-top:0;font-size:50px}.intro-header .site-heading .subheading,.intro-header .page-heading .subheading{font-family:"Helvetica Neue",Arial,"Hiragino Sans GB","STHeiti","Microsoft YaHei","WenQuanYi Micro Hei",SimSun,sans-serif;line-height:1.7;font-size:20px;line-height:1.1;display:block;font-weight:300;margin:10px 0 0}@media only screen and (min-width:768px){.intro-header .site-heading h1,.intro-header .page-heading h1{font-size:80px}}.intro-header .post-heading h1{font-size:30px}.intro-header .post-heading .subheading,.intro-header .post-heading .meta{line-height:1.1;display:block}.intro-header .post-heading .subheading{font-family:"Helvetica Neue",Arial,"Hiragino Sans GB","STHeiti","Microsoft YaHei","WenQuanYi Micro Hei",SimSun,sans-serif;line-height:1.7;font-size:17px;font-weight:normal;margin:10px 0 30px;margin-top:-5px}.intro-header .post-heading .meta{font-family:'Lora','Times New Roman',serif;font-style:italic;font-weight:300;font-size:18px}.intro-header .post-heading .meta a{color:white}@media only screen and (min-width:768px){.intro-header .post-heading h1{font-size:55px}.intro-header .post-heading .subheading{font-size:30px}.intro-header .post-heading .meta{font-size:20px}}.post-preview>a{color:#404040}.post-preview>a:hover,.post-preview>a:focus{text-decoration:none;color:#0085a1}.post-preview>a>.post-title{font-size:21px;line-height:1.3;margin-top:30px;margin-bottom:8px}.post-preview>a>.post-subtitle{font-size:15px;margin:0;font-weight:300;margin-bottom:10px}.post-preview>.post-meta{font-family:'Lora','Times New Roman',serif;color:gray;font-size:16px;font-style:italic;margin-top:0}.post-preview>.post-meta>a{text-decoration:none;color:#404040}.post-preview>.post-meta>a:hover,.post-preview>.post-meta>a:focus{color:#0085a1;text-decoration:underline}@media only screen and (min-width:768px){.post-preview>a>.post-title{font-size:26px;line-height:1.3;margin-bottom:10px}.post-preview>a>.post-subtitle{font-size:16px}.post-preview .post-meta{font-size:18px}}.post-content-preview{font-size:16px;color:#a3a3a3}.post-content-preview:hover{color:#0085a1}@media only screen and (min-width:768px){.post-content-preview{font-size:18px}}.section-heading{font-size:36px;margin-top:60px;font-weight:700}.caption{text-align:center;font-size:14px;padding:10px;font-style:italic;margin:0;display:block;border-bottom-right-radius:5px;border-bottom-left-radius:5px}footer{font-size:20px;padding:50px 0 65px}footer .list-inline{margin:0;padding:0}footer .copyright{font-size:14px;text-align:center;margin-bottom:0}.floating-label-form-group{font-size:14px;position:relative;margin-bottom:0;padding-bottom:.5em;border-bottom:1px solid #eee}.floating-label-form-group input,.floating-label-form-group textarea{z-index:1;position:relative;padding-right:0;padding-left:0;border:0;border-radius:0;font-size:1.5em;background:0;box-shadow:none !important;resize:none}.floating-label-form-group label{display:block;z-index:0;position:relative;top:2em;margin:0;font-size:.85em;line-height:1.764705882em;vertical-align:middle;vertical-align:baseline;opacity:0;-webkit-transition:top .3s ease,opacity .3s ease;-moz-transition:top .3s ease,opacity .3s ease;-ms-transition:top .3s ease,opacity .3s ease;transition:top .3s ease,opacity .3s ease}.floating-label-form-group::not(:first-child){padding-left:14px;border-left:1px solid #eee}.floating-label-form-group-with-value label{top:0;opacity:1}.floating-label-form-group-with-focus label{color:#0085a1}form .row:first-child .floating-label-form-group{border-top:1px solid #eee}.btn{font-family:"Helvetica Neue",Arial,"Hiragino Sans GB","STHeiti","Microsoft YaHei","WenQuanYi Micro Hei",SimSun,sans-serif;line-height:1.7;text-transform:uppercase;font-size:14px;font-weight:800;letter-spacing:1px;border-radius:0;padding:15px 25px}.btn-lg{font-size:16px;padding:25px 35px}.btn-default:hover,.btn-default:focus{background-color:#0085a1;border:1px solid #0085a1;color:white}.pager{margin:20px 0 0}.pager li>a,.pager li>span{font-family:"Helvetica Neue",Arial,"Hiragino Sans GB","STHeiti","Microsoft YaHei","WenQuanYi Micro Hei",SimSun,sans-serif;line-height:1.7;text-transform:uppercase;font-size:14px;font-weight:800;letter-spacing:1px;padding:10px 5px;background-color:white;border-radius:0}@media only screen and (min-width:768px){.pager li>a,.pager li>span{font-size:14px;padding:15px 25px}}.pager li>a{color:#404040}.pager li>a:hover,.pager li>a:focus{color:white;background-color:#0085a1;border:1px solid #0085a1}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:gray;background-color:#404040;cursor:not-allowed}::-moz-selection{color:white;text-shadow:none;background:#0085a1}::selection{color:white;text-shadow:none;background:#0085a1}img::selection{color:white;background:transparent}img::-moz-selection{color:white;background:transparent}body{webkit-tap-highlight-color:#0085a1}.tags{margin-bottom:-5px}.tags a,.tags .tag{display:inline-block;border:1px solid rgba(255,255,255,0.8);border-radius:999em;padding:0 10px;color:#fff;line-height:24px;font-size:12px;text-decoration:none;margin:0 1px;margin-bottom:6px}.tags a:hover,.tags .tag:hover,.tags a:active,.tags .tag:active{color:white;border-color:white;background-color:rgba(255,255,255,0.4);text-decoration:none}@media only screen and (min-width:768px){.tags a,.tags .tag{margin-right:5px}}@media only screen and (min-width:768px){#tag-heading{padding:50px 0}}#tag_cloud{margin:20px 0 15px 0}#tag_cloud a,#tag_cloud .tag{font-size:14px;border:0;line-height:28px;margin:0 2px;margin-bottom:8px}#tag_cloud a:hover,#tag_cloud .tag:hover,#tag_cloud a:active,#tag_cloud .tag:active{background-color:#0085a1 !important}@media only screen and (min-width:768px){#tag_cloud{margin-bottom:25px}}.tag-comments{font-size:12px}@media only screen and (min-width:768px){.tag-comments{font-size:14px}}.one-tag-list:first-child{margin-top:0}.listing-seperator{color:#0085a1;font-size:17px !important}.listing-seperator::before{margin-right:5px}@media only screen and (min-width:768px){.listing-seperator{font-size:20px !important;line-height:1.5 !important;margin-top:5px}}.one-tag-list .post-preview{position:relative}.one-tag-list .post-preview>a .post-title{font-size:15px;margin-top:20px}.one-tag-list .post-preview>a .post-subtitle{font-size:12px}.one-tag-list .post-preview>.post-meta{position:absolute;right:5px;bottom:0;margin:0;font-size:12px;line-height:12px}@media only screen and (min-width:768px){.one-tag-list .post-preview{margin-left:20px}.one-tag-list .post-preview>a>.post-title{font-size:18px;line-height:1.3}.one-tag-list .post-preview>a>.post-subtitle{font-size:14px}.one-tag-list .post-preview .post-meta{font-size:18px}}.post-container img{display:block;max-width:100%;height:auto;margin:1.5em auto 1.6em auto}.post-container img.shadow{box-shadow:rgba(0,0,0,0.258824) 0 2px 5px 0}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:inherit}.navbar-default .navbar-toggle:active{background-color:#ddd}.navbar-default .navbar-toggle{border-color:transparent;padding:14px 11px;margin-top:4px;margin-right:10px;margin-bottom:4px;border-radius:50%}.navbar-default .navbar-toggle .icon-bar{width:18px;border-radius:0}.navbar-default .navbar-toggle .icon-bar+.icon-bar{margin-top:3px}.comment #ds-thread{margin-top:20px}.comment #ds-thread #ds-reset a.ds-like-thread-button{border:1px solid #ddd;border-radius:0;background:white;box-shadow:none;text-shadow:none}.comment #ds-thread #ds-reset li.ds-tab a.ds-current{border:1px solid #ddd;border-radius:0;background:white;box-shadow:none;text-shadow:none}.comment #ds-thread #ds-reset .ds-textarea-wrapper{background:0}.comment #ds-thread #ds-reset .ds-gradient-bg{background:0}#ds-smilies-tooltip ul.ds-smilies-tabs li a{background:white !important}
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
203 |
--------------------------------------------------------------------------------
/css/codeboy.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", "STHeiti", "Microsoft YaHei", "WenQuanYi Micro Hei", SimSun, sans-serif;
3 | line-height: 1.7;
4 | font-size: 16px;
5 | color: #404040;
6 | overflow-x: hidden;
7 | }
8 | p {
9 | margin: 30px 0;
10 | }
11 | h1,
12 | h2,
13 | h3,
14 | h4,
15 | h5,
16 | h6 {
17 | font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", "STHeiti", "Microsoft YaHei", "WenQuanYi Micro Hei", SimSun, sans-serif;
18 | line-height: 1.7;
19 | line-height: 1.1;
20 | font-weight: 800;
21 | }
22 | h1 {
23 | font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
24 | }
25 | h4 {
26 | font-size: 20px;
27 | }
28 | a {
29 | color: #404040;
30 | }
31 | a:hover,
32 | a:focus {
33 | color: #0085a1;
34 | }
35 | a img:hover,
36 | a img:focus {
37 | cursor: zoom-in;
38 | }
39 | article {
40 | overflow-x: hidden;
41 | }
42 | blockquote {
43 | color: #808080;
44 | font-style: italic;
45 | font-size: 0.95em;
46 | margin: 20px 0 20px;
47 | }
48 | blockquote p {
49 | margin: 0;
50 | }
51 | .table th,
52 | .table td {
53 | border: 1px solid #eee !important;
54 | }
55 | hr.small {
56 | max-width: 100px;
57 | margin: 15px auto;
58 | border-width: 4px;
59 | border-color: white;
60 | }
61 | @media screen and (max-width: 500px) {
62 | pre code {
63 | display: block;
64 | width: 500px;
65 | }
66 | }
67 | .post-container a {
68 | color: #337ab7;
69 | }
70 | .post-container a:hover,
71 | .post-container a:focus {
72 | color: #0085a1;
73 | }
74 | .post-container ul,
75 | .post-container ol {
76 | margin-bottom: 40px;
77 | }
78 | .post-container ol ol,
79 | .post-container ol ul,
80 | .post-container ul ol,
81 | .post-container ul ul {
82 | margin-bottom: 5px;
83 | }
84 | .post-container li p {
85 | margin: 0;
86 | margin-bottom: 5px;
87 | }
88 | .post-container li h1,
89 | .post-container li h2,
90 | .post-container li h3,
91 | .post-container li h4,
92 | .post-container li h5,
93 | .post-container li h6 {
94 | line-height: 2;
95 | margin-top: 20px;
96 | }
97 | .navbar-custom {
98 | background: white;
99 | position: absolute;
100 | top: 0;
101 | left: 0;
102 | width: 100%;
103 | z-index: 3;
104 | font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", "STHeiti", "Microsoft YaHei", "WenQuanYi Micro Hei", SimSun, sans-serif;
105 | line-height: 1.7;
106 | }
107 | .navbar-custom .navbar-brand {
108 | font-weight: 800;
109 | }
110 | .navbar-custom .nav li a {
111 | text-transform: uppercase;
112 | font-size: 16px;
113 | font-weight: 800;
114 | letter-spacing: 1px;
115 | }
116 | @media only screen and (min-width: 768px) {
117 | .navbar-custom {
118 | background: transparent;
119 | border-bottom: 1px solid transparent;
120 | }
121 | .navbar-custom body {
122 | font-size: 20px;
123 | }
124 | .navbar-custom .navbar-brand {
125 | color: white;
126 | padding: 20px;
127 | }
128 | .navbar-custom .navbar-brand:hover,
129 | .navbar-custom .navbar-brand:focus {
130 | color: rgba(255, 255, 255, 0.8);
131 | }
132 | .navbar-custom .nav li a {
133 | font-size:18px;
134 | color: white;
135 | padding: 20px;
136 | }
137 | .navbar-custom .nav li a:hover,
138 | .navbar-custom .nav li a:focus {
139 | color: rgba(255, 255, 255, 0.8);
140 | }
141 | }
142 | @media only screen and (min-width: 1170px) {
143 | .navbar-custom {
144 | -webkit-transition: background-color 0.3s;
145 | -moz-transition: background-color 0.3s;
146 | transition: background-color 0.3s;
147 | /* Force Hardware Acceleration in WebKit */
148 | -webkit-transform: translate3d(0, 0, 0);
149 | -moz-transform: translate3d(0, 0, 0);
150 | -ms-transform: translate3d(0, 0, 0);
151 | -o-transform: translate3d(0, 0, 0);
152 | transform: translate3d(0, 0, 0);
153 | -webkit-backface-visibility: hidden;
154 | backface-visibility: hidden;
155 | }
156 | .navbar-custom.is-fixed {
157 | /* when the user scrolls down, we hide the header right above the viewport */
158 | position: fixed;
159 | top: -61px;
160 | background-color: rgba(255, 255, 255, 0.9);
161 | border-bottom: 1px solid #f2f2f2;
162 | -webkit-transition: -webkit-transform 0.3s;
163 | -moz-transition: -moz-transform 0.3s;
164 | transition: transform 0.3s;
165 | }
166 | .navbar-custom.is-fixed .navbar-brand {
167 | color: #404040;
168 | }
169 | .navbar-custom.is-fixed .navbar-brand:hover,
170 | .navbar-custom.is-fixed .navbar-brand:focus {
171 | color: #0085a1;
172 | }
173 | .navbar-custom.is-fixed .nav li a {
174 | color: #404040;
175 | }
176 | .navbar-custom.is-fixed .nav li a:hover,
177 | .navbar-custom.is-fixed .nav li a:focus {
178 | color: #0085a1;
179 | }
180 | .navbar-custom.is-visible {
181 | /* if the user changes the scrolling direction, we show the header */
182 | -webkit-transform: translate3d(0, 100%, 0);
183 | -moz-transform: translate3d(0, 100%, 0);
184 | -ms-transform: translate3d(0, 100%, 0);
185 | -o-transform: translate3d(0, 100%, 0);
186 | transform: translate3d(0, 100%, 0);
187 | }
188 | }
189 | .intro-header {
190 | background: no-repeat center center;
191 | background-color: #808080;
192 | background-attachment: scroll;
193 | -webkit-background-size: cover;
194 | -moz-background-size: cover;
195 | background-size: cover;
196 | -o-background-size: cover;
197 | margin-bottom: 0px;
198 | /* 0 on mobile */
199 | }
200 | @media only screen and (min-width: 768px) {
201 | .intro-header {
202 | margin-bottom: 20px;
203 | /* response on desktop */
204 | }
205 | }
206 | .intro-header .site-heading,
207 | .intro-header .post-heading,
208 | .intro-header .page-heading {
209 | padding: 100px 0 50px;
210 | color: white;
211 | }
212 | @media only screen and (min-width: 768px) {
213 | .intro-header .site-heading,
214 | .intro-header .post-heading,
215 | .intro-header .page-heading {
216 | padding: 150px 0;
217 | }
218 | }
219 | .intro-header .site-heading,
220 | .intro-header .page-heading {
221 | text-align: center;
222 | }
223 | .intro-header .site-heading h1,
224 | .intro-header .page-heading h1 {
225 | margin-top: 0;
226 | font-size: 50px;
227 | }
228 | .intro-header .site-heading .subheading,
229 | .intro-header .page-heading .subheading {
230 | font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", "STHeiti", "Microsoft YaHei", "WenQuanYi Micro Hei", SimSun, sans-serif;
231 | line-height: 1.7;
232 | font-size: 20px;
233 | line-height: 1.1;
234 | display: block;
235 | font-weight: 300;
236 | margin: 10px 0 0;
237 | }
238 | @media only screen and (min-width: 768px) {
239 | .intro-header .site-heading h1,
240 | .intro-header .page-heading h1 {
241 | font-size: 80px;
242 | }
243 | }
244 | .intro-header .post-heading h1 {
245 | font-size: 30px;
246 | }
247 | .intro-header .post-heading .subheading,
248 | .intro-header .post-heading .meta {
249 | line-height: 1.1;
250 | display: block;
251 | }
252 | .intro-header .post-heading .subheading {
253 | font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", "STHeiti", "Microsoft YaHei", "WenQuanYi Micro Hei", SimSun, sans-serif;
254 | line-height: 1.7;
255 | font-size: 17px;
256 | font-weight: normal;
257 | margin: 10px 0 30px;
258 | margin-top: -5px;
259 | }
260 | .intro-header .post-heading .meta {
261 | font-family: 'Lora', 'Times New Roman', serif;
262 | font-style: italic;
263 | font-weight: 300;
264 | font-size: 18px;
265 | }
266 | .intro-header .post-heading .meta a {
267 | color: white;
268 | }
269 | @media only screen and (min-width: 768px) {
270 | .intro-header .post-heading h1 {
271 | font-size: 55px;
272 | }
273 | .intro-header .post-heading .subheading {
274 | font-size: 30px;
275 | }
276 | .intro-header .post-heading .meta {
277 | font-size: 20px;
278 | }
279 | }
280 | .post-preview > a {
281 | color: #404040;
282 | }
283 | .post-preview > a:hover,
284 | .post-preview > a:focus {
285 | text-decoration: none;
286 | color: #0085a1;
287 | }
288 | .post-preview > a > .post-title {
289 | font-size: 21px;
290 | line-height: 1.3;
291 | margin-top: 30px;
292 | margin-bottom: 8px;
293 | }
294 | .post-preview > a > .post-subtitle {
295 | font-size: 15px;
296 | margin: 0;
297 | font-weight: 300;
298 | margin-bottom: 10px;
299 | }
300 | .post-preview > .post-meta {
301 | font-family: 'Lora', 'Times New Roman', serif;
302 | color: #808080;
303 | font-size: 16px;
304 | font-style: italic;
305 | margin-top: 0;
306 | }
307 | .post-preview > .post-meta > a {
308 | text-decoration: none;
309 | color: #404040;
310 | }
311 | .post-preview > .post-meta > a:hover,
312 | .post-preview > .post-meta > a:focus {
313 | color: #0085a1;
314 | text-decoration: underline;
315 | }
316 | @media only screen and (min-width: 768px) {
317 | .post-preview > a > .post-title {
318 | font-size: 26px;
319 | line-height: 1.3;
320 | margin-bottom: 10px;
321 | }
322 | .post-preview > a > .post-subtitle {
323 | font-size: 16px;
324 | }
325 | .post-preview .post-meta {
326 | font-size: 18px;
327 | }
328 | }
329 | .post-content-preview {
330 | font-size: 16px;
331 | color: #a3a3a3;
332 | }
333 | .post-content-preview:hover {
334 | color: #0085a1;
335 | }
336 | @media only screen and (min-width: 768px) {
337 | .post-content-preview {
338 | font-size: 18px;
339 | }
340 | }
341 | .section-heading {
342 | font-size: 36px;
343 | margin-top: 60px;
344 | font-weight: 700;
345 | }
346 | .caption {
347 | text-align: center;
348 | font-size: 14px;
349 | padding: 10px;
350 | font-style: italic;
351 | margin: 0;
352 | display: block;
353 | border-bottom-right-radius: 5px;
354 | border-bottom-left-radius: 5px;
355 | }
356 | footer {
357 | font-size: 20px;
358 | padding: 50px 0 65px;
359 | }
360 | footer .list-inline {
361 | margin: 0;
362 | padding: 0;
363 | }
364 | footer .copyright {
365 | font-size: 14px;
366 | text-align: center;
367 | margin-bottom: 0;
368 | }
369 | .floating-label-form-group {
370 | font-size: 14px;
371 | position: relative;
372 | margin-bottom: 0;
373 | padding-bottom: 0.5em;
374 | border-bottom: 1px solid #eeeeee;
375 | }
376 | .floating-label-form-group input,
377 | .floating-label-form-group textarea {
378 | z-index: 1;
379 | position: relative;
380 | padding-right: 0;
381 | padding-left: 0;
382 | border: none;
383 | border-radius: 0;
384 | font-size: 1.5em;
385 | background: none;
386 | box-shadow: none !important;
387 | resize: none;
388 | }
389 | .floating-label-form-group label {
390 | display: block;
391 | z-index: 0;
392 | position: relative;
393 | top: 2em;
394 | margin: 0;
395 | font-size: 0.85em;
396 | line-height: 1.764705882em;
397 | vertical-align: middle;
398 | vertical-align: baseline;
399 | opacity: 0;
400 | -webkit-transition: top 0.3s ease,opacity 0.3s ease;
401 | -moz-transition: top 0.3s ease,opacity 0.3s ease;
402 | -ms-transition: top 0.3s ease,opacity 0.3s ease;
403 | transition: top 0.3s ease,opacity 0.3s ease;
404 | }
405 | .floating-label-form-group::not(:first-child) {
406 | padding-left: 14px;
407 | border-left: 1px solid #eeeeee;
408 | }
409 | .floating-label-form-group-with-value label {
410 | top: 0;
411 | opacity: 1;
412 | }
413 | .floating-label-form-group-with-focus label {
414 | color: #0085a1;
415 | }
416 | form .row:first-child .floating-label-form-group {
417 | border-top: 1px solid #eeeeee;
418 | }
419 | .btn {
420 | font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", "STHeiti", "Microsoft YaHei", "WenQuanYi Micro Hei", SimSun, sans-serif;
421 | line-height: 1.7;
422 | text-transform: uppercase;
423 | font-size: 14px;
424 | font-weight: 800;
425 | letter-spacing: 1px;
426 | border-radius: 0;
427 | padding: 15px 25px;
428 | }
429 | .btn-lg {
430 | font-size: 16px;
431 | padding: 25px 35px;
432 | }
433 | .btn-default:hover,
434 | .btn-default:focus {
435 | background-color: #0085a1;
436 | border: 1px solid #0085a1;
437 | color: white;
438 | }
439 | .pager {
440 | margin: 20px 0 0;
441 | }
442 | .pager li > a,
443 | .pager li > span {
444 | font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", "STHeiti", "Microsoft YaHei", "WenQuanYi Micro Hei", SimSun, sans-serif;
445 | line-height: 1.7;
446 | text-transform: uppercase;
447 | font-size: 14px;
448 | font-weight: 800;
449 | letter-spacing: 1px;
450 | padding: 10px 5px;
451 | background-color: white;
452 | border-radius: 0;
453 | }
454 | @media only screen and (min-width: 768px) {
455 | .pager li > a,
456 | .pager li > span {
457 | font-size: 14px;
458 | padding: 15px 25px;
459 | }
460 | }
461 | .pager li > a {
462 | color: #404040;
463 | }
464 | .pager li > a:hover,
465 | .pager li > a:focus {
466 | color: white;
467 | background-color: #0085a1;
468 | border: 1px solid #0085a1;
469 | }
470 | .pager .disabled > a,
471 | .pager .disabled > a:hover,
472 | .pager .disabled > a:focus,
473 | .pager .disabled > span {
474 | color: #808080;
475 | background-color: #404040;
476 | cursor: not-allowed;
477 | }
478 | ::-moz-selection {
479 | color: white;
480 | text-shadow: none;
481 | background: #0085a1;
482 | }
483 | ::selection {
484 | color: white;
485 | text-shadow: none;
486 | background: #0085a1;
487 | }
488 | img::selection {
489 | color: white;
490 | background: transparent;
491 | }
492 | img::-moz-selection {
493 | color: white;
494 | background: transparent;
495 | }
496 | body {
497 | webkit-tap-highlight-color: #0085a1;
498 | }
499 | /* add tags support */
500 | .tags {
501 | margin-bottom: -5px;
502 | }
503 | .tags a,
504 | .tags .tag {
505 | display: inline-block;
506 | border: 1px solid rgba(255, 255, 255, 0.8);
507 | border-radius: 999em;
508 | padding: 0 10px;
509 | color: #ffffff;
510 | line-height: 24px;
511 | font-size: 12px;
512 | text-decoration: none;
513 | margin: 0 1px;
514 | margin-bottom: 6px;
515 | }
516 | .tags a:hover,
517 | .tags .tag:hover,
518 | .tags a:active,
519 | .tags .tag:active {
520 | color: white;
521 | border-color: white;
522 | background-color: rgba(255, 255, 255, 0.4);
523 | text-decoration: none;
524 | }
525 | @media only screen and (min-width: 768px) {
526 | .tags a,
527 | .tags .tag {
528 | margin-right: 5px;
529 | }
530 | }
531 | @media only screen and (min-width: 768px) {
532 | #tag-heading {
533 | padding: 50px 0;
534 | }
535 | }
536 | #tag_cloud {
537 | margin: 20px 0 15px 0;
538 | }
539 | #tag_cloud a,
540 | #tag_cloud .tag {
541 | font-size: 14px;
542 | border: none;
543 | line-height: 28px;
544 | margin: 0 2px;
545 | margin-bottom: 8px;
546 | }
547 | #tag_cloud a:hover,
548 | #tag_cloud .tag:hover,
549 | #tag_cloud a:active,
550 | #tag_cloud .tag:active {
551 | background-color: #0085a1 !important;
552 | }
553 | @media only screen and (min-width: 768px) {
554 | #tag_cloud {
555 | margin-bottom: 25px;
556 | }
557 | }
558 | .tag-comments {
559 | font-size: 12px;
560 | }
561 | @media only screen and (min-width: 768px) {
562 | .tag-comments {
563 | font-size: 14px;
564 | }
565 | }
566 | .one-tag-list:first-child {
567 | margin-top: 0px;
568 | }
569 | .listing-seperator {
570 | color: #0085a1;
571 | font-size: 17px !important;
572 | }
573 | .listing-seperator::before {
574 | margin-right: 5px;
575 | }
576 | @media only screen and (min-width: 768px) {
577 | .listing-seperator {
578 | font-size: 20px !important;
579 | line-height: 1.5 !important;
580 | margin-top: 5px;
581 | }
582 | }
583 | .one-tag-list .post-preview {
584 | position: relative;
585 | }
586 | .one-tag-list .post-preview > a .post-title {
587 | font-size: 15px;
588 | margin-top: 20px;
589 | }
590 | .one-tag-list .post-preview > a .post-subtitle {
591 | font-size: 12px;
592 | }
593 | .one-tag-list .post-preview > .post-meta {
594 | position: absolute;
595 | right: 5px;
596 | bottom: 0px;
597 | margin: 0px;
598 | font-size: 12px;
599 | line-height: 12px;
600 | }
601 | @media only screen and (min-width: 768px) {
602 | .one-tag-list .post-preview {
603 | margin-left: 20px;
604 | }
605 | .one-tag-list .post-preview > a > .post-title {
606 | font-size: 18px;
607 | line-height: 1.3;
608 | }
609 | .one-tag-list .post-preview > a > .post-subtitle {
610 | font-size: 14px;
611 | }
612 | .one-tag-list .post-preview .post-meta {
613 | font-size: 18px;
614 | }
615 | }
616 | /* Tags support End*/
617 | /* make all img responsible in post-container */
618 | .post-container img {
619 | display: block;
620 | max-width: 100%;
621 | height: auto;
622 | margin: 1.5em auto 1.6em auto;
623 | }
624 | .post-container img.shadow {
625 | box-shadow: rgba(0, 0, 0, 0.258824) 0px 2px 5px 0px;
626 | }
627 | /* Optimize UserExperience */
628 | .navbar-default .navbar-toggle:focus,
629 | .navbar-default .navbar-toggle:hover {
630 | background-color: inherit;
631 | }
632 | .navbar-default .navbar-toggle:active {
633 | background-color: #ddd;
634 | }
635 | /* customize Style for navBar button */
636 | .navbar-default .navbar-toggle {
637 | border-color: transparent;
638 | padding: 14px 11px;
639 | margin-top: 4px;
640 | margin-right: 10px;
641 | margin-bottom: 4px;
642 | border-radius: 50%;
643 | }
644 | .navbar-default .navbar-toggle .icon-bar {
645 | width: 18px;
646 | border-radius: 0px;
647 | }
648 | .navbar-default .navbar-toggle .icon-bar + .icon-bar {
649 | margin-top: 3px;
650 | }
651 | /* customize Style for Duoshuo */
652 | .comment #ds-thread {
653 | margin-top: 20px;
654 | }
655 | .comment #ds-thread #ds-reset a.ds-like-thread-button {
656 | border: 1px solid #ddd;
657 | border-radius: 0px;
658 | background: white;
659 | box-shadow: none;
660 | text-shadow: none;
661 | }
662 | .comment #ds-thread #ds-reset li.ds-tab a.ds-current {
663 | border: 1px solid #ddd;
664 | border-radius: 0px;
665 | background: white;
666 | box-shadow: none;
667 | text-shadow: none;
668 | }
669 | .comment #ds-thread #ds-reset .ds-textarea-wrapper {
670 | background: none;
671 | }
672 | .comment #ds-thread #ds-reset .ds-gradient-bg {
673 | background: none;
674 | }
675 | #ds-smilies-tooltip ul.ds-smilies-tabs li a {
676 | background: white !important;
677 | }
678 |
--------------------------------------------------------------------------------