express_ui 0.1.0.rc1
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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +38 -0
- data/Rakefile +37 -0
- data/app/assets/config/express_ui_manifest.js +2 -0
- data/app/assets/javascripts/express_ui/application.js +1 -0
- data/app/assets/javascripts/express_ui/copy_code.js +63 -0
- data/app/assets/javascripts/express_ui/search.js +103 -0
- data/app/assets/javascripts/express_ui/styleguide.js +90 -0
- data/app/assets/stylesheets/express_ui/atoms/_animations.sass +35 -0
- data/app/assets/stylesheets/express_ui/atoms/_buttons.sass +119 -0
- data/app/assets/stylesheets/express_ui/atoms/_headings.sass +51 -0
- data/app/assets/stylesheets/express_ui/atoms/_icons.sass +3 -0
- data/app/assets/stylesheets/express_ui/atoms/_images.sass +37 -0
- data/app/assets/stylesheets/express_ui/atoms/_media_queries.sass +27 -0
- data/app/assets/stylesheets/express_ui/atoms/_mixins.sass +33 -0
- data/app/assets/stylesheets/express_ui/atoms/_reset.sass +11 -0
- data/app/assets/stylesheets/express_ui/atoms/_typography.sass +167 -0
- data/app/assets/stylesheets/express_ui/atoms/_variables.sass +52 -0
- data/app/assets/stylesheets/express_ui/molecules/_button_group.sass +54 -0
- data/app/assets/stylesheets/express_ui/molecules/_container.sass +29 -0
- data/app/assets/stylesheets/express_ui/molecules/_flash_messages.sass +56 -0
- data/app/assets/stylesheets/express_ui/molecules/_form_groups.sass +96 -0
- data/app/assets/stylesheets/express_ui/molecules/_forms.sass +159 -0
- data/app/assets/stylesheets/express_ui/molecules/_lists.sass +56 -0
- data/app/assets/stylesheets/express_ui/molecules/_nav.sass +85 -0
- data/app/assets/stylesheets/express_ui/molecules/_tables.sass +77 -0
- data/app/assets/stylesheets/express_ui/molecules/_tabs.sass +23 -0
- data/app/assets/stylesheets/express_ui/organisms/_header.sass +29 -0
- data/app/assets/stylesheets/express_ui/organisms/_sidebar.sass +113 -0
- data/app/assets/stylesheets/express_ui/style.sass +31 -0
- data/app/assets/stylesheets/express_ui/styleguide.sass +200 -0
- data/app/assets/stylesheets/express_ui/templates/_content_sidebar.sass +31 -0
- data/app/assets/stylesheets/express_ui/templates/_full_width.sass +5 -0
- data/app/assets/stylesheets/express_ui/templates/_half_width.sass +8 -0
- data/app/assets/stylesheets/express_ui/templates/_master_detail.sass +50 -0
- data/app/components/code_demo.rb +31 -0
- data/app/controllers/express_ui/about_controller.rb +10 -0
- data/app/controllers/express_ui/application_controller.rb +5 -0
- data/app/controllers/express_ui/styleguide_controller.rb +10 -0
- data/app/controllers/express_ui/templates_controller.rb +26 -0
- data/app/controllers/express_ui/uicomponents_controller.rb +26 -0
- data/app/helpers/express_ui/application_helper.rb +28 -0
- data/app/jobs/express_ui/application_job.rb +4 -0
- data/app/mailers/express_ui/application_mailer.rb +6 -0
- data/app/models/express_ui/application_record.rb +5 -0
- data/app/views/express_ui/atoms/_animations.html.erb +33 -0
- data/app/views/express_ui/atoms/_buttons.html.erb +129 -0
- data/app/views/express_ui/atoms/_headings.html.erb +3 -0
- data/app/views/express_ui/atoms/_icons.html.erb +13 -0
- data/app/views/express_ui/atoms/_mixins.html.erb +6 -0
- data/app/views/express_ui/atoms/_typography.html.erb +201 -0
- data/app/views/express_ui/atoms/_variables.html.erb +50 -0
- data/app/views/express_ui/molecules/_button_group.html.erb +90 -0
- data/app/views/express_ui/molecules/_container.html.erb +32 -0
- data/app/views/express_ui/molecules/_flash_messages.html.erb +49 -0
- data/app/views/express_ui/molecules/_form_group_horizontal.html.erb +14 -0
- data/app/views/express_ui/molecules/_form_group_inline.html.erb +1 -0
- data/app/views/express_ui/molecules/_form_group_single_line.html.erb +9 -0
- data/app/views/express_ui/molecules/_form_groups.html.erb +69 -0
- data/app/views/express_ui/molecules/_forms.html.erb +209 -0
- data/app/views/express_ui/molecules/_forms_checkbox.html.erb +20 -0
- data/app/views/express_ui/molecules/_forms_radio.html.erb +12 -0
- data/app/views/express_ui/molecules/_forms_select.html.erb +11 -0
- data/app/views/express_ui/molecules/_nav.html.erb +11 -0
- data/app/views/express_ui/molecules/_nav_mega_menu.html.erb +74 -0
- data/app/views/express_ui/molecules/_table.html.erb +93 -0
- data/app/views/express_ui/molecules/_table_with_filtering.html.erb +55 -0
- data/app/views/express_ui/organisms/_header.html.erb +24 -0
- data/app/views/express_ui/shared/_header.html.erb +10 -0
- data/app/views/express_ui/shared/_search_box.html.erb +6 -0
- data/app/views/express_ui/shared/_sidebar_left.html.erb +4 -0
- data/app/views/express_ui/shared/_sidebar_right.html.erb +5 -0
- data/app/views/express_ui/styleguide/about.html.erb +22 -0
- data/app/views/express_ui/styleguide/index.html.erb +79 -0
- data/app/views/express_ui/templates/_header.html.erb +15 -0
- data/app/views/express_ui/templates/_templates.html.erb +57 -0
- data/app/views/express_ui/templates/content_and_sidebar.html.erb +32 -0
- data/app/views/express_ui/templates/content_and_sidebar_fixed.html.erb +34 -0
- data/app/views/express_ui/templates/full_width.html.erb +25 -0
- data/app/views/express_ui/templates/half_width.html.erb +25 -0
- data/app/views/express_ui/templates/master_detail.html.erb +41 -0
- data/app/views/express_ui/templates/master_detail_fixed.html.erb +36 -0
- data/app/views/express_ui/uicomponents/_buttons.html.et +10 -0
- data/app/views/express_ui/uicomponents/_flash_message.html.et +19 -0
- data/app/views/express_ui/uicomponents/_forms.html.et +118 -0
- data/app/views/express_ui/uicomponents/_heading.html.et +24 -0
- data/app/views/express_ui/uicomponents/_icons.html.et +35 -0
- data/app/views/express_ui/uicomponents/_layout.html.et +47 -0
- data/app/views/express_ui/uicomponents/_lists.html.et +9 -0
- data/app/views/express_ui/uicomponents/_login.html.erb +15 -0
- data/app/views/express_ui/uicomponents/_nav.html.et +18 -0
- data/app/views/express_ui/uicomponents/_pages.html.et +22 -0
- data/app/views/express_ui/uicomponents/_panel.html.et +33 -0
- data/app/views/express_ui/uicomponents/_popup.html.et +19 -0
- data/app/views/express_ui/uicomponents/_register.html.erb +14 -0
- data/app/views/express_ui/uicomponents/_sidebar.html.et +8 -0
- data/app/views/express_ui/uicomponents/_table.html.et +29 -0
- data/app/views/express_ui/uicomponents/_widget_box.html.et +14 -0
- data/app/views/express_ui/uicomponents/index.html.erb +55 -0
- data/app/views/layouts/express_ui/styleguide.html.erb +20 -0
- data/config/routes.rb +12 -0
- data/lib/express_ui.rb +5 -0
- data/lib/express_ui/engine.rb +12 -0
- data/lib/express_ui/version.rb +3 -0
- data/lib/tasks/express_ui_tasks.rake +4 -0
- metadata +251 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: 3aba4d25bce3a9b4dad5029c100a38467f15c305
|
|
4
|
+
data.tar.gz: d99847094ecdb814e7a25718cbd09e23b265f7fc
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: '0362895f696cd259db5f153335668a32af3cd688a0d2a76c5ab402f05696b60b7a92a65593842fa62ea00596d0745d799bf1f5c146e6e335362b6ad1f3db2ba0'
|
|
7
|
+
data.tar.gz: 485aeecd0951c2ee20a9d67e129480a4e95ba072263e27cc7c1270c6d05f53db3af040087772cc0d20d3c93d570518a5fa01f72d2af105988bfb3c181504cfb5
|
data/MIT-LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Copyright 2017 Steven Talcott Smith
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Express UI
|
|
2
|
+
==========
|
|
3
|
+
|
|
4
|
+
User interface library for AppExpress components.
|
|
5
|
+
|
|
6
|
+
## Installation
|
|
7
|
+
Add this line to your application's Gemfile:
|
|
8
|
+
|
|
9
|
+
```ruby
|
|
10
|
+
gem 'express_ui'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
And then execute:
|
|
14
|
+
```bash
|
|
15
|
+
$ bundle
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or install it yourself as:
|
|
19
|
+
```bash
|
|
20
|
+
$ gem install express_ui
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
Start the dummy Rails app:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
cd test/dummy
|
|
29
|
+
bin/rails s
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Visit `http://localhost:3000/express_ui`.
|
|
33
|
+
|
|
34
|
+
## Contributing
|
|
35
|
+
Contribution directions go here.
|
|
36
|
+
|
|
37
|
+
## License
|
|
38
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
begin
|
|
2
|
+
require 'bundler/setup'
|
|
3
|
+
rescue LoadError
|
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
require 'rdoc/task'
|
|
8
|
+
|
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
|
11
|
+
rdoc.title = 'ExpressUi'
|
|
12
|
+
rdoc.options << '--line-numbers'
|
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
|
14
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
|
|
18
|
+
load 'rails/tasks/engine.rake'
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
load 'rails/tasks/statistics.rake'
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
require 'bundler/gem_tasks'
|
|
26
|
+
|
|
27
|
+
require 'rake/testtask'
|
|
28
|
+
|
|
29
|
+
Rake::TestTask.new(:test) do |t|
|
|
30
|
+
t.libs << 'lib'
|
|
31
|
+
t.libs << 'test'
|
|
32
|
+
t.pattern = 'test/**/*_test.rb'
|
|
33
|
+
t.verbose = false
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
task default: :test
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//= require_tree .
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
function testCopyComand() {
|
|
2
|
+
try {
|
|
3
|
+
document.execCommand("copy")
|
|
4
|
+
return true
|
|
5
|
+
}
|
|
6
|
+
catch (error) {
|
|
7
|
+
return false
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function addClickToCopyButton(codeBlocks) {
|
|
12
|
+
codeBlocks.map(function(codeBlock, index){
|
|
13
|
+
var clickToCopyButton = createButton()
|
|
14
|
+
codeBlock.appendChild(clickToCopyButton)
|
|
15
|
+
clickToCopyButton.addEventListener('click', function(e) {
|
|
16
|
+
selectElementRange(this.parentNode)
|
|
17
|
+
})
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function selectElementRange(copyElementSelect) {
|
|
22
|
+
var range = document.createRange()
|
|
23
|
+
range.selectNode(copyElementSelect)
|
|
24
|
+
window.getSelection().removeAllRanges()
|
|
25
|
+
window.getSelection().addRange(range)
|
|
26
|
+
document.execCommand("copy")
|
|
27
|
+
window.getSelection().removeAllRanges()
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function createButton() {
|
|
31
|
+
var copyButton = document.createElement('button')
|
|
32
|
+
copyButton.className = 'ae-btn ae-btn-primary click-to-copy'
|
|
33
|
+
copyButton.data = 'Click to copy'
|
|
34
|
+
var clipboard = document.createElement('i')
|
|
35
|
+
clipboard.className = 'fa fa-clipboard'
|
|
36
|
+
copyButton.appendChild(clipboard)
|
|
37
|
+
return copyButton
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function addClickToCopyText() {
|
|
41
|
+
var codeBlockButtons = Array.prototype.slice.call(document.querySelectorAll('.ae-code-block .ae-btn'))
|
|
42
|
+
|
|
43
|
+
codeBlockButtons.map(function(button, index) {
|
|
44
|
+
var pre = button.closest('pre')
|
|
45
|
+
button.setAttribute('data-tooltip', 'Click to copy')
|
|
46
|
+
button.addEventListener('click', function(e){
|
|
47
|
+
button.setAttribute('data-tooltip', 'Copied!')
|
|
48
|
+
setTimeout(function(){
|
|
49
|
+
button.setAttribute('data-tooltip', 'Click to copy')},
|
|
50
|
+
500)
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
document.addEventListener("DOMContentLoaded", function() {
|
|
56
|
+
if (testCopyComand()) {
|
|
57
|
+
var codeBlocks = Array.prototype.slice.call(document.querySelectorAll(".ae-code-block"))
|
|
58
|
+
|
|
59
|
+
addClickToCopyButton(codeBlocks)
|
|
60
|
+
addClickToCopyText()
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
function hasClass(element, cls) {
|
|
2
|
+
return element.classList.contains(cls)
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
function addMatch(matchedElements, node) {
|
|
6
|
+
if (node.nodeType !== Node.TEXT_NODE) {
|
|
7
|
+
if (matchedElements.includes(node) == false){
|
|
8
|
+
matchedElements.push(node)
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function addNextElements(elements, matchedElements) {
|
|
14
|
+
elements.map(function(index, item){
|
|
15
|
+
if (matchedElements.includes(item) == false){
|
|
16
|
+
matchSubElements(item, matchedElements, null)
|
|
17
|
+
}
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function checkItemIsHeader($item) {
|
|
22
|
+
return $item.is(':header') //h1, h2, h3, etc
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function matchSubElements(element, matchedElements, header, isHeader) {
|
|
26
|
+
var $subElements = $(element.children)
|
|
27
|
+
|
|
28
|
+
if (isHeader) {
|
|
29
|
+
matchedElements.push($subElements[0])
|
|
30
|
+
} else {
|
|
31
|
+
$subElements.map(function(index, item){
|
|
32
|
+
var itemIsHeader = checkItemIsHeader($(item)) ? true : false
|
|
33
|
+
matchSubElements(item, matchedElements, header, itemIsHeader)
|
|
34
|
+
})
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
matchedElements.push(element)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function matchHeader(header, matchedElements) {
|
|
41
|
+
matchSubElements(header, matchedElements, null, true)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function matchElement(header, matchedElements, regexp){
|
|
45
|
+
var directSibElement = $(header).nextUntil(header.tagName)[0]
|
|
46
|
+
var $elements = []
|
|
47
|
+
|
|
48
|
+
if (directSibElement){
|
|
49
|
+
$elements = $(directSibElement.children)
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (header.textContent.match(regexp)){
|
|
53
|
+
matchHeader(header, matchedElements)
|
|
54
|
+
|
|
55
|
+
if (directSibElement) {addMatch(matchedElements, directSibElement) }
|
|
56
|
+
|
|
57
|
+
addNextElements($elements, matchedElements)
|
|
58
|
+
} else {
|
|
59
|
+
if (!!$elements.length) {
|
|
60
|
+
for (var i = 0; i < $elements.length; i++){
|
|
61
|
+
if ($elements[i].textContent.match(regexp)){
|
|
62
|
+
matchSubElements($elements[i], matchedElements, header)
|
|
63
|
+
addMatch(matchedElements, directSibElement)
|
|
64
|
+
matchHeader(header, matchedElements)
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
document.addEventListener("DOMContentLoaded", function() {
|
|
72
|
+
|
|
73
|
+
if (!document.querySelector('#ae-search-box')) { return; }
|
|
74
|
+
document.querySelector("#ae-search-box").addEventListener("input", function(event) {
|
|
75
|
+
|
|
76
|
+
var searchTerm = this.value
|
|
77
|
+
var headers = Array.prototype.slice.call(document.querySelector('.js-anchorific-content').querySelectorAll("h2"))
|
|
78
|
+
var regexp = new RegExp(searchTerm, "igm")
|
|
79
|
+
var allElements = document.querySelector('.js-anchorific-content').querySelectorAll('*')
|
|
80
|
+
var allElementsArray = Array.prototype.slice.call(allElements)
|
|
81
|
+
var matchedElements = []
|
|
82
|
+
var unmatchedElements = []
|
|
83
|
+
|
|
84
|
+
for (var i = 0; i < headers.length; i++) {
|
|
85
|
+
if (matchedElements.includes(headers[i]) == false){
|
|
86
|
+
matchElement(headers[i], matchedElements, regexp)
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
unmatchedElements = allElementsArray.filter(function(element, index) {
|
|
91
|
+
return matchedElements.indexOf(element) === -1
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
unmatchedElements.map(function(item, index) {
|
|
95
|
+
item.style.display = "none"
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
matchedElements.map(function(item, index) {
|
|
99
|
+
item.style.display = ""
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
//= require jquery
|
|
2
|
+
//= require jquery_ujs
|
|
3
|
+
//= require anchorific
|
|
4
|
+
//= require resizable
|
|
5
|
+
|
|
6
|
+
$(function() {
|
|
7
|
+
|
|
8
|
+
$('.ae-sidebar-right').resizable({
|
|
9
|
+
handles: 'w',
|
|
10
|
+
minWidth: 100,
|
|
11
|
+
maxWidth: $('.ae-sidebar-right').parent().width() * 0.4,
|
|
12
|
+
containment: '.ae-template-master-detail-fixed',
|
|
13
|
+
resize: function(event, ui){
|
|
14
|
+
var siblingMain = ui.element.siblings('.ae-content')
|
|
15
|
+
var siblingSidebar = ui.element.siblings('.ae-sidebar')
|
|
16
|
+
var parent = ui.element.parent()
|
|
17
|
+
ui.size.height = ui.originalSize.height
|
|
18
|
+
siblingMain.width(parent.width() - (siblingSidebar.width() + ui.size.width) - 100)
|
|
19
|
+
},
|
|
20
|
+
stop: function(event, ui){
|
|
21
|
+
ui.element.css('left', '')
|
|
22
|
+
}
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
var rightCaretIcon = "<i class='fa fa-caret-right'></i>"
|
|
26
|
+
|
|
27
|
+
$(".js-anchorific-content").anchorific({
|
|
28
|
+
headers: ':header:not(.ae-demo-container :header)'
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
$(".anchorific ul > li").each(function(index, item) {
|
|
32
|
+
$(item).has("ul").children("a").prepend(rightCaretIcon)
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
$('.anchorific a').on('click', function(e){
|
|
36
|
+
$(e.target).closest('li[data-tag]').children('ul').toggle()
|
|
37
|
+
$(e.target).find('i').toggleClass('fa-caret-right fa-caret-down')
|
|
38
|
+
|
|
39
|
+
$('html, body').animate({
|
|
40
|
+
scrollTop: $('[id="' + $.attr($(e.target).closest('a')[0], 'href').substr(1) + '"]').offset().top
|
|
41
|
+
}, 500);
|
|
42
|
+
return false;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
$('body').append("<a href='#' class='ae-btn ae-btn-secondary ae-btn-sm back-to-top'>Back to top <i class='fa fa-long-arrow-up'></i></a>");
|
|
46
|
+
$('.back-to-top').css('display', 'none')
|
|
47
|
+
|
|
48
|
+
// Freeze body when scrolling over sidebar
|
|
49
|
+
// $(".ae-sidebar-overlay").on("mouseover", function() {
|
|
50
|
+
// $("body").css("overflow-y", "hidden");
|
|
51
|
+
// $(this).css('z-index', '-1');
|
|
52
|
+
// });
|
|
53
|
+
|
|
54
|
+
// $(".js-ae-sidebar").on("mouseleave", function() {
|
|
55
|
+
// $("body").css("overflow-y", "auto");
|
|
56
|
+
// $(this).css('z-index', '1');
|
|
57
|
+
// });
|
|
58
|
+
|
|
59
|
+
$(window).scroll(function() {
|
|
60
|
+
if ($(this).scrollTop() >= 100) { // If page is scrolled more than 100px
|
|
61
|
+
$('.back-to-top').fadeIn(200); // Fade in the arrow
|
|
62
|
+
} else {
|
|
63
|
+
$('.back-to-top').fadeOut(100); // Else fade out the arrow
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
$('.back-to-top').click(function() {
|
|
68
|
+
$("html, body").animate({ scrollTop: 0 }, "slow");
|
|
69
|
+
return false;
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
//demo tabs
|
|
74
|
+
$('.ae-demo-container').on('click', '.ae-tab', function(e){
|
|
75
|
+
$clickedTab = $(this)
|
|
76
|
+
$parentContainer = $clickedTab.parents('.ae-demo-container')
|
|
77
|
+
tabContent = $clickedTab.data('tab')
|
|
78
|
+
|
|
79
|
+
$parentContainer.find('.ae-tab.active-tab').removeClass('active-tab')
|
|
80
|
+
$clickedTab.addClass('active-tab')
|
|
81
|
+
$parentContainer.find('.ae-tab-content.active-tab').removeClass('active-tab')
|
|
82
|
+
$parentContainer.find('#' + tabContent).addClass('active-tab')
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
$( document ).ready(function() {
|
|
87
|
+
$("ul li[data-tag='2']").children("ul").css("display", "none");
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@mixin easeInOut
|
|
2
|
+
-moz-transition: all 0.3s ease-in-out
|
|
3
|
+
-o-transition: all 0.3s ease-in-out
|
|
4
|
+
-webkit-transition: all 0.3s ease-in-out
|
|
5
|
+
transition: all 0.3s ease-in-out
|
|
6
|
+
|
|
7
|
+
@mixin animate($n)
|
|
8
|
+
transition: all $n ease-out
|
|
9
|
+
|
|
10
|
+
@mixin scale
|
|
11
|
+
transform: scale(1.1)
|
|
12
|
+
|
|
13
|
+
.ae-fade-in
|
|
14
|
+
&:hover
|
|
15
|
+
animation: fadeIn 1s linear
|
|
16
|
+
|
|
17
|
+
.ae-fade-out
|
|
18
|
+
&:hover
|
|
19
|
+
animation: fadeOut 1s linear
|
|
20
|
+
|
|
21
|
+
.ae-ease-in-out
|
|
22
|
+
&:hover
|
|
23
|
+
@include easeInOut
|
|
24
|
+
|
|
25
|
+
@keyframes fadeIn
|
|
26
|
+
0%
|
|
27
|
+
opacity: 0
|
|
28
|
+
100%
|
|
29
|
+
opacity: 1
|
|
30
|
+
|
|
31
|
+
@keyframes fadeOut
|
|
32
|
+
0%
|
|
33
|
+
opacity: 1
|
|
34
|
+
100%
|
|
35
|
+
opacity: 0
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
@mixin button
|
|
2
|
+
@include border-radius(3px !important)
|
|
3
|
+
padding: 0.5em
|
|
4
|
+
margin: 0.25em 0.25em 0 0
|
|
5
|
+
border: 0
|
|
6
|
+
cursor: pointer
|
|
7
|
+
|
|
8
|
+
.ae-btn
|
|
9
|
+
@include easeInOut
|
|
10
|
+
@include button
|
|
11
|
+
display: inline-block
|
|
12
|
+
text-decoration: none
|
|
13
|
+
text-transform: uppercase
|
|
14
|
+
box-shadow: none
|
|
15
|
+
vertical-align: middle
|
|
16
|
+
@include body-font
|
|
17
|
+
|
|
18
|
+
&:hover, &-hover
|
|
19
|
+
@include box-shadow(0, 0px, 5px, 0, $border-dark)
|
|
20
|
+
|
|
21
|
+
&:active, &-active
|
|
22
|
+
@include box-shadow(inset, 2px, 2px, 2px, darken($secondary-color, 5%))
|
|
23
|
+
|
|
24
|
+
&:focus, &-focus
|
|
25
|
+
@include box-shadow(inset, 2px, 2px, 2px, darken($secondary-color, 5%))
|
|
26
|
+
outline-color: $primary-color
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
.ae-btn-default
|
|
30
|
+
background: $secondary-color
|
|
31
|
+
border: 1px solid $secondary-color
|
|
32
|
+
color: $icon-color !important
|
|
33
|
+
|
|
34
|
+
&:active, &:focus
|
|
35
|
+
@include box-shadow(inset, 2px, 2px, 2px, darken($secondary-color, 20%))
|
|
36
|
+
|
|
37
|
+
.ae-btn-primary
|
|
38
|
+
background: $primary-color
|
|
39
|
+
border: 1px solid $primary-color
|
|
40
|
+
color: #fff !important
|
|
41
|
+
|
|
42
|
+
*
|
|
43
|
+
color: #fff !important
|
|
44
|
+
|
|
45
|
+
&.ae-btn-border
|
|
46
|
+
color: $primary-color !important
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
&:active, &:focus
|
|
50
|
+
@include box-shadow(inset, 2px, 2px, 2px, darken($primary-color, 20%))
|
|
51
|
+
|
|
52
|
+
.ae-btn-secondary
|
|
53
|
+
background: $secondary-color
|
|
54
|
+
border: 1px solid $secondary-color
|
|
55
|
+
color: #fff !important
|
|
56
|
+
|
|
57
|
+
*
|
|
58
|
+
color: #fff !important
|
|
59
|
+
|
|
60
|
+
&.ae-btn-border
|
|
61
|
+
color: $secondary-color !important
|
|
62
|
+
|
|
63
|
+
&:active, &:focus
|
|
64
|
+
@include box-shadow(inset, 2px, 2px, 2px, darken($secondary-color, 5%))
|
|
65
|
+
|
|
66
|
+
.ae-btn-success
|
|
67
|
+
background: $success
|
|
68
|
+
border: 1px solid $success
|
|
69
|
+
color: #fff !important
|
|
70
|
+
|
|
71
|
+
*
|
|
72
|
+
color: #fff !important
|
|
73
|
+
|
|
74
|
+
&:active, &:focus
|
|
75
|
+
@include box-shadow(inset, 2px, 2px, 2px, darken($success, 20%))
|
|
76
|
+
|
|
77
|
+
.ae-btn-danger
|
|
78
|
+
background: $cancelled
|
|
79
|
+
border: 1px solid $cancelled
|
|
80
|
+
color: #fff !important
|
|
81
|
+
|
|
82
|
+
*
|
|
83
|
+
color: #fff !important
|
|
84
|
+
|
|
85
|
+
&:active, &:focus
|
|
86
|
+
@include box-shadow(inset, 2px, 2px, 2px, darken($cancelled, 20%))
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
.ae-btn-sm
|
|
90
|
+
padding-top: 0.25em
|
|
91
|
+
padding-bottom: 0.25em
|
|
92
|
+
@include h6
|
|
93
|
+
|
|
94
|
+
.ae-btn-md
|
|
95
|
+
padding-top: 0.45em
|
|
96
|
+
padding-bottom: 0.45em
|
|
97
|
+
@include h5
|
|
98
|
+
|
|
99
|
+
.ae-btn-lg
|
|
100
|
+
padding-top: 0.5em
|
|
101
|
+
padding-bottom: 0.5em
|
|
102
|
+
@include h4
|
|
103
|
+
|
|
104
|
+
.ae-btn-border
|
|
105
|
+
border-style: solid
|
|
106
|
+
border-width: 1px
|
|
107
|
+
background: none
|
|
108
|
+
|
|
109
|
+
&:active
|
|
110
|
+
@include box-shadow(inset, 2px, 2px, 2px, lighten($secondary-color, 15%))
|
|
111
|
+
|
|
112
|
+
.ae-btn-disabled, button:disabled
|
|
113
|
+
background: lighten($secondary-color, 30%)
|
|
114
|
+
color: #ccc
|
|
115
|
+
cursor: not-allowed
|
|
116
|
+
border-color: lighten($secondary-color, 30%)
|
|
117
|
+
|
|
118
|
+
&:hover
|
|
119
|
+
box-shadow: none
|