dx 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +5 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +6 -0
  7. data/Gemfile.lock +108 -0
  8. data/LICENSE.txt +22 -0
  9. data/README.md +43 -0
  10. data/Rakefile +6 -0
  11. data/bin/console +14 -0
  12. data/bin/setup +8 -0
  13. data/deploy_locally.rb +2 -0
  14. data/docs/.babelrc +8 -0
  15. data/docs/assets/css/index.styl +13 -0
  16. data/docs/assets/css/normalize.css +1 -0
  17. data/docs/assets/js/index.js +25 -0
  18. data/docs/assets/js/lib/splitText.js +1 -0
  19. data/docs/assets/js/mouse.js +76 -0
  20. data/docs/build/client56e64b699755b52e5a2d.css +18 -0
  21. data/docs/build/client56e64b699755b52e5a2d.js +1 -0
  22. data/docs/build/webpack.stats.json +1 -0
  23. data/docs/index.js +36 -0
  24. data/docs/package-lock.json +9117 -0
  25. data/docs/package.json +65 -0
  26. data/docs/queries.js +32 -0
  27. data/docs/structure.yml +93 -0
  28. data/docs/views/index.pug +20 -0
  29. data/docs/views/layout.pug +14 -0
  30. data/docs/views/mixins.pug +4 -0
  31. data/docs/views/partials/footer.pug +2 -0
  32. data/docs/views/partials/header.pug +1 -0
  33. data/docs/views/show.pug +4 -0
  34. data/docs/webpack.js +158 -0
  35. data/docs/yarn.lock +5666 -0
  36. data/dx.gemspec +46 -0
  37. data/exe/dx +4 -0
  38. data/lib/dx.rb +8 -0
  39. data/lib/dx/auth.rb +37 -0
  40. data/lib/dx/cli.rb +48 -0
  41. data/lib/dx/deploy.rb +13 -0
  42. data/lib/dx/structure.rb +13 -0
  43. data/lib/dx/version.rb +3 -0
  44. data/lib/templates/pug/.babelrc +8 -0
  45. data/lib/templates/pug/assets/css/index.styl +13 -0
  46. data/lib/templates/pug/assets/css/normalize.css +1 -0
  47. data/lib/templates/pug/assets/js/index.js +25 -0
  48. data/lib/templates/pug/assets/js/lib/splitText.js +1 -0
  49. data/lib/templates/pug/assets/js/mouse.js +76 -0
  50. data/lib/templates/pug/build/client56e64b699755b52e5a2d.css +18 -0
  51. data/lib/templates/pug/build/client56e64b699755b52e5a2d.js +1 -0
  52. data/lib/templates/pug/build/webpack.stats.json +1 -0
  53. data/lib/templates/pug/index.js +35 -0
  54. data/lib/templates/pug/package-lock.json +9117 -0
  55. data/lib/templates/pug/package.json +60 -0
  56. data/lib/templates/pug/queries.js +32 -0
  57. data/lib/templates/pug/views/index.pug +20 -0
  58. data/lib/templates/pug/views/layout.pug +14 -0
  59. data/lib/templates/pug/views/mixins.pug +4 -0
  60. data/lib/templates/pug/views/partials/footer.pug +2 -0
  61. data/lib/templates/pug/views/partials/header.pug +1 -0
  62. data/lib/templates/pug/views/show.pug +4 -0
  63. data/lib/templates/pug/webpack.js +158 -0
  64. data/lib/templates/pug/yarn.lock +5666 -0
  65. metadata +291 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 34e08c08f9652926cd3990ffda906caa8e4eb13be203b097f6b2de8b8c8b4be0
