spuit 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. checksums.yaml +7 -0
  2. data/.editorconfig +11 -0
  3. data/.gitignore +70 -0
  4. data/.npmignore +9 -0
  5. data/Gemfile +4 -0
  6. data/README.md +16 -0
  7. data/Rakefile +1 -0
  8. data/assets/javascripts/index.js +2 -0
  9. data/assets/javascripts/spuit/Common.js +316 -0
  10. data/assets/javascripts/spuit/extend.js +46 -0
  11. data/assets/stylesheets/spuit/components/_body.sass +175 -0
  12. data/assets/stylesheets/spuit/components/_button.sass +116 -0
  13. data/assets/stylesheets/spuit/components/_form.sass +44 -0
  14. data/assets/stylesheets/spuit/components/_gist.sass +57 -0
  15. data/assets/stylesheets/spuit/components/_grids.sass +44 -0
  16. data/assets/stylesheets/spuit/components/_icon.scss +68 -0
  17. data/assets/stylesheets/spuit/components/_markdown.sass +182 -0
  18. data/assets/stylesheets/spuit/components/_messages.sass +18 -0
  19. data/assets/stylesheets/spuit/components/_shoulder.sass +13 -0
  20. data/assets/stylesheets/spuit/components/_split.sass +32 -0
  21. data/assets/stylesheets/spuit/components/_triangle.sass +40 -0
  22. data/assets/stylesheets/spuit/components/_wordwrap-fadeout.sass +19 -0
  23. data/assets/stylesheets/spuit/components/_wrap.sass +22 -0
  24. data/assets/stylesheets/spuit/elements/_checkbox.sass +46 -0
  25. data/assets/stylesheets/spuit/elements/_dl.sass +30 -0
  26. data/assets/stylesheets/spuit/elements/_fieldset.sass +46 -0
  27. data/assets/stylesheets/spuit/elements/_hr.sass +36 -0
  28. data/assets/stylesheets/spuit/elements/_input.sass +27 -0
  29. data/assets/stylesheets/spuit/elements/_radio.sass +47 -0
  30. data/assets/stylesheets/spuit/elements/_select.sass +54 -0
  31. data/assets/stylesheets/spuit/elements/_table.sass +58 -0
  32. data/assets/stylesheets/spuit/includes/_animations.scss +55 -0
  33. data/assets/stylesheets/spuit/includes/_grid.scss +345 -0
  34. data/assets/stylesheets/spuit/includes/_hiddens.scss +17 -0
  35. data/assets/stylesheets/spuit/includes/_normalize.scss +467 -0
  36. data/assets/stylesheets/spuit/includes/_spacers.scss +79 -0
  37. data/assets/stylesheets/spuit/includes/_spuit-utils.scss +11 -0
  38. data/assets/stylesheets/spuit/includes/_stickey-footer.scss +18 -0
  39. data/assets/stylesheets/spuit/includes/_webfonts.scss +30 -0
  40. data/assets/stylesheets/spuit/modules/_background-image.scss +63 -0
  41. data/assets/stylesheets/spuit/modules/_breakpoints.scss +19 -0
  42. data/assets/stylesheets/spuit/modules/_clearfix.scss +7 -0
  43. data/assets/stylesheets/spuit/modules/_fa.scss +28 -0
  44. data/assets/stylesheets/spuit/modules/_font-face.scss +31 -0
  45. data/assets/stylesheets/spuit/modules/_hide-text.scss +9 -0
  46. data/assets/stylesheets/spuit/modules/_inherit.scss +6 -0
  47. data/assets/stylesheets/spuit/modules/_reset.scss +55 -0
  48. data/assets/stylesheets/spuit/modules/_text-overflow.scss +15 -0
  49. data/assets/stylesheets/spuit/modules/_word-break.scss +11 -0
  50. data/assets/stylesheets/spuit/shortcuts/_absolute.scss +17 -0
  51. data/assets/stylesheets/spuit/shortcuts/_centering.scss +6 -0
  52. data/assets/stylesheets/spuit/shortcuts/_disc.scss +6 -0
  53. data/assets/stylesheets/spuit/variables/_colors.scss +3 -0
  54. data/assets/stylesheets/spuit/variables/_defaults.scss +3 -0
  55. data/assets/stylesheets/spuit/variables/_fonts.scss +6 -0
  56. data/assets/stylesheets/spuit/variables/_media-queries.scss +31 -0
  57. data/assets/stylesheets/spuit/variables/_svgs.scss +7 -0
  58. data/assets/stylesheets/spuit/variables/_timing-functions.sass +37 -0
  59. data/assets/stylesheets/styles.scss +164 -0
  60. data/assets/stylesheets/styles/config/_mixins.scss +23 -0
  61. data/assets/stylesheets/styles/config/_variables.scss +4 -0
  62. data/dist/favicon.png +0 -0
  63. data/dist/index.html +307 -0
  64. data/dist/javascripts/scripts.min.js +2 -0
  65. data/dist/javascripts/scripts.min.js.map +1 -0
  66. data/dist/stylesheets/styles.css +1 -0
  67. data/gulp/README.md +7 -0
  68. data/gulp/tasks/watch.js +79 -0
  69. data/gulpfile.js +2 -0
  70. data/lib/spuit.rb +41 -0
  71. data/lib/spuit/engine.rb +5 -0
  72. data/lib/spuit/generator.rb +80 -0
  73. data/lib/spuit/version.rb +3 -0
  74. data/package.json +38 -0
  75. data/spuit.gemspec +23 -0
  76. data/spuit.scss +47 -0
  77. metadata +147 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: f7eff9858625c2593126c4dd38ef5d57c908865b
4
+ data.tar.gz: 96bcf66d52d5585dae5a3d62a501f7e37ffbf3ac
5
+ SHA512:
6
+ metadata.gz: 3961d45431291d4be07e96e71c05777a6c0fa96e423dcadac4404fc20fe555dd356728c0adf80a1f83adb5ab0e6453cafc7fa9817f0962cd0ffeb42875321f88
7
+ data.tar.gz: '020308e8bb1855543faa2da9ca6a26861288a36dc857deeaf790860e839b223f6c06cda0bf3c18810eaf47399f8a107f9423732e0cbf53a63b28c17a39b5060d'
data/.editorconfig ADDED
@@ -0,0 +1,11 @@
1
+ [*]
2
+ indent_style = space
3
+ indent_size = 2
4
+ end_of_line = crlf
5
+ charset = utf-8
6
+ trim_trailing_whitespace = true
7
+ insert_final_newline = true
8
+ root = true
9
+
10
+ [*.md]
11
+ trim_trailing_whitespace = false
data/.gitignore ADDED
@@ -0,0 +1,70 @@
1
+
2
+ # Created by https://www.gitignore.io/api/node
3
+
4
+ ### Node ###
5
+ # Logs
6
+ logs
7
+ *.log
8
+ npm-debug.log*
9
+ yarn-debug.log*
10
+ yarn-error.log*
11
+
12
+ # Runtime data
13
+ pids
14
+ *.pid
15
+ *.seed
16
+ *.pid.lock
17
+
18
+ # Directory for instrumented libs generated by jscoverage/JSCover
19
+ lib-cov
20
+
21
+ # Coverage directory used by tools like istanbul
22
+ coverage
23
+
24
+ # nyc test coverage
25
+ .nyc_output
26
+
27
+ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
28
+ .grunt
29
+
30
+ # Bower dependency directory (https://bower.io/)
31
+ bower_components
32
+
33
+ # node-waf configuration
34
+ .lock-wscript
35
+
36
+ # Compiled binary addons (http://nodejs.org/api/addons.html)
37
+ build/Release
38
+
39
+ # Dependency directories
40
+ node_modules/
41
+ jspm_packages/
42
+
43
+ # Typescript v1 declaration files
44
+ typings/
45
+
46
+ # Optional npm cache directory
47
+ .npm
48
+
49
+ # Optional eslint cache
50
+ .eslintcache
51
+
52
+ # Optional REPL history
53
+ .node_repl_history
54
+
55
+ # Output of 'npm pack'
56
+ *.tgz
57
+
58
+ # Yarn Integrity file
59
+ .yarn-integrity
60
+
61
+ # dotenv environment variables file
62
+ .env
63
+
64
+
65
+ # End of https://www.gitignore.io/api/node
66
+
67
+ .DS_Store
68
+ node_modules
69
+
70
+ pkg/
data/.npmignore ADDED
@@ -0,0 +1,9 @@
1
+ .sass-cache
2
+ .DS_Store
3
+ node_modules
4
+ npm-debug.log
5
+ gulpfile.js
6
+ gulp
7
+ dist/index.html
8
+ assets/javascripts
9
+ .editorconfig
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in middleman-assets.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,16 @@
1
+ Spuit
2
+ ==============
3
+
4
+ A Sass Mixin Library from is8r to is8r
5
+
6
+ install:
7
+
8
+ ```
9
+ $ npm install spuit
10
+ ```
11
+
12
+ import:
13
+
14
+ ``` styles.scss
15
+ @import "node_modules/spuit/spuit";
16
+ ```
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,2 @@
1
+ $(function() {
2
+ });
@@ -0,0 +1,316 @@
1
+ var Common = {
2
+
3
+ //----------------------------------------------------------------------
4
+ // Params
5
+
6
+ // URLパラメータを受け取り
7
+ // var xml = Common.getUrlVars();
8
+ getUrlVars : function(){
9
+ var vars = [], hash;
10
+ var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
11
+ for(var i = 0; i < hashes.length; i++) {
12
+ hash = hashes[i].split('=');
13
+ vars.push(hash[0]);
14
+ vars[hash[0]] = hash[1];
15
+ }
16
+ return vars;
17
+ },
18
+
19
+ // StringやjsonpデータをXMLに変換
20
+ // var xmlObject = Common.string2xml(xml);
21
+ string2xml : function(xmlData){
22
+ if (window.ActiveXObject) {
23
+ //for IE
24
+ xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
25
+ xmlDoc.async="false";
26
+ xmlDoc.loadXML(xmlData);
27
+ return xmlDoc;
28
+ } else if (document.implementation && document.implementation.createDocument) {
29
+ //for Mozila
30
+ parser=new DOMParser();
31
+ xmlDoc=parser.parseFromString(xmlData,"text/xml");
32
+ return xmlDoc;
33
+ }
34
+ },
35
+
36
+ //オブジェクトの中身を確認
37
+ showObject : function(elm, type){
38
+ var str = '「' + typeof elm + "」の中身";
39
+ var cnt = 0;
40
+ for(i in elm){
41
+ if(type == 'html'){
42
+ str += '<br />?n' + "[" + cnt + "] " + i.bold() + ' = ' + elm[i];
43
+ } else {
44
+ str += '?n' + "[" + cnt + "] " + i + ' = ' + elm[i];
45
+ }
46
+ cnt++;
47
+ status = cnt;
48
+ }
49
+ return str;
50
+ },
51
+
52
+ //----------------------------------------------------------------------
53
+ //Math
54
+ //数字の頭に0を足す
55
+ zeroPlus : function(value){
56
+ return (n < 10) ? '0' + n : n;
57
+ },
58
+
59
+ // ランダムな数値を返す
60
+ // var n = Common.random(n);
61
+ random : function(n){
62
+ return Math.random()*n;
63
+ },
64
+
65
+ // ランダムな数を返す
66
+ // var n = Common.randomRange(1, 2);
67
+ randomRange : function(min, max){
68
+ return min + Math.random()*(max-min);
69
+ },
70
+
71
+ // ランダムな整数を返す
72
+ // var n = Common.randomInt(n);
73
+ randomInt : function(n){
74
+ return Math.floor(Math.random()*n);
75
+ },
76
+
77
+ // ランダムな整数を返す
78
+ // var n = Common.randomIntRange(10, 20);
79
+ randomIntRange : function(min, max){
80
+ return Math.floor(Math.random()*(max-min)) + min;
81
+ },
82
+
83
+ // 0か1をランダムで返す
84
+ // var n = Common.randomBit();
85
+ randomBit : function(n){
86
+ return (Math.random() < .5) ? 1 : 0;
87
+ },
88
+
89
+ // -1か1をランダムで返す
90
+ // var n = Common.randomSign();
91
+ randomSign : function(n){
92
+ return (Math.random() < .5) ? -1 : 1;
93
+ },
94
+
95
+ // 2点間の距離を測定
96
+ // var distance = Common.getDistance(o1,o2);
97
+ getDistance : function(o1,o2){
98
+ var d,dx,dy;
99
+ dx = o1.x - o2.x;
100
+ dy = o1.y - o2.y;
101
+ d = Math.sqrt(dx*dx+dy*dy);
102
+ return d;
103
+ },
104
+
105
+ // 2点間の角度を測定
106
+ // var d = Common.getDegrees(o1,o2);
107
+ // var r = Common.getRadians(o1,o2);
108
+ getDegrees : function(o1,o2){
109
+ return (Math.atan2(o2.y-o1.y, o2.x-o1.x)) * 180/Math.PI;
110
+ },
111
+ getRadians : function(o1,o2){
112
+ return Math.atan2(o2.y-o1.y, o2.x-o1.x);
113
+ },
114
+
115
+ // // 要素の座標を取得
116
+ // // Common.getRect($el).top;
117
+ // getRect : function($el){
118
+ // return $el[0].getBoundingClientRect();
119
+ // },
120
+
121
+ // スクロール座標を取得
122
+ // Common.getScroll().y;
123
+ getScroll : function(){
124
+ var de = document.documentElement, db = document.body;
125
+ var x = de.scrollLeft || db.scrollLeft;
126
+ var y = de.scrollTop || db.scrollTop;
127
+ return {x: x, y:y};
128
+ },
129
+
130
+ // ラジアン角に変更
131
+ // var r = Common.changeRadians(degrees);
132
+ changeRadians : function(degrees){
133
+ return degrees * Math.PI/180;
134
+ },
135
+
136
+ // ラジアン角から変更
137
+ // var d = Common.changeDegrees(radians);
138
+ changeDegrees : function(radians){
139
+ return radians * 180/Math.PI;
140
+ },
141
+
142
+ // sinを配列で返す
143
+ // var w = Common.getSinWave(1, 100);
144
+ getSinWave : function(value, c){
145
+ var ar = [];
146
+ var angle = 0;
147
+ var limite = value;
148
+
149
+ var n = 0;
150
+ var max = c;
151
+ var speed = 6.2/max;
152
+
153
+ for(var i=0;i<max;i++){
154
+ angle += speed;
155
+ n = Math.sin(angle)*limite;
156
+ ar.push(n);
157
+ }
158
+ return ar;
159
+ },
160
+
161
+ // cosを配列で返す
162
+ // var w = Common.getCosWave(1, 100);
163
+ getCosWave : function(value, c){
164
+ var ar = [];
165
+ var angle = 0;
166
+ var limite = value;
167
+
168
+ var n = 0;
169
+ var max = c;
170
+ var speed = 6.2/max;
171
+
172
+ for(var i=0;i<max;i++){
173
+ angle += speed;
174
+ n = Math.cos(angle)*limite;
175
+ ar.push(n);
176
+ }
177
+ return ar;
178
+ },
179
+
180
+ //スプライン曲線用
181
+ //Common.getSpline(x0,y0, x1,y1)
182
+ // var p;//now
183
+ // var pA;//next
184
+ // for (var i = 0; i < points.max-1; i++) {
185
+ // p = points.ary[i];
186
+ // p.pos.x = i*(stage.w/(points.max-4));
187
+ // }
188
+ //
189
+ // for (var i = 0; i < points.max-1; i++) {
190
+ // p = points.ary[i];
191
+ // pA = points.ary[i-1];
192
+ // if(i == 0) {
193
+ // context.moveTo(p.pos.x, p.pos.y + plusY);
194
+ // } else {
195
+ // var ch = Common.getSpline(pA.pos.x, pA.pos.y, p.pos.x, p.pos.y);
196
+ // var cx = ch[0];
197
+ // var cy = ch[1];
198
+ // context.quadraticCurveTo(pA.pos.x, pA.pos.y + plusY, cx, cy + plusY);
199
+ // }
200
+ // }
201
+ // context.lineTo(stage.w, stage.h);
202
+ // context.lineTo(0, stage.h);
203
+ // context.closePath();
204
+ // context.fill();
205
+ getSpline : function( arg1, arg2, arg3, arg4 )
206
+ {
207
+ var ret = {};
208
+ var Ho = Common.getSplinePoint( arg1, arg2, arg3, arg4 );
209
+ var L = null;
210
+ var S = null;
211
+ if( arg1 < arg3 )
212
+ {
213
+ L = arg3;
214
+ S = arg1;
215
+ }
216
+ else
217
+ {
218
+ L = arg1;
219
+ S = arg3;
220
+ }
221
+ ret[0] = (L -S)/2 +S;
222
+ ret[1] = Ho[0] *ret[0] +Ho[1];
223
+ return ret;
224
+ },
225
+
226
+ getSplinePoint : function( arg1, arg2, arg3, arg4 )
227
+ {
228
+ var a = (arg2 - arg4) /(arg1 -arg3);
229
+ var b = arg2 - arg1 *a;
230
+ var ret = Array( a, b );
231
+ return ret;
232
+ },
233
+
234
+ //----------------------------------------------------------------------
235
+ // Devices
236
+
237
+ // iPhone,iPad判別
238
+ // var bo = Common.isiOS();
239
+ isiOS : function(){
240
+ if(navigator.userAgent.indexOf('iPhone') > 0 || navigator.userAgent.indexOf('iPod') > 0 || navigator.userAgent.indexOf('iPad') > 0) {
241
+ return true;
242
+ } else {
243
+ return false;
244
+ }
245
+ },
246
+ isSmartPhone : function(){
247
+ if(navigator.userAgent.indexOf('iPhone') > 0 || navigator.userAgent.indexOf('iPod') > 0 || (navigator.userAgent.indexOf('Android') > 0 && navigator.userAgent.indexOf('Mobile') > 0)){
248
+ return true;
249
+ } else {
250
+ return false;
251
+ }
252
+ },
253
+ isTablet : function(){
254
+ if(navigator.userAgent.indexOf('iPad') > 0 || (navigator.userAgent.indexOf('Android') > 0 && navigator.userAgent.indexOf('Mobile') == -1) || navigator.userAgent.indexOf('A1_07') > 0 || navigator.userAgent.indexOf('SC-01C') > 0){
255
+ return true;
256
+ } else {
257
+ return false;
258
+ }
259
+ },
260
+ isMobile : function(){
261
+ if(Common.isSmartPhone() || Common.isTablet()){
262
+ return true;
263
+ } else {
264
+ return false;
265
+ }
266
+ },
267
+ hasTapEvent : function(){
268
+ return ('ontouchstart' in window);
269
+ },
270
+
271
+ // IE判別
272
+ // var bo = Common.isIE();
273
+ // var bo = Common.isIE6();
274
+ // var bo = Common.ltIE8();
275
+ isIE : function(){
276
+ var bo = false;
277
+ if( window.navigator.userAgent.match(/(msie|MSIE)/) || window.navigator.userAgent.match(/(T|t)rident/) ) {
278
+ bo = true;
279
+ }
280
+ return bo;
281
+ },
282
+ getIEVersion : function(){
283
+ var re = -1;
284
+ if( Common.isIE() ) {
285
+ re = window.navigator.userAgent.match(/((msie|MSIE)\s|rv:)([\d\.]+)/)[3];
286
+ re = parseInt(re);
287
+ }
288
+ return re;
289
+ },
290
+ isIE : function(n){
291
+ if(Common.isIE() && Common.isIEVersion() == n) {
292
+ return true;
293
+ } else {
294
+ return false;
295
+ }
296
+ },
297
+ ltIE : function(n){
298
+ if(Common.isIE() && Common.isIEVersion() < n) {
299
+ return true;
300
+ } else {
301
+ return false;
302
+ }
303
+ },
304
+
305
+ // アンドロイドバージョン判別
306
+ // var bo = Common.ltAndroid(2.2);//2.2(含まない)以下はtrue
307
+ ltAndroid : function(n){
308
+ var bo = false;
309
+ var ua = navigator.userAgent.toLowerCase();
310
+ var version = ua.substr(ua.indexOf('android')+8, 3);
311
+ if(ua.indexOf("android")){
312
+ if(parseFloat(version) < n) bo = true;
313
+ }
314
+ return bo;
315
+ }
316
+ }