megatron 0.0.3 → 0.0.4

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 (122) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +43 -2
  3. data/app/assets/javascripts/megatron/form.js +36 -0
  4. data/app/assets/javascripts/megatron/index.js +93 -0
  5. data/app/assets/javascripts/megatron/link.js +58 -0
  6. data/app/assets/javascripts/megatron/utils/auto-navigate.js +24 -0
  7. data/app/assets/javascripts/megatron/utils/form-notify.js +39 -0
  8. data/app/assets/javascripts/megatron/utils/index.js +112 -0
  9. data/app/assets/javascripts/megatron/utils/messages.js +97 -0
  10. data/app/assets/javascripts/megatron/utils/time/date-to-html.js +59 -0
  11. data/app/assets/javascripts/megatron/utils/time/time-switch.js +87 -0
  12. data/app/assets/javascripts/megatron/utils/time/timeago.js +95 -0
  13. data/app/assets/javascripts/megatron/utils/toggler.js +163 -0
  14. data/app/assets/stylesheets/_example.scss +76 -0
  15. data/app/assets/stylesheets/_grid.scss +41 -0
  16. data/app/assets/stylesheets/_typography.scss +38 -0
  17. data/app/assets/stylesheets/application.scss +19 -0
  18. data/app/assets/stylesheets/megatron/error-pages.scss +164 -0
  19. data/app/assets/stylesheets/megatron/error-pages/_animations.scss +96 -0
  20. data/app/assets/stylesheets/megatron/error-pages/_csi.scss +41 -0
  21. data/app/assets/stylesheets/megatron/error-pages/_waves.scss +36 -0
  22. data/app/assets/stylesheets/megatron/megatron.scss +3 -0
  23. data/app/assets/stylesheets/megatron/modules/_crop-height.scss +5 -0
  24. data/app/assets/stylesheets/megatron/modules/_index.scss +22 -0
  25. data/app/assets/stylesheets/megatron/modules/_logo.scss +67 -0
  26. data/app/assets/stylesheets/megatron/modules/_new-tag.scss +11 -0
  27. data/app/assets/stylesheets/megatron/modules/_progress.scss +80 -0
  28. data/app/assets/stylesheets/megatron/modules/app/_animation-classes.scss +3 -0
  29. data/app/assets/stylesheets/megatron/modules/app/_animations.scss +62 -0
  30. data/app/assets/stylesheets/megatron/modules/app/_index.scss +5 -0
  31. data/app/assets/stylesheets/megatron/modules/app/_layout.scss +261 -0
  32. data/app/assets/stylesheets/megatron/modules/app/_sizes.scss +28 -0
  33. data/app/assets/stylesheets/megatron/modules/app/_typography.scss +111 -0
  34. data/app/assets/stylesheets/megatron/modules/box/_base.scss +94 -0
  35. data/app/assets/stylesheets/megatron/modules/box/_color-box.scss +33 -0
  36. data/app/assets/stylesheets/megatron/modules/box/_deployment_box.scss +37 -0
  37. data/app/assets/stylesheets/megatron/modules/box/_index.scss +4 -0
  38. data/app/assets/stylesheets/megatron/modules/box/_placeholder.scss +6 -0
  39. data/app/assets/stylesheets/megatron/modules/buttons/_animations.scss +35 -0
  40. data/app/assets/stylesheets/megatron/modules/buttons/_buttons.scss +266 -0
  41. data/app/assets/stylesheets/megatron/modules/buttons/_index.scss +4 -0
  42. data/app/assets/stylesheets/megatron/modules/buttons/_mixins.scss +108 -0
  43. data/app/assets/stylesheets/megatron/modules/buttons/_pills.scss +44 -0
  44. data/app/assets/stylesheets/megatron/modules/code/_codemirror.scss +98 -0
  45. data/app/assets/stylesheets/megatron/modules/code/_highlighted.scss +65 -0
  46. data/app/assets/stylesheets/megatron/modules/code/_index.scss +3 -0
  47. data/app/assets/stylesheets/megatron/modules/code/_syntax.scss +18 -0
  48. data/app/assets/stylesheets/megatron/modules/core/_colored-items.scss +22 -0
  49. data/app/assets/stylesheets/megatron/modules/core/_colors.scss +163 -0
  50. data/app/assets/stylesheets/megatron/modules/core/_index.scss +3 -0
  51. data/app/assets/stylesheets/megatron/modules/core/_mixins.scss +262 -0
  52. data/app/assets/stylesheets/megatron/modules/core/_vars.scss +30 -0
  53. data/app/assets/stylesheets/megatron/modules/core/_z-index.scss +3 -0
  54. data/app/assets/stylesheets/megatron/modules/dialog/_animations.scss +48 -0
  55. data/app/assets/stylesheets/megatron/modules/dialog/_dialog.scss +81 -0
  56. data/app/assets/stylesheets/megatron/modules/dialog/_index.scss +2 -0
  57. data/app/assets/stylesheets/megatron/modules/forms/_base.scss +31 -0
  58. data/app/assets/stylesheets/megatron/modules/forms/_check-radio.scss +99 -0
  59. data/app/assets/stylesheets/megatron/modules/forms/_check-switch.scss +88 -0
  60. data/app/assets/stylesheets/megatron/modules/forms/_footer.scss +13 -0
  61. data/app/assets/stylesheets/megatron/modules/forms/_index.scss +10 -0
  62. data/app/assets/stylesheets/megatron/modules/forms/_login.scss +92 -0
  63. data/app/assets/stylesheets/megatron/modules/forms/_radio-nav.scss +62 -0
  64. data/app/assets/stylesheets/megatron/modules/forms/_select.scss +37 -0
  65. data/app/assets/stylesheets/megatron/modules/forms/_stacked-form.scss +29 -0
  66. data/app/assets/stylesheets/megatron/modules/forms/_table-form.scss +53 -0
  67. data/app/assets/stylesheets/megatron/modules/forms/_text-input.scss +118 -0
  68. data/app/assets/stylesheets/megatron/modules/grids/_alignment.scss +39 -0
  69. data/app/assets/stylesheets/megatron/modules/grids/_grid.scss +144 -0
  70. data/app/assets/stylesheets/megatron/modules/grids/_index.scss +2 -0
  71. data/app/assets/stylesheets/megatron/modules/headers/_actions.scss +10 -0
  72. data/app/assets/stylesheets/megatron/modules/headers/_base.scss +67 -0
  73. data/app/assets/stylesheets/megatron/modules/headers/_index.scss +4 -0
  74. data/app/assets/stylesheets/megatron/modules/headers/_meta.scss +10 -0
  75. data/app/assets/stylesheets/megatron/modules/headers/_site-header.scss +8 -0
  76. data/app/assets/stylesheets/megatron/modules/lib/_codemirror.scss +301 -0
  77. data/app/assets/stylesheets/megatron/modules/lists/_base.scss +13 -0
  78. data/app/assets/stylesheets/megatron/modules/lists/_box-list.scss +53 -0
  79. data/app/assets/stylesheets/megatron/modules/lists/_index.scss +2 -0
  80. data/app/assets/stylesheets/megatron/modules/messages/_index.scss +3 -0
  81. data/app/assets/stylesheets/megatron/modules/messages/_notice.scss +57 -0
  82. data/app/assets/stylesheets/megatron/modules/messages/_notifications.scss +126 -0
  83. data/app/assets/stylesheets/megatron/modules/messages/_pop-message.scss +157 -0
  84. data/app/assets/stylesheets/megatron/modules/nav/_auto-navigate.scss +7 -0
  85. data/app/assets/stylesheets/megatron/modules/nav/_breadcrumbs.scss +35 -0
  86. data/app/assets/stylesheets/megatron/modules/nav/_index.scss +8 -0
  87. data/app/assets/stylesheets/megatron/modules/nav/_main-sidebar.scss +21 -0
  88. data/app/assets/stylesheets/megatron/modules/nav/_mixins.scss +53 -0
  89. data/app/assets/stylesheets/megatron/modules/nav/_nav-toggle.scss +61 -0
  90. data/app/assets/stylesheets/megatron/modules/nav/_primary-nav.scss +120 -0
  91. data/app/assets/stylesheets/megatron/modules/nav/_secondary-nav.scss +105 -0
  92. data/app/assets/stylesheets/megatron/modules/nav/_tabs.scss +87 -0
  93. data/app/assets/stylesheets/megatron/modules/roboticons/_font.scss +62 -0
  94. data/app/assets/stylesheets/megatron/modules/roboticons/_icons.scss +219 -0
  95. data/app/assets/stylesheets/megatron/modules/roboticons/_index.scss +2 -0
  96. data/app/assets/stylesheets/megatron/modules/slider/_base.scss +49 -0
  97. data/app/assets/stylesheets/megatron/modules/slider/_index.scss +4 -0
  98. data/app/assets/stylesheets/megatron/modules/slider/_slider.scss +282 -0
  99. data/app/assets/stylesheets/megatron/modules/slider/_switch.scss +75 -0
  100. data/app/assets/stylesheets/megatron/modules/slider/_themes.scss +42 -0
  101. data/app/assets/stylesheets/megatron/modules/tables/_base.scss +170 -0
  102. data/app/assets/stylesheets/megatron/modules/tables/_border-table.scss +28 -0
  103. data/app/assets/stylesheets/megatron/modules/tables/_box-table.scss +36 -0
  104. data/app/assets/stylesheets/megatron/modules/tables/_columns.scss +8 -0
  105. data/app/assets/stylesheets/megatron/modules/tables/_doc-table.scss +22 -0
  106. data/app/assets/stylesheets/megatron/modules/tables/_icon-cell.scss +9 -0
  107. data/app/assets/stylesheets/megatron/modules/tables/_index.scss +7 -0
  108. data/app/assets/stylesheets/megatron/modules/tables/_link-cell.scss +8 -0
  109. data/app/assets/stylesheets/megatron/modules/tables/_responsive-table.scss +13 -0
  110. data/app/assets/stylesheets/megatron/modules/widgets/_index.scss +1 -0
  111. data/app/assets/stylesheets/megatron/modules/widgets/_time-switch.scss +24 -0
  112. data/lib/megatron.rb +1 -1
  113. data/lib/megatron/engine.rb +5 -0
  114. data/lib/megatron/version.rb +1 -1
  115. data/lib/tasks/megatron_tasks.rake +4 -4
  116. data/public/assets/megatron/megatron-0.0.4.css +3 -0
  117. data/public/assets/megatron/{megatron-0.0.3.css.map → megatron-0.0.4.css.map} +3 -3
  118. data/public/assets/megatron/{megatron-0.0.3.js → megatron-0.0.4.js} +1 -1
  119. data/public/assets/megatron/megatron-0.0.4.map.json +1 -0
  120. metadata +115 -6
  121. data/public/assets/megatron/megatron-0.0.3.css +0 -2
  122. data/public/assets/megatron/megatron-0.0.3.map.json +0 -1