4
+ data.tar.gz: bc582a81ef4ef37d98b9a81fa01d9b043c51ec45581da3cc2b206cf1238b4255
5
+ SHA512:
6
+ metadata.gz: 7310a398d99543d97b4302bf10228a95c5cf3ebade2bb787c35546dedd481723eb0eed46a5838c60858a377cb9ee98e52d1904cb0953e7050b5661b47aac4c23
7
+ data.tar.gz: 4ad822eab4a968a41db19ac9ef1a4f3356f4136184b7fc4cdef84dee7667c3b3feadad277897163dcdd3ec6aeaa38cbfc373f349b3288a720744ff220f4ee34a
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+ /*.gem
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.0
5
+ before_install: gem install bundler -v 1.16.0
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at ben@dee.mx. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in deemx.gemspec
6
+ gemspec
@@ -0,0 +1,108 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ deemx (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ addressable (2.5.2)
10
+ public_suffix (>= 2.0.2, < 4.0)
11
+ aruba (0.14.2)
12
+ childprocess (~> 0.5.6)
13
+ contracts (~> 0.9)
14
+ cucumber (>= 1.3.19)
15
+ ffi (~> 1.9.10)
16
+ rspec-expectations (>= 2.99)
17
+ thor (~> 0.19)
18
+ backports (3.10.3)
19
+ builder (3.2.3)
20
+ childprocess (0.5.9)
21
+ ffi (~> 1.0, >= 1.0.11)
22
+ contracts (0.16.0)
23
+ cucumber (3.0.2)
24
+ builder (>= 2.1.2)
25
+ cucumber-core (~> 3.0.0)
26
+ cucumber-expressions (~> 4.0.3)
27
+ cucumber-wire (~> 0.0.1)
28
+ diff-lcs (~> 1.3)
29
+ gherkin (~> 4.0)
30
+ multi_json (>= 1.7.5, < 2.0)
31
+ multi_test (>= 0.1.2)
32
+ cucumber-core (3.0.0)
33
+ backports (>= 3.8.0)
34
+ cucumber-tag_expressions (>= 1.0.1)
35
+ gherkin (>= 4.1.3)
36
+ cucumber-expressions (4.0.4)
37
+ cucumber-tag_expressions (1.0.1)
38
+ cucumber-wire (0.0.1)
39
+ curb (0.9.4)
40
+ diff-lcs (1.3)
41
+ equatable (0.5.0)
42
+ ffi (1.9.18)
43
+ gherkin (4.1.3)
44
+ hitimes (1.2.6)
45
+ launchy (2.4.3)
46
+ addressable (~> 2.3)
47
+ multi_json (1.12.2)
48
+ multi_test (0.1.2)
49
+ necromancer (0.4.0)
50
+ pastel (0.7.2)
51
+ equatable (~> 0.5.0)
52
+ tty-color (~> 0.4.0)
53
+ public_suffix (3.0.1)
54
+ rake (12.3.0)
55
+ rspec (3.7.0)
56
+ rspec-core (~> 3.7.0)
57
+ rspec-expectations (~> 3.7.0)
58
+ rspec-mocks (~> 3.7.0)
59
+ rspec-core (3.7.0)
60
+ rspec-support (~> 3.7.0)
61
+ rspec-expectations (3.7.0)
62
+ diff-lcs (>= 1.2.0, < 2.0)
63
+ rspec-support (~> 3.7.0)
64
+ rspec-mocks (3.7.0)
65
+ diff-lcs (>= 1.2.0, < 2.0)
66
+ rspec-support (~> 3.7.0)
67
+ rspec-support (3.7.0)
68
+ thor (0.20.0)
69
+ timers (4.1.2)
70
+ hitimes
71
+ tty-color (0.4.2)
72
+ tty-cursor (0.5.0)
73
+ tty-file (0.4.0)
74
+ diff-lcs (~> 1.3.0)
75
+ pastel (~> 0.7.1)
76
+ tty-prompt (~> 0.13.2)
77
+ tty-prompt (0.13.2)
78
+ necromancer (~> 0.4.0)
79
+ pastel (~> 0.7.0)
80
+ timers (~> 4.1.2)
81
+ tty-cursor (~> 0.5.0)
82
+ tty-reader (~> 0.1.0)
83
+ tty-reader (0.1.0)
84
+ wisper (~> 2.0.0)
85
+ tty-spinner (0.7.0)
86
+ tty-cursor (>= 0.5.0)
87
+ wisper (2.0.0)
88
+
89
+ PLATFORMS
90
+ ruby
91
+
92
+ DEPENDENCIES
93
+ aruba
94
+ bundler
95
+ cucumber
96
+ curb
97
+ deemx!
98
+ launchy
99
+ rake
100
+ rspec
101
+ thor
102
+ tty-file
103
+ tty-prompt
104
+ tty-reader
105
+ tty-spinner
106
+
107
+ BUNDLED WITH
108
+ 1.16.0
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 bbnnt
4
+
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
@@ -0,0 +1,43 @@
1
+ # Deemx
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/deemx`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'deemx'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install deemx
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/deemx. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the Deemx project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/deemx/blob/master/CODE_OF_CONDUCT.md).
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "dx"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start(__FILE__)
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,2 @@
1
+ system('gem build dx.gemspec')
2
+ system("gem install --local ~/Desktop/deemx.gem/dx-0.1.0.gem")
@@ -0,0 +1,8 @@
1
+ {
2
+ "presets": [
3
+ "es2015",
4
+ "react",
5
+ "stage-0"
6
+ ],
7
+ "plugins": ["transform-class-properties"]
8
+ }
@@ -0,0 +1,13 @@
1
+ @import './normalize.css'
2
+
3
+ html, body
4
+ margin: 0
5
+ background: yellow
6
+ padding: 2rem
7
+ font-family: Helvetica
8
+
9
+ #output
10
+ position: absolute
11
+ text-transform: uppercase
12
+ white-space: nowrap
13
+ pointer-events: none
@@ -0,0 +1 @@
1
+ article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none;height:0}[hidden]{display:none}html{font-size:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}html,button,input,select,textarea{font-family:sans-serif}body{margin:0}a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em;margin:.83em 0}h3{font-size:1.17em;margin:1em 0}h4{font-size:1em;margin:1.33em 0}h5{font-size:.83em;margin:1.67em 0}h6{font-size:.67em;margin:2.33em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}blockquote{margin:1em 40px}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}p,pre{margin:1em 0}code,kbd,pre,samp{font-family:monospace,serif;_font-family:'courier new',monospace;font-size:1em}pre{white-space:pre;white-space:pre-wrap;word-wrap:break-word}q{quotes:none}q:before,q:after{content:'';content:none}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}dl,menu,ol,ul{margin:1em 0}dd{margin:0 0 0 40px}menu,ol,ul{padding:0 0 0 40px}nav ul,nav ol{list-style:none;list-style-image:none}img{border:0;-ms-interpolation-mode:bicubic}svg:not(:root){overflow:hidden}figure{margin:0}form{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0;white-space:normal;*margin-left:-7px}button,input,select,textarea{font-size:100%;margin:0;vertical-align:baseline;*vertical-align:middle}button,input{line-height:normal}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer;*overflow:visible}button[disabled],html input[disabled]{cursor:default}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0;*height:13px;*width:13px}input[type="search"]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}[hidden]{display:none!important}#yui3-css-stamp.cssnormalize{display:none}
@@ -0,0 +1,25 @@
1
+ import _ from 'lodash'
2
+ import Highlight from 'highlight.js'
3
+ import ace from 'brace'
4
+ require('brace/mode/javascript')
5
+ require('brace/theme/monokai')
6
+
7
+ import gsap from 'gsap'
8
+
9
+ import '../css/index.styl'
10
+
11
+ import Mouse from './mouse'
12
+
13
+ // You js here
14
+
15
+ document.addEventListener("DOMContentLoaded", (event) => {
16
+
17
+ var editor = ace.edit("editor")
18
+ ace.getSession().setMode('ace/mode/yaml')
19
+ ace.getSession().setTabSize(2)
20
+ ace.setTheme('ace/theme/monokai')
21
+
22
+ Highlight.initHighlightingOnLoad()
23
+ Mouse.init()
24
+
25
+ });
@@ -0,0 +1 @@
1
+ var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;!function(e){"use strict";var t=e.GreenSockGlobals||e,i=function(e){var i,n=e.split("."),s=t;for(i=0;i<n.length;i++)s[n[i]]=s=s[n[i]]||{};return s},n=i("com.greensock.utils"),s=function(e){var t=e.nodeType,i="";if(1===t||9===t||11===t){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)i+=s(e)}else if(3===t||4===t)return e.nodeValue;return i},r=document,l=r.defaultView?r.defaultView.getComputedStyle:function(){},o=/([A-Z])/g,d=function(e,t,i,n){var s;return(i=i||l(e,null))?(e=i.getPropertyValue(t.replace(o,"-$1").toLowerCase()),s=e||i.length?e:i[t]):e.currentStyle&&(i=e.currentStyle,s=i[t]),n?s:parseInt(s,10)||0},p=function(e){return e.length&&e[0]&&(e[0].nodeType&&e[0].style&&!e.nodeType||e[0].length&&e[0][0])?!0:!1},a=function(e){var t,i,n,s=[],r=e.length;for(t=0;r>t;t++)if(i=e[t],p(i))for(n=i.length,n=0;n<i.length;n++)s.push(i[n]);else s.push(i);return s},h=/(?:\r|\n|\t\t)/g,u=/(?:\s\s+)/g,f=55296,c=56319,g=56320,y=127462,x=127487,S=127995,v=127999,b=function(e){return(e.charCodeAt(0)-f<<10)+(e.charCodeAt(1)-g)+65536},_=r.all&&!r.addEventListener,m=" style='position:relative;display:inline-block;"+(_?"*display:inline;*zoom:1;'":"'"),C=function(e,t){e=e||"";var i=-1!==e.indexOf("++"),n=1;return i&&(e=e.split("++").join("")),function(){return"<"+t+m+(e?" class='"+e+(i?n++:"")+"'>":">")}},T=n.SplitText=t.SplitText=function(e,t){if("string"==typeof e&&(e=T.selector(e)),!e)throw"cannot split a null element.";this.elements=p(e)?a(e):[e],this.chars=[],this.words=[],this.lines=[],this._originals=[],this.vars=t||{},this.split(t)},N=function(e,t,i){var n=e.nodeType;if(1===n||9===n||11===n)for(e=e.firstChild;e;e=e.nextSibling)N(e,t,i);else(3===n||4===n)&&(e.nodeValue=e.nodeValue.split(t).join(i))},w=function(e,t){var i=t.length;for(;--i>-1;)e.push(t[i])},A=function(e){var t,i=[],n=e.length;for(t=0;t!==n;i.push(e[t++]));return i},L=function(e,t,i){var n;for(;e&&e!==t;){if(n=e._next||e.nextSibling)return n.textContent.charAt(0)===i;e=e.parentNode||e._parent}return!1},B=function(e){var t,i,n=A(e.childNodes),s=n.length;for(t=0;s>t;t++)i=n[t],i._isSplit?B(i):(t&&3===i.previousSibling.nodeType?i.previousSibling.nodeValue+=3===i.nodeType?i.nodeValue:i.firstChild.nodeValue:3!==i.nodeType&&e.insertBefore(i.firstChild,i),e.removeChild(i))},V=function(e,t,i,n,s,o,p){var a,h,u,f,c,g,y,x,S,v,b,_,m=l(e),C=d(e,"paddingLeft",m),T=-999,A=d(e,"borderBottomWidth",m)+d(e,"borderTopWidth",m),V=d(e,"borderLeftWidth",m)+d(e,"borderRightWidth",m),W=d(e,"paddingTop",m)+d(e,"paddingBottom",m),H=d(e,"paddingLeft",m)+d(e,"paddingRight",m),E=.2*d(e,"fontSize"),k=d(e,"textAlign",m,!0),O=[],R=[],j=[],M=t.wordDelimiter||" ",G=t.span?"span":"div",$=t.type||t.split||"chars,words,lines",q=s&&-1!==$.indexOf("lines")?[]:null,z=-1!==$.indexOf("words"),D=-1!==$.indexOf("chars"),F="absolute"===t.position||t.absolute===!0,I=t.linesClass,P=-1!==(I||"").indexOf("++"),Q=[];for(q&&1===e.children.length&&e.children[0]._isSplit&&(e=e.children[0]),P&&(I=I.split("++").join("")),h=e.getElementsByTagName("*"),u=h.length,c=[],a=0;u>a;a++)c[a]=h[a];if(q||F)for(a=0;u>a;a++)f=c[a],g=f.parentNode===e,(g||F||D&&!z)&&(_=f.offsetTop,q&&g&&Math.abs(_-T)>E&&("BR"!==f.nodeName||0===a)&&(y=[],q.push(y),T=_),F&&(f._x=f.offsetLeft,f._y=_,f._w=f.offsetWidth,f._h=f.offsetHeight),q&&((f._isSplit&&g||!D&&g||z&&g||!z&&f.parentNode.parentNode===e&&!f.parentNode._isSplit)&&(y.push(f),f._x-=C,L(f,e,M)&&(f._wordEnd=!0)),"BR"===f.nodeName&&(f.nextSibling&&"BR"===f.nextSibling.nodeName||0===a)&&q.push([])));for(a=0;u>a;a++)f=c[a],g=f.parentNode===e,"BR"!==f.nodeName?(F&&(S=f.style,z||g||(f._x+=f.parentNode._x,f._y+=f.parentNode._y),S.left=f._x+"px",S.top=f._y+"px",S.position="absolute",S.display="block",S.width=f._w+1+"px",S.height=f._h+"px"),!z&&D?f._isSplit?(f._next=f.nextSibling,f.parentNode.appendChild(f)):f.parentNode._isSplit?(f._parent=f.parentNode,!f.previousSibling&&f.firstChild&&(f.firstChild._isFirst=!0),f.nextSibling&&" "===f.nextSibling.textContent&&!f.nextSibling.nextSibling&&Q.push(f.nextSibling),f._next=f.nextSibling&&f.nextSibling._isFirst?null:f.nextSibling,f.parentNode.removeChild(f),c.splice(a--,1),u--):g||(_=!f.nextSibling&&L(f.parentNode,e,M),f.parentNode._parent&&f.parentNode._parent.appendChild(f),_&&f.parentNode.appendChild(r.createTextNode(" ")),t.span&&(f.style.display="inline"),O.push(f)):f.parentNode._isSplit&&!f._isSplit&&""!==f.innerHTML?R.push(f):D&&!f._isSplit&&(t.span&&(f.style.display="inline"),O.push(f))):q||F?(f.parentNode&&f.parentNode.removeChild(f),c.splice(a--,1),u--):z||e.appendChild(f);for(a=Q.length;--a>-1;)Q[a].parentNode.removeChild(Q[a]);if(q){for(F&&(v=r.createElement(G),e.appendChild(v),b=v.offsetWidth+"px",_=v.offsetParent===e?0:e.offsetLeft,e.removeChild(v)),S=e.style.cssText,e.style.cssText="display:none;";e.firstChild;)e.removeChild(e.firstChild);for(x=" "===M&&(!F||!z&&!D),a=0;a<q.length;a++){for(y=q[a],v=r.createElement(G),v.style.cssText="display:block;text-align:"+k+";position:"+(F?"absolute;":"relative;"),I&&(v.className=I+(P?a+1:"")),j.push(v),u=y.length,h=0;u>h;h++)"BR"!==y[h].nodeName&&(f=y[h],v.appendChild(f),x&&f._wordEnd&&v.appendChild(r.createTextNode(" ")),F&&(0===h&&(v.style.top=f._y+"px",v.style.left=C+_+"px"),f.style.top="0px",_&&(f.style.left=f._x-_+"px")));0===u?v.innerHTML="&nbsp;":z||D||(B(v),N(v,String.fromCharCode(160)," ")),F&&(v.style.width=b,v.style.height=f._h+"px"),e.appendChild(v)}e.style.cssText=S}F&&(p>e.clientHeight&&(e.style.height=p-W+"px",e.clientHeight<p&&(e.style.height=p+A+"px")),o>e.clientWidth&&(e.style.width=o-H+"px",e.clientWidth<o&&(e.style.width=o+V+"px"))),w(i,O),w(n,R),w(s,j)},W=function(e,t,i,n){var l,o,d,p,a,g,_,m,C,T=t.span?"span":"div",w=t.type||t.split||"chars,words,lines",A=-1!==w.indexOf("chars"),L="absolute"===t.position||t.absolute===!0,B=t.wordDelimiter||" ",V=" "!==B?"":L?"&#173; ":" ",W=t.span?"</span>":"</div>",H=!0,E=r.createElement("div"),k=e.parentNode;for(k.insertBefore(E,e),E.textContent=e.nodeValue,k.removeChild(e),e=E,l=s(e),_=-1!==l.indexOf("<"),t.reduceWhiteSpace!==!1&&(l=l.replace(u," ").replace(h,"")),_&&(l=l.split("<").join("{{LT}}")),a=l.length,o=(" "===l.charAt(0)?V:"")+i(),d=0;a>d;d++)if(g=l.charAt(d),g===B&&l.charAt(d-1)!==B&&d){for(o+=H?W:"",H=!1;l.charAt(d+1)===B;)o+=V,d++;d===a-1?o+=V:")"!==l.charAt(d+1)&&(o+=V+i(),H=!0)}else"{"===g&&"{{LT}}"===l.substr(d,6)?(o+=A?n()+"{{LT}}</"+T+">":"{{LT}}",d+=5):g.charCodeAt(0)>=f&&g.charCodeAt(0)<=c||l.charCodeAt(d+1)>=65024&&l.charCodeAt(d+1)<=65039?(m=b(l.substr(d,2)),C=b(l.substr(d+2,2)),p=(y>m||m>x||y>C||C>x)&&(S>C||C>v)?2:4,o+=A&&" "!==g?n()+l.substr(d,p)+"</"+T+">":l.substr(d,p),d+=p-1):o+=A&&" "!==g?n()+g+"</"+T+">":g;e.outerHTML=o+(H?W:""),_&&N(k,"{{LT}}","<")},H=function(e,t,i,n){var s,r,l=A(e.childNodes),o=l.length,p="absolute"===t.position||t.absolute===!0;if(3!==e.nodeType||o>1){for(t.absolute=!1,s=0;o>s;s++)r=l[s],(3!==r.nodeType||/\S+/.test(r.nodeValue))&&(p&&3!==r.nodeType&&"inline"===d(r,"display",null,!0)&&(r.style.display="inline-block",r.style.position="relative"),r._isSplit=!0,H(r,t,i,n));return t.absolute=p,void(e._isSplit=!0)}W(e,t,i,n)},E=T.prototype;E.split=function(e){this.isSplit&&this.revert(),this.vars=e=e||this.vars,this._originals.length=this.chars.length=this.words.length=this.lines.length=0;var t,i,n,s=this.elements.length,r=e.span?"span":"div",l=C(e.wordsClass,r),o=C(e.charsClass,r);for(;--s>-1;)n=this.elements[s],this._originals[s]=n.innerHTML,t=n.clientHeight,i=n.clientWidth,H(n,e,l,o),V(n,e,this.chars,this.words,this.lines,i,t);return this.chars.reverse(),this.words.reverse(),this.lines.reverse(),this.isSplit=!0,this},E.revert=function(){if(!this._originals)throw"revert() call wasn't scoped properly.";var e=this._originals.length;for(;--e>-1;)this.elements[e].innerHTML=this._originals[e];return this.chars=[],this.words=[],this.lines=[],this.isSplit=!1,this},T.selector=e.$||e.jQuery||function(t){var i=e.$||e.jQuery;return i?(T.selector=i,i(t)):"undefined"==typeof document?t:document.querySelectorAll?document.querySelectorAll(t):document.getElementById("#"===t.charAt(0)?t.substr(1):t)},T.version="0.5.8"}(_gsScope),function(e){"use strict";var t=function(){return(_gsScope.GreenSockGlobals||_gsScope)[e]};"undefined"!=typeof module&&module.exports?module.exports=t():"function"==typeof define&&define.amd&&define([],t)}("SplitText");
@@ -0,0 +1,76 @@
1
+ import SplitText from './lib/splitText'
2
+ import { TweenMax } from "gsap"
3
+
4
+ const Mouse = {
5
+ last_position: {
6
+ x: 0,
7
+ y: 0
8
+ },
9
+ text: null,
10
+ chars: null,
11
+ output: null,
12
+
13
+ init: function(){
14
+
15
+ document.addEventListener('mousemove', Mouse.modifieTexte, false)
16
+ Mouse.text = new SplitText("#output", { type: "chars" })
17
+ Mouse.chars = Mouse.text.chars
18
+ Mouse.output = document.getElementById("output")
19
+
20
+ },
21
+
22
+ modifieTexte: function(e){
23
+
24
+ let { chars, last_position, output } = Mouse;
25
+
26
+ var restore;
27
+ var deltaX = last_position.x - event.offsetX,
28
+ deltaY = last_position.y - event.offsetY;
29
+
30
+ if (deltaX > 20) deltaX = 20
31
+ if (deltaY > 20) deltaY = 20
32
+ if (deltaX < -20) deltaX = -20
33
+ if (deltaY < -20) deltaY = -20
34
+
35
+ if (true) {
36
+
37
+ TweenMax.staggerTo( chars, 0.5, {
38
+ cycle: {
39
+ x: function(index, target) {
40
+ return index * index / 3 * deltaX / 2;
41
+ },
42
+ y: function(index, target) {
43
+ return index * index / 3 * deltaY / 2;
44
+ },
45
+ ease: Expo.easeInOut,
46
+ force3D: true
47
+ }
48
+ })
49
+
50
+ window.clearTimeout(restore)
51
+ restore = setTimeout(function() {
52
+ TweenMax.staggerTo( chars, 0.2, {
53
+ x: 0,
54
+ y: 0
55
+ });
56
+ })
57
+
58
+ }
59
+
60
+ TweenLite.to( output, 0.1, {
61
+ top: event.pageY - 20,
62
+ left: event.pageX - 20
63
+ })
64
+
65
+ last_position = {
66
+ x: event.offsetX,
67
+ y: event.offsetY,
68
+ ease: Expo.easeInOut
69
+ }
70
+
71
+ }
72
+
73
+ }
74
+
75
+
76
+ export default Mouse