ZEN-mode
by
noromanba
2014-01-16 [2014/01/16 03:23:22]
(Forked from
≡ by
noromanba)
simulate small-screen mode likes embed Opera (K-tai, Wii et al.)
@@ -1,40 +1,15 @@
/*
- * @title ≡
- * @description centering
+ * @title Wii/K-tai shim
+ * @description simulate Small Screen likes embed Opera
* @include http://*
- * @license MIT License http://nrm.mit-license.org/2012
- * @require
+ * @include https://*
+ * @license MIT License http://nrm.mit-license.org/2013
+ * @require
*/
-(function centering() {
- var addStyle = (function cc() {
- var parent = document.head || document.body || document.documentElement;
- var style = document.createElement('style');
- style.type = 'text/css';
- style.dataset.letName = cc.arguments.callee.caller.name; // XXX
- parent.appendChild(style);
-
- return function (css) {
- style.appendChild(document.createTextNode(css + '\n'));
- };
- })();
-
- var createStyle = function (spec, sel) {
- var s = [];
- s = Object.keys(spec).map(function (prop) {
- return (prop + ': ' + spec[prop] + ' !important; ');
- });
- s.unshift((sel || '*') + ' { ');
- s.push('}');
- return s.join('');
- };
-
- var rule = {
- old: { 'width': '100%', 'margin': '0 auto' },
- aut: { 'margin-left': 'auto', 'margin-right': 'auto' },
- pix: { 'margin-left': '100px','margin-right': '100px' },
- rem: { 'margin-left': '15rem', 'margin-right': '15rem' }
- };
-
- addStyle(createStyle(rule.rem, 'body'));
-})();
+(function () {
+ var style = document.body.style;
+ style.setProperty('margin', '0 auto', 'important');
+ style.setProperty('width', '70%', 'important');
+ style.setProperty('font-size', '28px', 'important');
+})();
(function () {
var style = document.body.style;
style.setProperty('margin', '0 auto', 'important');
style.setProperty('width', '70%', 'important');
style.setProperty('font-size', '28px', 'important');
})();
- Permalink
- このページへの個別リンクです。
- RAW
- 書かれたコードへの直接のリンクです。
- Packed
- 文字列が圧縮された書かれたコードへのリンクです。
- Userscript
- Greasemonkey 等で利用する場合の .user.js へのリンクです。
- Loader
- @require やソースコードが長い場合に多段ロードする Loader コミのコードへのリンクです。
- Metadata
- コード中にコメントで @xxx と書かれたメタデータの JSON です。