@pixelated-tech/components 3.13.0 → 3.13.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/dist/components/admin/site-health/site-health-dependency-vulnerabilities.js +3 -1
- package/dist/components/general/buzzwordbingo.css +8 -8
- package/dist/components/general/buzzwordbingo.js +3 -3
- package/dist/components/general/countup.css +19 -0
- package/dist/components/general/countup.js +62 -0
- package/dist/components/general/global-error.css +1 -1
- package/dist/components/general/global-error.js +1 -1
- package/dist/components/general/menu-accordion.css +24 -24
- package/dist/components/general/menu-accordion.js +13 -13
- package/dist/components/general/menu-expando.css +4 -4
- package/dist/components/general/menu-expando.js +7 -7
- package/dist/components/general/microinteractions.css +1 -1
- package/dist/components/general/nerdjoke.css +5 -5
- package/dist/components/general/nerdjoke.js +2 -2
- package/dist/components/general/recipe.css +1 -1
- package/dist/components/general/recipe.js +1 -1
- package/dist/components/general/semantic.js +1 -1
- package/dist/components/general/sidepanel.css +3 -3
- package/dist/components/general/skeleton.css +4 -4
- package/dist/components/general/skeleton.js +3 -3
- package/dist/components/general/styleguide.js +2 -2
- package/dist/components/general/table.css +6 -6
- package/dist/components/general/table.js +5 -5
- package/dist/components/general/tiles.js +3 -2
- package/dist/components/integrations/socialcard.css +6 -6
- package/dist/components/integrations/socialcard.js +2 -2
- package/dist/components/integrations/wordpress.components.js +1 -1
- package/dist/components/integrations/wordpress.css +2 -2
- package/dist/components/shoppingcart/ebay.components.js +11 -11
- package/dist/components/shoppingcart/ebay.css +20 -20
- package/dist/components/shoppingcart/shoppingcart.components.js +11 -11
- package/dist/components/shoppingcart/shoppingcart.css +19 -19
- package/dist/components/sitebuilder/form/form.css +4 -4
- package/dist/components/sitebuilder/form/formcomponents.js +3 -3
- package/dist/components/sitebuilder/page/components/PageBuilderUI.js +2 -2
- package/dist/config/pixelated.config.json.enc +1 -1
- package/dist/css/pixelated.grid.scss +1 -1
- package/dist/index.js +1 -0
- package/dist/scripts/pixelated-eslint-plugin.js +3 -3
- package/dist/types/components/admin/site-health/site-health-dependency-vulnerabilities.d.ts.map +1 -1
- package/dist/types/components/general/countup.d.ts +17 -0
- package/dist/types/components/general/countup.d.ts.map +1 -0
- package/dist/types/components/general/tiles.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stories/general/countup.stories.d.ts +47 -0
- package/dist/types/stories/general/countup.stories.d.ts.map +1 -0
- package/package.json +22 -12
|
@@ -37,6 +37,8 @@ export function SiteHealthDependencyVulnerabilities({ siteName }) {
|
|
|
37
37
|
data.status === 'Moderate Risk' ? '#f59e0b' :
|
|
38
38
|
data.status === 'High Risk' ? '#ef4444' :
|
|
39
39
|
data.status === 'Critical' ? '#ef4444' : '#6b7280'
|
|
40
|
-
} }) })] }) }), _jsxs("div", { className: "health-audit-item", children: [_jsx("span", { className: "health-audit-icon", style: { color: '#10b981' }, children: "\u2713" }), _jsx("div", { className: "health-audit-content", children: _jsxs("span", { className: "health-audit-title", children: ["Dependencies: ", data.totalDependencies || data.dependencies || 0] }) })] }), data.vulnerabilities && data.vulnerabilities.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { style: { fontSize: '1rem', fontWeight: '600', marginBottom: '1rem' }, children: ["Vulnerabilities (", data.summary.total, ")"] }), _jsx("div", { className: "health-audit-list", children: data.vulnerabilities.map((vuln, index) => (
|
|
40
|
+
} }) })] }) }), _jsxs("div", { className: "health-audit-item", children: [_jsx("span", { className: "health-audit-icon", style: { color: '#10b981' }, children: "\u2713" }), _jsx("div", { className: "health-audit-content", children: _jsxs("span", { className: "health-audit-title", children: ["Dependencies: ", data.totalDependencies || data.dependencies || 0] }) })] }), data.vulnerabilities && data.vulnerabilities.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { style: { fontSize: '1rem', fontWeight: '600', marginBottom: '1rem' }, children: ["Vulnerabilities (", data.summary.total, ")"] }), _jsx("div", { className: "health-audit-list", children: data.vulnerabilities.map((vuln, index) => (
|
|
41
|
+
// eslint-disable-next-line pixelated/class-name-kebab-case
|
|
42
|
+
_jsx("div", { className: `health-vulnerability-item health-vulnerability-${vuln.severity}`, children: _jsxs("div", { className: "health-vulnerability-header", children: [_jsx("span", { className: "health-vulnerability-severity", children: vuln.severity }), _jsxs("div", { children: [_jsx("span", { className: "health-vulnerability-name", children: vuln.name }), vuln.title && (_jsx("p", { className: "health-vulnerability-details", children: vuln.title })), _jsxs("div", { className: "health-vulnerability-meta", children: [_jsxs("span", { className: "health-vulnerability-range", children: ["Range: ", vuln.range] }), vuln.fixAvailable && (_jsx("span", { className: "health-vulnerability-fix", children: "\u2713 Fix available" }))] }), vuln.url && (_jsx("a", { href: vuln.url, target: "_blank", rel: "noopener noreferrer", className: "health-vulnerability-link", children: "View details \u2192" }))] })] }) }, index))) })] })), (!data.vulnerabilities || data.vulnerabilities.length === 0) && data.status === 'Secure' && (_jsxs("div", { className: "health-audit-item", children: [_jsx("span", { className: "health-audit-icon", style: { color: '#10b981' }, children: "\u2713" }), _jsx("div", { className: "health-audit-content", children: _jsx("span", { className: "health-audit-title", children: "No vulnerabilities found" }) })] })), _jsxs("p", { className: "health-timestamp", children: ["Last checked: ", new Date(data.timestamp).toLocaleString()] })] }));
|
|
41
43
|
} }));
|
|
42
44
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
============ BUZZWORD BINGO ============
|
|
3
3
|
======================================== */
|
|
4
4
|
|
|
5
|
-
.
|
|
5
|
+
.bingo-card {
|
|
6
6
|
border: 1px solid #AAA;
|
|
7
7
|
max-width: 640px;
|
|
8
8
|
margin: 0 auto;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.
|
|
11
|
+
.bingo-card {
|
|
12
12
|
|
|
13
|
-
.
|
|
13
|
+
.bingo-header{
|
|
14
14
|
border: 1px solid #AAA;
|
|
15
15
|
background-color: #CCC;
|
|
16
16
|
font-size: 2em;
|
|
@@ -18,24 +18,24 @@
|
|
|
18
18
|
aspect-ratio : 3 / 1;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
.
|
|
21
|
+
.bingo-box {
|
|
22
22
|
border: 1px solid #AAA;
|
|
23
23
|
aspect-ratio : 1 / 1;
|
|
24
24
|
width: 100%;
|
|
25
25
|
height: 100%;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.
|
|
29
|
-
.
|
|
28
|
+
.bingo-box-text,
|
|
29
|
+
.bingo-box-free-space {
|
|
30
30
|
text-align:center;
|
|
31
31
|
margin: auto 0;
|
|
32
32
|
/* word-spacing: 1000px; */ /* force wrap after each word */
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
.
|
|
35
|
+
.bingo-box-free-space {
|
|
36
36
|
font-size: 1.1em;
|
|
37
37
|
font-weight: bold;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
}
|
|
40
|
+
}
|
|
41
41
|
|
|
@@ -26,7 +26,7 @@ export function BuzzwordBingo(props) {
|
|
|
26
26
|
useEffect(() => {
|
|
27
27
|
setBingoWords(getBingoWords(buzzwords, 24));
|
|
28
28
|
}, [buzzwords]);
|
|
29
|
-
return (_jsxs("div", { className: "
|
|
29
|
+
return (_jsxs("div", { className: "bingo-card rowfix-5col", children: [myBingoHeaders.map((word) => (_jsx(BingoHeader, { word: word }, word))), bingoWords.map((word) => (_jsx(BingoBox, { word: word }, word)))] }));
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* BingoHeader — renders a single header cell for the bingo card (letters B I N G O).
|
|
@@ -38,7 +38,7 @@ BingoHeader.propTypes = {
|
|
|
38
38
|
word: PropTypes.string.isRequired,
|
|
39
39
|
};
|
|
40
40
|
function BingoHeader({ word }) {
|
|
41
|
-
return (_jsx("div", { className: "
|
|
41
|
+
return (_jsx("div", { className: "bingo-header grid-item", children: _jsx("div", { className: "bingo-box-text", children: word }) }));
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
44
|
* BingoBox — renders an individual bingo cell (word or 'FREE SPACE').
|
|
@@ -50,5 +50,5 @@ BingoBox.propTypes = {
|
|
|
50
50
|
word: PropTypes.string.isRequired,
|
|
51
51
|
};
|
|
52
52
|
function BingoBox({ word }) {
|
|
53
|
-
return (_jsx("div", { className: "
|
|
53
|
+
return (_jsx("div", { className: "bingo-box grid-item", children: _jsx("div", { className: (word == "FREE SPACE") ? "bingo-box-free-space bingo-box-free-space bingoBoxFreeSpace" : "bingo-box-text bingo-box-text bingoBoxText", children: word }) }));
|
|
54
54
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
.countup {
|
|
2
|
+
text-align: center;
|
|
3
|
+
|
|
4
|
+
.countup-pre, .countup-counter, .countup-post {
|
|
5
|
+
font-size: var(--font-size1);
|
|
6
|
+
font-family: var(--header-font);
|
|
7
|
+
font-weight: 800;
|
|
8
|
+
color: var(--primary-color);
|
|
9
|
+
}
|
|
10
|
+
.countup-pre {
|
|
11
|
+
--do-nothing: true;
|
|
12
|
+
}
|
|
13
|
+
.countup-counter {
|
|
14
|
+
--do-nothing: true;
|
|
15
|
+
}
|
|
16
|
+
.countup-post {
|
|
17
|
+
--do-nothing: true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { useIntersectionObserver } from '@pixelated-tech/components';
|
|
6
|
+
import "./countup.css";
|
|
7
|
+
/**
|
|
8
|
+
* CountUp Component - Animates a count from a starting number to an ending number over a specified duration.
|
|
9
|
+
* @param id - The ID for the count element.
|
|
10
|
+
* @param pre - Text to display before the count.
|
|
11
|
+
* @param post - Text to display after the count.
|
|
12
|
+
* @param start - The starting number of the count.
|
|
13
|
+
* @param end - The ending number of the count.
|
|
14
|
+
* @param duration - The duration of the count in milliseconds.
|
|
15
|
+
* @param decimals - Number of decimal places to display.
|
|
16
|
+
* @param content - Additional content to display below the count.
|
|
17
|
+
*/
|
|
18
|
+
CountUp.propTypes = {
|
|
19
|
+
id: PropTypes.string.isRequired,
|
|
20
|
+
pre: PropTypes.string,
|
|
21
|
+
post: PropTypes.string,
|
|
22
|
+
start: PropTypes.number.isRequired,
|
|
23
|
+
end: PropTypes.number.isRequired,
|
|
24
|
+
duration: PropTypes.number.isRequired,
|
|
25
|
+
decimals: PropTypes.number,
|
|
26
|
+
content: PropTypes.string,
|
|
27
|
+
};
|
|
28
|
+
export function CountUp({ id, pre = '', post = '', start, end, duration, decimals = 0, content }) {
|
|
29
|
+
const decimalize = (val) => decimalPlaces > 0 ? val.toFixed(decimalPlaces) : Math.floor(val).toString();
|
|
30
|
+
const decimalPlaces = decimals ?? 0;
|
|
31
|
+
const [counter, setCounter] = useState(decimalize(start));
|
|
32
|
+
const intervalMs = 16; // ~60fps
|
|
33
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
34
|
+
const containerRef = useIntersectionObserver((entry) => {
|
|
35
|
+
if (entry.isIntersecting)
|
|
36
|
+
setIsVisible(true);
|
|
37
|
+
}, {
|
|
38
|
+
rootMargin: "0px 0px -100px 0px", // same as scrollfade
|
|
39
|
+
threshold: 0, // same as scrollfade
|
|
40
|
+
disconnectAfterIntersection: true
|
|
41
|
+
} // fires once
|
|
42
|
+
);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (!isVisible)
|
|
45
|
+
return;
|
|
46
|
+
const steps = Math.max(1, Math.round(duration / intervalMs));
|
|
47
|
+
const step = (end - start) / steps;
|
|
48
|
+
let current = start;
|
|
49
|
+
const timer = setInterval(() => {
|
|
50
|
+
current += step;
|
|
51
|
+
const done = (step >= 0) ? current >= end : current <= end;
|
|
52
|
+
if (done) {
|
|
53
|
+
setCounter(decimalize(end));
|
|
54
|
+
clearInterval(timer);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
setCounter(decimalize(current));
|
|
58
|
+
}
|
|
59
|
+
}, intervalMs);
|
|
60
|
+
}, [isVisible]);
|
|
61
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { ref: containerRef, className: "countup", children: [_jsx("span", { className: 'countup-pre', children: pre }), _jsx("span", { id: id, className: 'countup-counter', children: counter }), _jsx("span", { className: 'countup-post', children: post }), _jsx("p", { children: content })] }) }));
|
|
62
|
+
}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
|
|
33
33
|
.ge-actions { display: flex; gap: var(--ge-gap); justify-content: center; margin-top: 20px; flex-wrap: wrap; }
|
|
34
34
|
.ge-btn { border-radius: var(--ge-radius); padding: 0.6rem 1rem; cursor: pointer; border: none; background: transparent; }
|
|
35
|
-
.ge-btn
|
|
35
|
+
.ge-btn-primary { background: var(--ge-foreground); color: #fff; }
|
|
36
36
|
.ge-link { color: var(--ge-foreground); text-decoration: underline; align-self: center; }
|
|
37
37
|
.ge-toggle { background: transparent; border: 1px solid #ddd; padding: 0.5rem 0.85rem; border-radius: var(--ge-radius); }
|
|
38
38
|
|
|
@@ -27,5 +27,5 @@ export function GlobalErrorUI({ error = null, reset, siteInfo, className = '' })
|
|
|
27
27
|
const contactHref = typeof si?.email === 'string'
|
|
28
28
|
? `mailto:${si.email}`
|
|
29
29
|
: undefined;
|
|
30
|
-
return (_jsx("main", { role: "alert", "aria-live": "polite", className: `global-error ${className}`, children: _jsxs("div", { className: "ge-inner", children: [_jsx("h1", { className: "ge-title", children: "Something went wrong" }), _jsx("p", { className: "ge-lead", children: "We encountered an unexpected error. Please try again or contact the site maintainer." }), _jsxs("div", { className: "ge-actions", children: [_jsx("button", { onClick: () => reset?.(), className: "ge-btn ge-btn
|
|
30
|
+
return (_jsx("main", { role: "alert", "aria-live": "polite", className: `global-error ${className}`, children: _jsxs("div", { className: "ge-inner", children: [_jsx("h1", { className: "ge-title", children: "Something went wrong" }), _jsx("p", { className: "ge-lead", children: "We encountered an unexpected error. Please try again or contact the site maintainer." }), _jsxs("div", { className: "ge-actions", children: [_jsx("button", { onClick: () => reset?.(), className: "ge-btn ge-btn-primary", children: "Try again" }), contactHref ? (_jsx("a", { href: contactHref, rel: "noopener noreferrer", className: "ge-link", children: "Contact support" })) : (_jsx("span", { className: "ge-unavailable", children: "Contact info unavailable" })), _jsx("button", { onClick: () => setShowDetails(s => !s), "aria-pressed": showDetails, className: "ge-btn ge-toggle", children: showDetails ? 'Hide details' : 'Show details' })] }), showDetails && (_jsxs("pre", { "data-testid": "error-details", className: "ge-details", children: [String(error?.message ?? 'Unknown error'), '\n', error?.stack ?? ''] })), _jsx("p", { className: "ge-note", children: "If this keeps happening, please file an issue or reach out to the maintainer." })] }) }));
|
|
31
31
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
===== SLIDING PANEL MENU =====
|
|
4
4
|
======================================== */
|
|
5
5
|
|
|
6
|
-
.
|
|
6
|
+
.panel-menu-button {
|
|
7
7
|
/* background-color: rgba(255,255,255,0.7); */
|
|
8
8
|
/* display: none; */
|
|
9
9
|
/* display: inline; */
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
.
|
|
26
|
+
.panel-menu-button .hamburger{
|
|
27
27
|
cursor: pointer;
|
|
28
28
|
font-family: Verdana;
|
|
29
29
|
font-size: 1.75rem;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.
|
|
34
|
+
.panel-menu-button .hamburger2{
|
|
35
35
|
/* 3 lines instead of unicode hamburger (U+2261) */
|
|
36
36
|
/* the tricks */
|
|
37
37
|
/* display: block; */
|
|
@@ -51,12 +51,12 @@
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/* hamburger hover style */
|
|
54
|
-
/* .
|
|
54
|
+
/* .accordion-menu .hamburger:hover {
|
|
55
55
|
color: #FFC75F;
|
|
56
56
|
} */
|
|
57
57
|
|
|
58
58
|
@media screen and (max-width: 480px) {
|
|
59
|
-
.
|
|
59
|
+
.panel-menu-button {
|
|
60
60
|
display: inline;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
============ ACCORDION MENU ============
|
|
78
78
|
======================================== */
|
|
79
79
|
|
|
80
|
-
.
|
|
80
|
+
.accordion-menu-wrapper {
|
|
81
81
|
/* background: #FFF; */
|
|
82
82
|
background: rgba(150, 190, 250, 0.7);
|
|
83
83
|
border-right: 1px solid #ccc;
|
|
@@ -91,33 +91,33 @@
|
|
|
91
91
|
padding: 5px;
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
.
|
|
94
|
+
.accordion-in {
|
|
95
95
|
left: 0px;
|
|
96
96
|
transition: transform 0.5s ease-out 0.0s;
|
|
97
97
|
transform: translateX(0px);
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
.
|
|
100
|
+
.accordion-out {
|
|
101
101
|
left: 0px;
|
|
102
102
|
transition: transform 0.5s ease-out 0.0s;
|
|
103
103
|
transform: translateX(-250px);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
-
.
|
|
106
|
+
.accordion-down {
|
|
107
107
|
top: 60px;
|
|
108
108
|
transition: transform 0.5s ease-out 0.0s;
|
|
109
109
|
transform: translateY(0px);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
.
|
|
112
|
+
.accordion-up {
|
|
113
113
|
/* bottom: 0px; */
|
|
114
114
|
top: 60px;
|
|
115
115
|
transition: transform 0.55s ease-out 0.0s;
|
|
116
116
|
transform: translateY(-150%);
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
.
|
|
120
|
-
.
|
|
119
|
+
.accordion-menu,
|
|
120
|
+
.accordion-menu ul {
|
|
121
121
|
/* ALL LIST LEVELS */
|
|
122
122
|
display: inline-block;
|
|
123
123
|
list-style-type: none;
|
|
@@ -125,17 +125,17 @@
|
|
|
125
125
|
width: 200px;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
.
|
|
128
|
+
.accordion-menu li {
|
|
129
129
|
/* ALL LIST ITEM LEVELS */
|
|
130
130
|
border-bottom: 1px solid #FFF;
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
.
|
|
133
|
+
.accordion-menu li:first-child {
|
|
134
134
|
/* ALL LIST ITEM LEVELS */
|
|
135
135
|
border-top: 1px solid #FFF;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
.
|
|
138
|
+
.accordion-menu a {
|
|
139
139
|
color: #000;
|
|
140
140
|
display: block;
|
|
141
141
|
text-decoration: none;
|
|
@@ -143,13 +143,13 @@
|
|
|
143
143
|
|
|
144
144
|
/* ===== LEVEL 1 ===== */
|
|
145
145
|
|
|
146
|
-
.
|
|
146
|
+
.accordion-menu > ul {
|
|
147
147
|
margin: 0px 0px 0px 5px;
|
|
148
148
|
padding: 0;
|
|
149
149
|
width: 200px;
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
.
|
|
152
|
+
.accordion-menu > ul > li > a {
|
|
153
153
|
/* this is the button */
|
|
154
154
|
color: black;
|
|
155
155
|
background: #CCC;
|
|
@@ -160,24 +160,24 @@
|
|
|
160
160
|
padding-left: 10px;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
.
|
|
163
|
+
.accordion-menu > ul > li > a:hover {
|
|
164
164
|
background: #EDD;
|
|
165
165
|
/* background-image: url(/images/pix/pix-bg-sm-bw.gif); */
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
/* ===== LEVEL 2 ===== */
|
|
169
169
|
|
|
170
|
-
.
|
|
170
|
+
.accordion-menu > ul > ul {
|
|
171
171
|
margin: 0px 0px 0px 20px;
|
|
172
172
|
padding: 0;
|
|
173
173
|
width: 180px;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
.
|
|
176
|
+
.menu-hide {
|
|
177
177
|
animation: hide 0.25s linear;
|
|
178
178
|
animation-fill-mode: forwards;
|
|
179
179
|
}
|
|
180
|
-
.
|
|
180
|
+
.menu-show {
|
|
181
181
|
animation: show 0.25s linear;
|
|
182
182
|
animation-fill-mode: forwards;
|
|
183
183
|
}
|
|
@@ -193,12 +193,12 @@
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
|
|
196
|
-
.
|
|
196
|
+
.accordion-menu ul > ul > li:first-child {
|
|
197
197
|
/* ALL LIST ITEM LEVELS */
|
|
198
198
|
border-top: 0px;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
.
|
|
201
|
+
.accordion-menu > ul > ul > li > a {
|
|
202
202
|
/* this is the button */
|
|
203
203
|
color: black;
|
|
204
204
|
background: #CCC;
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
line-height:30px;
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
.
|
|
211
|
+
.accordion-menu > ul > ul > li > a:hover {
|
|
212
212
|
background: #EDD;
|
|
213
213
|
/* background-image: url(/images/pix/pix-bg-sm-bw.gif); */
|
|
214
214
|
}
|
|
@@ -81,15 +81,15 @@ export function MenuAccordion(props) {
|
|
|
81
81
|
if (left.current === 0) {
|
|
82
82
|
if (debug)
|
|
83
83
|
console.log("Moving Menu Out");
|
|
84
|
-
menuParent?.classList.remove('
|
|
85
|
-
menuParent?.classList.add('
|
|
84
|
+
menuParent?.classList.remove('accordion-down'); /* accordionIn */
|
|
85
|
+
menuParent?.classList.add('accordion-up'); /* accordionOut */
|
|
86
86
|
setLeft(-250);
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
89
|
if (debug)
|
|
90
90
|
console.log("Moving Menu In");
|
|
91
|
-
menuParent?.classList.remove('
|
|
92
|
-
menuParent?.classList.add('
|
|
91
|
+
menuParent?.classList.remove('accordion-up'); /* accordionOut */
|
|
92
|
+
menuParent?.classList.add('accordion-down'); /* accordionIn */
|
|
93
93
|
setLeft(0);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -99,26 +99,26 @@ export function MenuAccordion(props) {
|
|
|
99
99
|
console.log("Expanding Menu Item...");
|
|
100
100
|
const parent = clickedItem.parentElement;
|
|
101
101
|
const subMenu = parent?.nextElementSibling;
|
|
102
|
-
if (subMenu && subMenu.classList.contains('
|
|
102
|
+
if (subMenu && subMenu.classList.contains('menu-hide')) {
|
|
103
103
|
if (debug)
|
|
104
104
|
console.log("Opening Submenu");
|
|
105
|
-
subMenu.classList.add('
|
|
106
|
-
subMenu.classList.remove('
|
|
105
|
+
subMenu.classList.add('menu-show');
|
|
106
|
+
subMenu.classList.remove('menu-hide');
|
|
107
107
|
}
|
|
108
108
|
else {
|
|
109
109
|
if (debug)
|
|
110
110
|
console.log("Closing Submenu");
|
|
111
111
|
if (subMenu)
|
|
112
|
-
subMenu.classList.add('
|
|
112
|
+
subMenu.classList.add('menu-hide');
|
|
113
113
|
if (subMenu)
|
|
114
|
-
subMenu.classList.remove('
|
|
114
|
+
subMenu.classList.remove('menu-show');
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
useEffect(() => {
|
|
118
118
|
window.moveMenu = moveMenu; // attach moveMenu function to the window object for use in MenuAccordionButton
|
|
119
119
|
documentRef.current = document; // for moveMenu
|
|
120
120
|
const menu = document.getElementById('accordionMenu');
|
|
121
|
-
const menuBtn = document.getElementById('
|
|
121
|
+
const menuBtn = document.getElementById('panel-menu-button');
|
|
122
122
|
function handleMenuClick(event) {
|
|
123
123
|
if (debug)
|
|
124
124
|
console.log("event : ", event, "target : ", event.target);
|
|
@@ -157,7 +157,7 @@ export function MenuAccordion(props) {
|
|
|
157
157
|
document.removeEventListener('click', handleMenuClick);
|
|
158
158
|
};
|
|
159
159
|
}, []);
|
|
160
|
-
return (_jsx("div", { className: "
|
|
160
|
+
return (_jsx("div", { className: "accordion-menu-wrapper accordion-up", suppressHydrationWarning: true, children: _jsx("div", { className: "accordion-menu", id: "accordionMenu", children: _jsx(MenuAccordionGroup, { menuItems: menuItems, state: undefined }, "accordionRoot") }) }));
|
|
161
161
|
}
|
|
162
162
|
/* ========== MENU GROUP ========== */
|
|
163
163
|
/**
|
|
@@ -177,7 +177,7 @@ MenuAccordionGroup.propTypes = {
|
|
|
177
177
|
};
|
|
178
178
|
export function MenuAccordionGroup(props) {
|
|
179
179
|
const myMenuItems = (props.menuItems.routes) ? props.menuItems.routes : props.menuItems;
|
|
180
|
-
return (_jsx("ul", { className: (props.state === "hide" ? "
|
|
180
|
+
return (_jsx("ul", { className: (props.state === "hide" ? "menu-hide" : "menu-show"), children: generateMenuItems({ menuData: myMenuItems, state: props.state ?? "hide" }) }, "menu-group-" + props.menuItems.name));
|
|
181
181
|
}
|
|
182
182
|
/* ========== MENU ITEM ========== */
|
|
183
183
|
/**
|
|
@@ -215,5 +215,5 @@ export function MenuAccordionButton(props) {
|
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
// suppressHydrationWarning suppresses hydration mismatch warnings for this button
|
|
218
|
-
return (_jsx("button", { className: "
|
|
218
|
+
return (_jsx("button", { className: "panel-menu-button", id: "panel-menu-button", onClick: slideMobilePanel, suppressHydrationWarning: true, children: _jsx("span", { className: "hamburger text-outline", children: hamburgerIcon }) }));
|
|
219
219
|
}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
===== MENU EXPANDO COMPONENT =====
|
|
5
5
|
======================================== */
|
|
6
6
|
|
|
7
|
-
.
|
|
7
|
+
.menu-expando {
|
|
8
8
|
display: inline-block;
|
|
9
9
|
}
|
|
10
10
|
|
|
@@ -72,7 +72,7 @@ details.menu-expando-wrapper a:hover {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
/* ========== NESTED MENU STYLING ========== */
|
|
75
|
-
details.
|
|
75
|
+
details.menu-expando-nested {
|
|
76
76
|
display: block;
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -118,7 +118,7 @@ details.menuExpandoNested li {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
/* ========== ANIMATIONS ========== */
|
|
121
|
-
@keyframes
|
|
121
|
+
@keyframes menu-expando-slide-down {
|
|
122
122
|
from {
|
|
123
123
|
opacity: 0;
|
|
124
124
|
}
|
|
@@ -127,7 +127,7 @@ details.menuExpandoNested li {
|
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
@keyframes
|
|
130
|
+
@keyframes menu-expando-slide-up {
|
|
131
131
|
from {
|
|
132
132
|
opacity: 1;
|
|
133
133
|
}
|
|
@@ -38,7 +38,7 @@ export function MenuExpando(props) {
|
|
|
38
38
|
if (!summary)
|
|
39
39
|
return;
|
|
40
40
|
// Initialize nested menus to be closed
|
|
41
|
-
const nestedDetails = details.querySelectorAll('details.
|
|
41
|
+
const nestedDetails = details.querySelectorAll('details.menu-expando-nested');
|
|
42
42
|
nestedDetails.forEach((nested) => {
|
|
43
43
|
const nestedUl = nested.querySelector('ul');
|
|
44
44
|
if (nestedUl) {
|
|
@@ -57,7 +57,7 @@ export function MenuExpando(props) {
|
|
|
57
57
|
isAnimating = true;
|
|
58
58
|
if (details.open) {
|
|
59
59
|
// Closing animation
|
|
60
|
-
ul.style.animation = '
|
|
60
|
+
ul.style.animation = 'menu-expando-slide-up 0.3s ease-out forwards';
|
|
61
61
|
setTimeout(() => {
|
|
62
62
|
details.open = false;
|
|
63
63
|
ul.style.animation = '';
|
|
@@ -67,7 +67,7 @@ export function MenuExpando(props) {
|
|
|
67
67
|
else {
|
|
68
68
|
// Opening animation
|
|
69
69
|
details.open = true;
|
|
70
|
-
ul.style.animation = '
|
|
70
|
+
ul.style.animation = 'menu-expando-slide-down 0.3s ease-out forwards';
|
|
71
71
|
setTimeout(() => {
|
|
72
72
|
ul.style.animation = '';
|
|
73
73
|
isAnimating = false;
|
|
@@ -75,7 +75,7 @@ export function MenuExpando(props) {
|
|
|
75
75
|
}
|
|
76
76
|
});
|
|
77
77
|
// Handle nested menu animations
|
|
78
|
-
const nestedDetailsForAnimation = details.querySelectorAll('details.
|
|
78
|
+
const nestedDetailsForAnimation = details.querySelectorAll('details.menu-expando-nested');
|
|
79
79
|
nestedDetailsForAnimation.forEach((nested) => {
|
|
80
80
|
nested.addEventListener('toggle', (e) => {
|
|
81
81
|
const nestedUl = nested.querySelector('ul');
|
|
@@ -115,7 +115,7 @@ export function MenuExpando(props) {
|
|
|
115
115
|
for (const item of props.menuItems) {
|
|
116
116
|
if (item && item.routes && item.routes.length > 0) {
|
|
117
117
|
// Item has nested routes - create expandable submenu
|
|
118
|
-
myItems.push(_jsx("li", { children: _jsxs("details", { className: "
|
|
118
|
+
myItems.push(_jsx("li", { children: _jsxs("details", { className: "menu-expando-nested", children: [_jsx("summary", { children: _jsx("a", { href: item.path, children: item.name }) }), _jsx("ul", { children: item.routes.map((route) => (_jsx(MenuExpandoItem, { name: route.name, href: route.path }, route.name))) })] }) }, item.name));
|
|
119
119
|
}
|
|
120
120
|
else if (item) {
|
|
121
121
|
// Regular item without nested routes
|
|
@@ -134,7 +134,7 @@ export function MenuExpando(props) {
|
|
|
134
134
|
}
|
|
135
135
|
return myItems;
|
|
136
136
|
}
|
|
137
|
-
return (_jsx("div", { className: "
|
|
137
|
+
return (_jsx("div", { className: "menu-expando", id: "menu-expando", children: _jsxs("details", { className: "menu-expando-wrapper", id: "menu-expando-wrapper", ref: detailsRef, children: [_jsx("summary", {}), _jsx("ul", { ref: ulRef, children: generateMenuItems() })] }) }));
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
140
140
|
* MenuExpandoItem — simple menu item renderer for `MenuExpando`.
|
|
@@ -169,5 +169,5 @@ export function MenuExpandoButton(props) {
|
|
|
169
169
|
handleMenuExpandoButtonClick(event);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
return (_jsx("div", { className: "
|
|
172
|
+
return (_jsx("div", { className: "menu-expando-button", id: "menu-expando-button", onClick: handleMenuExpandoButtonClick, onKeyDown: handleKeyDown, tabIndex: 0, role: "button", "aria-label": "Toggle mobile menu", children: _jsx(SmartImage, { src: "/images/icons/mobile-menu2.png", title: "Mobile Menu", alt: "Mobile Menu" }) }));
|
|
173
173
|
}
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
=============== NERDJOKE ===============
|
|
4
4
|
======================================== */
|
|
5
5
|
|
|
6
|
-
.
|
|
6
|
+
.nerd-joke {
|
|
7
7
|
padding-bottom: 20px;
|
|
8
8
|
font-size: 24px;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
.
|
|
11
|
+
.nerd-joke .joke-text div {
|
|
12
12
|
padding-bottom: 15px;
|
|
13
13
|
}
|
|
14
14
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
font-weight: bold;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.
|
|
23
|
+
.joke-button {
|
|
24
24
|
/* background-image: url(/images/pix/pix-bg-sm-bw.gif); */
|
|
25
25
|
border: 1px solid #999;
|
|
26
26
|
display: inline-block;
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
|
|
47
|
-
.
|
|
47
|
+
.joke-timer {
|
|
48
48
|
border: 1px solid #AAA;
|
|
49
49
|
position: relative;
|
|
50
50
|
/* height: 25px;
|
|
51
51
|
width: 100%; */
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
.
|
|
54
|
+
.joke-timer-svg {
|
|
55
55
|
width: 100%;
|
|
56
56
|
height: 10px;
|
|
57
57
|
fill: rgb(190,190,190);
|
|
@@ -103,7 +103,7 @@ export function NerdJoke(props) {
|
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
}, [loadJoke, startTimer]);
|
|
106
|
-
return (_jsx("div", { className: "
|
|
106
|
+
return (_jsx("div", { className: "nerd-joke", children: _jsxs("div", { className: "row-12col", children: [_jsx("div", { className: "grid-s1-e5", children: _jsx("div", { className: "left", children: _jsx(JokeButton, { clickFunction: pauseTimer, buttonText: "Pause || / Play >" }) }) }), _jsx("div", { className: "grid-s9-e13", children: _jsx("div", { className: "right", children: _jsx(JokeButton, { clickFunction: loadJoke, buttonText: "Next Joke ->" }) }) }), _jsx("div", { className: "joke-timer grid-s1-e13", children: _jsxs("div", { className: "row-12col", children: [_jsx("div", { className: "grid-s1-e11", children: _jsx("svg", { className: "joke-timer-svg", xmlns: "http://www.w3.org/2000/svg", children: _jsx("rect", { id: "jokeTimerPathElapsed" }) }) }), _jsx("div", { className: "grid-s11-e13 center", id: "jokeTimerLabel", children: formatTimeLeft(timeLeftRef.current) })] }) }), _jsxs("div", { className: "joke-text grid-s1-e13", children: [_jsxs("div", { children: [_jsx("span", { className: "label", children: "Q: " }), _jsxs("span", { className: "question", children: [" ", joke.question, " "] })] }), _jsxs("div", { children: [_jsx("span", { className: "label", children: "A: " }), _jsxs("span", { className: "answer", children: [" ", joke.answer, " "] })] })] })] }) }));
|
|
107
107
|
}
|
|
108
108
|
JokeButton.propTypes = {
|
|
109
109
|
/** Click handler invoked when the button is pressed (e.g., pause or fetch next). */
|
|
@@ -115,5 +115,5 @@ function JokeButton(props) {
|
|
|
115
115
|
/* <div className="jokeButton" onClick={props.clickFunction}>
|
|
116
116
|
{props.buttonText}
|
|
117
117
|
</div> */
|
|
118
|
-
return (_jsx("button", { className: "
|
|
118
|
+
return (_jsx("button", { className: "joke-button", onClick: props.clickFunction, children: props.buttonText }));
|
|
119
119
|
}
|
|
@@ -259,5 +259,5 @@ export function BackToTop() {
|
|
|
259
259
|
return false;
|
|
260
260
|
}
|
|
261
261
|
const config = usePixelatedConfig();
|
|
262
|
-
return (_jsx("div", { className: "
|
|
262
|
+
return (_jsx("div", { className: "back-to-top", children: _jsxs("a", { href: "#top", onClick: scrollToTop, children: [_jsx("div", { children: _jsx(SmartImage, { src: "/images/icons/up.jpg", title: "Back To Top", alt: "Back To Top", cloudinaryEnv: config?.cloudinary?.product_env ?? undefined, cloudinaryDomain: config?.cloudinary?.baseUrl ?? undefined, cloudinaryTransforms: config?.cloudinary?.transforms ?? undefined }) }), _jsx("div", { children: "Back To Top" })] }) }));
|
|
263
263
|
}
|
|
@@ -243,7 +243,7 @@ export function PageGridItem({ id, className, columnSpan, rowSpan, columnStart,
|
|
|
243
243
|
return (
|
|
244
244
|
/* THIS IS AN OLD STYLE */
|
|
245
245
|
/* <div className={"grid-item" + */
|
|
246
|
-
_jsx("div", { className: "
|
|
246
|
+
_jsx("div", { className: "grid-item" +
|
|
247
247
|
(className ? ` ${className}` : '') +
|
|
248
248
|
(columnStart && columnSpan && !columnEnd ? ` grid-s${columnStart}-w${columnSpan}` : '') +
|
|
249
249
|
(columnStart && columnEnd && !columnSpan ? ` grid-s${columnStart}-e${columnEnd}` : ''), id: (id) ? id : undefined, style: itemStyle, children: children }));
|