// 黄帝故里 H5 原型 · 共享组件层 (function () { var h = React.createElement; function Icon(paths, extra) { return h('svg', Object.assign({ viewBox: '0 0 24 24', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', stroke: 'currentColor', strokeWidth: '1.8', strokeLinecap: 'round', strokeLinejoin: 'round', className: 'hd-icon' }, extra || {}), paths); } var I = { back: h('svg', { key: 'b', viewBox: '0 0 24 24', className: 'hd-icon', fill: 'none', stroke: 'currentColor', strokeWidth: '2', strokeLinecap: 'round', strokeLinejoin: 'round' }, h('path', { d: 'M15 18l-6-6 6-6' })), home: h('svg', { key: 'h', viewBox: '0 0 24 24', className: 'hd-icon', fill: 'none', stroke: 'currentColor', strokeWidth: '1.8', strokeLinecap: 'round', strokeLinejoin: 'round' }, h('path', { d: 'M3 10.5L12 3l9 7.5M5 9.5V21h14V9.5' })), music: h('svg', { key: 'm', viewBox: '0 0 24 24', className: 'hd-icon', fill: 'none', stroke: 'currentColor', strokeWidth: '1.8', strokeLinecap: 'round', strokeLinejoin: 'round' }, [h('path', { d: 'M9 18V5l11-2v13', key: '1' }), h('circle', { cx: '6.5', cy: '18', r: '2.5', key: '2' }), h('circle', { cx: '17.5', cy: '16', r: '2.5', key: '3' })]), check: h('svg', { key: 'c', viewBox: '0 0 24 24', className: 'hd-icon', fill: 'none', stroke: 'currentColor', strokeWidth: '2.2', strokeLinecap: 'round', strokeLinejoin: 'round' }, h('path', { d: 'M4 12.5l5 5L20 6.5' })), close: h('svg', { key: 'x', viewBox: '0 0 24 24', className: 'hd-icon', fill: 'none', stroke: 'currentColor', strokeWidth: '2', strokeLinecap: 'round' }, [h('path', { d: 'M6 6l12 12', key: '1' }), h('path', { d: 'M18 6L6 18', key: '2' })]), chevron: h('svg', { key: 'v', viewBox: '0 0 24 24', className: 'hd-icon', fill: 'none', stroke: 'currentColor', strokeWidth: '2', strokeLinecap: 'round', strokeLinejoin: 'round' }, h('path', { d: 'M9 6l6 6-6 6' })), share: h('svg', { key: 's', viewBox: '0 0 24 24', className: 'hd-icon', fill: 'none', stroke: 'currentColor', strokeWidth: '1.8', strokeLinecap: 'round', strokeLinejoin: 'round' }, [h('circle', { cx: '6', cy: '12', r: '2.5', key: '1' }), h('circle', { cx: '18', cy: '5', r: '2.5', key: '2' }), h('circle', { cx: '18', cy: '19', r: '2.5', key: '3' }), h('path', { d: 'M8.2 10.8l7.6-4.1M8.2 13.2l7.6 4.1', key: '4' })]), download: h('svg', { key: 'd', viewBox: '0 0 24 24', className: 'hd-icon', fill: 'none', stroke: 'currentColor', strokeWidth: '1.8', strokeLinecap: 'round', strokeLinejoin: 'round' }, [h('path', { d: 'M12 3v12m0 0l-4.5-4.5M12 15l4.5-4.5', key: '1' }), h('path', { d: 'M4 17v2.5A1.5 1.5 0 005.5 21h13a1.5 1.5 0 001.5-1.5V17', key: '2' })]), pin: h('svg', { key: 'p', viewBox: '0 0 24 24', className: 'hd-icon', fill: 'none', stroke: 'currentColor', strokeWidth: '1.8', strokeLinecap: 'round', strokeLinejoin: 'round' }, [h('path', { d: 'M12 21s7-5.6 7-11a7 7 0 10-14 0c0 5.4 7 11 7 11z', key: '1' }), h('circle', { cx: '12', cy: '10', r: '2.6', key: '2' })]), clock: h('svg', { key: 't', viewBox: '0 0 24 24', className: 'hd-icon', fill: 'none', stroke: 'currentColor', strokeWidth: '1.8', strokeLinecap: 'round', strokeLinejoin: 'round' }, [h('circle', { cx: '12', cy: '12', r: '9', key: '1' }), h('path', { d: 'M12 7v5.2l3.5 2', key: '2' })]), ticket: h('svg', { key: 'tk', viewBox: '0 0 24 24', className: 'hd-icon', fill: 'none', stroke: 'currentColor', strokeWidth: '1.8', strokeLinecap: 'round', strokeLinejoin: 'round' }, [h('path', { d: 'M4 8a2 2 0 012-2h12a2 2 0 012 2v2a2 2 0 000 4v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2a2 2 0 000-4V8z', key: '1' }), h('path', { d: 'M14 6v12', strokeDasharray: '2 2.5', key: '2' })]), car: h('svg', { key: 'ca', viewBox: '0 0 24 24', className: 'hd-icon', fill: 'none', stroke: 'currentColor', strokeWidth: '1.8', strokeLinecap: 'round', strokeLinejoin: 'round' }, [h('path', { d: 'M5 16l1.5-5.5A2 2 0 018.4 9h7.2a2 2 0 011.9 1.5L19 16', key: '1' }), h('rect', { x: '3.5', y: '15', width: '17', height: '4.5', rx: '1.2', key: '2' }), h('circle', { cx: '7.5', cy: '19.6', r: '1.4', key: '3' }), h('circle', { cx: '16.5', cy: '19.6', r: '1.4', key: '4' })]) }; function StatusBar() { return h('div', { className: 'status-bar' }, [ h('span', { key: 'time', className: 'sb-time' }, '9:44'), h('div', { key: 'icons', className: 'sb-icons' }, [ h('svg', { key: 'sig', width: '17', height: '11', viewBox: '0 0 17 11', fill: 'currentColor' }, [h('rect', { key: 's1', x: '0', y: '7', width: '3', height: '4', rx: '0.6' }), h('rect', { key: 's2', x: '4.5', y: '5', width: '3', height: '6', rx: '0.6' }), h('rect', { key: 's3', x: '9', y: '2.5', width: '3', height: '8.5', rx: '0.6' }), h('rect', { key: 's4', x: '13.5', y: '0', width: '3', height: '11', rx: '0.6' })]), h('svg', { key: 'wifi', width: '16', height: '11', viewBox: '0 0 16 12', fill: 'none', stroke: 'currentColor', strokeWidth: '1.4', strokeLinecap: 'round' }, [h('path', { d: 'M1.5 4.2a10 10 0 0113 0', key: '1' }), h('path', { d: 'M4 6.8a6.2 6.2 0 018 0', key: '2' }), h('circle', { cx: '8', cy: '9.8', r: '1.1', fill: 'currentColor', stroke: 'none', key: '3' })]), h('svg', { key: 'bat', width: '25', height: '12', viewBox: '0 0 25 12', fill: 'none' }, [h('rect', { key: 'r', x: '0.5', y: '0.5', width: '21', height: '11', rx: '2.5', stroke: 'currentColor', opacity: '0.5' }), h('rect', { key: 'f', x: '2.2', y: '2.2', width: '15', height: '7.6', rx: '1.4', fill: 'currentColor' }), h('path', { d: 'M23.5 4v4a2.2 2.2 0 000-4z', fill: 'currentColor', key: 'p' })]) ]) ]); } function TopBar(props) { return h('div', { className: 'top-bar' }, [ h('button', { key: 'back', className: 'tb-btn', onClick: function () { if (window.HDAudio) window.HDAudio.tap(); props.onBack(); }, 'aria-label': '返回' }, I.back), h('div', { key: 'title', className: 'tb-title' }, props.title || '黄帝故里'), h('button', { key: 'bgm', className: 'tb-btn' + (props.bgmOn ? ' active' : ''), onClick: props.onBgm, 'aria-label': '背景音乐' }, I.music) ]); } function GoldButton(props) { var cls = 'btn ' + (props.variant === 'ghost' ? 'btn-ghost' : props.variant === 'red' ? 'btn-red' : 'btn-gold'); return h('button', { className: cls + (props.block ? ' btn-block' : '') + (props.disabled ? ' is-disabled' : ''), onClick: props.disabled ? undefined : function (ev) { if (window.HDAudio) window.HDAudio.tap(); if (props.onClick) props.onClick(ev); } }, props.children); } function Seal(props) { return h('div', { className: 'seal ' + (props.done ? 'seal-on' : 'seal-off') + (props.stamp ? ' seal-stamp' : '') }, [ h('span', { key: 's', className: 'seal-text' }, props.label) ]); } function CloudDecor() { return h('div', { className: 'cloud-decor', 'aria-hidden': 'true' }, [ h('svg', { key: 'c1', viewBox: '0 0 200 60', className: 'cloud cloud-1' }, h('path', { d: 'M20 45c-10 0-16-8-13-17 2-7 9-10 16-9 3-11 15-17 26-13 8 3 13 10 14 18 9-2 18 3 20 11 2 9-5 16-15 16H20z', fill: 'currentColor' })), h('svg', { key: 'c2', viewBox: '0 0 200 60', className: 'cloud cloud-2' }, h('path', { d: 'M20 45c-10 0-16-8-13-17 2-7 9-10 16-9 3-11 15-17 26-13 8 3 13 10 14 18 9-2 18 3 20 11 2 9-5 16-15 16H20z', fill: 'currentColor' })), h('svg', { key: 'c3', viewBox: '0 0 200 60', className: 'cloud cloud-3' }, h('path', { d: 'M20 45c-10 0-16-8-13-17 2-7 9-10 16-9 3-11 15-17 26-13 8 3 13 10 14 18 9-2 18 3 20 11 2 9-5 16-15 16H20z', fill: 'currentColor' })) ]); } function Toast(props) { if (!props.msg) return null; return h('div', { className: 'toast', role: 'status' }, props.msg); } function SectionTitle(props) { return h('div', { className: 'section-title' }, [ h('span', { key: 'l', className: 'st-line' }), h('span', { key: 't', className: 'st-text' }, props.children), h('span', { key: 'r', className: 'st-line' }) ]); } window.HDUI = { I: I, Icon: Icon, StatusBar: StatusBar, TopBar: TopBar, GoldButton: GoldButton, Seal: Seal, CloudDecor: CloudDecor, Toast: Toast, SectionTitle: SectionTitle }; })();