lato 0.1.42 → 0.1.44

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 457bb704321e6908156f6ba84d8f3a915256fc0ff59358b51e0f1ec5136ac911
4
- data.tar.gz: ede8652651a55487fa9c347a25339dd38680126fe6e1623cd5fe06ad4231070c
3
+ metadata.gz: 560743ac91d34285c3a1a14369638483ca28d3d2bc6d22227f648c794d7bd61e
4
+ data.tar.gz: 92b1bfe12065f7f84bbba9b71f451881c59329da2057b7780697a199a871693a
5
5
  SHA512:
6
- metadata.gz: 4975c3061dd1abf8e266b60361d7312651c13388bb3e038adcb095fdde8df4ad6c6887979d54f3b22b62e26ad280bc7d8587be9efa82bb4c424c963085f01aa6
7
- data.tar.gz: d15b1650e38924b913daa37058610429fab02344e5f3c952f1cd1dee153e11e57f6254bdaca60a880fd6c3fe235959ffc5ff154483883b0a7a254c5d07d21748
6
+ metadata.gz: 723a1c8ea05d63e3e6c4f1f8b1fb50fbdfa86062627c78da29e2b11cfa0d6a3347aaab1278253a9e03cc0067d88873d0dd3c07138a51f8388c72a0539c948f32
7
+ data.tar.gz: d71032b716971f96ca2d8309c1863e1c6a17388ff45ed3af39c35ef2b03896f27a5965f3470d97dc59e4ca7c7b9302515c540ff7be914d364d1328469a0252aa
@@ -5,14 +5,49 @@ import "bootstrap"
5
5
  // Import controllers (stimulus rails)
6
6
  import "controllers"
7
7
 
8
- // Close sidebar before page change with turbo
9
- document.addEventListener("turbo:before-visit", (e) => {
10
- document.body.classList.remove('aside-open')
8
+ /**
9
+ * Manage page transitions
10
+ */
11
+
12
+ const PAGE_TRANSITION_TIME = 150
13
+
14
+ document.addEventListener('DOMContentLoaded', () => {
15
+ console.log('DOMContentLoaded')
16
+
17
+ // add is-loaded class
18
+ document.body.classList.add('is-loaded')
19
+ })
20
+
21
+ document.addEventListener('turbo:load', () => {
22
+ console.log('turbo:load')
23
+
24
+ setTimeout(() => {
25
+ // add is-loaded class
26
+ document.body.classList.add('is-loaded')
27
+ }, PAGE_TRANSITION_TIME)
11
28
  })
12
29
 
13
- // Close all boostrap modals before page change with turbo
14
- document.addEventListener("turbo:before-visit", (e) => {
15
- document.querySelectorAll('.modal').forEach((modal) => {
16
- modal.classList.remove('show')
30
+ document.addEventListener('turbo:before-render', (e) => {
31
+ console.log('turbo:before-render')
32
+
33
+ e.preventDefault()
34
+
35
+ // remove is-loaded class
36
+ document.body.classList.remove('is-loaded')
37
+
38
+ // hide modals and make body scrollable
39
+ document.querySelectorAll('.modal.show').forEach((el) => {
40
+ el.classList.remove('show')
41
+ el.style.display = 'none'
17
42
  })
18
- })
43
+ document.querySelectorAll('.modal-backdrop').forEach((el) => {
44
+ el.remove()
45
+ })
46
+ document.body.classList.remove('modal-open')
47
+ document.body.style.paddingRight = ''
48
+ document.body.style.overflow = ''
49
+
50
+ setTimeout(() => {
51
+ e.detail.resume()
52
+ }, PAGE_TRANSITION_TIME)
53
+ })
@@ -81,7 +81,16 @@ export default class extends Controller {
81
81
  const index = this.getFreeModalIndex()
82
82
 
83
83
  if (options.turboFrame && options.turboFrame != '_top') {
84
- this.modalBodyTargets[index].innerHTML = `<turbo-frame id="${options.turboFrame}"></turbo-frame>`
84
+ this.modalBodyTargets[index].innerHTML = `
85
+ <turbo-frame id="${options.turboFrame}">
86
+ <div class="placeholder-glow">
87
+ <span class="placeholder placeholder-lg col-12"></span>
88
+ <span class="placeholder placeholder-lg col-12"></span>
89
+ <span class="placeholder placeholder-lg col-12"></span>
90
+ <span class="placeholder placeholder-lg col-12"></span>
91
+ </div>
92
+ </turbo-frame>
93
+ `
85
94
 
86
95
  if (options.actionTitle) {
87
96
  this.modalTitleTargets[index].innerHTML = options.actionTitle
@@ -24,8 +24,18 @@
24
24
 
25
25
  /** Custom style */
26
26
 
27
+ body {
28
+ &.is-loaded {
29
+ main {
30
+ opacity: 1;
31
+ }
32
+ }
33
+ }
34
+
27
35
  main {
28
36
  width: 100%;
37
+ opacity: 0;
38
+ transition: opacity 0.15s ease-in-out;
29
39
  }
30
40
 
31
41
  main, aside {
data/lib/lato/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lato
2
- VERSION = "0.1.42"
2
+ VERSION = "0.1.44"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lato
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.42
4
+ version: 0.1.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-03-09 00:00:00.000000000 Z
11
+ date: 2023-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails