@hortonstudio/main 1.2.35 → 1.4.1
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.
- package/.claude/settings.local.json +22 -1
- package/TEMP-before-after-attributes.md +158 -0
- package/animations/hero.js +741 -611
- package/animations/text.js +532 -317
- package/animations/transition.js +36 -21
- package/autoInit/accessibility.js +173 -50
- package/autoInit/counter.js +338 -0
- package/autoInit/form.js +471 -0
- package/autoInit/modal.js +43 -38
- package/autoInit/navbar.js +494 -371
- package/autoInit/smooth-scroll.js +86 -84
- package/index.js +138 -88
- package/package.json +1 -1
- package/utils/before-after.js +279 -146
- package/utils/scroll-progress.js +26 -21
- package/utils/toc.js +73 -66
- package/CLAUDE.md +0 -45
- package/debug-version.html +0 -37
@@ -39,7 +39,28 @@
|
|
39
39
|
"Bash(git checkout:*)",
|
40
40
|
"Bash(rg:*)",
|
41
41
|
"Bash(/usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg -n \"data-hs-heroconfig\" /Users/devan/Documents/custom-code/main/animations/hero.js)",
|
42
|
-
"Bash(/usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg -n \"data-hs-config\" /Users/devan/Documents/custom-code/main/animations/hero.js)"
|
42
|
+
"Bash(/usr/local/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg -n \"data-hs-config\" /Users/devan/Documents/custom-code/main/animations/hero.js)",
|
43
|
+
"Bash(node:*)",
|
44
|
+
"Bash(npm run:*)",
|
45
|
+
"Bash(test:*)",
|
46
|
+
"Bash(~/.claude/hooks/smart-lint.sh:*)",
|
47
|
+
"Bash(bash:*)",
|
48
|
+
"Bash(npm install:*)",
|
49
|
+
"Bash(eslint --version)",
|
50
|
+
"Bash(prettier --version)",
|
51
|
+
"Bash(npm test)",
|
52
|
+
"Bash(cat:*)",
|
53
|
+
"Bash(~/.claude/hooks/violation-status.sh:*)",
|
54
|
+
"Bash(make lint:*)",
|
55
|
+
"Bash(make test:*)",
|
56
|
+
"Bash(make fmt:*)",
|
57
|
+
"Bash(eslint:*)",
|
58
|
+
"Bash(prettier --check \"**/*.js\")",
|
59
|
+
"Bash(prettier:*)",
|
60
|
+
"Bash(npx depcheck:*)",
|
61
|
+
"Bash(npx prettier:*)",
|
62
|
+
"Bash(npx prettier:*)",
|
63
|
+
"Bash(npx prettier:*)"
|
43
64
|
],
|
44
65
|
"deny": []
|
45
66
|
}
|
@@ -0,0 +1,158 @@
|
|
1
|
+
# Before-After Component Attributes Guide
|
2
|
+
|
3
|
+
This is a temporary reference for the `data-hs-ba` attributes used in the before-after utility.
|
4
|
+
|
5
|
+
## Required Structure
|
6
|
+
|
7
|
+
### Main Container
|
8
|
+
```html
|
9
|
+
<div data-hs-ba="wrapper">
|
10
|
+
<!-- All before-after content goes here -->
|
11
|
+
</div>
|
12
|
+
```
|
13
|
+
|
14
|
+
### Individual Slide/Item
|
15
|
+
Each comparison should be a direct child of the wrapper:
|
16
|
+
```html
|
17
|
+
<div data-hs-ba="wrapper">
|
18
|
+
<div class="slide-1">
|
19
|
+
<!-- First comparison -->
|
20
|
+
</div>
|
21
|
+
<div class="slide-2">
|
22
|
+
<!-- Second comparison -->
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
```
|
26
|
+
|
27
|
+
## Image Elements
|
28
|
+
|
29
|
+
### Image Wrapper Container
|
30
|
+
```html
|
31
|
+
<div data-hs-ba="image-wrapper">
|
32
|
+
<!-- Before and after images go inside here -->
|
33
|
+
</div>
|
34
|
+
```
|
35
|
+
|
36
|
+
### Before Image
|
37
|
+
```html
|
38
|
+
<img src="before.jpg" data-hs-ba="image-before" alt="Before image">
|
39
|
+
```
|
40
|
+
|
41
|
+
### After Image
|
42
|
+
```html
|
43
|
+
<img src="after.jpg" data-hs-ba="image-after" alt="After image">
|
44
|
+
```
|
45
|
+
|
46
|
+
## Interactive Controls
|
47
|
+
|
48
|
+
### Mode Buttons
|
49
|
+
```html
|
50
|
+
<!-- Show only before image -->
|
51
|
+
<button data-hs-ba="mode-before">Before</button>
|
52
|
+
|
53
|
+
<!-- Show split view with slider -->
|
54
|
+
<button data-hs-ba="mode-split">Split</button>
|
55
|
+
|
56
|
+
<!-- Show only after image -->
|
57
|
+
<button data-hs-ba="mode-after">After</button>
|
58
|
+
```
|
59
|
+
|
60
|
+
### Navigation Arrows
|
61
|
+
```html
|
62
|
+
<!-- Previous slide -->
|
63
|
+
<button data-hs-ba="left">←</button>
|
64
|
+
|
65
|
+
<!-- Next slide -->
|
66
|
+
<button data-hs-ba="right">→</button>
|
67
|
+
```
|
68
|
+
|
69
|
+
### Slider Handle (for split mode)
|
70
|
+
```html
|
71
|
+
<div data-hs-ba="slider"></div>
|
72
|
+
```
|
73
|
+
|
74
|
+
## Pagination
|
75
|
+
|
76
|
+
### Pagination Container with Template
|
77
|
+
```html
|
78
|
+
<div data-hs-ba="pagination">
|
79
|
+
<!-- Single template dot - system will clone this for each slide -->
|
80
|
+
<div class="ba_1_pagination_dot"></div>
|
81
|
+
</div>
|
82
|
+
```
|
83
|
+
|
84
|
+
**How it works**:
|
85
|
+
- Place ONE template dot inside the pagination container
|
86
|
+
- The system will automatically clone this template for each slide
|
87
|
+
- Each generated dot gets proper accessibility attributes
|
88
|
+
- The `is-active` class is automatically managed
|
89
|
+
|
90
|
+
**Generated Structure** (example with 3 slides):
|
91
|
+
```html
|
92
|
+
<div data-hs-ba="pagination">
|
93
|
+
<div class="ba_1_pagination_dot is-active" role="button" tabindex="0" aria-label="Go to slide 1" aria-current="true"></div>
|
94
|
+
<div class="ba_1_pagination_dot" role="button" tabindex="0" aria-label="Go to slide 2" aria-current="false"></div>
|
95
|
+
<div class="ba_1_pagination_dot" role="button" tabindex="0" aria-label="Go to slide 3" aria-current="false"></div>
|
96
|
+
</div>
|
97
|
+
```
|
98
|
+
|
99
|
+
## Complete Example
|
100
|
+
|
101
|
+
```html
|
102
|
+
<div data-hs-ba="wrapper">
|
103
|
+
<!-- Slide 1 -->
|
104
|
+
<div class="ba-slide">
|
105
|
+
<div data-hs-ba="image-wrapper" class="ba-image_wrap">
|
106
|
+
<img src="before1.jpg" data-hs-ba="image-before" alt="Before">
|
107
|
+
<img src="after1.jpg" data-hs-ba="image-after" alt="After">
|
108
|
+
<div data-hs-ba="slider"></div>
|
109
|
+
</div>
|
110
|
+
|
111
|
+
<!-- Mode controls -->
|
112
|
+
<div class="controls">
|
113
|
+
<button data-hs-ba="mode-before">Before</button>
|
114
|
+
<button data-hs-ba="mode-split" class="is-active">Split</button>
|
115
|
+
<button data-hs-ba="mode-after">After</button>
|
116
|
+
</div>
|
117
|
+
|
118
|
+
<!-- Navigation -->
|
119
|
+
<button data-hs-ba="left">Previous</button>
|
120
|
+
<button data-hs-ba="right">Next</button>
|
121
|
+
|
122
|
+
<!-- Pagination -->
|
123
|
+
<div data-hs-ba="pagination">
|
124
|
+
<div class="ba_1_pagination_dot"></div> <!-- Template dot -->
|
125
|
+
</div>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<!-- Slide 2 -->
|
129
|
+
<div class="ba-slide">
|
130
|
+
<!-- Similar structure... -->
|
131
|
+
</div>
|
132
|
+
|
133
|
+
<!-- Slide 3 -->
|
134
|
+
<div class="ba-slide">
|
135
|
+
<!-- Similar structure... -->
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
```
|
139
|
+
|
140
|
+
## Default Behavior
|
141
|
+
|
142
|
+
- **Default mode**: Split view at 50% position
|
143
|
+
- **Active states**: Elements with `is-active` class are highlighted
|
144
|
+
- **Keyboard support**: Arrow keys navigate slides or move slider
|
145
|
+
- **Touch support**: Dragging works on the slider handle
|
146
|
+
- **Accessibility**: Full ARIA support with proper labels
|
147
|
+
|
148
|
+
## Notes
|
149
|
+
|
150
|
+
- Each slide can have its own controls (mode buttons, navigation, pagination)
|
151
|
+
- The wrapper image container should have `data-hs-ba="image-wrapper"` for proper click handling
|
152
|
+
- Pagination dots are clicked to jump to specific slides
|
153
|
+
- Mode buttons toggle between before, split, and after views
|
154
|
+
- The slider only appears in split mode
|
155
|
+
|
156
|
+
---
|
157
|
+
|
158
|
+
*This is a temporary file for development reference. Delete when no longer needed.*
|