@@ -0,0 +1,8 @@
1
+ @import "mixins";
2
+ @import "primary-nav";
3
+ @import "secondary-nav";
4
+ @import "main-sidebar";
5
+ @import "breadcrumbs";
6
+ @import "tabs";
7
+ @import "nav-toggle";
8
+ @import "auto-navigate";
@@ -0,0 +1,21 @@
1
+ .main-sidebar {
2
+ @include h-pad_box;
3
+ @include until($x-large) {
4
+ @include invert-h-pad;
5
+ border-top: 1px solid $page-border;
6
+ box-shadow: #fff 0 1px inset;
7
+ }
8
+ @include at-least($x-large) {
9
+ padding-top: 1px;
10
+ background: $page-gray;
11
+ border-left: 1px solid $page-border;
12
+ }
13
+ section {
14
+ margin: { top: $block-margin; bottom: $block-margin; }
15
+ }
16
+
17
+ section + section {
18
+ border-top: 1px solid $page-border;
19
+ box-shadow: #fff 0 1px inset;
20
+ }
21
+ }
@@ -0,0 +1,53 @@
1
+ @mixin link-label-base($color, $offset, $direction: left) {
2
+ position: absolute;
3
+ #{$direction}: $offset;
4
+ z-index: -1;
5
+ font-size: 14px;
6
+ background: $color;
7
+ border-radius: 4px;
8
+ top: 50%;
9
+ color: #fff;
10
+ padding: 10px 15px;
11
+ line-height: 20px;
12
+ opacity: 0;
13
+
14
+ transform: translate3d(-5px, -50%, 0);
15
+ &:before {
16
+ @include triangle($direction, $color, 4px);
17
+ content: "";
18
+ position: absolute;
19
+ #{$direction}: -4px;
20
+ top: 50%;
21
+ transform: translate3d(0, -50%, 0);
22
+ opacity: 0;
23
+ }
24
+ }
25
+
26
+ @mixin link-label-hover {
27
+ position: relative;
28
+ z-index: 3;
29
+ + .link_label {
30
+ transition: {
31
+ property: opacity, transform;
32
+ timing-function: ease-out;
33
+ duration: .15s;
34
+ }
35
+ z-index: 2;
36
+ transform: translate3d(10px, -50%, 0);
37
+ opacity: 1;
38
+ font-weight: normal;
39
+ @include smooth-text;
40
+ &:before { opacity: 1; }
41
+ }
42
+ }
43
+
44
+ @mixin link-label($color, $offset, $direction: left) {
45
+ .link_label {
46
+ @include link-label-base($color, $offset, $direction);
47
+ }
48
+
49
+ [class*=_icon]:hover {
50
+ @include link-label-hover;
51
+ }
52
+ }
53
+
@@ -0,0 +1,61 @@
1
+ $header-pad: 15px;
2
+
3
+ // Nav button for toggling mobile nav
4
+ .nav_toggle {
5
+
6
+ float: left;
7
+ cursor: pointer;
8
+ font-size: 12px;
9
+ padding: 8px 2px;
10
+ border: 0px;
11
+ background: none;
12
+ position: absolute;
13
+ right: $header-pad;
14
+
15
+ // Do not show for large screens
16
+ @include at-least($medium){
17
+ display: none;
18
+ }
19
+
20
+ &:focus {
21
+ outline: none;
22
+ }
23
+
24
+ .icon {
25
+ &, &:before, &:after {
26
+ position: relative;
27
+ display: block;
28
+ width: 18px;
29
+ height: 3px;
30
+ background: #fff;
31
+ transition: all .15s ease-in-out;
32
+ }
33
+ &:before, &:after {
34
+ content: "";
35
+ }
36
+ &:before { top: -6px; }
37
+ &:after { top: 3px; }
38
+
39
+ @include until($medium) {
40
+ .active-nav & {
41
+ background: rgba(#fff, 0);
42
+ &:before {
43
+ transform: rotate(-45deg);
44
+ top: -1px;
45
+ }
46
+ &:after {
47
+ transform: rotate(45deg);
48
+ top: -4px;
49
+ }
50
+ }
51
+ }
52
+ }
53
+ }
54
+
55
+ .nav_menu {
56
+ color: #fff;
57
+ position: absolute;
58
+ left: -10%;
59
+ top: 100%;
60
+ font-size: 10px;
61
+ }
@@ -0,0 +1,120 @@
1
+ $primary-nav-color: rgba(#fff, 0.4);
2
+ $primary-nav-here-color: #fff;
3
+ $primary-nav-hover-color: rgba(#fff, 0.7);
4
+ $header-pad: 15px;
5
+
6
+ .active-nav {
7
+ @include until($medium) {
8
+ overflow-x: hidden;
9
+ .page {
10
+ transform: translate3d(map-get($primary-nav-width, small), 0, 0);
11
+ overflow-x: hidden;
12
+ }
13
+ }
14
+ }
15
+
16
+ .primary_nav-item {
17
+ color: $primary-nav-color;
18
+ text-decoration: none;
19
+ transition: .1s color ease-in-out;
20
+ display: block;
21
+ padding: 10px 8px 6px;
22
+ border-bottom: 1px solid rgba(#fff, .1);
23
+
24
+ &:hover, &:focus {
25
+ color: $primary-nav-hover-color;
26
+ }
27
+
28
+ &.here {
29
+ color: $primary-nav-here-color;
30
+ }
31
+
32
+ .icon_label {
33
+ @include smooth-text;
34
+ }
35
+
36
+ @include until($medium) {
37
+
38
+ &:hover, &:focus {
39
+ background: rgba(#fff, .05);
40
+ }
41
+
42
+ &.here {
43
+ background-color: $link-color;
44
+ &:hover, &:focus {
45
+ background-color: lighten($link-color, 3);
46
+ }
47
+ }
48
+
49
+ #{icon-selector()} {
50
+ display: inline-block;
51
+ font-size: 26px;
52
+ width: 28px;
53
+ text-align: center;
54
+ }
55
+
56
+ .icon_label {
57
+ line-height: 22px;
58
+ position: relative;
59
+ top: -5px;
60
+ }
61
+
62
+ }
63
+
64
+ @include at-least($medium) {
65
+ width: map-get($primary-nav-width, large);
66
+ text-align: center;
67
+ position: relative;
68
+ border: none;
69
+ padding: 0;
70
+ [class*=_icon] {
71
+ display: block;
72
+ width: 100%;
73
+ padding: 7px 0;
74
+ }
75
+
76
+ #{icon-selector()} {
77
+ font-size: 35px;
78
+ }
79
+
80
+ @include link-label($link-color, map-get($primary-nav-width, large) - 15);
81
+
82
+ }
83
+ }
84
+
85
+ // Special positioning for sign_out link
86
+ //
87
+ @include at-least($medium) {
88
+
89
+ // Move top-links to the top right
90
+ //
91
+ .primary_nav-top {
92
+ position: absolute;
93
+ top: $header-pad;
94
+ right: nth($h-pad-box, 2);
95
+ font-size: 14px;
96
+ line-height: 22px;
97
+
98
+ .primary_nav-item {
99
+ padding: 0;
100
+ display: inline-block;
101
+ margin-left: .8em;
102
+ width: auto;
103
+ [class*=_icon] {
104
+ display: inline;
105
+ }
106
+ #{icon-selector()} {
107
+ display: inline;
108
+ font-size: 1.2em;
109
+ position: relative;
110
+ top: .1em;
111
+ }
112
+ }
113
+ }
114
+ }
115
+
116
+ @include at-least($max + 20) {
117
+ .primary_nav-top {
118
+ right: 0;
119
+ }
120
+ }
@@ -0,0 +1,105 @@
1
+ // Colors
2
+ $secondary-nav-bg: $silver;
3
+ $secondary-nav-color: #8d9297;
4
+ $secondary-nav-border: $overcast;
5
+
6
+ $secondary-nav-here-icon-color: $link-color;
7
+ $secondary-nav-here-text-color: $text-color;
8
+ $secondary-nav-here-bg: #fafafa;
9
+ $secondary-nav-hover-bg: #f5f5f5;
10
+
11
+ // Sizes
12
+ $secondary-nav-width-small: 38px;
13
+
14
+ .secondary_nav {
15
+ background: $secondary-nav-bg;
16
+
17
+ @include until($small) {
18
+ border-bottom: 1px solid $secondary-nav-border;
19
+ }
20
+
21
+ @include at-least($small) {
22
+ border-right: 1px solid $secondary-nav-border;
23
+
24
+ .link_label {
25
+ display: inline-block;
26
+ @include smooth-text;
27
+ }
28
+ }
29
+ }
30
+
31
+ .secondary_nav-item {
32
+ white-space: nowrap;
33
+ text-decoration: none;
34
+ display: table-cell;
35
+ text-align: center;
36
+ color: $secondary-nav-color;
37
+ line-height: 30px;
38
+ position: relative;
39
+ padding: 3px 8px;
40
+
41
+ .link_label {
42
+ display: none;
43
+ @include at-least(450px) {
44
+ display: block;
45
+ font-size: 11px;
46
+ line-height: 18px;
47
+ }
48
+ }
49
+
50
+ @include at-least($small) {
51
+ text-align: left;
52
+ display: block;
53
+ }
54
+
55
+ @include between($small, $large) {
56
+ padding: 0;
57
+ [class*=_icon] {
58
+ display: inline-block;
59
+ padding: 3px 8px;
60
+ }
61
+ @include link-label(lighten($base-bg, 15), 30px);
62
+ }
63
+
64
+ @include at-least($large) {
65
+ padding: 3px 18px 3px 10px;
66
+
67
+ .link_label {
68
+ display: inline-block;
69
+ font-size: 14px;
70
+ transition: opacity ease-out .3s;
71
+ }
72
+ }
73
+
74
+ #{icon-selector()} {
75
+ font-size: 20px;
76
+ width: 25px;
77
+ display: inline-block;
78
+ text-align: center;
79
+ position: relative;
80
+ top: 3px;
81
+ }
82
+
83
+
84
+ &:focus, &:hover, &.here {
85
+ box-shadow: 1px 0 0 rgba(#000, .1), -1px 0 0 rgba(#000, .1);
86
+ background: $secondary-nav-hover-bg;
87
+ color: $secondary-nav-here-text-color;
88
+
89
+ @include at-least($small) {
90
+ box-shadow: 0 1px 0 rgba(#000, .1), 0 -1px 0 rgba(#000, .1);
91
+
92
+ &:first-child {
93
+ box-shadow: 0 1px 0 rgba(#000, .1);
94
+ }
95
+ }
96
+ }
97
+
98
+ &.here {
99
+ background: $secondary-nav-here-bg;
100
+
101
+ #{icon-selector()} {
102
+ color: $secondary-nav-here-icon-color;
103
+ }
104
+ }
105
+ }
@@ -0,0 +1,87 @@
1
+ $main-nav-bg: lighten($secondary_nav-bg, 1);
2
+ $main-nav-here-bg: $main-bg;
3
+ $main-nav-color: $lightgray;
4
+ $main-nav-here-color: $mediumgray;
5
+
6
+ .tabs {
7
+ @include invert-h-pad;
8
+ @include h-pad_box;
9
+ margin: { top: $block-margin; bottom: $block-margin; }
10
+ border-bottom: 1px solid $page-border;
11
+ display: table;
12
+ top: 1px;
13
+ position: relative;
14
+
15
+ // Fake table cell allowing tabs to have auto-width
16
+ &:after {
17
+ display: table-cell;
18
+ width: 100%;
19
+ content: "";
20
+ }
21
+
22
+ .tab-btn {
23
+ position: absolute;
24
+ right: nth($h-pad-box, 1);
25
+ @include at-least($medium) {
26
+ right: nth($h-pad-box, 2);
27
+ }
28
+ }
29
+ }
30
+
31
+ .box-tabs {
32
+ border: 1px solid $page-border;
33
+ .box &:not(:first-child) {
34
+ border-top: 0;
35
+ }
36
+ }
37
+
38
+ .tab {
39
+ display: table-cell;
40
+ width: auto;
41
+ padding: 10px 13px;
42
+ text-decoration: none;
43
+ color: $main-nav-color;
44
+ font-size: 14px;
45
+ position: relative;
46
+ top: 1px;
47
+ white-space: pre;
48
+
49
+ border: {
50
+ width: 1px;
51
+ left-width: 0;
52
+ style: solid;
53
+ color: $page-border;
54
+ }
55
+
56
+ &:hover, &:focus {
57
+ color: $gray;
58
+ }
59
+
60
+ &.here {
61
+ color: $mediumgray;
62
+ background: linear-gradient(rgba(#fff, .8), rgba(#fff, 0));
63
+ }
64
+ }
65
+
66
+ .box-tabs .tab {
67
+ border-top: 0;
68
+
69
+ &.here {
70
+ background-color: $white;
71
+ }
72
+ }
73
+
74
+ .tabs .tab {
75
+ &:first-child {
76
+ border-top-left-radius: 5px;
77
+ border-left-width: 1px;
78
+ }
79
+
80
+ &:last-of-type {
81
+ border-top-right-radius: 5px;
82
+ }
83
+ &.here {
84
+ border-bottom-color: $main-nav-here-bg;
85
+ }
86
+ }
87
+