nk_jtb 0.20.0 → 0.21.0
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/.stylelintrc.json +2 -1
- package/_root.scss +31 -0
- package/_themes.scss +165 -0
- package/dev.html +205 -4
- package/dev1.html +205 -2
- package/dev2.html +2 -2
- package/examples/accordion.html +210 -0
- package/examples/dropdown.html +75 -0
- package/examples/examples-to-sort.html +1729 -0
- package/{flexbox.html → examples/flexbox.html} +17 -17
- package/examples/laravel-page-layout.html +227 -0
- package/examples/navigation-and-menus.html +220 -0
- package/examples/pagination.html +153 -0
- package/examples/sidebar.html +315 -0
- package/examples.html +1041 -0
- package/index.html +84 -1225
- package/package.json +1 -1
- package/readme.md +26 -4
- package/src/base/_auto-spacing.scss +44 -0
- package/src/base/_base.scss +31 -33
- package/src/base/_list.scss +8 -17
- package/src/base/_typography.scss +20 -17
- package/src/base/index.scss +1 -1
- package/src/build.scss +0 -1
- package/src/common-tools.scss +1 -0
- package/src/components/_accordion.scss +48 -56
- package/src/components/_box.scss +11 -14
- package/src/components/_button.scss +29 -12
- package/src/components/_dropdown.scss +10 -10
- package/src/components/_icon.scss +2 -2
- package/src/components/_list.scss +7 -7
- package/src/components/_menu.scss +15 -9
- package/src/components/_navbar.scss +4 -15
- package/src/components/_other.scss +13 -13
- package/src/components/_tabs.scss +5 -5
- package/src/extras/_nk-app.scss +20 -18
- package/src/extras/_nk-docs.scss +29 -175
- package/src/forms/_control.scss +2 -2
- package/src/forms/_form.scss +5 -5
- package/src/forms/_toggle.scss +16 -16
- package/src/functions/_classes.scss +132 -18
- package/src/functions/_color-functions.scss +13 -12
- package/src/functions/_map-and-list-helpers.scss +6 -6
- package/src/functions/_strings.scss +45 -13
- package/src/maps_and_variables/_base.scss +30 -9
- package/src/maps_and_variables/_components.scss +6 -14
- package/src/maps_and_variables/_config.scss +86 -29
- package/src/maps_and_variables/_form-controls.scss +2 -2
- package/src/maps_and_variables/_property-and-value-maps.scss +50 -0
- package/src/maps_and_variables/_property-maps.scss +4 -49
- package/src/maps_and_variables/_utility-maps.scss +10 -27
- package/src/maps_and_variables/index.scss +1 -3
- package/src/mixins/_backgrounds.scss +25 -0
- package/src/mixins/_build-classes.scss +5 -4
- package/src/mixins/_build-magic-classes.scss +20 -13
- package/src/mixins/_build-magic-grid.scss +3 -3
- package/src/mixins/_make-classes.scss +31 -51
- package/src/mixins/_media.scss +4 -4
- package/src/mixins/_property-makers.scss +5 -5
- package/src/mixins/_transition.scss +88 -0
- package/src/play.scss +1 -2
- package/src/utilities/_alignment.scss +46 -39
- package/src/utilities/_backgrounds.scss +2 -23
- package/src/utilities/_border.scss +7 -7
- package/src/utilities/_color.scss +4 -4
- package/src/utilities/_container.scss +2 -2
- package/src/utilities/_display-visibility.scss +2 -2
- package/src/utilities/_flexbox.scss +18 -38
- package/src/utilities/_grid.scss +10 -8
- package/src/utilities/_interactivity.scss +2 -2
- package/src/utilities/_layout.scss +2 -2
- package/src/utilities/_misc.scss +8 -23
- package/src/utilities/_sizing.scss +2 -2
- package/src/utilities/_spacing.scss +29 -9
- package/src/utilities/_themes.scss +2 -2
- package/src/utilities/_transition.scss +45 -8
- package/src/utilities/_typography.scss +13 -13
- package/.vscode/settings.json +0 -3
- package/src/base/_content_gap.scss +0 -47
- package/src/maps_and_variables/_layout.scss +0 -21
- package/src/maps_and_variables/_position-maps.scss +0 -62
- package/src/maps_and_variables/_values-variants-and-properties.scss +0 -43
- package/tmp427/_state.scss +0 -20
- package/tmp427/_typography.scss +0 -36
- package/tmp427/_utils-to-add.scss +0 -64
- /package/{directory-structure.md → docs/directory-structure.md} +0 -0
- /package/{resolvers.md → docs/resolvers.md} +0 -0
- /package/{layout-examples.html → examples/layout-examples.html} +0 -0
package/.stylelintrc.json
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"scss/comment-no-empty": null,
|
|
12
12
|
"order/properties-alphabetical-order": true,
|
|
13
13
|
"scss/dollar-variable-colon-space-after": "always",
|
|
14
|
-
"scss/dollar-variable-empty-line-before": null
|
|
14
|
+
"scss/dollar-variable-empty-line-before": null,
|
|
15
|
+
"hue-degree-notation": null
|
|
15
16
|
}
|
|
16
17
|
}
|
package/_root.scss
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
|
|
2
|
+
@use '../color-and-themes/themes' as *;
|
|
3
|
+
@use '../maps_and_variables/property-and-value-maps' as *;
|
|
4
|
+
@use 'sass:map';
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
// create css variables
|
|
8
|
+
@each $color, $value in $color-map {
|
|
9
|
+
--#{$color}: #{$value};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// Mixin to generate CSS custom properties from a theme map
|
|
14
|
+
@mixin theme-properties($theme-map) {
|
|
15
|
+
@each $property, $value in $theme-map {
|
|
16
|
+
--#{'' + $property}: #{$value};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
:root,
|
|
21
|
+
[data-theme='light'] {
|
|
22
|
+
@include theme-properties($light);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
[data-theme='dark'] {
|
|
26
|
+
@include theme-properties($dark);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
[data-theme='docs'] {
|
|
30
|
+
@include theme-properties($docs);
|
|
31
|
+
}
|
package/_themes.scss
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
@use 'colors' as c;
|
|
2
|
+
@use 'sass:map';
|
|
3
|
+
|
|
4
|
+
// prettier-ignore
|
|
5
|
+
$light: (
|
|
6
|
+
// Brand Colors - Primary Semantic Colors
|
|
7
|
+
color-primary: oklch(62.3% 0.214 259.815), // blue-500
|
|
8
|
+
color-secondary: oklch(37.2% 0.044 257.287), // slate-700
|
|
9
|
+
color-accent: oklch(79.5% 0.184 86.047), // yellow-500
|
|
10
|
+
|
|
11
|
+
// Typography - Text Colors
|
|
12
|
+
text-base: oklch(20.8% 0.042 265.755), // slate-900
|
|
13
|
+
text-muted: oklch(55.4% 0.046 257.417), // slate-500
|
|
14
|
+
text-heading: oklch(20.8% 0.042 265.755), // slate-900
|
|
15
|
+
text-lead: oklch(44.6% 0.043 257.281), // slate-600
|
|
16
|
+
|
|
17
|
+
// Links
|
|
18
|
+
text-link: oklch(58.8% 0.158 241.966), // sky-600
|
|
19
|
+
text-link-hover: oklch(50% 0.134 242.749), // sky-700
|
|
20
|
+
|
|
21
|
+
// Code
|
|
22
|
+
// text-code: oklch(54.1% 0.281 293.009), // violet-600
|
|
23
|
+
// text-code-comment: oklch(55.4% 0.046 257.417), // slate-500
|
|
24
|
+
|
|
25
|
+
// Backgrounds - Surface Colors
|
|
26
|
+
bg-body: oklch(98.5% 0 0), // white
|
|
27
|
+
bg-surface: oklch(98.4% 0.003 247.858), // slate-50
|
|
28
|
+
|
|
29
|
+
// Interactive backgrounds
|
|
30
|
+
// bg-hover: oklch(92.9% 0.013 255.508), // slate-200
|
|
31
|
+
// bg-active: oklch(86.9% 0.022 252.894), // slate-300
|
|
32
|
+
// bg-selected: oklch(88.2% 0.059 254.128), // blue-200
|
|
33
|
+
// bg-focus: oklch(93.2% 0.032 255.585), // blue-100
|
|
34
|
+
|
|
35
|
+
// Overlays
|
|
36
|
+
// bg-overlay: oklch(20.8% 0.042 265.755 / 50%), // slate-900 at 50%
|
|
37
|
+
// bg-modal: oklch(98.5% 0 0), // white
|
|
38
|
+
// bg-tooltip: oklch(27.9% 0.041 260.031), // slate-800
|
|
39
|
+
|
|
40
|
+
// Code blocks
|
|
41
|
+
// bg-code: oklch(96.8% 0.007 247.896), // slate-100
|
|
42
|
+
// bg-code-block: oklch(98.4% 0.003 247.858), // slate-50
|
|
43
|
+
|
|
44
|
+
// Borders - Edge Colors
|
|
45
|
+
// border-default: oklch(92.9% 0.013 255.508), // slate-200
|
|
46
|
+
// border-strong: oklch(86.9% 0.022 252.894), // slate-300
|
|
47
|
+
// border-subtle: oklch(96.8% 0.007 247.896), // slate-100
|
|
48
|
+
// border-focus: oklch(62.3% 0.214 259.815), // blue-500
|
|
49
|
+
// border-error: oklch(63.7% 0.237 25.331), // red-500
|
|
50
|
+
// border-success: oklch(72.3% 0.219 149.579), // green-500
|
|
51
|
+
// border-warning: oklch(76.9% 0.188 70.08), // amber-500
|
|
52
|
+
|
|
53
|
+
// Component-specific
|
|
54
|
+
// border-input: oklch(86.9% 0.022 252.894), // slate-300
|
|
55
|
+
// border-input-hover: oklch(70.4% 0.04 256.788), // slate-400
|
|
56
|
+
// border-input-focus: oklch(62.3% 0.214 259.815), // blue-500
|
|
57
|
+
|
|
58
|
+
// Shadows - Elevation & Depth
|
|
59
|
+
// shadow-xs: 0 1px 2px 0 oklch(20.8% 0.042 265.755 / 5%),
|
|
60
|
+
// --shadow-sm: 0 1px 3px 0 oklch(20.8% 0.042 265.755 / 10%),
|
|
61
|
+
// 1px 2px -1px oklch(20.8% 0.042 265.755 / 10%),
|
|
62
|
+
// --shadow-md: 0 4px 6px -1px oklch(20.8% 0.042 265.755 / 10%),
|
|
63
|
+
// 2px 4px -2px oklch(20.8% 0.042 265.755 / 10%),
|
|
64
|
+
// --shadow-lg: 0 10px 15px -3px oklch(20.8% 0.042 265.755 / 10%),
|
|
65
|
+
// 4px 6px -4px oklch(20.8% 0.042 265.755 / 10%),
|
|
66
|
+
// --shadow-xl: 0 20px 25px -5px oklch(20.8% 0.042 265.755 / 10%),
|
|
67
|
+
// 8px 10px -6px oklch(20.8% 0.042 265.755 / 10%),
|
|
68
|
+
// shadow-2xl: 0 25px 50px -12px oklch(20.8% 0.042 265.755 / 25%),
|
|
69
|
+
// shadow-focus: 0 0 0 3px oklch(62.3% 0.214 259.815 / 20%), // blue-500 at 20%
|
|
70
|
+
// shadow-focus-danger: 0 0 0 3px oklch(63.7% 0.237 25.331 / 20%), // red-500 at 20%
|
|
71
|
+
|
|
72
|
+
// Effects - Opacity & Filters
|
|
73
|
+
// opacity-disabled: 0.5,
|
|
74
|
+
// opacity-hover: 0.8,
|
|
75
|
+
// opacity-loading: 0.6,
|
|
76
|
+
|
|
77
|
+
// Transitions - Animation Durations
|
|
78
|
+
// Note: These could be SASS variables, but keeping as CSS props allows
|
|
79
|
+
// runtime modification (e.g., for reduced motion preferences)
|
|
80
|
+
// transition-fast: 150ms,
|
|
81
|
+
// transition-base: 250ms,
|
|
82
|
+
// transition-slow: 350ms,
|
|
83
|
+
// transition-slower: 500ms,
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
// prettier-ignore
|
|
87
|
+
$dark: (
|
|
88
|
+
// Brand Colors - Primary Semantic Colors
|
|
89
|
+
color-primary: oklch(70.7% 0.165 254.624), // blue-400
|
|
90
|
+
color-secondary: oklch(44.6% 0.043 257.281), // slate-600
|
|
91
|
+
color-accent: oklch(85.2% 0.199 91.936), // yellow-400
|
|
92
|
+
|
|
93
|
+
// Typography - Text Colors (Inverted)
|
|
94
|
+
text-base: oklch(96.8% 0.007 247.896), // slate-100
|
|
95
|
+
text-muted: oklch(55.4% 0.046 257.417), // slate-500
|
|
96
|
+
text-heading: oklch(98.4% 0.003 247.858), // slate-50
|
|
97
|
+
text-lead: oklch(70.4% 0.04 256.788), // slate-400
|
|
98
|
+
|
|
99
|
+
// Links
|
|
100
|
+
text-link: oklch(74.6% 0.16 232.661), // sky-400
|
|
101
|
+
text-link-hover: oklch(82.8% 0.111 230.318), // sky-300
|
|
102
|
+
|
|
103
|
+
// Code
|
|
104
|
+
// text-code: oklch(70.2% 0.183 293.541), // violet-400
|
|
105
|
+
// text-code-comment: oklch(55.4% 0.046 257.417), // slate-500
|
|
106
|
+
|
|
107
|
+
// Backgrounds - Surface Colors (Dark)
|
|
108
|
+
bg-body: oklch(20.8% 0.042 265.755), // slate-900
|
|
109
|
+
bg-surface: oklch(27.9% 0.041 260.031), // slate-800
|
|
110
|
+
|
|
111
|
+
// Interactive backgrounds
|
|
112
|
+
// bg-hover: oklch(37.2% 0.044 257.287), // slate-700
|
|
113
|
+
// bg-active: oklch(44.6% 0.043 257.281), // slate-600
|
|
114
|
+
// bg-selected: oklch(42.4% 0.199 265.638), // blue-800
|
|
115
|
+
// bg-focus: oklch(37.9% 0.146 265.522), // blue-900
|
|
116
|
+
|
|
117
|
+
// Overlays
|
|
118
|
+
// bg-overlay: oklch(20.8% 0.042 265.755 / 75%), // slate-900 at 75%
|
|
119
|
+
// bg-modal: oklch(27.9% 0.041 260.031), // slate-800
|
|
120
|
+
// bg-tooltip: oklch(37.2% 0.044 257.287), // slate-700
|
|
121
|
+
|
|
122
|
+
// Code blocks
|
|
123
|
+
// bg-code: oklch(27.9% 0.041 260.031), // slate-800
|
|
124
|
+
// bg-code-block: oklch(20.8% 0.042 265.755), // slate-900
|
|
125
|
+
|
|
126
|
+
// Borders - Edge Colors (Lighter in dark mode)
|
|
127
|
+
// border-default: oklch(37.2% 0.044 257.287), // slate-700
|
|
128
|
+
// border-strong: oklch(44.6% 0.043 257.281), // slate-600
|
|
129
|
+
// border-subtle: oklch(27.9% 0.041 260.031), // slate-800
|
|
130
|
+
// border-focus: oklch(70.7% 0.165 254.624), // blue-400
|
|
131
|
+
// border-error: oklch(70.4% 0.191 22.216), // red-400
|
|
132
|
+
// border-success: oklch(79.2% 0.209 151.711), // green-400
|
|
133
|
+
// border-warning: oklch(82.8% 0.189 84.429), // amber-400
|
|
134
|
+
|
|
135
|
+
// Component-specific
|
|
136
|
+
// border-input: oklch(44.6% 0.043 257.281), // slate-600
|
|
137
|
+
// border-input-hover: oklch(55.4% 0.046 257.417), // slate-500
|
|
138
|
+
// border-input-focus: oklch(70.7% 0.165 254.624), // blue-400
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
// prettier-ignore
|
|
142
|
+
$docs: (
|
|
143
|
+
// Brand Colors - Primary Semantic Colors
|
|
144
|
+
color-primary: hsl(224 76% 40%),
|
|
145
|
+
color-secondary: hsl(215 25% 27%),
|
|
146
|
+
color-accent: hsl(217 91% 60%),
|
|
147
|
+
// accent-bg: hsl(211 51% 24%),
|
|
148
|
+
|
|
149
|
+
// Typography Colors
|
|
150
|
+
text-base: hsl(214 32% 83%),
|
|
151
|
+
text-muted: hsl(215 16% 47%), // Menu titles, TOC titles, labels
|
|
152
|
+
text-secondary: hsl(215 20% 65%), // TOC links, less prominent text
|
|
153
|
+
text-heading: hsl(210 40% 96%),
|
|
154
|
+
|
|
155
|
+
// Links
|
|
156
|
+
link-color: hsl(199 89% 61%),
|
|
157
|
+
link-color-hover: hsl(199 89% 58%),
|
|
158
|
+
|
|
159
|
+
// Backgrounds
|
|
160
|
+
bg-body: hsl(222 47% 11%),
|
|
161
|
+
surface-bg: hsl(217 33% 17%), // Sidebar, code blocks
|
|
162
|
+
|
|
163
|
+
// Borders
|
|
164
|
+
border-color: hsl(215 25% 27%), // Main borders
|
|
165
|
+
);
|
package/dev.html
CHANGED
|
@@ -6,13 +6,214 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/images/favicon.svg" />
|
|
8
8
|
<title>DEV</title>
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
<!-- order matters, make sure the plugin comes before alpine.js -->
|
|
10
|
+
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/collapse@3.x.x/dist/cdn.min.js"></script>
|
|
11
|
+
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
|
11
12
|
</head>
|
|
12
13
|
|
|
14
|
+
<body class="container py-5 bg-gray-200">
|
|
15
|
+
<div class="x">some text</div>
|
|
16
|
+
<section id="horizontal-menu-examples">
|
|
17
|
+
<h2>Horizontal Menu Examples</h2>
|
|
18
|
+
<p>All parents are identical except for the alpine.js triggers.</p>
|
|
19
|
+
<div class="menu-title">Utility Example</div>
|
|
20
|
+
<nav id="utility-example" class="bx pxy-1 bdr bdr-blue">
|
|
21
|
+
<ul class="flex gap-05 txt-sm">
|
|
22
|
+
<li>
|
|
23
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 rounded-lg txt-gray-700 hover:bg-gray-100">
|
|
24
|
+
<svg class="wh-1.25 bdr bdr-blue bg-stripes-blue"></svg>
|
|
25
|
+
Item
|
|
26
|
+
</a>
|
|
27
|
+
</li>
|
|
28
|
+
<li>
|
|
29
|
+
<a href="#" class="bg-gray-200 flex items-center gap-075 px-075 py-05 rounded-lg txt-gray-700">
|
|
30
|
+
<svg class="wh-1.25 bdr bdr-blue bg-stripes-blue"></svg>
|
|
31
|
+
Active
|
|
32
|
+
</a>
|
|
33
|
+
</li>
|
|
34
|
+
<!-- Click to toggle -->
|
|
35
|
+
<li class="relative" x-data="{ open: false }">
|
|
36
|
+
<button x-on:click="open = ! open" class="flex items-center gap-075 px-075 py-05 rounded-lg txt-gray-700 hover:bg-gray-100">
|
|
37
|
+
<span class="flex items-center gap-075">
|
|
38
|
+
<svg class="wh-1.25 bdr bdr-blue bg-stripes-blue"></svg>
|
|
39
|
+
Parent (Click)
|
|
40
|
+
</span>
|
|
41
|
+
<svg class="wh-1" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
|
|
42
|
+
<path x-show="open" d="m6 15 6-6 6 6" />
|
|
43
|
+
<path x-show="!open" d="m6 9 6 6 6-6" />
|
|
44
|
+
</svg>
|
|
45
|
+
</button>
|
|
46
|
+
<div x-show="open" x-collapse x-cloak class="absolute mt-05 flex w-10 z-100">
|
|
47
|
+
<ul class="bx pxy-0 w-full flex-col gap-0">
|
|
48
|
+
<li>
|
|
49
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 txt-gray-700 hover:bg-gray-100">
|
|
50
|
+
Child Item
|
|
51
|
+
</a>
|
|
52
|
+
</li>
|
|
53
|
+
<li>
|
|
54
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 txt-gray-700 hover:bg-gray-100">
|
|
55
|
+
Child Item
|
|
56
|
+
</a>
|
|
57
|
+
</li>
|
|
58
|
+
</ul>
|
|
59
|
+
</div>
|
|
60
|
+
</li>
|
|
61
|
+
<!-- Click with click.away -->
|
|
62
|
+
<li class="relative" x-data="{ open: false }" x-on:click.away="open = false">
|
|
63
|
+
<button x-on:click="open = ! open" class="flex items-center gap-075 px-075 py-05 rounded-lg txt-gray-700 hover:bg-gray-100">
|
|
64
|
+
<span class="flex items-center gap-075">
|
|
65
|
+
<svg class="wh-1.25 bdr bdr-blue bg-stripes-blue"></svg>
|
|
66
|
+
Parent (Click Away)
|
|
67
|
+
</span>
|
|
68
|
+
<svg class="wh-1" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
|
|
69
|
+
<path x-show="open" d="m6 15 6-6 6 6" />
|
|
70
|
+
<path x-show="!open" d="m6 9 6 6 6-6" />
|
|
71
|
+
</svg>
|
|
72
|
+
</button>
|
|
73
|
+
<div x-show="open" x-collapse class="absolute mt-05 flex w-10 z-100" style="display: none;">
|
|
74
|
+
<ul class="bx pxy-0 w-full flex-col gap-0">
|
|
75
|
+
<li>
|
|
76
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 txt-gray-700 hover:bg-gray-100">
|
|
77
|
+
Child Item
|
|
78
|
+
</a>
|
|
79
|
+
</li>
|
|
80
|
+
<li>
|
|
81
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 txt-gray-700 hover:bg-gray-100">
|
|
82
|
+
Child Item
|
|
83
|
+
</a>
|
|
84
|
+
</li>
|
|
85
|
+
</ul>
|
|
86
|
+
</div>
|
|
87
|
+
</li>
|
|
88
|
+
<!-- Hover to show -->
|
|
89
|
+
<li class="relative" x-data="{ open: false }" x-on:mouseenter="open = true" x-on:mouseleave="open = false">
|
|
90
|
+
<button x-on:click="open = ! open" class="flex items-center gap-075 px-075 py-05 rounded-lg txt-gray-700 hover:bg-gray-100">
|
|
91
|
+
<span class="flex items-center gap-075">
|
|
92
|
+
<svg class="wh-1.25 bdr bdr-blue bg-stripes-blue"></svg>
|
|
93
|
+
Parent (Hover)
|
|
94
|
+
</span>
|
|
95
|
+
<svg class="wh-1" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
|
|
96
|
+
<path x-show="open" d="m6 15 6-6 6 6" />
|
|
97
|
+
<path x-show="!open" d="m6 9 6 6 6-6" />
|
|
98
|
+
</svg>
|
|
99
|
+
</button>
|
|
100
|
+
<div x-show="open" x-collapse x-cloak class="absolute mt-05 flex w-10 z-100">
|
|
101
|
+
<ul class="bx pxy-0 w-full flex-col gap-0">
|
|
102
|
+
<li>
|
|
103
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 txt-gray-700 hover:bg-gray-100">
|
|
104
|
+
Child Item
|
|
105
|
+
</a>
|
|
106
|
+
</li>
|
|
107
|
+
<li>
|
|
108
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 txt-gray-700 hover:bg-gray-100">
|
|
109
|
+
Child Item
|
|
110
|
+
</a>
|
|
111
|
+
</li>
|
|
112
|
+
</ul>
|
|
113
|
+
</div>
|
|
114
|
+
</li>
|
|
115
|
+
</ul>
|
|
116
|
+
</nav>
|
|
117
|
+
<div class="menu-title">Menu Class Example</div>
|
|
118
|
+
<nav id="menu-class-example" class="menu bx pxy-1 bdr bdr-green">
|
|
119
|
+
<ul class="flex gap-05 txt-sm">
|
|
120
|
+
<li>
|
|
121
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 rounded-lg txt-gray-700 hover:bg-gray-100">
|
|
122
|
+
<svg class="wh-1.25 bdr bdr-green bg-stripes-green"></svg>
|
|
123
|
+
Item
|
|
124
|
+
</a>
|
|
125
|
+
</li>
|
|
126
|
+
<li>
|
|
127
|
+
<a href="#" class="bg-gray-200 flex items-center gap-075 px-075 py-05 rounded-lg txt-gray-700">
|
|
128
|
+
<svg class="wh-1.25 bdr bdr-green bg-stripes-green"></svg>
|
|
129
|
+
Active
|
|
130
|
+
</a>
|
|
131
|
+
</li>
|
|
132
|
+
<!-- Click to toggle -->
|
|
133
|
+
<li class="relative" x-data="{ open: false }">
|
|
134
|
+
<button x-on:click="open = ! open" class="flex items-center gap-075 px-075 py-05 rounded-lg txt-gray-700 hover:bg-gray-100">
|
|
135
|
+
<span class="flex items-center gap-075">
|
|
136
|
+
<svg class="wh-1.25 bdr bdr-green bg-stripes-green"></svg>
|
|
137
|
+
Parent (Click)
|
|
138
|
+
</span>
|
|
139
|
+
<svg class="wh-1" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
|
|
140
|
+
<path x-show="open" d="m6 15 6-6 6 6" />
|
|
141
|
+
<path x-show="!open" d="m6 9 6 6 6-6" />
|
|
142
|
+
</svg>
|
|
143
|
+
</button>
|
|
144
|
+
<div x-show="open" x-collapse x-cloak class="absolute mt-05 flex w-10 z-100">
|
|
145
|
+
<ul class="bx pxy-0 w-full flex-col gap-0">
|
|
146
|
+
<li>
|
|
147
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 txt-gray-700 hover:bg-gray-100">
|
|
148
|
+
Child Item
|
|
149
|
+
</a>
|
|
150
|
+
</li>
|
|
151
|
+
<li>
|
|
152
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 txt-gray-700 hover:bg-gray-100">
|
|
153
|
+
Child Item
|
|
154
|
+
</a>
|
|
155
|
+
</li>
|
|
156
|
+
</ul>
|
|
157
|
+
</div>
|
|
158
|
+
</li>
|
|
159
|
+
<!-- Click with click.away -->
|
|
160
|
+
<li class="relative" x-data="{ open: false }" x-on:click.away="open = false">
|
|
161
|
+
<button x-on:click="open = ! open" class="flex items-center gap-075 px-075 py-05 rounded-lg txt-gray-700 hover:bg-gray-100">
|
|
162
|
+
<span class="flex items-center gap-075">
|
|
163
|
+
<svg class="wh-1.25 bdr bdr-green bg-stripes-green"></svg>
|
|
164
|
+
Parent (Click Away)
|
|
165
|
+
</span>
|
|
166
|
+
<svg class="wh-1" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
|
|
167
|
+
<path x-show="open" d="m6 15 6-6 6 6" />
|
|
168
|
+
<path x-show="!open" d="m6 9 6 6 6-6" />
|
|
169
|
+
</svg>
|
|
170
|
+
</button>
|
|
171
|
+
<div x-show="open" x-collapse class="absolute mt-05 flex w-10 z-100" style="display: none;">
|
|
172
|
+
<ul class="bx pxy-0 w-full flex-col gap-0">
|
|
173
|
+
<li>
|
|
174
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 txt-gray-700 hover:bg-gray-100">
|
|
175
|
+
Child Item
|
|
176
|
+
</a>
|
|
177
|
+
</li>
|
|
178
|
+
<li>
|
|
179
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 txt-gray-700 hover:bg-gray-100">
|
|
180
|
+
Child Item
|
|
181
|
+
</a>
|
|
182
|
+
</li>
|
|
183
|
+
</ul>
|
|
184
|
+
</div>
|
|
185
|
+
</li>
|
|
186
|
+
<!-- Hover to show -->
|
|
187
|
+
<li class="relative" x-data="{ open: false }" x-on:mouseenter="open = true" x-on:mouseleave="open = false">
|
|
188
|
+
<button x-on:click="open = ! open" class="flex items-center gap-075 px-075 py-05 rounded-lg txt-gray-700 hover:bg-gray-100">
|
|
189
|
+
<span class="flex items-center gap-075">
|
|
190
|
+
<svg class="wh-1.25 bdr bdr-green bg-stripes-green"></svg>
|
|
191
|
+
Parent (Hover)
|
|
192
|
+
</span>
|
|
193
|
+
<svg class="wh-1" xmlns="http://www.w3.org/2000/svg" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24">
|
|
194
|
+
<path x-show="open" d="m6 15 6-6 6 6" />
|
|
195
|
+
<path x-show="!open" d="m6 9 6 6 6-6" />
|
|
196
|
+
</svg>
|
|
197
|
+
</button>
|
|
198
|
+
<div x-show="open" x-collapse x-cloak class="absolute mt-05 flex w-10 z-100">
|
|
199
|
+
<ul class="bx pxy-0 w-full flex-col gap-0">
|
|
200
|
+
<li>
|
|
201
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 txt-gray-700 hover:bg-gray-100">
|
|
202
|
+
Child Item
|
|
203
|
+
</a>
|
|
204
|
+
</li>
|
|
205
|
+
<li>
|
|
206
|
+
<a href="#" class="flex items-center gap-075 px-075 py-05 txt-gray-700 hover:bg-gray-100">
|
|
207
|
+
Child Item
|
|
208
|
+
</a>
|
|
209
|
+
</li>
|
|
210
|
+
</ul>
|
|
211
|
+
</div>
|
|
212
|
+
</li>
|
|
213
|
+
</ul>
|
|
214
|
+
</nav>
|
|
13
215
|
|
|
14
|
-
|
|
15
|
-
|
|
216
|
+
</section>
|
|
16
217
|
<script type="module" src="/main.js"></script>
|
|
17
218
|
</body>
|
|
18
219
|
|
package/dev1.html
CHANGED
|
@@ -6,12 +6,215 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/images/favicon.svg" />
|
|
8
8
|
<title>DEV 1</title>
|
|
9
|
-
<script defer src="https://
|
|
10
|
-
|
|
9
|
+
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/collapse@3.x.x/dist/cdn.min.js"></script>
|
|
10
|
+
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
|
11
|
+
<style>
|
|
12
|
+
/* Transform Transitions */
|
|
13
|
+
.scale-box {
|
|
14
|
+
background: linear-gradient(45deg, #f093fb 0%, #f5576c 100%);
|
|
15
|
+
transition: transform 0.3s ease;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.scale-box:hover {
|
|
19
|
+
transform: scale(1.2);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.rotate-box {
|
|
23
|
+
background: linear-gradient(45deg, #4facfe 0%, #00f2fe 100%);
|
|
24
|
+
transition: transform 0.5s ease;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.rotate-box:hover {
|
|
28
|
+
transform: rotate(180deg);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.translate-box {
|
|
32
|
+
background: linear-gradient(45deg, #fa709a 0%, #fee140 100%);
|
|
33
|
+
transition: transform 0.4s ease;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.translate-box:hover {
|
|
37
|
+
transform: translateY(-20px);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Opacity Transition */
|
|
41
|
+
.fade-box {
|
|
42
|
+
background: linear-gradient(45deg, #a8edea 0%, #fed6e3 100%);
|
|
43
|
+
color: #333;
|
|
44
|
+
transition: opacity 0.5s ease;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.fade-box:hover {
|
|
48
|
+
opacity: 0.3;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* Multiple Properties */
|
|
52
|
+
.multi-box {
|
|
53
|
+
background: linear-gradient(45deg, #ffecd2 0%, #fcb69f 100%);
|
|
54
|
+
box-shadow: 0 5px 15px rgb(0 0 0 / 10%);
|
|
55
|
+
color: #333;
|
|
56
|
+
transition: all 0.4s ease;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.multi-box:hover {
|
|
60
|
+
background: linear-gradient(45deg, #ff9a9e 0%, #fecfef 100%);
|
|
61
|
+
box-shadow: 0 15px 35px rgb(0 0 0 / 30%);
|
|
62
|
+
transform: scale(1.1) rotate(5deg);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* Timing Functions Demo */
|
|
66
|
+
.timing-demo {
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
gap: 15px;
|
|
69
|
+
width: 100%;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.timing-row {
|
|
73
|
+
gap: 15px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.timing-label {
|
|
77
|
+
color: #333;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.timing-bar {
|
|
81
|
+
background: #3498db;
|
|
82
|
+
border-radius: 5px;
|
|
83
|
+
flex: 1;
|
|
84
|
+
height: 50px;
|
|
85
|
+
transition-duration: 2s;
|
|
86
|
+
transition-property: transform;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.timing-bar.linear {
|
|
90
|
+
transition-timing-function: linear;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.timing-bar.ease {
|
|
94
|
+
transition-timing-function: ease;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.timing-bar.ease-in {
|
|
98
|
+
transition-timing-function: ease-in;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.timing-bar.ease-out {
|
|
102
|
+
transition-timing-function: ease-out;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.timing-bar.ease-in-out {
|
|
106
|
+
transition-timing-function: ease-in-out;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.timing-bar.active {
|
|
110
|
+
transform: translateX(200px);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.reset-btn {
|
|
114
|
+
background: #667eea;
|
|
115
|
+
border: none;
|
|
116
|
+
border-radius: 8px;
|
|
117
|
+
font-size: 16px;
|
|
118
|
+
margin-block-start: 15px;
|
|
119
|
+
padding: 12px 30px;
|
|
120
|
+
transition: all 0.3s ease;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.reset-btn:hover {
|
|
124
|
+
background: #764ba2;
|
|
125
|
+
box-shadow: 0 5px 15px rgb(0 0 0 / 20%);
|
|
126
|
+
transform: translateY(-2px);
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
11
129
|
</head>
|
|
12
130
|
|
|
13
131
|
<body class="pxy">
|
|
14
132
|
|
|
133
|
+
<!-- The key thing to remember is that transitions need two states (like
|
|
134
|
+
normal and :hover) and a transition property that tells the browser how to
|
|
135
|
+
animate between them. -->
|
|
136
|
+
|
|
137
|
+
<div class="container-md">
|
|
138
|
+
<h1>CSS Transitions Interactive Demo</h1>
|
|
139
|
+
<div class="bx">
|
|
140
|
+
<h2>1. Color Transition</h2>
|
|
141
|
+
<p>Hover over the box to see the color change smoothly. Uses: <code>transition: background-color 0.5s ease;</code></p>
|
|
142
|
+
<div class="bx light flex-centered gap">
|
|
143
|
+
<div class="transition wh-8 rounded-1 flex-centered txt-white blue hover:bg-red">Hover Me!</div>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<div class="bx">
|
|
148
|
+
<h2>2. Transform Transitions</h2>
|
|
149
|
+
<p>Hover over each box to see different transform effects:</p>
|
|
150
|
+
<div class="bx light flex-centered gap">
|
|
151
|
+
<div class="wh-8 rounded-1 flex-centered txt-white scale-box">Scale</div>
|
|
152
|
+
<div class="wh-8 rounded-1 flex-centered txt-white rotate-box">Rotate</div>
|
|
153
|
+
<div class="wh-8 rounded-1 flex-centered txt-white translate-box">Translate</div>
|
|
154
|
+
</div>
|
|
155
|
+
</div>
|
|
156
|
+
|
|
157
|
+
<div class="bx">
|
|
158
|
+
<h2>3. Opacity Transition</h2>
|
|
159
|
+
<p>Hover to fade. Uses: <code>transition: opacity 0.5s ease;</code></p>
|
|
160
|
+
<div class="bx light flex-centered gap">
|
|
161
|
+
<div class="wh-8 rounded-1 flex-centered txt-white fade-box">Fade Me!</div>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
|
|
165
|
+
<div class="bx">
|
|
166
|
+
<h2>4. Multiple Properties</h2>
|
|
167
|
+
<p>This box transitions multiple properties at once: color, transform, and shadow. Uses: <code>transition: all 0.4s ease;</code></p>
|
|
168
|
+
<div class="bx light flex-centered gap">
|
|
169
|
+
<div class="multi-box">All Together!</div>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
|
|
173
|
+
<div class="bx">
|
|
174
|
+
<h2>5. Timing Functions</h2>
|
|
175
|
+
<p>Click the button to see how different timing functions affect animation speed. All take 2 seconds but move differently:</p>
|
|
176
|
+
<div class="bx light flex-centered gap">
|
|
177
|
+
<div class="timing-demo">
|
|
178
|
+
<div class="timing-row">
|
|
179
|
+
<div class="timing-label">linear</div>
|
|
180
|
+
<div class="timing-bar linear"></div>
|
|
181
|
+
</div>
|
|
182
|
+
<div class="timing-row">
|
|
183
|
+
<div class="timing-label">ease</div>
|
|
184
|
+
<div class="timing-bar ease"></div>
|
|
185
|
+
</div>
|
|
186
|
+
<div class="timing-row">
|
|
187
|
+
<div class="timing-label">ease-in</div>
|
|
188
|
+
<div class="timing-bar ease-in"></div>
|
|
189
|
+
</div>
|
|
190
|
+
<div class="timing-row">
|
|
191
|
+
<div class="timing-label">ease-out</div>
|
|
192
|
+
<div class="timing-bar ease-out"></div>
|
|
193
|
+
</div>
|
|
194
|
+
<div class="timing-row">
|
|
195
|
+
<div class="timing-label">ease-in-out</div>
|
|
196
|
+
<div class="timing-bar ease-in-out"></div>
|
|
197
|
+
</div>
|
|
198
|
+
<button class="reset-btn" onclick="animateBars()">Animate Bars</button>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
<script>
|
|
205
|
+
function animateBars() {
|
|
206
|
+
const bars = document.querySelectorAll('.timing-bar');
|
|
207
|
+
bars.forEach(bar => bar.classList.remove('active'));
|
|
208
|
+
|
|
209
|
+
setTimeout(() => {
|
|
210
|
+
bars.forEach(bar => bar.classList.add('active'));
|
|
211
|
+
}, 50);
|
|
212
|
+
|
|
213
|
+
setTimeout(() => {
|
|
214
|
+
bars.forEach(bar => bar.classList.remove('active'));
|
|
215
|
+
}, 2500);
|
|
216
|
+
}
|
|
217
|
+
</script>
|
|
15
218
|
<script type="module" src="/main.js"></script>
|
|
16
219
|
</body>
|
|
17
220
|
|
package/dev2.html
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="/images/favicon.svg" />
|
|
8
8
|
<title>DEV 2</title>
|
|
9
|
-
<script defer src="https://
|
|
10
|
-
|
|
9
|
+
<script defer src="https://cdn.jsdelivr.net/npm/@alpinejs/collapse@3.x.x/dist/cdn.min.js"></script>
|
|
10
|
+
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script>
|
|
11
11
|
</head>
|
|
12
12
|
|
|
13
13
|
<body class="pxy">
|