impact-ui 5.0.0 → 5.0.1-beta.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/_virtual/index13.js +2 -2
- package/dist/_virtual/index14.js +2 -2
- package/dist/_virtual/index15.js +2 -2
- package/dist/_virtual/index16.js +2 -2
- package/dist/_virtual/index2.js +2 -2
- package/dist/_virtual/index3.js +4 -2
- package/dist/_virtual/index4.js +3 -3
- package/dist/_virtual/index5.js +2 -4
- package/dist/assets/halloween_candle_light.html.js +2320 -0
- package/dist/assets/halloween_night.html.js +2307 -0
- package/dist/components/Accordion/index.js +1 -1
- package/dist/components/AccordionModern/SortableAccordionComp.d.ts +2 -2
- package/dist/components/AccordionModern/SortableAccordionComp.d.ts.map +1 -1
- package/dist/components/AccordionModern/SortableAccordionComp.js +2 -2
- package/dist/components/AccordionModern/index.d.ts +1 -1
- package/dist/components/AccordionModern/index.d.ts.map +1 -1
- package/dist/components/AccordionModern/index.js +34 -41
- package/dist/components/Alert/index.js +1 -1
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Badge/filled/filledIconLabelBadges/index.d.ts +1 -1
- package/dist/components/Badge/filled/filledIconLabelBadges/index.d.ts.map +1 -1
- package/dist/components/Badge/filled/filledIconLabelBadges/index.js +1 -1
- package/dist/components/Badge/filled/filledOnlyIconBadges/index.d.ts +1 -1
- package/dist/components/Badge/filled/filledOnlyIconBadges/index.d.ts.map +1 -1
- package/dist/components/Badge/filled/filledOnlyIconBadges/index.js +1 -1
- package/dist/components/Badge/filled/filledOnlyLabelBadges/index.d.ts +1 -1
- package/dist/components/Badge/filled/filledOnlyLabelBadges/index.d.ts.map +1 -1
- package/dist/components/Badge/filled/filledOnlyLabelBadges/index.js +1 -1
- package/dist/components/Badge/filled/index.d.ts +1 -1
- package/dist/components/Badge/filled/index.d.ts.map +1 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Badge/stroke/index.d.ts +1 -1
- package/dist/components/Badge/stroke/index.d.ts.map +1 -1
- package/dist/components/Badge/stroke/strokeIconLabelBadges/index.d.ts +1 -1
- package/dist/components/Badge/stroke/strokeIconLabelBadges/index.d.ts.map +1 -1
- package/dist/components/Badge/stroke/strokeIconLabelBadges/index.js +1 -1
- package/dist/components/Badge/stroke/strokeOnlyIconBadges/index.d.ts +1 -1
- package/dist/components/Badge/stroke/strokeOnlyIconBadges/index.d.ts.map +1 -1
- package/dist/components/Badge/stroke/strokeOnlyIconBadges/index.js +1 -1
- package/dist/components/Badge/stroke/strokeOnlyLabelBadges/index.d.ts +1 -1
- package/dist/components/Badge/stroke/strokeOnlyLabelBadges/index.d.ts.map +1 -1
- package/dist/components/Badge/stroke/strokeOnlyLabelBadges/index.js +1 -1
- package/dist/components/Badge/subtle/index.d.ts +1 -1
- package/dist/components/Badge/subtle/index.d.ts.map +1 -1
- package/dist/components/Badge/subtle/subtleIOnlyIconBadges/index.d.ts +1 -1
- package/dist/components/Badge/subtle/subtleIOnlyIconBadges/index.d.ts.map +1 -1
- package/dist/components/Badge/subtle/subtleIOnlyIconBadges/index.js +1 -1
- package/dist/components/Badge/subtle/subtleIconLabelBadges/index.d.ts +1 -1
- package/dist/components/Badge/subtle/subtleIconLabelBadges/index.d.ts.map +1 -1
- package/dist/components/Badge/subtle/subtleIconLabelBadges/index.js +1 -1
- package/dist/components/Badge/subtle/subtleOnlyLabelBadges/index.d.ts +1 -1
- package/dist/components/Badge/subtle/subtleOnlyLabelBadges/index.d.ts.map +1 -1
- package/dist/components/Badge/subtle/subtleOnlyLabelBadges/index.js +1 -1
- package/dist/components/BottomSheet/index.d.ts +1 -1
- package/dist/components/BottomSheet/index.d.ts.map +1 -1
- package/dist/components/BottomSheet/index.js +1 -1
- package/dist/components/Breadcrumbs/HomeIcon.d.ts +1 -1
- package/dist/components/Breadcrumbs/HomeIcon.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/HomeIcon.js +1 -1
- package/dist/components/Breadcrumbs/index.d.ts +1 -1
- package/dist/components/Breadcrumbs/index.d.ts.map +1 -1
- package/dist/components/Breadcrumbs/index.js +8 -2
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +5 -1
- package/dist/components/ButtonGroup/index.d.ts +1 -1
- package/dist/components/ButtonGroup/index.d.ts.map +1 -1
- package/dist/components/ButtonGroup/index.js +1 -1
- package/dist/components/Card/index.js +1 -1
- package/dist/components/Chart/ChartSkeleton.d.ts +1 -1
- package/dist/components/Chart/ChartSkeleton.d.ts.map +1 -1
- package/dist/components/Chart/ChartSkeleton.js +24 -17
- package/dist/components/Chart/index.d.ts +2 -1
- package/dist/components/Chart/index.d.ts.map +1 -1
- package/dist/components/Chart/index.js +84 -28
- package/dist/components/Chatbot/Chatbot.types.d.ts +2 -0
- package/dist/components/Chatbot/Chatbot.types.d.ts.map +1 -1
- package/dist/components/Chatbot/bookMarkPanel.d.ts +1 -1
- package/dist/components/Chatbot/bookMarkPanel.d.ts.map +1 -1
- package/dist/components/Chatbot/bookMarkPanel.js +12 -5
- package/dist/components/Chatbot/chatBotFooter.d.ts +1 -1
- package/dist/components/Chatbot/chatBotFooter.d.ts.map +1 -1
- package/dist/components/Chatbot/chatBotLandingScreen.d.ts +1 -1
- package/dist/components/Chatbot/chatBotLandingScreen.d.ts.map +1 -1
- package/dist/components/Chatbot/chatInput.d.ts +1 -1
- package/dist/components/Chatbot/chatInput.d.ts.map +1 -1
- package/dist/components/Chatbot/chatInput.js +7 -9
- package/dist/components/Chatbot/chatbotModuleMenu.d.ts +1 -1
- package/dist/components/Chatbot/chatbotModuleMenu.d.ts.map +1 -1
- package/dist/components/Chatbot/chatbotModuleMenu.js +10 -15
- package/dist/components/Chatbot/constant.d.ts.map +1 -1
- package/dist/components/Chatbot/constant.js +12 -12
- package/dist/components/Chatbot/conversationScreen.d.ts +1 -1
- package/dist/components/Chatbot/conversationScreen.d.ts.map +1 -1
- package/dist/components/Chatbot/customScreen.d.ts +1 -1
- package/dist/components/Chatbot/customScreen.d.ts.map +1 -1
- package/dist/components/Chatbot/historyPanel.d.ts +1 -1
- package/dist/components/Chatbot/historyPanel.d.ts.map +1 -1
- package/dist/components/Chatbot/historyPanel.js +157 -93
- package/dist/components/Chatbot/index.d.ts +1 -1
- package/dist/components/Chatbot/index.d.ts.map +1 -1
- package/dist/components/Chatbot/index.js +7 -4
- package/dist/components/Chatbot/newChatComponent.d.ts +1 -1
- package/dist/components/Chatbot/newChatComponent.d.ts.map +1 -1
- package/dist/components/Checkbox/WithDropDown.d.ts +1 -1
- package/dist/components/Checkbox/WithDropDown.d.ts.map +1 -1
- package/dist/components/Checkbox/WithoutFormLabel.d.ts +1 -1
- package/dist/components/Checkbox/WithoutFormLabel.d.ts.map +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Chips/chipLeadingIcon.d.ts +6 -0
- package/dist/components/Chips/chipLeadingIcon.d.ts.map +1 -0
- package/dist/components/Chips/chipLeadingIcon.js +46 -0
- package/dist/components/Chips/index.d.ts.map +1 -1
- package/dist/components/Chips/index.js +7 -2
- package/dist/components/CommentsPanel/CommentsContext.d.ts +1 -1
- package/dist/components/CommentsPanel/CommentsContext.d.ts.map +1 -1
- package/dist/components/CommentsPanel/CommentsContext.js +5 -4
- package/dist/components/CommentsPanel/CommentsPanel.impl.d.ts +1 -1
- package/dist/components/CommentsPanel/CommentsPanel.impl.d.ts.map +1 -1
- package/dist/components/CommentsPanel/CommentsPanel.impl.js +11 -8
- package/dist/components/CommentsPanel/CommentsPanel.types.d.ts +1 -1
- package/dist/components/CommentsPanel/CommentsPanel.types.d.ts.map +1 -1
- package/dist/components/CreateItemFlow/index.js +1 -1
- package/dist/components/DatePicker/datePickerDropdown.d.ts +1 -1
- package/dist/components/DatePicker/datePickerDropdown.d.ts.map +1 -1
- package/dist/components/DatePicker/datePickerFooter.d.ts +1 -1
- package/dist/components/DatePicker/datePickerFooter.d.ts.map +1 -1
- package/dist/components/DatePicker/datePickerInput.d.ts.map +1 -1
- package/dist/components/DatePicker/datePickerInput.js +5 -2
- package/dist/components/DatePicker/index.js +2 -2
- package/dist/components/DatePicker/showMonthYearSelect.d.ts +1 -1
- package/dist/components/DatePicker/showMonthYearSelect.d.ts.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.types.d.ts +21 -1
- package/dist/components/DateRangePicker/DateRangePicker.types.d.ts.map +1 -1
- package/dist/components/DateRangePicker/dateRangePickerCustom.d.ts +1 -1
- package/dist/components/DateRangePicker/dateRangePickerCustom.d.ts.map +1 -1
- package/dist/components/DateRangePicker/dateRangePickerDropdown.d.ts +3 -1
- package/dist/components/DateRangePicker/dateRangePickerDropdown.d.ts.map +1 -1
- package/dist/components/DateRangePicker/dateRangePickerDropdown.js +129 -68
- package/dist/components/DateRangePicker/dateRangePickerFooter.d.ts +1 -1
- package/dist/components/DateRangePicker/dateRangePickerFooter.d.ts.map +1 -1
- package/dist/components/DateRangePicker/dateRangePickerInput.d.ts +1 -1
- package/dist/components/DateRangePicker/dateRangePickerInput.d.ts.map +1 -1
- package/dist/components/DateRangePicker/dateRangePickerInput.js +6 -7
- package/dist/components/DateRangePicker/index.d.ts +1 -1
- package/dist/components/DateRangePicker/index.d.ts.map +1 -1
- package/dist/components/DateRangePicker/index.js +4 -2
- package/dist/components/DateRangePicker/showMonthYearSelect.d.ts +1 -1
- package/dist/components/DateRangePicker/showMonthYearSelect.d.ts.map +1 -1
- package/dist/components/DateRangePicker/utils.d.ts +21 -0
- package/dist/components/DateRangePicker/utils.d.ts.map +1 -1
- package/dist/components/DateRangePicker/utils.js +97 -0
- package/dist/components/DynamicLayout/index.d.ts +2 -1
- package/dist/components/DynamicLayout/index.d.ts.map +1 -1
- package/dist/components/DynamicLayout/index.js +1 -1
- package/dist/components/EmptyState/EmptyStateImage.d.ts +2 -2
- package/dist/components/EmptyState/EmptyStateImage.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyStateImage.js +26 -13
- package/dist/components/EmptyState/index.d.ts +1 -1
- package/dist/components/EmptyState/index.d.ts.map +1 -1
- package/dist/components/EmptyState/index.js +29 -1
- package/dist/components/FileUpload/TemplatePreview.d.ts +1 -1
- package/dist/components/FileUpload/TemplatePreview.d.ts.map +1 -1
- package/dist/components/FileUpload/index.d.ts +1 -1
- package/dist/components/FileUpload/index.d.ts.map +1 -1
- package/dist/components/FileUpload/index.js +11 -4
- package/dist/components/FilterPanel/FilterPanelHeader.d.ts +1 -1
- package/dist/components/FilterPanel/FilterPanelHeader.d.ts.map +1 -1
- package/dist/components/FilterPanel/PanelFooter.d.ts +1 -1
- package/dist/components/FilterPanel/PanelFooter.d.ts.map +1 -1
- package/dist/components/FilterPanel/PanelSidebar.d.ts +1 -1
- package/dist/components/FilterPanel/PanelSidebar.d.ts.map +1 -1
- package/dist/components/FilterPanel/index.d.ts +1 -1
- package/dist/components/FilterPanel/index.d.ts.map +1 -1
- package/dist/components/FilterPanel/index.js +67 -43
- package/dist/components/FiltersStrip/AppliedFilters.d.ts +1 -1
- package/dist/components/FiltersStrip/AppliedFilters.d.ts.map +1 -1
- package/dist/components/FiltersStrip/FilterDropDown.d.ts +1 -1
- package/dist/components/FiltersStrip/FilterDropDown.d.ts.map +1 -1
- package/dist/components/FiltersStrip/FilterSlider.d.ts +1 -1
- package/dist/components/FiltersStrip/FilterSlider.d.ts.map +1 -1
- package/dist/components/FiltersStrip/FilterSlider.js +1 -1
- package/dist/components/FiltersStrip/FilterSliderPortal.d.ts +1 -1
- package/dist/components/FiltersStrip/FilterSliderPortal.d.ts.map +1 -1
- package/dist/components/FiltersStrip/index.d.ts +1 -1
- package/dist/components/FiltersStrip/index.d.ts.map +1 -1
- package/dist/components/FiltersStrip/index.js +1 -1
- package/dist/components/HalloweenStyleIntro/HalloweenStyleIntroProvider.d.ts +14 -0
- package/dist/components/HalloweenStyleIntro/HalloweenStyleIntroProvider.d.ts.map +1 -0
- package/dist/components/HalloweenStyleIntro/HalloweenStyleIntroProvider.js +112 -0
- package/dist/components/HalloweenStyleIntro/halloweenIntro.constants.d.ts +8 -0
- package/dist/components/HalloweenStyleIntro/halloweenIntro.constants.d.ts.map +1 -0
- package/dist/components/HalloweenStyleIntro/halloweenIntro.constants.js +4 -0
- package/dist/components/HalloweenStyleIntro/halloweenIntroHtml.d.ts +8 -0
- package/dist/components/HalloweenStyleIntro/halloweenIntroHtml.d.ts.map +1 -0
- package/dist/components/HalloweenStyleIntro/halloweenIntroHtml.js +21 -0
- package/dist/components/HalloweenStyleIntro/index.d.ts +4 -0
- package/dist/components/HalloweenStyleIntro/index.d.ts.map +1 -0
- package/dist/components/Header/Header.types.d.ts +22 -4
- package/dist/components/Header/Header.types.d.ts.map +1 -1
- package/dist/components/Header/index.d.ts +1 -1
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +89 -48
- package/dist/components/HomePage/HomePage.types.d.ts +3 -2
- package/dist/components/HomePage/HomePage.types.d.ts.map +1 -1
- package/dist/components/HomePage/constants.d.ts.map +1 -1
- package/dist/components/HomePage/constants.js +23 -44
- package/dist/components/HomePage/index.d.ts +1 -1
- package/dist/components/HomePage/index.d.ts.map +1 -1
- package/dist/components/HomePage/index.js +28 -23
- package/dist/components/ImpactIcon/index.d.ts +19 -0
- package/dist/components/ImpactIcon/index.d.ts.map +1 -0
- package/dist/components/ImpactIcon/index.js +52 -0
- package/dist/components/Input/HelperText.d.ts +1 -1
- package/dist/components/Input/HelperText.d.ts.map +1 -1
- package/dist/components/Input/HelperText.js +3 -1
- package/dist/components/Input/InputWithIcon.d.ts +1 -1
- package/dist/components/Input/InputWithIcon.d.ts.map +1 -1
- package/dist/components/Input/InputWithIcon.js +1 -1
- package/dist/components/Input/VanillaInput.d.ts +1 -1
- package/dist/components/Input/VanillaInput.d.ts.map +1 -1
- package/dist/components/Input/VanillaInput.js +1 -1
- package/dist/components/Input/index.js +3 -3
- package/dist/components/KeyboardShortCuts/Keycombo.d.ts +2 -2
- package/dist/components/KeyboardShortCuts/Keycombo.d.ts.map +1 -1
- package/dist/components/KeyboardShortCuts/ShortcutLandingPage.d.ts +1 -1
- package/dist/components/KeyboardShortCuts/ShortcutLandingPage.d.ts.map +1 -1
- package/dist/components/KeyboardShortCuts/ShortcutLandingPage.js +5 -4
- package/dist/components/KeyboardShortCuts/ShortcutModal.d.ts +1 -1
- package/dist/components/KeyboardShortCuts/ShortcutModal.d.ts.map +1 -1
- package/dist/components/KeyboardShortCuts/ShortcutModal.js +2 -2
- package/dist/components/KeyboardShortCuts/StarOutlineIcon.d.ts +1 -1
- package/dist/components/KeyboardShortCuts/StarOutlineIcon.d.ts.map +1 -1
- package/dist/components/KeyboardShortCuts/allSetBox.d.ts +1 -1
- package/dist/components/KeyboardShortCuts/allSetBox.d.ts.map +1 -1
- package/dist/components/KeyboardShortCuts/allSetBox.js +2 -2
- package/dist/components/KeyboardShortCuts/index.d.ts +1 -1
- package/dist/components/KeyboardShortCuts/index.d.ts.map +1 -1
- package/dist/components/KeyboardShortCuts/index.js +1 -1
- package/dist/components/KeyboardShortCuts/screen2.d.ts +1 -1
- package/dist/components/KeyboardShortCuts/screen2.d.ts.map +1 -1
- package/dist/components/KeyboardShortCuts/screen3.d.ts +1 -1
- package/dist/components/KeyboardShortCuts/screen3.d.ts.map +1 -1
- package/dist/components/KeyboardShortCuts/tutorial.d.ts +2 -1
- package/dist/components/KeyboardShortCuts/tutorial.d.ts.map +1 -1
- package/dist/components/KeyboardShortCuts/tutorial.js +3 -2
- package/dist/components/Loader/HalloweenLoaderSlides.d.ts +13 -0
- package/dist/components/Loader/HalloweenLoaderSlides.d.ts.map +1 -0
- package/dist/components/Loader/HalloweenLoaderSlides.js +109 -0
- package/dist/components/Loader/index.d.ts +1 -1
- package/dist/components/Loader/index.d.ts.map +1 -1
- package/dist/components/Loader/index.js +3 -1
- package/dist/components/Menu/IconMenuItem.js +1 -1
- package/dist/components/Menu/MenuHeaderInfo.d.ts +2 -2
- package/dist/components/Menu/MenuHeaderInfo.d.ts.map +1 -1
- package/dist/components/Menu/MenuHeaderInfo.js +10 -2
- package/dist/components/Menu/NestedMenuItem.js +1 -1
- package/dist/components/Menu/index.js +5 -14
- package/dist/components/Menu/nestedMenuItemsFromObject.js +1 -1
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/Modal/index.js +1 -1
- package/dist/components/MonthPicker/index.d.ts +1 -1
- package/dist/components/MonthPicker/index.d.ts.map +1 -1
- package/dist/components/MonthPicker/index.js +10 -4
- package/dist/components/MonthRangePicker/constants.d.ts +4 -0
- package/dist/components/MonthRangePicker/constants.d.ts.map +1 -1
- package/dist/components/MonthRangePicker/constants.js +15 -1
- package/dist/components/MonthRangePicker/index.d.ts +1 -1
- package/dist/components/MonthRangePicker/index.d.ts.map +1 -1
- package/dist/components/MonthRangePicker/index.js +32 -28
- package/dist/components/NewCreateItemFlow/index.d.ts +1 -1
- package/dist/components/NewCreateItemFlow/index.d.ts.map +1 -1
- package/dist/components/NewCreateItemFlow/index.js +1 -1
- package/dist/components/NewDynamicLayout/index.d.ts +1 -1
- package/dist/components/NewDynamicLayout/index.d.ts.map +1 -1
- package/dist/components/NewDynamicLayout/index.js +13 -15
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationChipsList.d.ts +1 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationChipsList.d.ts.map +1 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.d.ts +1 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.d.ts.map +1 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationList.js +1 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.d.ts +1 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.d.ts.map +1 -1
- package/dist/components/Notification/NotificationBody/NotificationList/NotificationListItem.js +12 -16
- package/dist/components/Notification/NotificationBody/NotificationPanelContent.d.ts +1 -1
- package/dist/components/Notification/NotificationBody/NotificationPanelContent.d.ts.map +1 -1
- package/dist/components/Notification/NotificationBody/NotificationTaskList.d.ts +1 -1
- package/dist/components/Notification/NotificationBody/NotificationTaskList.d.ts.map +1 -1
- package/dist/components/Notification/NotificationBody/index.d.ts +1 -1
- package/dist/components/Notification/NotificationBody/index.d.ts.map +1 -1
- package/dist/components/Notification/NotificationHeader.d.ts.map +1 -1
- package/dist/components/Notification/NotificationHeader.js +13 -3
- package/dist/components/Notification/index.d.ts +1 -1
- package/dist/components/Notification/index.d.ts.map +1 -1
- package/dist/components/Notification/index.js +1 -1
- package/dist/components/OnboardingTour/index.d.ts +1 -1
- package/dist/components/OnboardingTour/index.d.ts.map +1 -1
- package/dist/components/OnboardingTour/index.js +10 -4
- package/dist/components/OnboardingTour/productTourList.d.ts +1 -1
- package/dist/components/OnboardingTour/productTourList.d.ts.map +1 -1
- package/dist/components/OnboardingTour/productTourList.js +4 -4
- package/dist/components/OnboardingTour/tooltipCard.d.ts +1 -1
- package/dist/components/OnboardingTour/tooltipCard.d.ts.map +1 -1
- package/dist/components/OnboardingTour/tooltipCard.js +2 -2
- package/dist/components/Panel/index.d.ts +1 -1
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +13 -7
- package/dist/components/Popover/Popover.types.d.ts +5 -0
- package/dist/components/Popover/Popover.types.d.ts.map +1 -1
- package/dist/components/Popover/index.d.ts +1 -1
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +12 -4
- package/dist/components/ProfileMenu/ProfileMenu.types.d.ts +50 -0
- package/dist/components/ProfileMenu/ProfileMenu.types.d.ts.map +1 -0
- package/dist/components/ProfileMenu/ProfileMenuListItem.d.ts +12 -0
- package/dist/components/ProfileMenu/ProfileMenuListItem.d.ts.map +1 -0
- package/dist/components/ProfileMenu/ProfileMenuListItem.js +42 -0
- package/dist/components/ProfileMenu/index.d.ts +11 -0
- package/dist/components/ProfileMenu/index.d.ts.map +1 -0
- package/dist/components/ProfileMenu/index.js +160 -0
- package/dist/components/ProgressBar/index.d.ts +1 -1
- package/dist/components/ProgressBar/index.d.ts.map +1 -1
- package/dist/components/ProgressBar/index.js +1 -1
- package/dist/components/Prompt/index.d.ts +1 -1
- package/dist/components/Prompt/index.d.ts.map +1 -1
- package/dist/components/Prompt/index.js +10 -2
- package/dist/components/RadioButtonGroup/index.d.ts +1 -1
- package/dist/components/RadioButtonGroup/index.d.ts.map +1 -1
- package/dist/components/RadioButtonGroup/index.js +1 -1
- package/dist/components/Select/customGroupHeading.d.ts +1 -1
- package/dist/components/Select/customGroupHeading.d.ts.map +1 -1
- package/dist/components/Select/dropdown.d.ts +1 -1
- package/dist/components/Select/dropdown.d.ts.map +1 -1
- package/dist/components/Select/index.js +2 -2
- package/dist/components/Select/menuList.d.ts +2 -1
- package/dist/components/Select/menuList.d.ts.map +1 -1
- package/dist/components/Select/menuList.js +2 -1
- package/dist/components/Select/optionList.d.ts +2 -1
- package/dist/components/Select/optionList.d.ts.map +1 -1
- package/dist/components/Select/selected-option-tags.d.ts +1 -1
- package/dist/components/Select/selected-option-tags.d.ts.map +1 -1
- package/dist/components/Shortcuts/ShortcutHint.d.ts +1 -1
- package/dist/components/Shortcuts/ShortcutHint.d.ts.map +1 -1
- package/dist/components/Shortcuts/ShortcutHint.js +4 -18
- package/dist/components/Shortcuts/ShortcutScope.d.ts +1 -1
- package/dist/components/Shortcuts/ShortcutScope.d.ts.map +1 -1
- package/dist/components/Shortcuts/ShortcutsProvider.d.ts +1 -1
- package/dist/components/Shortcuts/ShortcutsProvider.d.ts.map +1 -1
- package/dist/components/Sidebar/ChildMenu.d.ts +1 -1
- package/dist/components/Sidebar/ChildMenu.d.ts.map +1 -1
- package/dist/components/Sidebar/ParentMenu.d.ts +1 -1
- package/dist/components/Sidebar/ParentMenu.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarActions.d.ts +1 -1
- package/dist/components/Sidebar/SidebarActions.d.ts.map +1 -1
- package/dist/components/Sidebar/SidebarActions.js +3 -3
- package/dist/components/Sidebar/SidebarMenus.d.ts +1 -1
- package/dist/components/Sidebar/SidebarMenus.d.ts.map +1 -1
- package/dist/components/Sidebar/index.d.ts +1 -1
- package/dist/components/Sidebar/index.d.ts.map +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/Skeleton/index.d.ts +1 -1
- package/dist/components/Skeleton/index.d.ts.map +1 -1
- package/dist/components/Skeleton/index.js +1 -1
- package/dist/components/Slider/index.d.ts +1 -1
- package/dist/components/Slider/index.d.ts.map +1 -1
- package/dist/components/Slider/index.js +8 -6
- package/dist/components/Slider/sliderValueLabel.d.ts +7 -0
- package/dist/components/Slider/sliderValueLabel.d.ts.map +1 -0
- package/dist/components/Slider/sliderValueLabel.js +31 -0
- package/dist/components/Stepper/index.d.ts +1 -1
- package/dist/components/Stepper/index.d.ts.map +1 -1
- package/dist/components/Stepper/index.js +2 -2
- package/dist/components/Switch/index.d.ts.map +1 -1
- package/dist/components/Switch/index.js +11 -10
- package/dist/components/TableChat/EmptyContainer.d.ts +2 -1
- package/dist/components/TableChat/EmptyContainer.d.ts.map +1 -1
- package/dist/components/TableChat/EmptyContainer.js +1 -1
- package/dist/components/TableChat/TableChatSidePanel.d.ts +1 -1
- package/dist/components/TableChat/TableChatSidePanel.d.ts.map +1 -1
- package/dist/components/TableChat/TableChatSidePanel.js +1 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatFooterSkeleton.d.ts +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatFooterSkeleton.d.ts.map +1 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatFooterSkeleton.js +1 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatHeaderSkeleton.d.ts +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatHeaderSkeleton.d.ts.map +1 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatHeaderSkeleton.js +1 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatMessageListSkeleton.d.ts +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatMessageListSkeleton.d.ts.map +1 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatMessageListSkeleton.js +1 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.d.ts +2 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.d.ts.map +1 -1
- package/dist/components/TableChat/components/ChatMessageSkeleton/ChatSkeleton.js +1 -1
- package/dist/components/TableChat/components/SkeletonList.d.ts +1 -1
- package/dist/components/TableChat/components/SkeletonList.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/AddChatContainer/AddChatContainer.js +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChannelCheckbox/ChannelCheckbox.d.ts +3 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChannelCheckbox/ChannelCheckbox.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelItem.js +6 -5
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelList.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatChannelList.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderButton/ChatHeaderButton.d.ts +2 -2
- package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderButton/ChatHeaderButton.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatHeaderNavigation.js +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatIconButton/ChatIconButton.d.ts +3 -1
- package/dist/components/TableChat/components/TableChatLeftSection/ChatIconButton/ChatIconButton.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/TableChatChannelHeader.js +1 -1
- package/dist/components/TableChat/components/TableChatLeftSection/UnreadBadge/UnreadBadge.d.ts +3 -1
- package/dist/components/TableChat/components/TableChatLeftSection/UnreadBadge/UnreadBadge.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.d.ts +2 -2
- package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/AvatarGroup/AvatarGroup.js +19 -37
- package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDefaultMessageType/ChatDefaultMessageType.js +13 -21
- package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatDeleteMessageType/ChatDeletedMessageType.js +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatEditedMessageType/ChatEditedMessageType.js +24 -13
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeader.js +4 -4
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderAction.js +23 -11
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatHeader/ChatHeaderInfo.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.d.ts +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatInput/ChatInput.js +21 -24
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessageActions/ChatMessageActions.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessageActions/ChatMessageActions.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.d.ts +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessageAvatar/ChatMessageAvatar.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatMessages/ChatMessage.js +5 -6
- package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ChatNotificationSettings/ChatNotificationSettings.js +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/DateSeparator/DateSeparator.js +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/EmojiPicker/EmojiPicker.d.ts +3 -1
- package/dist/components/TableChat/components/TableChatRightSection/EmojiPicker/EmojiPicker.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/FileUploader/FileUploader.d.ts +3 -1
- package/dist/components/TableChat/components/TableChatRightSection/FileUploader/FileUploader.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/FileUploader/FileUploader.js +6 -6
- package/dist/components/TableChat/components/TableChatRightSection/ImageUploader/ImageUploader.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ImageUploader/ImageUploader.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ImageUploader/ImageUploader.js +5 -5
- package/dist/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/PinedChatPanel/PinedChatPanel.js +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.d.ts +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/ReplyBadge/ReplyBadge.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.d.ts +2 -1
- package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.d.ts.map +1 -1
- package/dist/components/TableChat/components/TableChatRightSection/TableChatRightSection.js +12 -5
- package/dist/components/TableChat/components/TextEditor/EditorToolbar.js +1 -1
- package/dist/components/TableChat/components/TextEditor/Mention.d.ts.map +1 -1
- package/dist/components/TableChat/components/TextEditor/Mention.js +2 -7
- package/dist/components/TableChat/components/TextEditor/MentionList.js +1 -1
- package/dist/components/TableV36/AdvanceSearchModalItem.d.ts +3 -1
- package/dist/components/TableV36/AdvanceSearchModalItem.d.ts.map +1 -1
- package/dist/components/TableV36/AdvanceSortModal.d.ts +3 -1
- package/dist/components/TableV36/AdvanceSortModal.d.ts.map +1 -1
- package/dist/components/TableV36/AdvanceSortModal.js +42 -42
- package/dist/components/TableV36/AgGridHeader.d.ts +1 -1
- package/dist/components/TableV36/AgGridHeader.d.ts.map +1 -1
- package/dist/components/TableV36/AgGridHeader.js +21 -11
- package/dist/components/TableV36/CellTooltip.d.ts +1 -1
- package/dist/components/TableV36/CellTooltip.d.ts.map +1 -1
- package/dist/components/TableV36/CommentsPortal.d.ts.map +1 -1
- package/dist/components/TableV36/CommentsPortal.js +7 -4
- package/dist/components/TableV36/NewAdvanceSearchModal/NewAdvanceSearchModal.d.ts +3 -1
- package/dist/components/TableV36/NewAdvanceSearchModal/NewAdvanceSearchModal.d.ts.map +1 -1
- package/dist/components/TableV36/NewAdvanceSearchModal/NewAdvanceSearchModalItem.d.ts +3 -1
- package/dist/components/TableV36/NewAdvanceSearchModal/NewAdvanceSearchModalItem.d.ts.map +1 -1
- package/dist/components/TableV36/NewAdvanceSearchModal/NewAdvanceSearchModalItem.js +5 -0
- package/dist/components/TableV36/NoComments.d.ts +3 -1
- package/dist/components/TableV36/NoComments.d.ts.map +1 -1
- package/dist/components/TableV36/NoComments.js +1 -1
- package/dist/components/TableV36/Table.types.d.ts +2 -2
- package/dist/components/TableV36/Table.types.d.ts.map +1 -1
- package/dist/components/TableV36/TableSkeletonCell.d.ts +1 -1
- package/dist/components/TableV36/TableSkeletonCell.d.ts.map +1 -1
- package/dist/components/TableV36/TableSkeletonCell.js +3 -15
- package/dist/components/TableV36/actionBar.d.ts +3 -1
- package/dist/components/TableV36/actionBar.d.ts.map +1 -1
- package/dist/components/TableV36/advanceSearchModal.d.ts +3 -1
- package/dist/components/TableV36/advanceSearchModal.d.ts.map +1 -1
- package/dist/components/TableV36/index.d.ts.map +1 -1
- package/dist/components/TableV36/index.js +21 -11
- package/dist/components/TableV36/tableFunctions.d.ts.map +1 -1
- package/dist/components/TableV36/tableFunctions.js +37 -23
- package/dist/components/TableV36/tableHeader.d.ts +1 -1
- package/dist/components/TableV36/tableHeader.d.ts.map +1 -1
- package/dist/components/TableV36/tableHeader.js +5 -4
- package/dist/components/TableV36/tableIcons.d.ts +4 -2
- package/dist/components/TableV36/tableIcons.d.ts.map +1 -1
- package/dist/components/TableV36/tableMoreOptions.d.ts +3 -1
- package/dist/components/TableV36/tableMoreOptions.d.ts.map +1 -1
- package/dist/components/TableV36/tableMoreOptions.js +36 -18
- package/dist/components/TableV36/tablePagination.d.ts +3 -1
- package/dist/components/TableV36/tablePagination.d.ts.map +1 -1
- package/dist/components/TableV36/tablePagination.js +1 -1
- package/dist/components/TableV36/tableSettings.d.ts +3 -1
- package/dist/components/TableV36/tableSettings.d.ts.map +1 -1
- package/dist/components/TableV36/tableSettings.js +8 -9
- package/dist/components/TableV36/withCommentIcon.d.ts.map +1 -1
- package/dist/components/TableV36/withCommentIcon.js +13 -5
- package/dist/components/Tabs/TabPanel.d.ts +1 -1
- package/dist/components/Tabs/TabPanel.d.ts.map +1 -1
- package/dist/components/Tabs/index.d.ts +1 -1
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Tag/filled.d.ts +1 -1
- package/dist/components/Tag/filled.d.ts.map +1 -1
- package/dist/components/Tag/index.js +1 -1
- package/dist/components/Tag/solid.d.ts +1 -1
- package/dist/components/Tag/solid.d.ts.map +1 -1
- package/dist/components/Tag/stroke.d.ts +1 -1
- package/dist/components/Tag/stroke.d.ts.map +1 -1
- package/dist/components/TagGroup/index.d.ts +1 -1
- package/dist/components/TagGroup/index.d.ts.map +1 -1
- package/dist/components/TextArea/index.d.ts +1 -1
- package/dist/components/TextArea/index.d.ts.map +1 -1
- package/dist/components/TextArea/index.js +3 -3
- package/dist/components/ThemingPanel/AccentColorSection.d.ts +11 -0
- package/dist/components/ThemingPanel/AccentColorSection.d.ts.map +1 -0
- package/dist/components/ThemingPanel/AccentColorSection.js +43 -0
- package/dist/components/ThemingPanel/EnhanceContrastSection.d.ts +11 -0
- package/dist/components/ThemingPanel/EnhanceContrastSection.d.ts.map +1 -0
- package/dist/components/ThemingPanel/EnhanceContrastSection.js +42 -0
- package/dist/components/ThemingPanel/InterfaceThemeSection.d.ts +13 -0
- package/dist/components/ThemingPanel/InterfaceThemeSection.d.ts.map +1 -0
- package/dist/components/ThemingPanel/InterfaceThemeSection.js +118 -0
- package/dist/components/ThemingPanel/StylesSection.d.ts +11 -0
- package/dist/components/ThemingPanel/StylesSection.d.ts.map +1 -0
- package/dist/components/ThemingPanel/StylesSection.js +43 -0
- package/dist/components/ThemingPanel/ThemesTab.d.ts +23 -0
- package/dist/components/ThemingPanel/ThemesTab.d.ts.map +1 -0
- package/dist/components/ThemingPanel/ThemesTab.js +49 -0
- package/dist/components/ThemingPanel/ThemingPanel.d.ts +10 -0
- package/dist/components/ThemingPanel/ThemingPanel.d.ts.map +1 -0
- package/dist/components/ThemingPanel/ThemingPanel.js +198 -0
- package/dist/components/ThemingPanel/ThemingPanel.types.d.ts +31 -0
- package/dist/components/ThemingPanel/ThemingPanel.types.d.ts.map +1 -0
- package/dist/components/ThemingPanel/ThemingPanel.types.js +8 -0
- package/dist/components/ThemingPanel/index.d.ts +10 -0
- package/dist/components/ThemingPanel/index.d.ts.map +1 -0
- package/dist/components/ThemingPanel/themingPanel.constants.d.ts +23 -0
- package/dist/components/ThemingPanel/themingPanel.constants.d.ts.map +1 -0
- package/dist/components/ThemingPanel/themingPanel.constants.js +42 -0
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/components/Toast/index.d.ts.map +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/common/HelperText/index.d.ts +1 -1
- package/dist/components/common/HelperText/index.d.ts.map +1 -1
- package/dist/components/common/HelperText/index.js +1 -1
- package/dist/components/common/MentionEditor/MentionList/index.js +1 -1
- package/dist/components/common/MentionEditor/index.js +1 -1
- package/dist/components/index.d.ts +10 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +48 -0
- package/dist/components/shared/tableColumnSettings/columnsSettingsVirtualList.d.ts +1 -1
- package/dist/components/shared/tableColumnSettings/columnsSettingsVirtualList.d.ts.map +1 -1
- package/dist/components/shared/tableColumnSettings/columnsTabV36.d.ts.map +1 -1
- package/dist/components/shared/tableColumnSettings/tableSettingsV36.d.ts +3 -1
- package/dist/components/shared/tableColumnSettings/tableSettingsV36.d.ts.map +1 -1
- package/dist/i18n/I18nContext.d.ts +1 -1
- package/dist/i18n/I18nContext.d.ts.map +1 -1
- package/dist/locales/de-DE.json.d.ts +42 -0
- package/dist/locales/de-DE.json.js +42 -0
- package/dist/locales/en-US.json.d.ts +42 -0
- package/dist/locales/en-US.json.js +42 -0
- package/dist/locales/es-ES.json.d.ts +42 -0
- package/dist/locales/es-ES.json.js +42 -0
- package/dist/mcp-component-registry.json +180 -80
- package/dist/node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js +4 -4
- package/dist/node_modules/@impactsmartsuite/impact-icons/dist/index.js +637 -363
- package/dist/node_modules/@mui/icons-material/utils/createSvgIcon.js +3 -3
- package/dist/node_modules/@mui/material/styles/ThemeProvider.js +43 -0
- package/dist/node_modules/@mui/private-theming/ThemeProvider/ThemeProvider.js +59 -0
- package/dist/node_modules/@mui/private-theming/ThemeProvider/nested.js +5 -0
- package/dist/node_modules/@mui/private-theming/node_modules/@mui/utils/esm/exactProp/exactProp.js +19 -0
- package/dist/node_modules/@mui/private-theming/useTheme/ThemeContext.js +8 -0
- package/dist/node_modules/@mui/private-theming/useTheme/useTheme.js +12 -0
- package/dist/node_modules/@mui/system/colorManipulator.js +2 -2
- package/dist/node_modules/@mui/system/esm/DefaultPropsProvider/DefaultPropsProvider.js +12 -2
- package/dist/node_modules/@mui/system/esm/RtlProvider/index.js +14 -4
- package/dist/node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.js +86 -0
- package/dist/node_modules/@mui/system/esm/ThemeProvider/useLayerOrder.js +50 -0
- package/dist/node_modules/@mui/system/esm/createStyled.js +1 -1
- package/dist/node_modules/@mui/system/node_modules/@mui/utils/esm/exactProp/exactProp.js +19 -0
- package/dist/node_modules/@mui/system/node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js +5 -0
- package/dist/node_modules/@mui/system/node_modules/@mui/utils/esm/useId/useId.js +24 -0
- package/dist/node_modules/call-bind/index.js +3 -3
- package/dist/node_modules/es-abstract/2025/ToString.js +21 -0
- package/dist/node_modules/es-abstract-get/GetMethod.js +33 -0
- package/dist/node_modules/es-abstract-get/GetV.js +25 -0
- package/dist/node_modules/es-abstract-get/isPropertyKey.js +13 -0
- package/dist/node_modules/es-to-primitive/es2015.js +28 -28
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js +1 -1
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js +1 -1
- package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/is-symbol/index.js +1 -1
- package/dist/node_modules/moment/dist/locale/de.js +21 -1
- package/dist/node_modules/moment/dist/moment.js +792 -624
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +1 -1
- package/dist/node_modules/react-dates/lib/theme/DefaultTheme.js +4 -4
- package/dist/node_modules/react-dates/lib/utils/registerCSSInterfaceWithDefaultTheme.js +3 -3
- package/dist/node_modules/react-dates/lib/utils/registerInterfaceWithDefaultTheme.js +3 -3
- package/dist/node_modules/react-is/cjs/react-is.development.js +1 -1
- package/dist/node_modules/react-is/cjs/react-is.production.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/react-with-styles/lib/ThemedStyleSheet.js +6 -6
- package/dist/node_modules/react-with-styles-interface-css/dist/index.js +5 -5
- package/dist/node_modules/react-with-styles-interface-css/dist/utils/getClassName.js +3 -3
- package/dist/node_modules/react-with-styles-interface-css/dist/utils/separateStyles.js +4 -4
- package/dist/node_modules/string.prototype.trim/implementation.js +12 -4
- package/dist/node_modules/stylis/src/Parser.js +1 -1
- package/dist/node_modules/stylis/src/Tokenizer.js +1 -1
- package/dist/stories/LocaleDictionaryCollapse.d.ts +1 -1
- package/dist/stories/LocaleDictionaryCollapse.d.ts.map +1 -1
- package/dist/stories/designTokensStoryHelpers.d.ts +2 -0
- package/dist/stories/designTokensStoryHelpers.d.ts.map +1 -0
- package/dist/stories/i18nDemo.d.ts +1 -1
- package/dist/stories/i18nDemo.d.ts.map +1 -1
- package/dist/stories/tableV36ChatApiMock.d.ts +10 -29
- package/dist/stories/tableV36ChatApiMock.d.ts.map +1 -1
- package/dist/styles/style.css +1 -1
- package/dist/styles/tokens/effects.generated.d.ts +60 -0
- package/dist/styles/tokens/effects.generated.d.ts.map +1 -0
- package/dist/styles/tokens/effects.generated.js +80 -0
- package/dist/styles/tokens/tokens.generated.d.ts +428 -0
- package/dist/styles/tokens/tokens.generated.d.ts.map +1 -0
- package/dist/styles/tokens/tokens.generated.js +421 -0
- package/dist/tokens/ImpactUiAppProviders.d.ts +18 -0
- package/dist/tokens/ImpactUiAppProviders.d.ts.map +1 -0
- package/dist/tokens/ImpactUiAppProviders.js +23 -0
- package/dist/tokens/ImpactUiThemeProvider.d.ts +17 -0
- package/dist/tokens/ImpactUiThemeProvider.d.ts.map +1 -0
- package/dist/tokens/ImpactUiThemeProvider.js +82 -0
- package/dist/tokens/createImpactUiMuiTheme.d.ts +13 -0
- package/dist/tokens/createImpactUiMuiTheme.d.ts.map +1 -0
- package/dist/tokens/createImpactUiMuiTheme.js +112 -0
- package/dist/tokens/index.d.ts +18 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/interfaceStyleDom.d.ts +21 -0
- package/dist/tokens/interfaceStyleDom.d.ts.map +1 -0
- package/dist/tokens/interfaceStyleDom.js +64 -0
- package/dist/tokens/theme.types.d.ts +19 -0
- package/dist/tokens/theme.types.d.ts.map +1 -0
- package/dist/tokens/themeDom.d.ts +31 -0
- package/dist/tokens/themeDom.d.ts.map +1 -0
- package/dist/tokens/themeDom.js +103 -0
- package/dist/tokens/useImpactUiInterfaceStyle.d.ts +7 -0
- package/dist/tokens/useImpactUiInterfaceStyle.d.ts.map +1 -0
- package/dist/tokens/useImpactUiInterfaceStyle.js +19 -0
- package/dist/tokens/useImpactUiTheme.d.ts +9 -0
- package/dist/tokens/useImpactUiTheme.d.ts.map +1 -0
- package/dist/tokens/useImpactUiTheme.js +46 -0
- package/package.json +11 -3
- /package/dist/_virtual/{react-is.development2.js → react-is2.development.js} +0 -0
- /package/dist/_virtual/{react-is.production.min2.js → react-is2.production.min.js} +0 -0
- /package/dist/_virtual/{react-is.development3.js → react-is3.development.js} +0 -0
|
@@ -0,0 +1,2307 @@
|
|
|
1
|
+
const halloweenNightHtml = `<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" />
|
|
6
|
+
<title>Halloween: Night</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
9
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Creepster&display=swap" />
|
|
10
|
+
<style>
|
|
11
|
+
html,
|
|
12
|
+
body {
|
|
13
|
+
margin: 0;
|
|
14
|
+
height: 100%;
|
|
15
|
+
background: #000;
|
|
16
|
+
overflow: hidden;
|
|
17
|
+
}
|
|
18
|
+
canvas {
|
|
19
|
+
display: block;
|
|
20
|
+
}
|
|
21
|
+
#hint {
|
|
22
|
+
position: fixed;
|
|
23
|
+
inset: 0;
|
|
24
|
+
display: grid;
|
|
25
|
+
place-items: center;
|
|
26
|
+
margin: 0;
|
|
27
|
+
pointer-events: none;
|
|
28
|
+
user-select: none;
|
|
29
|
+
font:
|
|
30
|
+
400 15px/1.5 'Iowan Old Style',
|
|
31
|
+
'Palatino Linotype',
|
|
32
|
+
Palatino,
|
|
33
|
+
Georgia,
|
|
34
|
+
serif;
|
|
35
|
+
letter-spacing: 0.05em;
|
|
36
|
+
color: #7f766a;
|
|
37
|
+
transition: opacity 1.4s ease;
|
|
38
|
+
}
|
|
39
|
+
#hint.gone {
|
|
40
|
+
opacity: 0;
|
|
41
|
+
}
|
|
42
|
+
</style>
|
|
43
|
+
<script type="importmap">
|
|
44
|
+
{
|
|
45
|
+
"imports": {
|
|
46
|
+
"three": "https://cdn.jsdelivr.net/npm/three@0.170.0/build/three.module.js",
|
|
47
|
+
"three/addons/": "https://cdn.jsdelivr.net/npm/three@0.170.0/examples/jsm/"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
<\/script>
|
|
51
|
+
</head>
|
|
52
|
+
<body>
|
|
53
|
+
<p id="hint">Best experienced with sound.</p>
|
|
54
|
+
<script type="module">
|
|
55
|
+
import * as THREE from 'three';
|
|
56
|
+
import { RoomEnvironment } from 'three/addons/environments/RoomEnvironment.js';
|
|
57
|
+
import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
|
|
58
|
+
import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
|
|
59
|
+
import { BokehPass } from 'three/addons/postprocessing/BokehPass.js';
|
|
60
|
+
import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
|
|
61
|
+
import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js';
|
|
62
|
+
import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js';
|
|
63
|
+
import { mergeGeometries, mergeVertices } from 'three/addons/utils/BufferGeometryUtils.js';
|
|
64
|
+
|
|
65
|
+
/* ==========================================================================
|
|
66
|
+
THE LAST CANDLE
|
|
67
|
+
An empty graveyard at night. The camera makes one slow push down the aisle
|
|
68
|
+
while the moonlight, fog and carved pumpkins fade up from black; at the end
|
|
69
|
+
every light goes out at once.
|
|
70
|
+
|
|
71
|
+
Timeline (seconds)
|
|
72
|
+
0.0 - 0.8 pitch black, every light at 0
|
|
73
|
+
0.8 - 6.5 moon, sky, fog and environment fade up; pumpkins kindle
|
|
74
|
+
9.5 - 15.5 cloud dims the moon; the pumpkins gutter
|
|
75
|
+
2.5 - 7.5 the stone monument at the end of the aisle wakes: its edges and
|
|
76
|
+
veins glow blue to violet; a witch's hat hovers above it
|
|
77
|
+
9.8 - 16.9 "Happy Halloween" burns in at the top-left corner: fire-lit letters,
|
|
78
|
+
a hot igniting edge, heat shimmer and rising embers
|
|
79
|
+
1.0 - 16.9 a small "Applying Style...." status line at the bottom centre, dots loading
|
|
80
|
+
16.9 every light hits exactly 0
|
|
81
|
+
16.9 - 20.0 pitch black
|
|
82
|
+
========================================================================== */
|
|
83
|
+
|
|
84
|
+
const RENDER = new URLSearchParams(location.search).has('render');
|
|
85
|
+
const EMBED = new URLSearchParams(location.search).has('embed');
|
|
86
|
+
const T = {
|
|
87
|
+
revealIn: 0.8,
|
|
88
|
+
revealFull: 6.5,
|
|
89
|
+
devilGo: 2.2,
|
|
90
|
+
devilArrive: 14.4,
|
|
91
|
+
lift0: 15.0,
|
|
92
|
+
lift1: 16.1,
|
|
93
|
+
blow0: 16.25,
|
|
94
|
+
out: 16.9,
|
|
95
|
+
end: 20.0,
|
|
96
|
+
loop: 22.0,
|
|
97
|
+
};
|
|
98
|
+
const Z_START = -31.0,
|
|
99
|
+
Z_END = 0.4; // the point the camera looks at and focuses on
|
|
100
|
+
const CAM_Z0 = 9.0,
|
|
101
|
+
CAM_Z1 = 3.4; // dolly path
|
|
102
|
+
const CAM_Y0 = 1.74,
|
|
103
|
+
CAM_Y1 = 1.45;
|
|
104
|
+
const FOG_DENSITY = 0.043;
|
|
105
|
+
// light levels at full reveal (physical units: lux for the moon, candela for point lights)
|
|
106
|
+
const K = {
|
|
107
|
+
moon: 1.7,
|
|
108
|
+
hemi: 0.6,
|
|
109
|
+
env: 0.16,
|
|
110
|
+
pump: 0.42,
|
|
111
|
+
glow: 1.6,
|
|
112
|
+
ap0: 0.00025,
|
|
113
|
+
ap1: 0.0013,
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
/* ---------- deterministic randomness ---------- */
|
|
117
|
+
function mulberry32(a) {
|
|
118
|
+
return function () {
|
|
119
|
+
a |= 0;
|
|
120
|
+
a = (a + 0x6d2b79f5) | 0;
|
|
121
|
+
let t = Math.imul(a ^ (a >>> 15), 1 | a);
|
|
122
|
+
t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
|
|
123
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
const rng = mulberry32(31102026);
|
|
127
|
+
const rand = (a = 0, b = 1) => a + (b - a) * rng();
|
|
128
|
+
function hash1(n) {
|
|
129
|
+
const x = Math.sin(n * 127.1 + 311.7) * 43758.5453;
|
|
130
|
+
return x - Math.floor(x);
|
|
131
|
+
}
|
|
132
|
+
function noise1(x) {
|
|
133
|
+
const i = Math.floor(x),
|
|
134
|
+
f = x - i,
|
|
135
|
+
u = f * f * (3 - 2 * f);
|
|
136
|
+
return hash1(i) * (1 - u) + hash1(i + 1) * u;
|
|
137
|
+
}
|
|
138
|
+
function fbm1(x) {
|
|
139
|
+
return 0.5 * noise1(x) + 0.3 * noise1(x * 2.03 + 7.1) + 0.2 * noise1(x * 4.11 + 3.3);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/* ---------- easing ---------- */
|
|
143
|
+
const clamp = (x, a = 0, b = 1) => Math.min(b, Math.max(a, x));
|
|
144
|
+
const lerp = (a, b, t) => a + (b - a) * t;
|
|
145
|
+
const smooth = (e0, e1, x) => {
|
|
146
|
+
const t = clamp((x - e0) / (e1 - e0));
|
|
147
|
+
return t * t * (3 - 2 * t);
|
|
148
|
+
};
|
|
149
|
+
const smoother = (e0, e1, x) => {
|
|
150
|
+
const t = clamp((x - e0) / (e1 - e0));
|
|
151
|
+
return t * t * t * (t * (t * 6 - 15) + 10);
|
|
152
|
+
};
|
|
153
|
+
// long-tailed ease: very gentle start and an extremely soft landing
|
|
154
|
+
function easeLong(u) {
|
|
155
|
+
u = clamp(u);
|
|
156
|
+
const p = 2.3,
|
|
157
|
+
a = Math.pow(u, p),
|
|
158
|
+
b = Math.pow(1 - u, p);
|
|
159
|
+
return a / (a + b);
|
|
160
|
+
}
|
|
161
|
+
// glide profile: speed ~ u^1.6 (1-u)^2.6, integrated once (a drifting body that bleeds speed slowly)
|
|
162
|
+
const TRAVEL = (() => {
|
|
163
|
+
const N = 2048,
|
|
164
|
+
arr = new Float32Array(N + 1);
|
|
165
|
+
let s = 0;
|
|
166
|
+
for (let i = 1; i <= N; i++) {
|
|
167
|
+
const u = (i - 0.5) / N;
|
|
168
|
+
s += Math.pow(u, 1.6) * Math.pow(1 - u, 2.6);
|
|
169
|
+
arr[i] = s;
|
|
170
|
+
}
|
|
171
|
+
for (let i = 0; i <= N; i++) arr[i] /= s;
|
|
172
|
+
return arr;
|
|
173
|
+
})();
|
|
174
|
+
function travel(u) {
|
|
175
|
+
u = clamp(u);
|
|
176
|
+
const f = u * 2048,
|
|
177
|
+
i = Math.min(2047, Math.floor(f));
|
|
178
|
+
return lerp(TRAVEL[i], TRAVEL[i + 1], f - i);
|
|
179
|
+
}
|
|
180
|
+
function devilZ(t) {
|
|
181
|
+
return lerp(Z_START, Z_END, travel((t - T.devilGo) / (T.devilArrive - T.devilGo)));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/* ---------- sound: UI-style, procedural, scheduled on the same timeline ----------
|
|
185
|
+
0.8 - 16.9 a very quiet cinematic bed: low drone, dark pad, soft wind
|
|
186
|
+
0.8 - 16.9 slight wind, gusting and drifting across the speakers
|
|
187
|
+
1.5 a ghostly, theremin-like wail drifts across
|
|
188
|
+
8.0 the wail again, drifting back the other way
|
|
189
|
+
5.2, 10.6, 15.0 bats flit past, squeaking softly
|
|
190
|
+
11.8 a wolf howls far off to the right, very quietly
|
|
191
|
+
16.9 power-off blip, then silence
|
|
192
|
+
------------------------------------------------------------------------- */
|
|
193
|
+
const sndCache = new WeakMap();
|
|
194
|
+
function noiseBuf(ctx, seconds, kind, seed) {
|
|
195
|
+
const sr = ctx.sampleRate,
|
|
196
|
+
fade = Math.floor(0.05 * sr),
|
|
197
|
+
n = Math.floor(seconds * sr) + fade,
|
|
198
|
+
b = ctx.createBuffer(2, n, sr);
|
|
199
|
+
for (let ch = 0; ch < 2; ch++) {
|
|
200
|
+
const r = mulberry32(seed + ch * 7919),
|
|
201
|
+
d = b.getChannelData(ch);
|
|
202
|
+
let b0 = 0,
|
|
203
|
+
b1 = 0,
|
|
204
|
+
b2 = 0,
|
|
205
|
+
last = 0;
|
|
206
|
+
for (let i = 0; i < n; i++) {
|
|
207
|
+
const w = r() * 2 - 1;
|
|
208
|
+
if (kind === 'white') d[i] = w * 0.7;
|
|
209
|
+
else if (kind === 'pink') {
|
|
210
|
+
b0 = 0.99765 * b0 + w * 0.099046;
|
|
211
|
+
b1 = 0.963 * b1 + w * 0.2965164;
|
|
212
|
+
b2 = 0.57 * b2 + w * 1.0526913;
|
|
213
|
+
d[i] = (b0 + b1 + b2 + w * 0.1848) * 0.2;
|
|
214
|
+
} else {
|
|
215
|
+
last = (last + 0.02 * w) / 1.02;
|
|
216
|
+
d[i] = last * 3.2;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// seamless loop: the head fades in from the tail that will precede it
|
|
220
|
+
for (let i = 0; i < fade; i++) {
|
|
221
|
+
const k = i / fade;
|
|
222
|
+
d[i] = d[i] * k + d[n - fade + i] * (1 - k);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
b.__loopEnd = (n - fade) / sr;
|
|
226
|
+
return b;
|
|
227
|
+
}
|
|
228
|
+
function impulseBuf(ctx, seconds, seed) {
|
|
229
|
+
const sr = ctx.sampleRate,
|
|
230
|
+
n = Math.floor(seconds * sr),
|
|
231
|
+
b = ctx.createBuffer(2, n, sr),
|
|
232
|
+
pre = Math.floor(0.018 * sr);
|
|
233
|
+
for (let ch = 0; ch < 2; ch++) {
|
|
234
|
+
const r = mulberry32(seed + ch * 31),
|
|
235
|
+
d = b.getChannelData(ch);
|
|
236
|
+
let lp = 0;
|
|
237
|
+
for (let i = 0; i < n; i++) {
|
|
238
|
+
const x = i / n,
|
|
239
|
+
w = r() * 2 - 1;
|
|
240
|
+
lp += (w - lp) * (0.6 - 0.5 * x);
|
|
241
|
+
d[i] = i < pre ? 0 : lp * Math.pow(1 - x, 1.6) * Math.exp(-3.0 * x);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return b;
|
|
245
|
+
}
|
|
246
|
+
function buildSound(ctx, t0, dest) {
|
|
247
|
+
const S =
|
|
248
|
+
sndCache.get(ctx) ||
|
|
249
|
+
(() => {
|
|
250
|
+
const c = {
|
|
251
|
+
white: noiseBuf(ctx, 3, 'white', 101),
|
|
252
|
+
brown: noiseBuf(ctx, 8, 'brown', 303),
|
|
253
|
+
ir: impulseBuf(ctx, 1.1, 404),
|
|
254
|
+
};
|
|
255
|
+
sndCache.set(ctx, c);
|
|
256
|
+
return c;
|
|
257
|
+
})();
|
|
258
|
+
const master = ctx.createGain();
|
|
259
|
+
master.gain.value = 0;
|
|
260
|
+
master.gain.setValueAtTime(2.2, t0);
|
|
261
|
+
master.gain.setValueAtTime(2.2, t0 + T.out + 0.22);
|
|
262
|
+
master.gain.linearRampToValueAtTime(0, t0 + T.out + 0.25);
|
|
263
|
+
const comp = ctx.createDynamicsCompressor();
|
|
264
|
+
comp.threshold.value = -14;
|
|
265
|
+
comp.ratio.value = 3;
|
|
266
|
+
comp.attack.value = 0.004;
|
|
267
|
+
comp.release.value = 0.2;
|
|
268
|
+
master.connect(comp);
|
|
269
|
+
comp.connect(dest);
|
|
270
|
+
const verb = ctx.createConvolver();
|
|
271
|
+
verb.buffer = S.ir;
|
|
272
|
+
const verbOut = ctx.createGain();
|
|
273
|
+
verbOut.gain.value = 0.18;
|
|
274
|
+
verb.connect(verbOut).connect(master);
|
|
275
|
+
const bus = ctx.createGain();
|
|
276
|
+
bus.connect(master);
|
|
277
|
+
bus.connect(verb);
|
|
278
|
+
|
|
279
|
+
const tone = (t, f0, f1, dur, type = 'sine', amp = 0.2, pan = 0, attack = 0.004) => {
|
|
280
|
+
const o = ctx.createOscillator();
|
|
281
|
+
o.type = type;
|
|
282
|
+
o.frequency.setValueAtTime(f0, t0 + t);
|
|
283
|
+
if (f1 !== f0) o.frequency.exponentialRampToValueAtTime(f1, t0 + t + dur);
|
|
284
|
+
const g = ctx.createGain();
|
|
285
|
+
g.gain.value = 0;
|
|
286
|
+
g.gain.setValueAtTime(0, t0 + t);
|
|
287
|
+
g.gain.linearRampToValueAtTime(amp, t0 + t + attack);
|
|
288
|
+
g.gain.exponentialRampToValueAtTime(0.0001, t0 + t + dur);
|
|
289
|
+
const p = ctx.createStereoPanner();
|
|
290
|
+
p.pan.value = pan;
|
|
291
|
+
o.connect(g).connect(p).connect(bus);
|
|
292
|
+
o.start(t0 + t);
|
|
293
|
+
o.stop(t0 + t + dur + 0.02);
|
|
294
|
+
};
|
|
295
|
+
const whoosh = (t, dur, fA, fB, amp, pan0 = 0, pan1 = 0) => {
|
|
296
|
+
const s = ctx.createBufferSource();
|
|
297
|
+
s.buffer = S.white;
|
|
298
|
+
s.loop = true;
|
|
299
|
+
s.loopEnd = S.white.__loopEnd;
|
|
300
|
+
const bp = ctx.createBiquadFilter();
|
|
301
|
+
bp.type = 'bandpass';
|
|
302
|
+
bp.Q.value = 1.2;
|
|
303
|
+
bp.frequency.setValueAtTime(fA, t0 + t);
|
|
304
|
+
bp.frequency.exponentialRampToValueAtTime(fB, t0 + t + dur);
|
|
305
|
+
const g = ctx.createGain();
|
|
306
|
+
g.gain.value = 0;
|
|
307
|
+
g.gain.setValueAtTime(0, t0 + t);
|
|
308
|
+
g.gain.linearRampToValueAtTime(amp, t0 + t + dur * 0.45);
|
|
309
|
+
g.gain.exponentialRampToValueAtTime(0.0001, t0 + t + dur);
|
|
310
|
+
const p = ctx.createStereoPanner();
|
|
311
|
+
p.pan.setValueAtTime(pan0, t0 + t);
|
|
312
|
+
p.pan.linearRampToValueAtTime(pan1, t0 + t + dur);
|
|
313
|
+
s.connect(bp).connect(g).connect(p).connect(bus);
|
|
314
|
+
s.start(t0 + t, 0);
|
|
315
|
+
s.stop(t0 + t + dur + 0.02);
|
|
316
|
+
};
|
|
317
|
+
|
|
318
|
+
// cinematic bed, very low: fades up with the picture, swells slowly, cuts with the lights
|
|
319
|
+
{
|
|
320
|
+
const bed = ctx.createGain();
|
|
321
|
+
bed.connect(bus);
|
|
322
|
+
const lvl = (t) => smoother(0.8, 6.0, t) * (0.75 + 0.25 * smoother(8, 15.5, t));
|
|
323
|
+
const n = Math.ceil(T.out * 30),
|
|
324
|
+
env = new Float32Array(n);
|
|
325
|
+
for (let i = 0; i < n; i++) env[i] = 0.1 * lvl((T.out * i) / (n - 1)); // 0.1 keeps it far under everything else
|
|
326
|
+
bed.gain.value = 0;
|
|
327
|
+
bed.gain.setValueCurveAtTime(env, t0, T.out - 0.02);
|
|
328
|
+
bed.gain.linearRampToValueAtTime(0, t0 + T.out);
|
|
329
|
+
const stopAt = t0 + T.out + 0.05;
|
|
330
|
+
const osc = (type, f, det, amp, dest) => {
|
|
331
|
+
const o = ctx.createOscillator();
|
|
332
|
+
o.type = type;
|
|
333
|
+
o.frequency.value = f;
|
|
334
|
+
o.detune.value = det;
|
|
335
|
+
const g = ctx.createGain();
|
|
336
|
+
g.gain.value = amp;
|
|
337
|
+
o.connect(g).connect(dest);
|
|
338
|
+
o.start(t0);
|
|
339
|
+
o.stop(stopAt);
|
|
340
|
+
};
|
|
341
|
+
// low drone (A and E)
|
|
342
|
+
const droneLP = ctx.createBiquadFilter();
|
|
343
|
+
droneLP.type = 'lowpass';
|
|
344
|
+
droneLP.frequency.value = 320;
|
|
345
|
+
droneLP.connect(bed);
|
|
346
|
+
osc('sine', 55, 0, 0.05, droneLP);
|
|
347
|
+
osc('sine', 55.3, 0, 0.04, droneLP);
|
|
348
|
+
osc('triangle', 82.41, 0, 0.02, droneLP);
|
|
349
|
+
osc('triangle', 110, 3, 0.012, droneLP);
|
|
350
|
+
// dark A-minor pad that slowly opens
|
|
351
|
+
const padLP = ctx.createBiquadFilter();
|
|
352
|
+
padLP.type = 'lowpass';
|
|
353
|
+
padLP.Q.value = 0.8;
|
|
354
|
+
padLP.connect(bed);
|
|
355
|
+
const m = Math.ceil(T.out * 20),
|
|
356
|
+
cut = new Float32Array(m);
|
|
357
|
+
for (let i = 0; i < m; i++) {
|
|
358
|
+
const t = (T.out * i) / (m - 1);
|
|
359
|
+
cut[i] = 380 + 520 * smoother(4, 15.5, t) + 60 * Math.sin(t * 0.7);
|
|
360
|
+
}
|
|
361
|
+
padLP.frequency.value = cut[0];
|
|
362
|
+
padLP.frequency.setValueCurveAtTime(cut, t0, T.out);
|
|
363
|
+
[
|
|
364
|
+
[110, -6],
|
|
365
|
+
[110, 6],
|
|
366
|
+
[130.81, -5],
|
|
367
|
+
[130.81, 5],
|
|
368
|
+
[164.81, -4],
|
|
369
|
+
[164.81, 4],
|
|
370
|
+
].forEach(([f, d]) => osc('sawtooth', f, d, 0.006, padLP));
|
|
371
|
+
// soft wind
|
|
372
|
+
const wind = ctx.createBufferSource();
|
|
373
|
+
wind.buffer = S.brown;
|
|
374
|
+
wind.loop = true;
|
|
375
|
+
wind.loopEnd = S.brown.__loopEnd;
|
|
376
|
+
const windLP = ctx.createBiquadFilter();
|
|
377
|
+
windLP.type = 'lowpass';
|
|
378
|
+
windLP.Q.value = 0.5;
|
|
379
|
+
const wc = new Float32Array(m),
|
|
380
|
+
wg = new Float32Array(m);
|
|
381
|
+
for (let i = 0; i < m; i++) {
|
|
382
|
+
const t = (T.out * i) / (m - 1);
|
|
383
|
+
wc[i] = 260 + 380 * fbm1(t * 0.4 + 3.1);
|
|
384
|
+
wg[i] = 0.05 * (0.6 + 0.8 * (fbm1(t * 0.45 + 7.3) - 0.3));
|
|
385
|
+
}
|
|
386
|
+
windLP.frequency.value = wc[0];
|
|
387
|
+
windLP.frequency.setValueCurveAtTime(wc, t0, T.out);
|
|
388
|
+
const windG = ctx.createGain();
|
|
389
|
+
windG.gain.value = wg[0];
|
|
390
|
+
windG.gain.setValueCurveAtTime(wg, t0, T.out);
|
|
391
|
+
wind.connect(windLP).connect(windG).connect(bed);
|
|
392
|
+
wind.start(t0, 1.3);
|
|
393
|
+
wind.stop(stopAt);
|
|
394
|
+
}
|
|
395
|
+
// slight wind in the background: a low rush plus an airy gusting top, drifting left and right
|
|
396
|
+
{
|
|
397
|
+
const WIND = 0.07; // overall level: slight
|
|
398
|
+
const m = Math.ceil(T.out * 30),
|
|
399
|
+
at = (i) => (T.out * i) / (m - 1);
|
|
400
|
+
const curve = (fn) => {
|
|
401
|
+
const c = new Float32Array(m);
|
|
402
|
+
for (let i = 0; i < m; i++) c[i] = fn(at(i));
|
|
403
|
+
return c;
|
|
404
|
+
};
|
|
405
|
+
const gust = (t) => 0.55 + 0.75 * Math.max(0, fbm1(t * 0.5 + 11.7) - 0.25);
|
|
406
|
+
const level = (t) => smoother(0.8, 5.0, t) * gust(t);
|
|
407
|
+
const out = ctx.createGain();
|
|
408
|
+
out.gain.value = 0;
|
|
409
|
+
out.gain.setValueCurveAtTime(
|
|
410
|
+
curve((t) => WIND * level(t)),
|
|
411
|
+
t0,
|
|
412
|
+
T.out - 0.02
|
|
413
|
+
);
|
|
414
|
+
out.gain.linearRampToValueAtTime(0, t0 + T.out);
|
|
415
|
+
const pan = ctx.createStereoPanner();
|
|
416
|
+
pan.pan.value = 0;
|
|
417
|
+
pan.pan.setValueCurveAtTime(
|
|
418
|
+
curve((t) => 0.55 * Math.sin(t * 0.33 + 0.8)),
|
|
419
|
+
t0,
|
|
420
|
+
T.out
|
|
421
|
+
);
|
|
422
|
+
out.connect(pan).connect(bus);
|
|
423
|
+
const src = (buf, offset) => {
|
|
424
|
+
const s = ctx.createBufferSource();
|
|
425
|
+
s.buffer = buf;
|
|
426
|
+
s.loop = true;
|
|
427
|
+
s.loopEnd = buf.__loopEnd;
|
|
428
|
+
s.start(t0, offset);
|
|
429
|
+
s.stop(t0 + T.out + 0.05);
|
|
430
|
+
return s;
|
|
431
|
+
};
|
|
432
|
+
// low rush
|
|
433
|
+
const lp = ctx.createBiquadFilter();
|
|
434
|
+
lp.type = 'lowpass';
|
|
435
|
+
lp.Q.value = 0.6;
|
|
436
|
+
lp.frequency.value = 500;
|
|
437
|
+
lp.frequency.setValueCurveAtTime(
|
|
438
|
+
curve((t) => 380 + 520 * fbm1(t * 0.5 + 11.7)),
|
|
439
|
+
t0,
|
|
440
|
+
T.out
|
|
441
|
+
);
|
|
442
|
+
src(S.brown, 4.2).connect(lp).connect(out);
|
|
443
|
+
// airy, whistling top that rises with each gust
|
|
444
|
+
const bp = ctx.createBiquadFilter();
|
|
445
|
+
bp.type = 'bandpass';
|
|
446
|
+
bp.Q.value = 1.6;
|
|
447
|
+
bp.frequency.value = 900;
|
|
448
|
+
bp.frequency.setValueCurveAtTime(
|
|
449
|
+
curve((t) => 700 + 900 * fbm1(t * 0.5 + 11.7) + 150 * Math.sin(t * 0.9)),
|
|
450
|
+
t0,
|
|
451
|
+
T.out
|
|
452
|
+
);
|
|
453
|
+
const airG = ctx.createGain();
|
|
454
|
+
airG.gain.value = 0.35;
|
|
455
|
+
src(S.white, 1.1).connect(bp).connect(airG).connect(out);
|
|
456
|
+
}
|
|
457
|
+
// bats: a few quiet passes of high squeaks and soft wing flutter, flying across the stereo field
|
|
458
|
+
const batPass = (tStart, dur, panFrom, panTo, seed, amp) => {
|
|
459
|
+
const R = mulberry32(seed);
|
|
460
|
+
for (let t = tStart + 0.05; t < tStart + dur - 0.05;) {
|
|
461
|
+
const u = (t - tStart) / dur,
|
|
462
|
+
near = Math.sin(Math.PI * u); // louder as it passes closest
|
|
463
|
+
const pan = lerp(panFrom, panTo, u),
|
|
464
|
+
f0 = 7000 + R() * 2500;
|
|
465
|
+
tone(
|
|
466
|
+
t,
|
|
467
|
+
f0,
|
|
468
|
+
f0 * (0.45 + R() * 0.1),
|
|
469
|
+
0.018 + R() * 0.02,
|
|
470
|
+
'sine',
|
|
471
|
+
amp * (0.4 + 0.6 * near) * (0.6 + 0.4 * R()),
|
|
472
|
+
pan,
|
|
473
|
+
0.002
|
|
474
|
+
);
|
|
475
|
+
t += R() < 0.3 ? 0.035 + R() * 0.03 : 0.09 + R() * 0.16; // short clusters, then gaps
|
|
476
|
+
}
|
|
477
|
+
const n = ctx.createBufferSource();
|
|
478
|
+
n.buffer = S.white;
|
|
479
|
+
n.loop = true;
|
|
480
|
+
n.loopEnd = S.white.__loopEnd;
|
|
481
|
+
const bp = ctx.createBiquadFilter();
|
|
482
|
+
bp.type = 'bandpass';
|
|
483
|
+
bp.frequency.value = 900;
|
|
484
|
+
bp.Q.value = 0.9;
|
|
485
|
+
const g = ctx.createGain(),
|
|
486
|
+
k = Math.ceil(dur * 200),
|
|
487
|
+
env = new Float32Array(k);
|
|
488
|
+
for (let i = 0; i < k; i++) {
|
|
489
|
+
const u = i / (k - 1);
|
|
490
|
+
env[i] =
|
|
491
|
+
amp *
|
|
492
|
+
0.9 *
|
|
493
|
+
Math.sin(Math.PI * u) *
|
|
494
|
+
Math.pow(0.5 + 0.5 * Math.sin(u * dur * 2 * Math.PI * 11), 3);
|
|
495
|
+
}
|
|
496
|
+
g.gain.value = 0;
|
|
497
|
+
g.gain.setValueCurveAtTime(env, t0 + tStart, dur);
|
|
498
|
+
const pn = ctx.createStereoPanner();
|
|
499
|
+
pn.pan.setValueAtTime(panFrom, t0 + tStart);
|
|
500
|
+
pn.pan.linearRampToValueAtTime(panTo, t0 + tStart + dur);
|
|
501
|
+
n.connect(bp).connect(g).connect(pn).connect(bus);
|
|
502
|
+
n.start(t0 + tStart, R() * 2);
|
|
503
|
+
n.stop(t0 + tStart + dur + 0.02);
|
|
504
|
+
};
|
|
505
|
+
batPass(5.2, 1.6, -0.8, 0.8, 4101, 0.035);
|
|
506
|
+
batPass(10.6, 1.1, 0.8, -0.5, 4202, 0.03);
|
|
507
|
+
batPass(15.0, 1.3, -0.6, 0.9, 4303, 0.028);
|
|
508
|
+
// a voice whose pitch and level follow curves over its life
|
|
509
|
+
const voiceCurve = (t, dur, freqFn, ampFn, type = 'sine', pan = 0, lpf = 4000) => {
|
|
510
|
+
const n = Math.max(8, Math.ceil(dur * 120)),
|
|
511
|
+
fq = new Float32Array(n),
|
|
512
|
+
am = new Float32Array(n);
|
|
513
|
+
for (let i = 0; i < n; i++) {
|
|
514
|
+
const u = i / (n - 1);
|
|
515
|
+
fq[i] = freqFn(u);
|
|
516
|
+
am[i] = ampFn(u);
|
|
517
|
+
}
|
|
518
|
+
am[n - 1] = 0;
|
|
519
|
+
const o = ctx.createOscillator();
|
|
520
|
+
o.type = type;
|
|
521
|
+
o.frequency.value = fq[0];
|
|
522
|
+
o.frequency.setValueCurveAtTime(fq, t0 + t, dur);
|
|
523
|
+
const g = ctx.createGain();
|
|
524
|
+
g.gain.value = 0;
|
|
525
|
+
g.gain.setValueCurveAtTime(am, t0 + t, dur);
|
|
526
|
+
const lp = ctx.createBiquadFilter();
|
|
527
|
+
lp.type = 'lowpass';
|
|
528
|
+
lp.frequency.value = lpf;
|
|
529
|
+
const p = ctx.createStereoPanner();
|
|
530
|
+
if (Array.isArray(pan)) {
|
|
531
|
+
p.pan.setValueAtTime(pan[0], t0 + t);
|
|
532
|
+
p.pan.linearRampToValueAtTime(pan[1], t0 + t + dur);
|
|
533
|
+
} else p.pan.value = pan;
|
|
534
|
+
o.connect(lp).connect(g).connect(p).connect(bus);
|
|
535
|
+
o.start(t0 + t);
|
|
536
|
+
o.stop(t0 + t + dur + 0.02);
|
|
537
|
+
};
|
|
538
|
+
// ghostly wail: theremin-like rise and fall with vibrato, drifting across, low
|
|
539
|
+
const wail = (t, pan) => {
|
|
540
|
+
const vib = (u) => 1 + 0.03 * Math.sin(u * 2.3 * 2 * Math.PI * 5.5),
|
|
541
|
+
shape = (u) => Math.sin(Math.PI * Math.min(1, u * 1.3));
|
|
542
|
+
voiceCurve(
|
|
543
|
+
t,
|
|
544
|
+
2.3,
|
|
545
|
+
(u) => (520 + 380 * shape(u)) * vib(u),
|
|
546
|
+
(u) => 0.045 * Math.sin(Math.PI * u),
|
|
547
|
+
'sine',
|
|
548
|
+
pan,
|
|
549
|
+
3000
|
|
550
|
+
);
|
|
551
|
+
voiceCurve(
|
|
552
|
+
t,
|
|
553
|
+
2.3,
|
|
554
|
+
(u) => (260 + 190 * shape(u)) * vib(u),
|
|
555
|
+
(u) => 0.018 * Math.sin(Math.PI * u),
|
|
556
|
+
'triangle',
|
|
557
|
+
pan,
|
|
558
|
+
1500
|
|
559
|
+
);
|
|
560
|
+
};
|
|
561
|
+
wail(1.5, [0.7, -0.7]); // as the graveyard fades up, right to left
|
|
562
|
+
wail(8.0, [-0.7, 0.7]); // again in the middle, left to right
|
|
563
|
+
// wolf howl, far off to the right, very low
|
|
564
|
+
voiceCurve(
|
|
565
|
+
11.8,
|
|
566
|
+
2.4,
|
|
567
|
+
(u) =>
|
|
568
|
+
(u < 0.25 ? 300 + 320 * (u / 0.25) : u < 0.7 ? 620 : 620 - 270 * ((u - 0.7) / 0.3)) *
|
|
569
|
+
(1 + 0.012 * Math.sin(u * 2.4 * 2 * Math.PI * 6)),
|
|
570
|
+
(u) => 0.025 * Math.min(1, u * 5) * Math.min(1, (1 - u) * 4),
|
|
571
|
+
'sine',
|
|
572
|
+
0.75,
|
|
573
|
+
1600
|
|
574
|
+
);
|
|
575
|
+
// lights out: power off
|
|
576
|
+
tone(T.out, 880, 90, 0.22, 'sine', 0.2);
|
|
577
|
+
tone(T.out, 1760, 180, 0.12, 'triangle', 0.06);
|
|
578
|
+
tone(T.out, 4000, 4000, 0.008, 'square', 0.03);
|
|
579
|
+
}
|
|
580
|
+
function wavBase64(buf) {
|
|
581
|
+
const ch = buf.numberOfChannels,
|
|
582
|
+
n = buf.length,
|
|
583
|
+
sr = buf.sampleRate,
|
|
584
|
+
bytes = new Uint8Array(44 + n * ch * 2),
|
|
585
|
+
v = new DataView(bytes.buffer);
|
|
586
|
+
const str = (o, s) => {
|
|
587
|
+
for (let i = 0; i < s.length; i++) v.setUint8(o + i, s.charCodeAt(i));
|
|
588
|
+
};
|
|
589
|
+
str(0, 'RIFF');
|
|
590
|
+
v.setUint32(4, 36 + n * ch * 2, true);
|
|
591
|
+
str(8, 'WAVE');
|
|
592
|
+
str(12, 'fmt ');
|
|
593
|
+
v.setUint32(16, 16, true);
|
|
594
|
+
v.setUint16(20, 1, true);
|
|
595
|
+
v.setUint16(22, ch, true);
|
|
596
|
+
v.setUint32(24, sr, true);
|
|
597
|
+
v.setUint32(28, sr * ch * 2, true);
|
|
598
|
+
v.setUint16(32, ch * 2, true);
|
|
599
|
+
v.setUint16(34, 16, true);
|
|
600
|
+
str(36, 'data');
|
|
601
|
+
v.setUint32(40, n * ch * 2, true);
|
|
602
|
+
const data = [];
|
|
603
|
+
for (let c = 0; c < ch; c++) data.push(buf.getChannelData(c));
|
|
604
|
+
let o = 44;
|
|
605
|
+
for (let i = 0; i < n; i++)
|
|
606
|
+
for (let c = 0; c < ch; c++) {
|
|
607
|
+
const s = Math.max(-1, Math.min(1, data[c][i]));
|
|
608
|
+
v.setInt16(o, s < 0 ? s * 0x8000 : s * 0x7fff, true);
|
|
609
|
+
o += 2;
|
|
610
|
+
}
|
|
611
|
+
let bin = '';
|
|
612
|
+
for (let i = 0; i < bytes.length; i += 0x8000)
|
|
613
|
+
bin += String.fromCharCode.apply(null, bytes.subarray(i, i + 0x8000));
|
|
614
|
+
return btoa(bin);
|
|
615
|
+
}
|
|
616
|
+
async function renderSoundtrack() {
|
|
617
|
+
const ctx = new OfflineAudioContext(2, Math.ceil(T.end * 48000), 48000);
|
|
618
|
+
buildSound(ctx, 0, ctx.destination);
|
|
619
|
+
return wavBase64(await ctx.startRendering());
|
|
620
|
+
}
|
|
621
|
+
/* ---------- end sound ---------- */
|
|
622
|
+
|
|
623
|
+
/* ---------- renderer ---------- */
|
|
624
|
+
let W = RENDER ? 1920 : innerWidth,
|
|
625
|
+
H = RENDER ? 1080 : innerHeight;
|
|
626
|
+
const renderer = new THREE.WebGLRenderer({
|
|
627
|
+
antialias: true,
|
|
628
|
+
powerPreference: 'high-performance',
|
|
629
|
+
preserveDrawingBuffer: RENDER,
|
|
630
|
+
});
|
|
631
|
+
let pixelRatio = RENDER ? 1 : Math.min(devicePixelRatio, 1.5);
|
|
632
|
+
renderer.setPixelRatio(pixelRatio);
|
|
633
|
+
renderer.setSize(W, H);
|
|
634
|
+
renderer.toneMapping = THREE.ACESFilmicToneMapping;
|
|
635
|
+
renderer.toneMappingExposure = 1.15;
|
|
636
|
+
renderer.shadowMap.enabled = true;
|
|
637
|
+
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
|
|
638
|
+
renderer.setClearColor(0x000000, 1);
|
|
639
|
+
document.body.appendChild(renderer.domElement);
|
|
640
|
+
const maxAniso = renderer.capabilities.getMaxAnisotropy();
|
|
641
|
+
|
|
642
|
+
const scene = new THREE.Scene();
|
|
643
|
+
const FOG_BASE = new THREE.Color(0x18232f);
|
|
644
|
+
scene.fog = new THREE.FogExp2(0x000000, FOG_DENSITY);
|
|
645
|
+
scene.background = new THREE.Color(0x000000);
|
|
646
|
+
const pmrem = new THREE.PMREMGenerator(renderer);
|
|
647
|
+
scene.environment = pmrem.fromScene(new RoomEnvironment(), 0.04).texture;
|
|
648
|
+
scene.environmentIntensity = 0;
|
|
649
|
+
|
|
650
|
+
const camera = new THREE.PerspectiveCamera(32, W / H, 0.1, 100);
|
|
651
|
+
camera.position.set(0, CAM_Y0, CAM_Z0);
|
|
652
|
+
|
|
653
|
+
/* ---------- procedural textures (seeded, tileable) ---------- */
|
|
654
|
+
function tileNoise(size, cells, seed) {
|
|
655
|
+
const r = mulberry32(seed),
|
|
656
|
+
g = new Float32Array(cells * cells);
|
|
657
|
+
for (let i = 0; i < g.length; i++) g[i] = r();
|
|
658
|
+
const out = new Float32Array(size * size);
|
|
659
|
+
for (let y = 0; y < size; y++) {
|
|
660
|
+
const fy = (y / size) * cells,
|
|
661
|
+
iy = Math.floor(fy),
|
|
662
|
+
ty = fy - iy,
|
|
663
|
+
sy = ty * ty * (3 - 2 * ty),
|
|
664
|
+
y0 = iy % cells,
|
|
665
|
+
y1 = (iy + 1) % cells;
|
|
666
|
+
for (let x = 0; x < size; x++) {
|
|
667
|
+
const fx = (x / size) * cells,
|
|
668
|
+
ix = Math.floor(fx),
|
|
669
|
+
tx = fx - ix,
|
|
670
|
+
sx = tx * tx * (3 - 2 * tx),
|
|
671
|
+
x0 = ix % cells,
|
|
672
|
+
x1 = (ix + 1) % cells;
|
|
673
|
+
const a = g[y0 * cells + x0],
|
|
674
|
+
b = g[y0 * cells + x1],
|
|
675
|
+
c = g[y1 * cells + x0],
|
|
676
|
+
d = g[y1 * cells + x1];
|
|
677
|
+
out[y * size + x] = (a * (1 - sx) + b * sx) * (1 - sy) + (c * (1 - sx) + d * sx) * sy;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
return out;
|
|
681
|
+
}
|
|
682
|
+
function fbmField(size, base, oct, seed) {
|
|
683
|
+
const acc = new Float32Array(size * size);
|
|
684
|
+
let amp = 0.5,
|
|
685
|
+
tot = 0;
|
|
686
|
+
for (let o = 0; o < oct; o++) {
|
|
687
|
+
const n = tileNoise(size, base << o, seed + o * 101);
|
|
688
|
+
for (let i = 0; i < acc.length; i++) acc[i] += n[i] * amp;
|
|
689
|
+
tot += amp;
|
|
690
|
+
amp *= 0.5;
|
|
691
|
+
}
|
|
692
|
+
for (let i = 0; i < acc.length; i++) acc[i] = clamp((acc[i] / tot - 0.5) * 2.3 + 0.5);
|
|
693
|
+
return acc;
|
|
694
|
+
}
|
|
695
|
+
function canvasTex(size, fill, srgb, repeat = 1) {
|
|
696
|
+
const c = document.createElement('canvas');
|
|
697
|
+
c.width = c.height = size;
|
|
698
|
+
const ctx = c.getContext('2d'),
|
|
699
|
+
img = ctx.createImageData(size, size);
|
|
700
|
+
for (let i = 0; i < size * size; i++) {
|
|
701
|
+
const p = fill(i);
|
|
702
|
+
img.data[i * 4] = p[0] * 255;
|
|
703
|
+
img.data[i * 4 + 1] = p[1] * 255;
|
|
704
|
+
img.data[i * 4 + 2] = p[2] * 255;
|
|
705
|
+
img.data[i * 4 + 3] = 255;
|
|
706
|
+
}
|
|
707
|
+
ctx.putImageData(img, 0, 0);
|
|
708
|
+
const t = new THREE.CanvasTexture(c);
|
|
709
|
+
t.wrapS = t.wrapT = THREE.RepeatWrapping;
|
|
710
|
+
t.repeat.set(repeat, repeat);
|
|
711
|
+
t.colorSpace = srgb ? THREE.SRGBColorSpace : THREE.NoColorSpace;
|
|
712
|
+
t.anisotropy = maxAniso;
|
|
713
|
+
return t;
|
|
714
|
+
}
|
|
715
|
+
const TS = 512;
|
|
716
|
+
const nA = fbmField(TS, 4, 6, 11),
|
|
717
|
+
nB = fbmField(TS, 8, 4, 23),
|
|
718
|
+
nC = fbmField(TS, 32, 3, 37),
|
|
719
|
+
nD = fbmField(TS, 4, 5, 53);
|
|
720
|
+
|
|
721
|
+
const stoneMap = canvasTex(
|
|
722
|
+
TS,
|
|
723
|
+
(i) => {
|
|
724
|
+
const base = 0.34 + 0.2 * nA[i] + 0.07 * (nC[i] - 0.5);
|
|
725
|
+
let r = base,
|
|
726
|
+
g = base * 0.985,
|
|
727
|
+
b = base * 0.95;
|
|
728
|
+
const lichen = smooth(0.62, 0.85, nB[i]) * 0.38;
|
|
729
|
+
r = lerp(r, 0.24, lichen);
|
|
730
|
+
g = lerp(g, 0.27, lichen);
|
|
731
|
+
b = lerp(b, 0.15, lichen);
|
|
732
|
+
const pit = smooth(0.68, 0.88, nC[i]) * 0.22;
|
|
733
|
+
return [r * (1 - pit), g * (1 - pit), b * (1 - pit)];
|
|
734
|
+
},
|
|
735
|
+
true,
|
|
736
|
+
1.7
|
|
737
|
+
);
|
|
738
|
+
const stoneRough = canvasTex(
|
|
739
|
+
TS,
|
|
740
|
+
(i) => {
|
|
741
|
+
const v = 0.7 + 0.28 * nB[i];
|
|
742
|
+
return [v, v, v];
|
|
743
|
+
},
|
|
744
|
+
false,
|
|
745
|
+
1.7
|
|
746
|
+
);
|
|
747
|
+
const stoneBump = canvasTex(
|
|
748
|
+
TS,
|
|
749
|
+
(i) => {
|
|
750
|
+
const v = 0.6 * nC[i] + 0.4 * nA[i];
|
|
751
|
+
return [v, v, v];
|
|
752
|
+
},
|
|
753
|
+
false,
|
|
754
|
+
1.7
|
|
755
|
+
);
|
|
756
|
+
const soilMap = canvasTex(
|
|
757
|
+
TS,
|
|
758
|
+
(i) => {
|
|
759
|
+
const a = nD[i],
|
|
760
|
+
c = nC[i];
|
|
761
|
+
let r = 0.13 + 0.07 * a,
|
|
762
|
+
g = 0.105 + 0.055 * a,
|
|
763
|
+
b = 0.085 + 0.04 * a;
|
|
764
|
+
const leaf = smooth(0.62, 0.8, nB[i]) * 0.6;
|
|
765
|
+
r = lerp(r, 0.24, leaf);
|
|
766
|
+
g = lerp(g, 0.17, leaf);
|
|
767
|
+
b = lerp(b, 0.09, leaf);
|
|
768
|
+
const k = 0.85 + 0.3 * c;
|
|
769
|
+
return [r * k, g * k, b * k];
|
|
770
|
+
},
|
|
771
|
+
true,
|
|
772
|
+
1
|
|
773
|
+
);
|
|
774
|
+
soilMap.repeat.set(22, 34);
|
|
775
|
+
const soilBump = canvasTex(
|
|
776
|
+
TS,
|
|
777
|
+
(i) => {
|
|
778
|
+
const v = 0.55 * nC[i] + 0.45 * nB[i];
|
|
779
|
+
return [v, v, v];
|
|
780
|
+
},
|
|
781
|
+
false,
|
|
782
|
+
1
|
|
783
|
+
);
|
|
784
|
+
soilBump.repeat.set(22, 34);
|
|
785
|
+
const fabricBump = canvasTex(
|
|
786
|
+
TS,
|
|
787
|
+
(i) => {
|
|
788
|
+
const x = (i % TS) / TS;
|
|
789
|
+
const v =
|
|
790
|
+
0.5 + 0.38 * Math.sin(Math.PI * 2 * (x * 11) + 3.2 * nA[i]) + 0.12 * (nC[i] - 0.5);
|
|
791
|
+
return [v, v, v];
|
|
792
|
+
},
|
|
793
|
+
false,
|
|
794
|
+
1
|
|
795
|
+
);
|
|
796
|
+
/* ---------- materials ---------- */
|
|
797
|
+
const P = (o) => new THREE.MeshPhysicalMaterial(o);
|
|
798
|
+
const stoneMats = [0xbdb8ae, 0xa8a49c, 0xc9c2b4, 0x9a9890].map((c, k) =>
|
|
799
|
+
P({
|
|
800
|
+
color: c,
|
|
801
|
+
map: stoneMap,
|
|
802
|
+
roughnessMap: stoneRough,
|
|
803
|
+
roughness: 1.0,
|
|
804
|
+
bumpMap: stoneBump,
|
|
805
|
+
bumpScale: 0.5 + k * 0.1,
|
|
806
|
+
metalness: 0,
|
|
807
|
+
specularIntensity: 0.35,
|
|
808
|
+
envMapIntensity: 0.6,
|
|
809
|
+
})
|
|
810
|
+
);
|
|
811
|
+
const groundMat = P({
|
|
812
|
+
color: 0xffffff,
|
|
813
|
+
vertexColors: true,
|
|
814
|
+
map: soilMap,
|
|
815
|
+
roughness: 0.97,
|
|
816
|
+
bumpMap: soilBump,
|
|
817
|
+
bumpScale: 3.0,
|
|
818
|
+
specularIntensity: 0.25,
|
|
819
|
+
});
|
|
820
|
+
const barkMat = P({
|
|
821
|
+
color: 0x3a322b,
|
|
822
|
+
roughness: 0.93,
|
|
823
|
+
bumpMap: stoneBump,
|
|
824
|
+
bumpScale: 4.0,
|
|
825
|
+
specularIntensity: 0.2,
|
|
826
|
+
});
|
|
827
|
+
const ironMat = P({
|
|
828
|
+
color: 0x1d1c1b,
|
|
829
|
+
metalness: 0.85,
|
|
830
|
+
roughness: 0.58,
|
|
831
|
+
envMapIntensity: 0.8,
|
|
832
|
+
});
|
|
833
|
+
const grassMat = P({
|
|
834
|
+
color: 0xffffff,
|
|
835
|
+
roughness: 0.85,
|
|
836
|
+
specularIntensity: 0.3,
|
|
837
|
+
sheen: 0.4,
|
|
838
|
+
sheenColor: 0x8a8460,
|
|
839
|
+
sheenRoughness: 0.6,
|
|
840
|
+
});
|
|
841
|
+
|
|
842
|
+
/* ---------- terrain ---------- */
|
|
843
|
+
function groundH(x, z) {
|
|
844
|
+
const m = smooth(0.9, 2.4, Math.abs(x));
|
|
845
|
+
const h =
|
|
846
|
+
0.1 * Math.sin(0.33 * x + 0.21 * z) * Math.sin(0.27 * z - 0.13 * x + 1.0) +
|
|
847
|
+
0.05 * Math.sin(1.13 * x + 0.6) * Math.cos(0.87 * z + 0.3) +
|
|
848
|
+
0.025 * Math.sin(2.7 * x + 1.9 * z);
|
|
849
|
+
const hill = 1.4 * smooth(-26, -70, z) * (0.6 + 0.4 * Math.sin(0.13 * x + 0.8));
|
|
850
|
+
return h * m - 0.015 * (1 - m) + hill;
|
|
851
|
+
}
|
|
852
|
+
{
|
|
853
|
+
const g = new THREE.PlaneGeometry(76, 110, 152, 220);
|
|
854
|
+
g.rotateX(-Math.PI / 2);
|
|
855
|
+
g.translate(0, 0, -35);
|
|
856
|
+
const pos = g.attributes.position,
|
|
857
|
+
col = new Float32Array(pos.count * 3);
|
|
858
|
+
for (let i = 0; i < pos.count; i++) {
|
|
859
|
+
const x = pos.getX(i),
|
|
860
|
+
z = pos.getZ(i);
|
|
861
|
+
pos.setY(i, groundH(x, z));
|
|
862
|
+
const path = 1 - smooth(0.5, 1.6, Math.abs(x));
|
|
863
|
+
const damp = 0.5 + 0.5 * Math.sin(x * 0.7 + z * 0.4) * Math.sin(z * 0.23);
|
|
864
|
+
col[i * 3] = lerp(0.82 + 0.1 * damp, 1.18, path);
|
|
865
|
+
col[i * 3 + 1] = lerp(0.86 + 0.08 * damp, 1.1, path);
|
|
866
|
+
col[i * 3 + 2] = lerp(0.8, 1.02, path);
|
|
867
|
+
}
|
|
868
|
+
g.setAttribute('color', new THREE.BufferAttribute(col, 3));
|
|
869
|
+
g.computeVertexNormals();
|
|
870
|
+
const ground = new THREE.Mesh(g, groundMat);
|
|
871
|
+
ground.receiveShadow = true;
|
|
872
|
+
scene.add(ground);
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
/* ---------- sky dome (no glow, just a cold gradient behind the fog) ---------- */
|
|
876
|
+
const moonDir = new THREE.Vector3(-10, 14, -34).normalize();
|
|
877
|
+
const skyMat = new THREE.ShaderMaterial({
|
|
878
|
+
side: THREE.BackSide,
|
|
879
|
+
depthWrite: false,
|
|
880
|
+
fog: false,
|
|
881
|
+
uniforms: { uFog: { value: new THREE.Color(0) }, uMoon: { value: moonDir } },
|
|
882
|
+
vertexShader: \`varying vec3 vDir; void main(){ vec4 w = modelMatrix*vec4(position,1.0); vDir = w.xyz - cameraPosition; gl_Position = projectionMatrix*viewMatrix*w; }\`,
|
|
883
|
+
fragmentShader: \`uniform vec3 uFog; uniform vec3 uMoon; varying vec3 vDir;
|
|
884
|
+
void main(){ vec3 d = normalize(vDir); float h = d.y;
|
|
885
|
+
vec3 col = uFog * mix(1.0, 0.38, smoothstep(0.0, 0.5, h));
|
|
886
|
+
float m = max(dot(d, normalize(uMoon)), 0.0); col += uFog * 1.3 * pow(m, 5.0) * smoothstep(-0.05, 0.2, h);
|
|
887
|
+
gl_FragColor = vec4(col, 1.0); }\`,
|
|
888
|
+
});
|
|
889
|
+
const sky = new THREE.Mesh(new THREE.SphereGeometry(85, 32, 16), skyMat);
|
|
890
|
+
sky.renderOrder = -1;
|
|
891
|
+
scene.add(sky);
|
|
892
|
+
|
|
893
|
+
/* ---------- tombstones ---------- */
|
|
894
|
+
function stoneShape(w, h, type) {
|
|
895
|
+
const s = new THREE.Shape(),
|
|
896
|
+
hw = w / 2;
|
|
897
|
+
if (type === 0) {
|
|
898
|
+
s.moveTo(-hw, 0);
|
|
899
|
+
s.lineTo(hw, 0);
|
|
900
|
+
s.lineTo(hw, h - hw);
|
|
901
|
+
s.absarc(0, h - hw, hw, 0, Math.PI, false);
|
|
902
|
+
s.lineTo(-hw, 0);
|
|
903
|
+
} else if (type === 1) {
|
|
904
|
+
s.moveTo(-hw, 0);
|
|
905
|
+
s.lineTo(hw, 0);
|
|
906
|
+
s.lineTo(hw, h * 0.62);
|
|
907
|
+
s.quadraticCurveTo(hw, h * 0.9, 0, h);
|
|
908
|
+
s.quadraticCurveTo(-hw, h * 0.9, -hw, h * 0.62);
|
|
909
|
+
s.lineTo(-hw, 0);
|
|
910
|
+
} else if (type === 2) {
|
|
911
|
+
s.moveTo(-hw, 0);
|
|
912
|
+
s.lineTo(hw, 0);
|
|
913
|
+
s.lineTo(hw, h * 0.8);
|
|
914
|
+
s.quadraticCurveTo(hw * 0.95, h * 0.88, hw * 0.58, h * 0.88);
|
|
915
|
+
s.quadraticCurveTo(hw * 0.25, h * 0.88, 0, h);
|
|
916
|
+
s.quadraticCurveTo(-hw * 0.25, h * 0.88, -hw * 0.58, h * 0.88);
|
|
917
|
+
s.quadraticCurveTo(-hw * 0.95, h * 0.88, -hw, h * 0.8);
|
|
918
|
+
s.lineTo(-hw, 0);
|
|
919
|
+
} else {
|
|
920
|
+
const a = w * 0.15,
|
|
921
|
+
y0 = h * 0.6,
|
|
922
|
+
y1 = y0 + 2 * a;
|
|
923
|
+
s.moveTo(-a, 0);
|
|
924
|
+
s.lineTo(a, 0);
|
|
925
|
+
s.lineTo(a, y0);
|
|
926
|
+
s.lineTo(hw, y0);
|
|
927
|
+
s.lineTo(hw, y1);
|
|
928
|
+
s.lineTo(a, y1);
|
|
929
|
+
s.lineTo(a, h);
|
|
930
|
+
s.lineTo(-a, h);
|
|
931
|
+
s.lineTo(-a, y1);
|
|
932
|
+
s.lineTo(-hw, y1);
|
|
933
|
+
s.lineTo(-hw, y0);
|
|
934
|
+
s.lineTo(-a, y0);
|
|
935
|
+
s.lineTo(-a, 0);
|
|
936
|
+
}
|
|
937
|
+
return s;
|
|
938
|
+
}
|
|
939
|
+
const stoneGroup = new THREE.Group();
|
|
940
|
+
scene.add(stoneGroup);
|
|
941
|
+
function addTomb(x, z, scale) {
|
|
942
|
+
const type = rng() < 0.12 ? 3 : Math.floor(rand(0, 3)),
|
|
943
|
+
r = rng();
|
|
944
|
+
const w = (type === 3 ? rand(0.55, 0.75) : rand(0.5, 0.78)) * scale,
|
|
945
|
+
h = (type === 3 ? rand(1.0, 1.35) : rand(0.7, 1.15)) * scale,
|
|
946
|
+
d = rand(0.1, 0.17) * scale;
|
|
947
|
+
const geo = new THREE.ExtrudeGeometry(stoneShape(w, h, type), {
|
|
948
|
+
depth: d,
|
|
949
|
+
bevelEnabled: true,
|
|
950
|
+
bevelThickness: 0.014,
|
|
951
|
+
bevelSize: 0.014,
|
|
952
|
+
bevelSegments: 2,
|
|
953
|
+
curveSegments: 18,
|
|
954
|
+
});
|
|
955
|
+
geo.translate(0, 0, -d / 2);
|
|
956
|
+
const m = new THREE.Mesh(geo, stoneMats[Math.floor(r * 4)]);
|
|
957
|
+
const grp = new THREE.Group();
|
|
958
|
+
grp.add(m);
|
|
959
|
+
if (type !== 3 && rng() < 0.45) {
|
|
960
|
+
const pl = new THREE.Mesh(
|
|
961
|
+
new THREE.BoxGeometry(w * 1.18, 0.12 * scale, d * 2.2),
|
|
962
|
+
m.material
|
|
963
|
+
);
|
|
964
|
+
pl.position.y = 0.0;
|
|
965
|
+
m.position.y = 0.05 * scale;
|
|
966
|
+
grp.add(pl);
|
|
967
|
+
pl.castShadow = pl.receiveShadow = true;
|
|
968
|
+
}
|
|
969
|
+
grp.position.set(x, groundH(x, z) - rand(0.03, 0.1), z);
|
|
970
|
+
grp.rotation.set(
|
|
971
|
+
rand(-0.11, 0.07),
|
|
972
|
+
rand(-0.3, 0.3) + (x > 0 ? -0.08 : 0.08),
|
|
973
|
+
rand(-0.09, 0.09)
|
|
974
|
+
);
|
|
975
|
+
m.castShadow = m.receiveShadow = true;
|
|
976
|
+
stoneGroup.add(grp);
|
|
977
|
+
if (rng() < 0.5) {
|
|
978
|
+
const mound = new THREE.Mesh(
|
|
979
|
+
new THREE.SphereGeometry(1, 20, 12, 0, Math.PI * 2, 0, Math.PI / 2),
|
|
980
|
+
groundMat
|
|
981
|
+
);
|
|
982
|
+
mound.scale.set(w * 0.62, 0.11, 0.85);
|
|
983
|
+
mound.position.set(x + rand(-0.05, 0.05), groundH(x, z + 0.95) - 0.05, z + 0.95);
|
|
984
|
+
mound.receiveShadow = true;
|
|
985
|
+
scene.add(mound);
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
function addObelisk(x, z) {
|
|
989
|
+
const h = rand(1.5, 2.1),
|
|
990
|
+
w = rand(0.32, 0.4),
|
|
991
|
+
grp = new THREE.Group(),
|
|
992
|
+
mat = stoneMats[Math.floor(rand(0, 4))];
|
|
993
|
+
const base = new THREE.Mesh(new THREE.BoxGeometry(w * 1.7, 0.28, w * 1.7), mat);
|
|
994
|
+
base.position.y = 0.1;
|
|
995
|
+
const shaft = new THREE.Mesh(new THREE.CylinderGeometry(w * 0.48, w * 0.68, h, 4, 1), mat);
|
|
996
|
+
shaft.rotation.y = Math.PI / 4;
|
|
997
|
+
shaft.position.y = 0.24 + h / 2;
|
|
998
|
+
const tip = new THREE.Mesh(new THREE.ConeGeometry(w * 0.48, w * 0.7, 4), mat);
|
|
999
|
+
tip.rotation.y = Math.PI / 4;
|
|
1000
|
+
tip.position.y = 0.24 + h + w * 0.35;
|
|
1001
|
+
[base, shaft, tip].forEach((o) => {
|
|
1002
|
+
o.castShadow = o.receiveShadow = true;
|
|
1003
|
+
grp.add(o);
|
|
1004
|
+
});
|
|
1005
|
+
grp.position.set(x, groundH(x, z) - 0.05, z);
|
|
1006
|
+
grp.rotation.set(rand(-0.04, 0.04), rand(0, 1), rand(-0.05, 0.05));
|
|
1007
|
+
stoneGroup.add(grp);
|
|
1008
|
+
}
|
|
1009
|
+
for (const side of [-1, 1]) {
|
|
1010
|
+
for (let z = 6.2; z > -40; z -= rand(2.2, 3.0))
|
|
1011
|
+
addTomb(side * rand(1.55, 2.05), z + rand(-0.4, 0.4), rand(0.9, 1.1));
|
|
1012
|
+
for (let z = 5.0; z > -42; z -= rand(2.4, 3.4))
|
|
1013
|
+
addTomb(side * rand(3.0, 4.2), z + rand(-0.5, 0.5), rand(0.85, 1.15));
|
|
1014
|
+
for (let z = 3.0; z > -44; z -= rand(2.6, 4.0)) {
|
|
1015
|
+
const x = side * rand(5.2, 8.5);
|
|
1016
|
+
if (rng() < 0.18) addObelisk(x, z);
|
|
1017
|
+
else addTomb(x, z, rand(0.9, 1.25));
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
|
|
1021
|
+
/* ---------- dead trees ---------- */
|
|
1022
|
+
function makeTree(seed, scale) {
|
|
1023
|
+
const r = mulberry32(seed),
|
|
1024
|
+
geos = [],
|
|
1025
|
+
Y = new THREE.Vector3(0, 1, 0);
|
|
1026
|
+
function seg(a, b, r0, r1, joint) {
|
|
1027
|
+
const d = new THREE.Vector3().subVectors(b, a),
|
|
1028
|
+
L = d.length();
|
|
1029
|
+
const g = new THREE.CylinderGeometry(r1, r0, L, 7, 1);
|
|
1030
|
+
g.translate(0, L / 2, 0);
|
|
1031
|
+
g.applyQuaternion(new THREE.Quaternion().setFromUnitVectors(Y, d.normalize()));
|
|
1032
|
+
g.translate(a.x, a.y, a.z);
|
|
1033
|
+
geos.push(g);
|
|
1034
|
+
if (joint) {
|
|
1035
|
+
const s = new THREE.SphereGeometry(r1 * 1.02, 8, 6);
|
|
1036
|
+
s.translate(b.x, b.y, b.z);
|
|
1037
|
+
geos.push(s);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
function branch(p, dir, len, rad, depth) {
|
|
1041
|
+
let cur = p.clone(),
|
|
1042
|
+
d = dir.clone(),
|
|
1043
|
+
r0 = rad * (depth === 0 ? 1.7 : 1);
|
|
1044
|
+
for (let i = 0; i < 3; i++) {
|
|
1045
|
+
d.add(
|
|
1046
|
+
new THREE.Vector3((r() - 0.5) * 0.7, (r() - 0.45) * 0.35, (r() - 0.5) * 0.7)
|
|
1047
|
+
).normalize();
|
|
1048
|
+
const nxt = cur.clone().addScaledVector(d, len / 3),
|
|
1049
|
+
r1 = rad * (1 - (0.5 * (i + 1)) / 3);
|
|
1050
|
+
seg(cur, nxt, r0, r1, depth < 3);
|
|
1051
|
+
cur = nxt;
|
|
1052
|
+
r0 = r1;
|
|
1053
|
+
}
|
|
1054
|
+
if (depth >= 5 || rad < 0.012) return;
|
|
1055
|
+
const kids = depth < 1 ? 3 : 2 + (r() < 0.4 ? 1 : 0);
|
|
1056
|
+
for (let k = 0; k < kids; k++) {
|
|
1057
|
+
const nd = d
|
|
1058
|
+
.clone()
|
|
1059
|
+
.add(new THREE.Vector3((r() - 0.5) * 1.7, r() * 0.7 - 0.15, (r() - 0.5) * 1.7))
|
|
1060
|
+
.normalize();
|
|
1061
|
+
branch(cur, nd, len * (0.6 + r() * 0.16), r0 * 0.74, depth + 1);
|
|
1062
|
+
}
|
|
1063
|
+
}
|
|
1064
|
+
branch(
|
|
1065
|
+
new THREE.Vector3(0, -0.3, 0),
|
|
1066
|
+
new THREE.Vector3(0, 1, 0),
|
|
1067
|
+
3.4 * scale,
|
|
1068
|
+
0.2 * scale,
|
|
1069
|
+
0
|
|
1070
|
+
);
|
|
1071
|
+
return mergeGeometries(geos);
|
|
1072
|
+
}
|
|
1073
|
+
[
|
|
1074
|
+
[-5.6, -13, 1.25, 7],
|
|
1075
|
+
[6.8, -19, 1.1, 19],
|
|
1076
|
+
[-8.5, -27, 1.3, 33],
|
|
1077
|
+
[4.6, -35, 1.0, 41],
|
|
1078
|
+
[9.5, -8, 0.9, 57],
|
|
1079
|
+
[-11, -6, 1.0, 71],
|
|
1080
|
+
[12, -30, 1.2, 83],
|
|
1081
|
+
].forEach(([x, z, s, seed]) => {
|
|
1082
|
+
const t = new THREE.Mesh(makeTree(seed, s), barkMat);
|
|
1083
|
+
t.position.set(x, groundH(x, z), z);
|
|
1084
|
+
t.rotation.y = seed;
|
|
1085
|
+
t.castShadow = true;
|
|
1086
|
+
t.receiveShadow = true;
|
|
1087
|
+
scene.add(t);
|
|
1088
|
+
});
|
|
1089
|
+
|
|
1090
|
+
/* ---------- gate and iron fence (at the far end of the aisle) ---------- */
|
|
1091
|
+
const GATE_Z = -27;
|
|
1092
|
+
{
|
|
1093
|
+
const pillarMat = stoneMats[1];
|
|
1094
|
+
for (const side of [-1, 1]) {
|
|
1095
|
+
const pg = new THREE.Group();
|
|
1096
|
+
const p = new THREE.Mesh(new THREE.BoxGeometry(0.5, 2.5, 0.5), pillarMat);
|
|
1097
|
+
p.position.y = 1.25;
|
|
1098
|
+
const cap = new THREE.Mesh(new THREE.BoxGeometry(0.64, 0.14, 0.64), pillarMat);
|
|
1099
|
+
cap.position.y = 2.57;
|
|
1100
|
+
const fin = new THREE.Mesh(new THREE.SphereGeometry(0.17, 20, 14), pillarMat);
|
|
1101
|
+
fin.position.y = 2.82;
|
|
1102
|
+
[p, cap, fin].forEach((o) => {
|
|
1103
|
+
o.castShadow = o.receiveShadow = true;
|
|
1104
|
+
pg.add(o);
|
|
1105
|
+
});
|
|
1106
|
+
pg.position.set(side * 1.65, groundH(side * 1.65, GATE_Z), GATE_Z);
|
|
1107
|
+
scene.add(pg);
|
|
1108
|
+
// open gate leaf, hinged at the pillar, swung toward the camera
|
|
1109
|
+
const bars = [];
|
|
1110
|
+
for (let i = 0; i < 8; i++) {
|
|
1111
|
+
const b = new THREE.CylinderGeometry(0.013, 0.013, 1.9, 6);
|
|
1112
|
+
b.translate(0.08 + i * 0.16, 0.98, 0);
|
|
1113
|
+
bars.push(b);
|
|
1114
|
+
const tip = new THREE.ConeGeometry(0.03, 0.12, 6);
|
|
1115
|
+
tip.translate(0.08 + i * 0.16, 1.98, 0);
|
|
1116
|
+
bars.push(tip);
|
|
1117
|
+
}
|
|
1118
|
+
for (const y of [0.18, 1.55, 1.8]) {
|
|
1119
|
+
const r = new THREE.BoxGeometry(1.24, 0.035, 0.035);
|
|
1120
|
+
r.translate(0.64, y, 0);
|
|
1121
|
+
bars.push(r);
|
|
1122
|
+
}
|
|
1123
|
+
const leaf = new THREE.Mesh(mergeGeometries(bars.map((g) => g.toNonIndexed())), ironMat);
|
|
1124
|
+
leaf.castShadow = true;
|
|
1125
|
+
const hinge = new THREE.Group();
|
|
1126
|
+
hinge.position.set(side * 1.38, groundH(side * 1.38, GATE_Z), GATE_Z + 0.02);
|
|
1127
|
+
hinge.rotation.y = side < 0 ? -1.15 : Math.PI + 1.15;
|
|
1128
|
+
hinge.add(leaf);
|
|
1129
|
+
scene.add(hinge);
|
|
1130
|
+
}
|
|
1131
|
+
// arch
|
|
1132
|
+
const arch = new THREE.Mesh(new THREE.TorusGeometry(1.4, 0.022, 8, 48, Math.PI), ironMat);
|
|
1133
|
+
arch.position.set(0, 2.45, GATE_Z);
|
|
1134
|
+
arch.castShadow = true;
|
|
1135
|
+
scene.add(arch);
|
|
1136
|
+
// fence
|
|
1137
|
+
const barGeo = mergeGeometries([
|
|
1138
|
+
new THREE.CylinderGeometry(0.011, 0.011, 1.5, 5).translate(0, 0.75, 0).toNonIndexed(),
|
|
1139
|
+
new THREE.ConeGeometry(0.026, 0.1, 5).translate(0, 1.55, 0).toNonIndexed(),
|
|
1140
|
+
]);
|
|
1141
|
+
const xs = [];
|
|
1142
|
+
for (const side of [-1, 1]) for (let x = 2.0; x < 16; x += 0.15) xs.push(side * x);
|
|
1143
|
+
const fence = new THREE.InstancedMesh(barGeo, ironMat, xs.length);
|
|
1144
|
+
const m4 = new THREE.Matrix4();
|
|
1145
|
+
xs.forEach((x, i) => {
|
|
1146
|
+
m4.makeRotationZ((hash1(i * 3.1) - 0.5) * 0.06);
|
|
1147
|
+
m4.setPosition(x, groundH(x, GATE_Z) - 0.05, GATE_Z);
|
|
1148
|
+
fence.setMatrixAt(i, m4);
|
|
1149
|
+
});
|
|
1150
|
+
fence.castShadow = true;
|
|
1151
|
+
scene.add(fence);
|
|
1152
|
+
for (const side of [-1, 1])
|
|
1153
|
+
for (const y of [0.25, 1.32]) {
|
|
1154
|
+
const r = new THREE.Mesh(new THREE.BoxGeometry(14, 0.03, 0.03), ironMat);
|
|
1155
|
+
r.position.set(side * 9, y + 0.1, GATE_Z);
|
|
1156
|
+
r.castShadow = true;
|
|
1157
|
+
scene.add(r);
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
/* ---------- dead grass ---------- */
|
|
1162
|
+
{
|
|
1163
|
+
const N = 5200,
|
|
1164
|
+
blade = new THREE.ConeGeometry(0.008, 0.18, 3, 1);
|
|
1165
|
+
blade.translate(0, 0.09, 0);
|
|
1166
|
+
const grass = new THREE.InstancedMesh(blade, grassMat, N),
|
|
1167
|
+
m4 = new THREE.Matrix4(),
|
|
1168
|
+
q = new THREE.Quaternion(),
|
|
1169
|
+
e = new THREE.Euler(),
|
|
1170
|
+
s = new THREE.Vector3(),
|
|
1171
|
+
p = new THREE.Vector3(),
|
|
1172
|
+
c = new THREE.Color();
|
|
1173
|
+
let n = 0;
|
|
1174
|
+
while (n < N) {
|
|
1175
|
+
const x = rand(-13, 13),
|
|
1176
|
+
z = rand(-40, 8.5);
|
|
1177
|
+
if (Math.abs(x) < 0.75 + rng() * 0.6) continue;
|
|
1178
|
+
e.set(rand(-0.45, 0.45), rand(0, 6.28), rand(-0.45, 0.45));
|
|
1179
|
+
q.setFromEuler(e);
|
|
1180
|
+
s.set(rand(0.7, 1.3), rand(0.45, 1.5), rand(0.7, 1.3));
|
|
1181
|
+
p.set(x, groundH(x, z) - 0.02, z);
|
|
1182
|
+
m4.compose(p, q, s);
|
|
1183
|
+
grass.setMatrixAt(n, m4);
|
|
1184
|
+
c.setRGB(lerp(0.14, 0.27, rng()), lerp(0.13, 0.23, rng()), lerp(0.08, 0.12, rng()));
|
|
1185
|
+
grass.setColorAt(n, c);
|
|
1186
|
+
n++;
|
|
1187
|
+
}
|
|
1188
|
+
grass.receiveShadow = true;
|
|
1189
|
+
scene.add(grass);
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
/* ---------- pumpkins ---------- */
|
|
1193
|
+
const pumpkinColorDark = new THREE.Color(0x5a1e06),
|
|
1194
|
+
pumpkinColorLight = new THREE.Color(0xd9661c);
|
|
1195
|
+
function pumpkinDeform(v) {
|
|
1196
|
+
const th = Math.atan2(v.z, v.x),
|
|
1197
|
+
lobe = Math.pow(Math.abs(Math.cos(th * 4)), 0.5);
|
|
1198
|
+
const rf = (1 - 0.075 * (1 - lobe)) * (1 - 0.06 * v.y * v.y);
|
|
1199
|
+
let y = v.y * 0.72 - 0.2 * smooth(0.72, 1.0, v.y) + 0.08 * smooth(-0.8, -1.0, v.y);
|
|
1200
|
+
return { p: new THREE.Vector3(v.x * rf, y, v.z * rf), lobe };
|
|
1201
|
+
}
|
|
1202
|
+
const pumpkinGeo = (() => {
|
|
1203
|
+
let g = new THREE.SphereGeometry(1, 64, 40);
|
|
1204
|
+
g.deleteAttribute('uv');
|
|
1205
|
+
g.deleteAttribute('normal');
|
|
1206
|
+
g = mergeVertices(g);
|
|
1207
|
+
const pos = g.attributes.position,
|
|
1208
|
+
col = new Float32Array(pos.count * 3),
|
|
1209
|
+
v = new THREE.Vector3(),
|
|
1210
|
+
c = new THREE.Color();
|
|
1211
|
+
for (let i = 0; i < pos.count; i++) {
|
|
1212
|
+
v.fromBufferAttribute(pos, i).normalize();
|
|
1213
|
+
const d = pumpkinDeform(v);
|
|
1214
|
+
pos.setXYZ(i, d.p.x, d.p.y, d.p.z);
|
|
1215
|
+
c.copy(pumpkinColorDark).lerp(
|
|
1216
|
+
pumpkinColorLight,
|
|
1217
|
+
Math.pow(d.lobe, 1.6) * (0.75 + 0.25 * (1 - Math.abs(v.y)))
|
|
1218
|
+
);
|
|
1219
|
+
col[i * 3] = c.r;
|
|
1220
|
+
col[i * 3 + 1] = c.g;
|
|
1221
|
+
col[i * 3 + 2] = c.b;
|
|
1222
|
+
}
|
|
1223
|
+
g.setAttribute('color', new THREE.BufferAttribute(col, 3));
|
|
1224
|
+
g.computeVertexNormals();
|
|
1225
|
+
return g;
|
|
1226
|
+
})();
|
|
1227
|
+
const pumpkinMat = P({
|
|
1228
|
+
color: 0xffffff,
|
|
1229
|
+
vertexColors: true,
|
|
1230
|
+
roughness: 0.52,
|
|
1231
|
+
clearcoat: 0.35,
|
|
1232
|
+
clearcoatRoughness: 0.45,
|
|
1233
|
+
sheen: 0.3,
|
|
1234
|
+
sheenColor: 0xffa060,
|
|
1235
|
+
specularIntensity: 0.6,
|
|
1236
|
+
});
|
|
1237
|
+
const stemMat = P({ color: 0x4a4426, roughness: 0.82, bumpMap: stoneBump, bumpScale: 3 });
|
|
1238
|
+
function subdivide(geo, times) {
|
|
1239
|
+
let g = geo.index ? geo.toNonIndexed() : geo;
|
|
1240
|
+
for (let k = 0; k < times; k++) {
|
|
1241
|
+
const a = g.attributes.position.array,
|
|
1242
|
+
out = [];
|
|
1243
|
+
for (let i = 0; i < a.length; i += 9) {
|
|
1244
|
+
const A = [a[i], a[i + 1], a[i + 2]],
|
|
1245
|
+
B = [a[i + 3], a[i + 4], a[i + 5]],
|
|
1246
|
+
C = [a[i + 6], a[i + 7], a[i + 8]];
|
|
1247
|
+
const mid = (p, q) => [(p[0] + q[0]) / 2, (p[1] + q[1]) / 2, (p[2] + q[2]) / 2];
|
|
1248
|
+
const ab = mid(A, B),
|
|
1249
|
+
bc = mid(B, C),
|
|
1250
|
+
ca = mid(C, A);
|
|
1251
|
+
out.push(
|
|
1252
|
+
...A,
|
|
1253
|
+
...ab,
|
|
1254
|
+
...ca,
|
|
1255
|
+
...ab,
|
|
1256
|
+
...B,
|
|
1257
|
+
...bc,
|
|
1258
|
+
...ca,
|
|
1259
|
+
...bc,
|
|
1260
|
+
...C,
|
|
1261
|
+
...ab,
|
|
1262
|
+
...bc,
|
|
1263
|
+
...ca
|
|
1264
|
+
);
|
|
1265
|
+
}
|
|
1266
|
+
g = new THREE.BufferGeometry();
|
|
1267
|
+
g.setAttribute('position', new THREE.Float32BufferAttribute(out, 3));
|
|
1268
|
+
}
|
|
1269
|
+
return g;
|
|
1270
|
+
}
|
|
1271
|
+
const faceGeo = (() => {
|
|
1272
|
+
const shapes = [];
|
|
1273
|
+
const tri = (pts) => {
|
|
1274
|
+
const s = new THREE.Shape();
|
|
1275
|
+
s.moveTo(...pts[0]);
|
|
1276
|
+
pts.slice(1).forEach((p) => s.lineTo(...p));
|
|
1277
|
+
s.closePath();
|
|
1278
|
+
return s;
|
|
1279
|
+
};
|
|
1280
|
+
shapes.push(
|
|
1281
|
+
tri([
|
|
1282
|
+
[0.12, 0.08],
|
|
1283
|
+
[0.42, 0.17],
|
|
1284
|
+
[0.25, 0.38],
|
|
1285
|
+
]),
|
|
1286
|
+
tri([
|
|
1287
|
+
[-0.12, 0.08],
|
|
1288
|
+
[-0.25, 0.38],
|
|
1289
|
+
[-0.42, 0.17],
|
|
1290
|
+
]),
|
|
1291
|
+
tri([
|
|
1292
|
+
[-0.06, -0.03],
|
|
1293
|
+
[0.06, -0.03],
|
|
1294
|
+
[0, 0.07],
|
|
1295
|
+
])
|
|
1296
|
+
);
|
|
1297
|
+
const yu = (x) => -0.1 - 0.1 * (1 - (x / 0.5) ** 2),
|
|
1298
|
+
yl = (x) => -0.14 - 0.26 * (1 - (x / 0.5) ** 2);
|
|
1299
|
+
const m = new THREE.Shape();
|
|
1300
|
+
m.moveTo(-0.5, yu(-0.5));
|
|
1301
|
+
for (let x = -0.45; x <= 0.451; x += 0.05) {
|
|
1302
|
+
const xr = Math.round(x * 100) / 100;
|
|
1303
|
+
if (xr === -0.05) {
|
|
1304
|
+
m.lineTo(-0.05, yl(-0.05));
|
|
1305
|
+
m.lineTo(-0.05, yl(-0.05) + 0.08);
|
|
1306
|
+
m.lineTo(0.05, yl(0.05) + 0.08);
|
|
1307
|
+
m.lineTo(0.05, yl(0.05));
|
|
1308
|
+
continue;
|
|
1309
|
+
}
|
|
1310
|
+
if (xr === 0 || xr === 0.05) continue;
|
|
1311
|
+
m.lineTo(xr, yl(xr));
|
|
1312
|
+
}
|
|
1313
|
+
m.lineTo(0.5, yu(0.5));
|
|
1314
|
+
for (let x = 0.45; x >= -0.451; x -= 0.05) {
|
|
1315
|
+
const xr = Math.round(x * 100) / 100;
|
|
1316
|
+
if (xr === 0.22) {
|
|
1317
|
+
m.lineTo(0.22, yu(0.22));
|
|
1318
|
+
m.lineTo(0.22, yu(0.22) - 0.08);
|
|
1319
|
+
m.lineTo(0.12, yu(0.12) - 0.08);
|
|
1320
|
+
m.lineTo(0.12, yu(0.12));
|
|
1321
|
+
continue;
|
|
1322
|
+
}
|
|
1323
|
+
if (xr === -0.12) {
|
|
1324
|
+
m.lineTo(-0.12, yu(-0.12));
|
|
1325
|
+
m.lineTo(-0.12, yu(-0.12) - 0.08);
|
|
1326
|
+
m.lineTo(-0.22, yu(-0.22) - 0.08);
|
|
1327
|
+
m.lineTo(-0.22, yu(-0.22));
|
|
1328
|
+
continue;
|
|
1329
|
+
}
|
|
1330
|
+
if ((xr > 0.12 && xr < 0.22) || (xr > -0.22 && xr < -0.12)) continue;
|
|
1331
|
+
m.lineTo(xr, yu(xr));
|
|
1332
|
+
}
|
|
1333
|
+
m.closePath();
|
|
1334
|
+
shapes.push(m);
|
|
1335
|
+
const flat = subdivide(new THREE.ShapeGeometry(shapes, 1), 3),
|
|
1336
|
+
pos = flat.attributes.position;
|
|
1337
|
+
const col = new Float32Array(pos.count * 3),
|
|
1338
|
+
v = new THREE.Vector3();
|
|
1339
|
+
for (let i = 0; i < pos.count; i++) {
|
|
1340
|
+
const x = pos.getX(i),
|
|
1341
|
+
y = pos.getY(i);
|
|
1342
|
+
v.set(x, y, Math.sqrt(Math.max(0, 1 - x * x - y * y))).normalize();
|
|
1343
|
+
const d = pumpkinDeform(v);
|
|
1344
|
+
d.p.addScaledVector(v, 0.014);
|
|
1345
|
+
pos.setXYZ(i, d.p.x, d.p.y, d.p.z);
|
|
1346
|
+
const k = 0.55 + 0.45 * smooth(0.55, 0.0, Math.hypot(x * 0.8, y + 0.05));
|
|
1347
|
+
col[i * 3] = k;
|
|
1348
|
+
col[i * 3 + 1] = k * k;
|
|
1349
|
+
col[i * 3 + 2] = k * k * k;
|
|
1350
|
+
}
|
|
1351
|
+
flat.setAttribute('color', new THREE.BufferAttribute(col, 3));
|
|
1352
|
+
return flat;
|
|
1353
|
+
})();
|
|
1354
|
+
const pumpkins = [];
|
|
1355
|
+
function addPumpkin(x, z, r, carved, withLight) {
|
|
1356
|
+
const g = new THREE.Group(),
|
|
1357
|
+
body = new THREE.Mesh(pumpkinGeo, pumpkinMat);
|
|
1358
|
+
body.castShadow = body.receiveShadow = true;
|
|
1359
|
+
g.add(body);
|
|
1360
|
+
const st = new THREE.CylinderGeometry(0.045, 0.08, 0.26, 7, 5);
|
|
1361
|
+
const sp = st.attributes.position;
|
|
1362
|
+
for (let i = 0; i < sp.count; i++) {
|
|
1363
|
+
const yy = sp.getY(i) + 0.13;
|
|
1364
|
+
sp.setX(i, sp.getX(i) + 0.1 * yy * yy);
|
|
1365
|
+
}
|
|
1366
|
+
st.computeVertexNormals();
|
|
1367
|
+
const stem = new THREE.Mesh(st, stemMat);
|
|
1368
|
+
stem.position.y = 0.58;
|
|
1369
|
+
stem.rotation.y = rand(0, 6);
|
|
1370
|
+
stem.castShadow = true;
|
|
1371
|
+
g.add(stem);
|
|
1372
|
+
let face = null,
|
|
1373
|
+
faceMat = null,
|
|
1374
|
+
light = null;
|
|
1375
|
+
if (carved) {
|
|
1376
|
+
faceMat = new THREE.MeshBasicMaterial({
|
|
1377
|
+
color: 0x000000,
|
|
1378
|
+
vertexColors: true,
|
|
1379
|
+
polygonOffset: true,
|
|
1380
|
+
polygonOffsetFactor: -2,
|
|
1381
|
+
polygonOffsetUnits: -2,
|
|
1382
|
+
});
|
|
1383
|
+
face = new THREE.Mesh(faceGeo, faceMat);
|
|
1384
|
+
g.add(face);
|
|
1385
|
+
if (withLight) {
|
|
1386
|
+
light = new THREE.PointLight(0xff7a2a, 0, 5, 2);
|
|
1387
|
+
light.position.set(0, 0.25, 0.55);
|
|
1388
|
+
g.add(light);
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
g.scale.setScalar(r);
|
|
1392
|
+
g.position.set(x, groundH(x, z) + r * 0.62, z);
|
|
1393
|
+
g.rotation.y = Math.atan2(0 - x, 3.0 - z) + rand(-0.18, 0.18);
|
|
1394
|
+
g.rotation.z = rand(-0.08, 0.08);
|
|
1395
|
+
scene.add(g);
|
|
1396
|
+
pumpkins.push({ g, faceMat, light, seed: pumpkins.length * 13.7 + 2.1 });
|
|
1397
|
+
}
|
|
1398
|
+
addPumpkin(-0.98, -1.35, 0.3, true, true);
|
|
1399
|
+
addPumpkin(1.18, -2.75, 0.34, true, true);
|
|
1400
|
+
addPumpkin(1.42, -2.25, 0.2, false);
|
|
1401
|
+
addPumpkin(-1.38, 4.6, 0.26, true, true);
|
|
1402
|
+
addPumpkin(-2.4, 2.1, 0.22, false);
|
|
1403
|
+
addPumpkin(1.55, -6.6, 0.27, true, false);
|
|
1404
|
+
addPumpkin(-1.75, -11.2, 0.3, true, false);
|
|
1405
|
+
addPumpkin(2.6, -8.4, 0.24, false);
|
|
1406
|
+
addPumpkin(1.6, -17.5, 0.28, true, false);
|
|
1407
|
+
addPumpkin(-2.9, -3.8, 0.2, false);
|
|
1408
|
+
|
|
1409
|
+
/* ---------- ground mist (soft sheets, never in the dolly path) ---------- */
|
|
1410
|
+
const mistUniforms = {
|
|
1411
|
+
uTime: { value: 0 },
|
|
1412
|
+
uColor: { value: new THREE.Color(0) },
|
|
1413
|
+
uCandlePos: { value: new THREE.Vector3() },
|
|
1414
|
+
uCandleCol: { value: new THREE.Color(1.0, 0.5, 0.18) },
|
|
1415
|
+
uCandleI: { value: 0 },
|
|
1416
|
+
uCam: { value: new THREE.Vector3() },
|
|
1417
|
+
uFogDensity: { value: FOG_DENSITY },
|
|
1418
|
+
};
|
|
1419
|
+
function mistMaterial(vertical, opacity) {
|
|
1420
|
+
return new THREE.ShaderMaterial({
|
|
1421
|
+
transparent: true,
|
|
1422
|
+
depthWrite: false,
|
|
1423
|
+
fog: false,
|
|
1424
|
+
side: THREE.DoubleSide,
|
|
1425
|
+
uniforms: {
|
|
1426
|
+
...mistUniforms,
|
|
1427
|
+
uVertical: { value: vertical ? 1 : 0 },
|
|
1428
|
+
uOpacity: { value: opacity },
|
|
1429
|
+
},
|
|
1430
|
+
vertexShader: \`varying vec3 vW; void main(){ vec4 w = modelMatrix*vec4(position,1.0); vW = w.xyz; gl_Position = projectionMatrix*viewMatrix*w; }\`,
|
|
1431
|
+
fragmentShader: \`
|
|
1432
|
+
uniform float uTime, uOpacity, uFogDensity, uVertical, uCandleI; uniform vec3 uColor, uCandlePos, uCandleCol, uCam; varying vec3 vW;
|
|
1433
|
+
float hash(vec2 p){ p = fract(p*vec2(123.34,456.21)); p += dot(p, p+45.32); return fract(p.x*p.y); }
|
|
1434
|
+
float vn(vec2 p){ vec2 i = floor(p), f = fract(p), u = f*f*(3.0-2.0*f);
|
|
1435
|
+
return mix(mix(hash(i), hash(i+vec2(1,0)), u.x), mix(hash(i+vec2(0,1)), hash(i+vec2(1,1)), u.x), u.y); }
|
|
1436
|
+
float fbm(vec2 p){ float a = 0.5, s = 0.0; for(int i=0;i<4;i++){ s += a*vn(p); p = p*2.03 + vec2(1.7,9.2); a *= 0.5; } return s; }
|
|
1437
|
+
void main(){
|
|
1438
|
+
vec2 q = uVertical > 0.5 ? vec2(vW.x*0.32 + uTime*0.05, vW.y*0.75 - uTime*0.012) : vec2(vW.x*0.22 + uTime*0.04, vW.z*0.2 + uTime*0.025);
|
|
1439
|
+
float n = fbm(q + 1.3*fbm(q*1.6 - uTime*0.03));
|
|
1440
|
+
float a = smoothstep(0.38, 0.86, n) * uOpacity;
|
|
1441
|
+
if (uVertical > 0.5) { a *= smoothstep(0.0, 0.6, vW.y) * smoothstep(3.0, 1.1, vW.y) * smoothstep(13.0, 5.0, abs(vW.x)); }
|
|
1442
|
+
else { a *= smoothstep(15.0, 4.0, abs(vW.x)); }
|
|
1443
|
+
float dc = distance(uCam, vW); a *= smoothstep(0.9, 3.5, dc);
|
|
1444
|
+
float fogF = 1.0 - exp(-pow(uFogDensity*dc, 2.0));
|
|
1445
|
+
float dl = distance(vW, uCandlePos); float w = uCandleI / (0.3 + dl*dl);
|
|
1446
|
+
vec3 col = uColor + uCandleCol * w * 0.22;
|
|
1447
|
+
a = a * (1.0 - 0.75*fogF) * (1.0 + min(w, 3.0)*0.35);
|
|
1448
|
+
gl_FragColor = vec4(col, clamp(a, 0.0, 1.0));
|
|
1449
|
+
}\`,
|
|
1450
|
+
});
|
|
1451
|
+
}
|
|
1452
|
+
const mistGroup = new THREE.Group();
|
|
1453
|
+
scene.add(mistGroup);
|
|
1454
|
+
{
|
|
1455
|
+
const h1 = new THREE.Mesh(new THREE.PlaneGeometry(36, 66), mistMaterial(false, 0.55));
|
|
1456
|
+
h1.rotation.x = -Math.PI / 2;
|
|
1457
|
+
h1.position.set(0, 0.2, -24);
|
|
1458
|
+
mistGroup.add(h1);
|
|
1459
|
+
const h2 = new THREE.Mesh(new THREE.PlaneGeometry(36, 60), mistMaterial(false, 0.3));
|
|
1460
|
+
h2.rotation.x = -Math.PI / 2;
|
|
1461
|
+
h2.position.set(0, 0.55, -27);
|
|
1462
|
+
mistGroup.add(h2);
|
|
1463
|
+
for (const z of [-3.5, -9, -15.5, -22.5]) {
|
|
1464
|
+
const v = new THREE.Mesh(new THREE.PlaneGeometry(26, 3.2), mistMaterial(true, 0.5));
|
|
1465
|
+
v.position.set(0, 1.5, z);
|
|
1466
|
+
mistGroup.add(v);
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
/* ==========================================================================
|
|
1471
|
+
THE MONUMENT: three carved stone shards on a buried boulder, glowing blue
|
|
1472
|
+
to violet along their edges and veins, with a witch's hat hovering above.
|
|
1473
|
+
========================================================================== */
|
|
1474
|
+
const MON_Z = -4.5,
|
|
1475
|
+
MON_LIFT = 0.12,
|
|
1476
|
+
PX = 0.00685; // reference drawing: 1 px = 6.85 mm
|
|
1477
|
+
function vnoise3(x, y, z) {
|
|
1478
|
+
const xi = Math.floor(x),
|
|
1479
|
+
yi = Math.floor(y),
|
|
1480
|
+
zi = Math.floor(z),
|
|
1481
|
+
s = (t) => t * t * (3 - 2 * t),
|
|
1482
|
+
u = s(x - xi),
|
|
1483
|
+
v = s(y - yi),
|
|
1484
|
+
w = s(z - zi);
|
|
1485
|
+
const hh = (a, b, c) => hash1(a * 127.1 + b * 311.7 + c * 74.7),
|
|
1486
|
+
l = (a, b, t) => a + (b - a) * t;
|
|
1487
|
+
return l(
|
|
1488
|
+
l(
|
|
1489
|
+
l(hh(xi, yi, zi), hh(xi + 1, yi, zi), u),
|
|
1490
|
+
l(hh(xi, yi + 1, zi), hh(xi + 1, yi + 1, zi), u),
|
|
1491
|
+
v
|
|
1492
|
+
),
|
|
1493
|
+
l(
|
|
1494
|
+
l(hh(xi, yi, zi + 1), hh(xi + 1, yi, zi + 1), u),
|
|
1495
|
+
l(hh(xi, yi + 1, zi + 1), hh(xi + 1, yi + 1, zi + 1), u),
|
|
1496
|
+
v
|
|
1497
|
+
),
|
|
1498
|
+
w
|
|
1499
|
+
);
|
|
1500
|
+
}
|
|
1501
|
+
const GN = \`
|
|
1502
|
+
float gh(vec3 p){ p = fract(p*0.3183099 + 0.1); p *= 17.0; return fract(p.x*p.y*p.z*(p.x+p.y+p.z)); }
|
|
1503
|
+
float gn(vec3 x){ vec3 i = floor(x), f = fract(x); f = f*f*(3.0-2.0*f);
|
|
1504
|
+
return mix(mix(mix(gh(i), gh(i+vec3(1,0,0)), f.x), mix(gh(i+vec3(0,1,0)), gh(i+vec3(1,1,0)), f.x), f.y),
|
|
1505
|
+
mix(mix(gh(i+vec3(0,0,1)), gh(i+vec3(1,0,1)), f.x), mix(gh(i+vec3(0,1,1)), gh(i+vec3(1,1,1)), f.x), f.y), f.z); }
|
|
1506
|
+
\`;
|
|
1507
|
+
const monUni = {
|
|
1508
|
+
uGlow: { value: 0 },
|
|
1509
|
+
uTime: { value: 0 },
|
|
1510
|
+
uTop: { value: new THREE.Color(0x6aaee6) },
|
|
1511
|
+
uBot: { value: new THREE.Color(0x6a6ee6) },
|
|
1512
|
+
uOrigin: { value: new THREE.Vector3(0, 0, MON_Z) },
|
|
1513
|
+
};
|
|
1514
|
+
const glowStoneMat = P({
|
|
1515
|
+
color: 0x4c5262,
|
|
1516
|
+
map: stoneMap,
|
|
1517
|
+
roughnessMap: stoneRough,
|
|
1518
|
+
roughness: 1,
|
|
1519
|
+
bumpMap: stoneBump,
|
|
1520
|
+
bumpScale: 1.4,
|
|
1521
|
+
specularIntensity: 0.45,
|
|
1522
|
+
envMapIntensity: 0.7,
|
|
1523
|
+
});
|
|
1524
|
+
glowStoneMat.onBeforeCompile = (sh) => {
|
|
1525
|
+
Object.assign(sh.uniforms, monUni);
|
|
1526
|
+
sh.vertexShader =
|
|
1527
|
+
'uniform vec3 uOrigin; varying vec3 vMon;\\n' +
|
|
1528
|
+
sh.vertexShader.replace(
|
|
1529
|
+
'#include <begin_vertex>',
|
|
1530
|
+
'#include <begin_vertex>\\n vMon = (modelMatrix * vec4(transformed, 1.0)).xyz - uOrigin;'
|
|
1531
|
+
);
|
|
1532
|
+
sh.fragmentShader =
|
|
1533
|
+
'uniform float uGlow, uTime; uniform vec3 uTop, uBot; varying vec3 vMon;\\n' +
|
|
1534
|
+
GN +
|
|
1535
|
+
sh.fragmentShader.replace(
|
|
1536
|
+
'#include <emissivemap_fragment>',
|
|
1537
|
+
\`#include <emissivemap_fragment>
|
|
1538
|
+
float k = clamp(0.5 + 0.38*(vMon.y - 1.1) - 0.3*vMon.x, 0.0, 1.0); // light blue top-left, violet bottom-right
|
|
1539
|
+
vec3 gcol = mix(uBot, uTop, k);
|
|
1540
|
+
float rim = pow(1.0 - abs(dot(normalize(normal), normalize(vViewPosition))), 3.0);
|
|
1541
|
+
float r1 = 1.0 - abs(gn(vMon*2.4 + vec3(0.0, uTime*0.04, 0.0))*2.0 - 1.0);
|
|
1542
|
+
float r2 = 1.0 - abs(gn(vMon*5.5 + 11.0)*2.0 - 1.0);
|
|
1543
|
+
float vein = smoothstep(0.982, 0.999, r1) + 0.5*smoothstep(0.99, 0.9995, r2); // sparse, thin cracks
|
|
1544
|
+
float pulse = 0.8 + 0.2*sin(uTime*2.2 - vMon.y*3.0);
|
|
1545
|
+
totalEmissiveRadiance += gcol * uGlow * (0.08 + 1.9*rim + 3.0*vein*pulse);\`
|
|
1546
|
+
);
|
|
1547
|
+
};
|
|
1548
|
+
glowStoneMat.customProgramCacheKey = () => 'glow-stone';
|
|
1549
|
+
const monument = new THREE.Group();
|
|
1550
|
+
monument.position.set(0, MON_LIFT, MON_Z);
|
|
1551
|
+
scene.add(monument);
|
|
1552
|
+
function shard(pts, depth, zOff, seed) {
|
|
1553
|
+
const s = new THREE.Shape(),
|
|
1554
|
+
m2 = pts.map(([px, py]) => [(px - 227) * PX, (575 - py) * PX]);
|
|
1555
|
+
const cx = m2.reduce((a, q) => a + q[0], 0) / m2.length,
|
|
1556
|
+
cy = m2.reduce((a, q) => a + q[1], 0) / m2.length;
|
|
1557
|
+
m2.forEach(([x, y], i) => {
|
|
1558
|
+
x = cx + (x - cx) * 0.95;
|
|
1559
|
+
y = cy + (y - cy) * 0.95;
|
|
1560
|
+
if (i) s.lineTo(x, y);
|
|
1561
|
+
else s.moveTo(x, y);
|
|
1562
|
+
});
|
|
1563
|
+
s.closePath(); // shrink a little so the gaps stay open
|
|
1564
|
+
const g = new THREE.ExtrudeGeometry(s, {
|
|
1565
|
+
depth,
|
|
1566
|
+
bevelEnabled: true,
|
|
1567
|
+
bevelThickness: 0.06,
|
|
1568
|
+
bevelSize: 0.03,
|
|
1569
|
+
bevelSegments: 3,
|
|
1570
|
+
curveSegments: 1,
|
|
1571
|
+
});
|
|
1572
|
+
g.translate(0, 0, -depth / 2 + zOff);
|
|
1573
|
+
const pos = g.attributes.position,
|
|
1574
|
+
v = new THREE.Vector3();
|
|
1575
|
+
for (let i = 0; i < pos.count; i++) {
|
|
1576
|
+
// rough it up; shared corners move together, so no cracks
|
|
1577
|
+
v.fromBufferAttribute(pos, i);
|
|
1578
|
+
const n = (a, b) => vnoise3(v.x * a + seed, v.y * a + b, v.z * a) - 0.5;
|
|
1579
|
+
v.x += 0.05 * n(5, 1) + 0.015 * n(17, 4);
|
|
1580
|
+
v.y += 0.05 * n(5, 7) + 0.015 * n(17, 9);
|
|
1581
|
+
v.z += 0.06 * n(5, 13);
|
|
1582
|
+
pos.setXYZ(i, v.x, v.y, v.z);
|
|
1583
|
+
}
|
|
1584
|
+
g.computeVertexNormals();
|
|
1585
|
+
const m = new THREE.Mesh(g, glowStoneMat);
|
|
1586
|
+
m.castShadow = m.receiveShadow = true;
|
|
1587
|
+
monument.add(m);
|
|
1588
|
+
}
|
|
1589
|
+
shard(
|
|
1590
|
+
[
|
|
1591
|
+
[166, 350],
|
|
1592
|
+
[226, 397],
|
|
1593
|
+
[140, 575],
|
|
1594
|
+
[82, 528],
|
|
1595
|
+
],
|
|
1596
|
+
0.42,
|
|
1597
|
+
0.0,
|
|
1598
|
+
3.1
|
|
1599
|
+
); // leaning slab
|
|
1600
|
+
shard(
|
|
1601
|
+
[
|
|
1602
|
+
[198, 283],
|
|
1603
|
+
[258, 330],
|
|
1604
|
+
[233, 383],
|
|
1605
|
+
[172, 338],
|
|
1606
|
+
],
|
|
1607
|
+
0.36,
|
|
1608
|
+
0.04,
|
|
1609
|
+
7.7
|
|
1610
|
+
); // top block
|
|
1611
|
+
shard(
|
|
1612
|
+
[
|
|
1613
|
+
[268, 356],
|
|
1614
|
+
[372, 575],
|
|
1615
|
+
[207, 488],
|
|
1616
|
+
],
|
|
1617
|
+
0.4,
|
|
1618
|
+
-0.03,
|
|
1619
|
+
12.9
|
|
1620
|
+
); // triangle
|
|
1621
|
+
{
|
|
1622
|
+
// the boulder it stands on, half buried
|
|
1623
|
+
const g = new THREE.IcosahedronGeometry(1, 4),
|
|
1624
|
+
pos = g.attributes.position,
|
|
1625
|
+
v = new THREE.Vector3();
|
|
1626
|
+
for (let i = 0; i < pos.count; i++) {
|
|
1627
|
+
v.fromBufferAttribute(pos, i);
|
|
1628
|
+
const k =
|
|
1629
|
+
1 +
|
|
1630
|
+
0.18 * (vnoise3(v.x * 2.2, v.y * 2.2, v.z * 2.2) - 0.5) +
|
|
1631
|
+
0.06 * (vnoise3(v.x * 6 + 3, v.y * 6, v.z * 6) - 0.5);
|
|
1632
|
+
pos.setXYZ(i, v.x * k * 1.45, v.y * k * 0.38, v.z * k * 0.85);
|
|
1633
|
+
}
|
|
1634
|
+
g.computeVertexNormals();
|
|
1635
|
+
const base = new THREE.Mesh(
|
|
1636
|
+
g,
|
|
1637
|
+
P({
|
|
1638
|
+
color: 0x5d5b58,
|
|
1639
|
+
map: stoneMap,
|
|
1640
|
+
roughnessMap: stoneRough,
|
|
1641
|
+
roughness: 1,
|
|
1642
|
+
bumpMap: stoneBump,
|
|
1643
|
+
bumpScale: 1.6,
|
|
1644
|
+
specularIntensity: 0.3,
|
|
1645
|
+
})
|
|
1646
|
+
);
|
|
1647
|
+
base.position.set(0.02, groundH(0, MON_Z) - 0.02, MON_Z);
|
|
1648
|
+
base.castShadow = base.receiveShadow = true;
|
|
1649
|
+
scene.add(base);
|
|
1650
|
+
}
|
|
1651
|
+
// its glow on the ground, the fog and the underside of the hat
|
|
1652
|
+
const monLights = [
|
|
1653
|
+
[new THREE.PointLight(0x6aaee6, 0, 0, 2), [-0.5, 1.2, 1.6], 1.0],
|
|
1654
|
+
[new THREE.PointLight(0x6a6ee6, 0, 0, 2), [0.7, 0.45, 1.5], 1.0],
|
|
1655
|
+
[new THREE.PointLight(0x7a9ef0, 0, 0, 2), [0, 2.25, 0.35], 0.45],
|
|
1656
|
+
];
|
|
1657
|
+
monLights.forEach(([l, p]) => {
|
|
1658
|
+
l.position.set(...p);
|
|
1659
|
+
monument.add(l);
|
|
1660
|
+
});
|
|
1661
|
+
|
|
1662
|
+
// the hat: crooked cone, curled brim, band and gold buckle
|
|
1663
|
+
const HAT_Y = MON_LIFT + 2.0 + 0.32;
|
|
1664
|
+
const hat = new THREE.Group();
|
|
1665
|
+
hat.position.set(-0.08, HAT_Y, MON_Z);
|
|
1666
|
+
scene.add(hat);
|
|
1667
|
+
const hatRed = new THREE.Color(0x8f3434),
|
|
1668
|
+
hatPink = new THREE.Color(0xe9b7ac);
|
|
1669
|
+
const hatMat = P({
|
|
1670
|
+
color: 0xffffff,
|
|
1671
|
+
vertexColors: true,
|
|
1672
|
+
roughness: 0.86,
|
|
1673
|
+
sheen: 0.6,
|
|
1674
|
+
sheenColor: 0xf0b8a8,
|
|
1675
|
+
sheenRoughness: 0.5,
|
|
1676
|
+
specularIntensity: 0.3,
|
|
1677
|
+
side: THREE.DoubleSide,
|
|
1678
|
+
bumpMap: fabricBump,
|
|
1679
|
+
bumpScale: 0.6,
|
|
1680
|
+
});
|
|
1681
|
+
{
|
|
1682
|
+
const H = 1.35,
|
|
1683
|
+
pts = [];
|
|
1684
|
+
for (let i = 0; i <= 48; i++) {
|
|
1685
|
+
const t = i / 48;
|
|
1686
|
+
pts.push(new THREE.Vector2(0.42 * Math.pow(1 - t, 1.1) + 0.012, t * H));
|
|
1687
|
+
}
|
|
1688
|
+
const g = new THREE.LatheGeometry(pts, 72, Math.PI, Math.PI * 2),
|
|
1689
|
+
pos = g.attributes.position,
|
|
1690
|
+
col = new Float32Array(pos.count * 3),
|
|
1691
|
+
c = new THREE.Color();
|
|
1692
|
+
for (let i = 0; i < pos.count; i++) {
|
|
1693
|
+
let x = pos.getX(i),
|
|
1694
|
+
y = pos.getY(i),
|
|
1695
|
+
z = pos.getZ(i);
|
|
1696
|
+
const hn = y / H,
|
|
1697
|
+
phi = Math.atan2(x, z);
|
|
1698
|
+
const wr =
|
|
1699
|
+
1 +
|
|
1700
|
+
0.06 * Math.sin(hn * 15 + phi * 2) * smooth(0.1, 0.6, hn) +
|
|
1701
|
+
0.03 * Math.sin(phi * 5 + hn * 9);
|
|
1702
|
+
x *= wr;
|
|
1703
|
+
z *= wr;
|
|
1704
|
+
x += -0.45 * Math.pow(hn, 2.2) - 0.12 * smooth(0.75, 1, hn); // tip bends to the left
|
|
1705
|
+
y -= 0.14 * smooth(0.72, 1, hn) * hn; // and droops
|
|
1706
|
+
pos.setXYZ(i, x, y, z);
|
|
1707
|
+
const hl =
|
|
1708
|
+
smooth(0.1, 0.85, Math.sin(phi)) *
|
|
1709
|
+
smooth(0.12, 0.45, hn) *
|
|
1710
|
+
(1 - smooth(0.85, 1, hn)) *
|
|
1711
|
+
0.75;
|
|
1712
|
+
c.copy(hatRed).lerp(hatPink, hl);
|
|
1713
|
+
col[i * 3] = c.r;
|
|
1714
|
+
col[i * 3 + 1] = c.g;
|
|
1715
|
+
col[i * 3 + 2] = c.b;
|
|
1716
|
+
}
|
|
1717
|
+
g.setAttribute('color', new THREE.BufferAttribute(col, 3));
|
|
1718
|
+
g.computeVertexNormals();
|
|
1719
|
+
const cone = new THREE.Mesh(g, hatMat);
|
|
1720
|
+
cone.castShadow = cone.receiveShadow = true;
|
|
1721
|
+
hat.add(cone);
|
|
1722
|
+
}
|
|
1723
|
+
{
|
|
1724
|
+
const prof = [
|
|
1725
|
+
[0.3, 0.02],
|
|
1726
|
+
[0.6, 0.0],
|
|
1727
|
+
[0.85, 0.03],
|
|
1728
|
+
[0.98, 0.1],
|
|
1729
|
+
[1.0, 0.12],
|
|
1730
|
+
[0.99, 0.1],
|
|
1731
|
+
[0.85, 0.0],
|
|
1732
|
+
[0.6, -0.025],
|
|
1733
|
+
[0.3, -0.01],
|
|
1734
|
+
];
|
|
1735
|
+
const g = new THREE.LatheGeometry(
|
|
1736
|
+
prof.map((p) => new THREE.Vector2(...p)),
|
|
1737
|
+
96,
|
|
1738
|
+
Math.PI,
|
|
1739
|
+
Math.PI * 2
|
|
1740
|
+
);
|
|
1741
|
+
const pos = g.attributes.position,
|
|
1742
|
+
col = new Float32Array(pos.count * 3),
|
|
1743
|
+
c = new THREE.Color();
|
|
1744
|
+
for (let i = 0; i < pos.count; i++) {
|
|
1745
|
+
let x = pos.getX(i),
|
|
1746
|
+
y = pos.getY(i),
|
|
1747
|
+
z = pos.getZ(i);
|
|
1748
|
+
const r = Math.hypot(x, z),
|
|
1749
|
+
phi = Math.atan2(x, z),
|
|
1750
|
+
top = i % prof.length < 5;
|
|
1751
|
+
y += 0.035 * Math.sin(phi * 3 + 1) * smooth(0.4, 1, r);
|
|
1752
|
+
y += 0.16 * smooth(0.55, 1, r) * Math.pow(Math.max(0, Math.sin(phi)), 3); // right edge curls up
|
|
1753
|
+
y -= 0.05 * smooth(0.6, 1, r) * Math.max(0, -Math.sin(phi));
|
|
1754
|
+
pos.setXYZ(i, x, y, z * 0.82);
|
|
1755
|
+
c.copy(hatRed).lerp(hatPink, smooth(0.7, 1, r) * Math.max(0, Math.sin(phi)) * 0.6);
|
|
1756
|
+
if (!top) c.multiplyScalar(0.6);
|
|
1757
|
+
col[i * 3] = c.r;
|
|
1758
|
+
col[i * 3 + 1] = c.g;
|
|
1759
|
+
col[i * 3 + 2] = c.b;
|
|
1760
|
+
}
|
|
1761
|
+
g.setAttribute('color', new THREE.BufferAttribute(col, 3));
|
|
1762
|
+
g.computeVertexNormals();
|
|
1763
|
+
const brim = new THREE.Mesh(g, hatMat);
|
|
1764
|
+
brim.castShadow = brim.receiveShadow = true;
|
|
1765
|
+
hat.add(brim);
|
|
1766
|
+
}
|
|
1767
|
+
{
|
|
1768
|
+
const band = new THREE.Mesh(
|
|
1769
|
+
new THREE.CylinderGeometry(0.432, 0.448, 0.13, 72, 1, true),
|
|
1770
|
+
P({
|
|
1771
|
+
color: 0x5a1f1f,
|
|
1772
|
+
roughness: 0.8,
|
|
1773
|
+
sheen: 0.4,
|
|
1774
|
+
sheenColor: 0xc08070,
|
|
1775
|
+
side: THREE.DoubleSide,
|
|
1776
|
+
})
|
|
1777
|
+
);
|
|
1778
|
+
band.position.y = 0.075;
|
|
1779
|
+
band.castShadow = true;
|
|
1780
|
+
hat.add(band);
|
|
1781
|
+
const a = 0.55,
|
|
1782
|
+
piv = new THREE.Group();
|
|
1783
|
+
piv.position.set(Math.sin(a) * 0.455, 0.075, Math.cos(a) * 0.455);
|
|
1784
|
+
piv.rotation.y = a;
|
|
1785
|
+
hat.add(piv);
|
|
1786
|
+
const buckle = new THREE.Mesh(
|
|
1787
|
+
new THREE.TorusGeometry(0.075, 0.014, 8, 4),
|
|
1788
|
+
P({ color: 0xf2c230, metalness: 1, roughness: 0.32, clearcoat: 0.3 })
|
|
1789
|
+
);
|
|
1790
|
+
buckle.rotation.z = Math.PI / 4;
|
|
1791
|
+
piv.add(buckle);
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1794
|
+
/* ---------- lights ---------- */
|
|
1795
|
+
const moon = new THREE.DirectionalLight(0xa9bfe6, 0);
|
|
1796
|
+
moon.position.set(-10, 14, -34);
|
|
1797
|
+
moon.target.position.set(0, 0, -12);
|
|
1798
|
+
moon.castShadow = true;
|
|
1799
|
+
moon.shadow.mapSize.set(2048, 2048);
|
|
1800
|
+
Object.assign(moon.shadow.camera, {
|
|
1801
|
+
left: -27,
|
|
1802
|
+
right: 27,
|
|
1803
|
+
top: 27,
|
|
1804
|
+
bottom: -27,
|
|
1805
|
+
near: 1,
|
|
1806
|
+
far: 90,
|
|
1807
|
+
});
|
|
1808
|
+
moon.shadow.bias = -0.0005;
|
|
1809
|
+
moon.shadow.normalBias = 0.03;
|
|
1810
|
+
scene.add(moon, moon.target);
|
|
1811
|
+
const hemi = new THREE.HemisphereLight(0x3d4d6a, 0x16100c, 0);
|
|
1812
|
+
scene.add(hemi);
|
|
1813
|
+
|
|
1814
|
+
/* ---------- "Happy Halloween": a burning title in the top-left corner ----------
|
|
1815
|
+
Screen-space pass after tone mapping, placed in the lower part of the frame so it frames
|
|
1816
|
+
the monument instead of covering it. The letters ignite left to right behind a hot edge,
|
|
1817
|
+
then burn: fire flowing upward inside, a charred rim, an orange halo, heat shimmer and
|
|
1818
|
+
embers rising off the words. */
|
|
1819
|
+
// <fire-title>
|
|
1820
|
+
const TITLE_T0 = 9.8,
|
|
1821
|
+
TITLE_W = 0.42,
|
|
1822
|
+
TITLE_CY = 0.867,
|
|
1823
|
+
TITLE_LEFT = 0.05; // start, rect width, rect centre (from bottom), left margin
|
|
1824
|
+
const TITLE_FRAG = \`
|
|
1825
|
+
uniform sampler2D tDiffuse, tMask; uniform float uT, uAspect, uOn; uniform vec4 uRect; varying vec2 vUv;
|
|
1826
|
+
float hh(vec2 p){ return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453); }
|
|
1827
|
+
float vn(vec2 p){ vec2 i = floor(p), f = fract(p); f = f*f*(3.0-2.0*f);
|
|
1828
|
+
return mix(mix(hh(i), hh(i+vec2(1.0,0.0)), f.x), mix(hh(i+vec2(0.0,1.0)), hh(i+vec2(1.0,1.0)), f.x), f.y); }
|
|
1829
|
+
float fbm(vec2 p){ float s = 0.0, a = 0.5; for (int i = 0; i < 4; i++){ s += a*vn(p); p = p*2.03 + vec2(1.7, 9.2); a *= 0.5; } return s; }
|
|
1830
|
+
void main(){
|
|
1831
|
+
vec3 col = texture2D(tDiffuse, vUv).rgb;
|
|
1832
|
+
vec2 q = (vUv - uRect.xy)/uRect.zw + 0.5;
|
|
1833
|
+
if (uT <= 0.0 || uOn <= 0.0 || q.x < -0.12 || q.x > 1.12 || q.y < -0.5 || q.y > 2.2) { gl_FragColor = vec4(col, 1.0); return; }
|
|
1834
|
+
float R = uRect.z*uAspect/uRect.w;
|
|
1835
|
+
vec2 hq = q + vec2((vn(vec2(q.x*14.0, q.y*6.0 - uT*3.0)) - 0.5)*0.003, (vn(vec2(q.x*10.0 + 3.0, q.y*5.0 - uT*2.5)) - 0.5)*0.012); // heat shimmer
|
|
1836
|
+
vec4 M = texture2D(tMask, hq); // r sharp, g soft, b wide halo
|
|
1837
|
+
float n = fbm(q*vec2(R*2.5, 2.5) + 3.1);
|
|
1838
|
+
float front = uT*0.75 - q.x*0.9 + (n - 0.5)*0.5; // ignition sweeps left to right
|
|
1839
|
+
float lit = smoothstep(0.0, 0.08, front);
|
|
1840
|
+
float edge = smoothstep(0.0, 0.05, front)*(1.0 - smoothstep(0.05, 0.28, front));
|
|
1841
|
+
col *= 1.0 - 0.5*M.b*smoothstep(-0.2, 0.3, front); // the night darkens behind the words
|
|
1842
|
+
float flick = 0.86 + 0.14*vn(vec2(uT*7.0, 1.0));
|
|
1843
|
+
float fire = fbm(vec2(q.x*R*3.0, q.y*3.0 - uT*1.6));
|
|
1844
|
+
vec3 deep = vec3(0.78, 0.17, 0.02), hot = vec3(1.0, 0.6, 0.1), core = vec3(1.0, 0.92, 0.66);
|
|
1845
|
+
vec3 fillc = mix(deep, hot, smoothstep(0.3, 0.75, fire + 0.3*(1.0 - clamp(q.y, 0.0, 1.0))));
|
|
1846
|
+
fillc = mix(fillc, core, smoothstep(0.72, 0.95, fire)*0.6);
|
|
1847
|
+
float inside = smoothstep(0.38, 0.62, M.g);
|
|
1848
|
+
float rim = smoothstep(0.38, 0.5, M.g)*(1.0 - smoothstep(0.55, 0.85, M.g));
|
|
1849
|
+
vec3 letters = fillc*flick*(1.0 - 0.45*rim); // charred rim, burning heart
|
|
1850
|
+
col += vec3(1.0, 0.4, 0.07)*(M.g*0.55 + M.b*0.55)*flick*lit*0.6; // halo
|
|
1851
|
+
col = mix(col, letters, inside*lit);
|
|
1852
|
+
col += vec3(1.0, 0.82, 0.5)*edge*smoothstep(0.15, 0.6, M.g)*1.3; // the igniting edge flares
|
|
1853
|
+
vec2 sp = vec2(q.x*R*6.0, q.y*6.0 - uT*1.3); // embers drifting up off the words
|
|
1854
|
+
vec2 cid = floor(sp), cf = fract(sp) - 0.5; float hs = hh(cid);
|
|
1855
|
+
vec2 off = vec2(hh(cid + 7.1) - 0.5, hh(cid + 3.3) - 0.5)*0.6 + vec2(sin(uT*3.0 + hs*20.0)*0.15, 0.0);
|
|
1856
|
+
float spark = step(0.86, hs)*smoothstep(0.09, 0.0, length(cf - off))*smoothstep(2.0, 0.7, q.y)*smoothstep(0.1, 0.6, q.y)
|
|
1857
|
+
* smoothstep(0.05, 0.3, max(texture2D(tMask, vec2(q.x, 0.34)).b, texture2D(tMask, vec2(q.x, 0.66)).b))*lit;
|
|
1858
|
+
col += vec3(1.0, 0.55, 0.15)*spark*(0.55 + 0.45*sin(uT*9.0 + hs*40.0));
|
|
1859
|
+
gl_FragColor = vec4(min(col, vec3(1.0)), 1.0);
|
|
1860
|
+
}\`;
|
|
1861
|
+
function blurInto(src, CW, CH, RB, passes) {
|
|
1862
|
+
const b = src.slice(),
|
|
1863
|
+
tmp = new Float32Array(src.length),
|
|
1864
|
+
cl = (v, n) => Math.min(n - 1, Math.max(0, v)),
|
|
1865
|
+
k = 1 / (2 * RB + 1);
|
|
1866
|
+
for (let pass = 0; pass < passes; pass++) {
|
|
1867
|
+
for (let y = 0; y < CH; y++) {
|
|
1868
|
+
const row = y * CW;
|
|
1869
|
+
let s = 0;
|
|
1870
|
+
for (let x = -RB; x <= RB; x++) s += b[row + cl(x, CW)];
|
|
1871
|
+
for (let x = 0; x < CW; x++) {
|
|
1872
|
+
tmp[row + x] = s * k;
|
|
1873
|
+
s += b[row + cl(x + RB + 1, CW)] - b[row + cl(x - RB, CW)];
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
for (let x = 0; x < CW; x++) {
|
|
1877
|
+
let s = 0;
|
|
1878
|
+
for (let y = -RB; y <= RB; y++) s += tmp[cl(y, CH) * CW + x];
|
|
1879
|
+
for (let y = 0; y < CH; y++) {
|
|
1880
|
+
b[y * CW + x] = s * k;
|
|
1881
|
+
s += tmp[cl(y + RB + 1, CH) * CW + x] - tmp[cl(y - RB, CH) * CW + x];
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
}
|
|
1885
|
+
return b;
|
|
1886
|
+
}
|
|
1887
|
+
function buildTitleMask(text) {
|
|
1888
|
+
const CW = 2048,
|
|
1889
|
+
CH = 512,
|
|
1890
|
+
c = document.createElement('canvas');
|
|
1891
|
+
c.width = CW;
|
|
1892
|
+
c.height = CH;
|
|
1893
|
+
const g = c.getContext('2d'),
|
|
1894
|
+
font = (s) => \`400 \${s}px "Creepster", "Chiller", "Papyrus", Georgia, serif\`;
|
|
1895
|
+
const lines = text.split('\\n');
|
|
1896
|
+
g.font = font(260);
|
|
1897
|
+
const widest = Math.max(...lines.map((l) => g.measureText(l).width));
|
|
1898
|
+
const fs = Math.floor(Math.min((260 * 1820) / widest, 400 / (lines.length * 1.12)));
|
|
1899
|
+
g.font = font(fs);
|
|
1900
|
+
g.textAlign = 'left';
|
|
1901
|
+
g.textBaseline = 'middle';
|
|
1902
|
+
g.fillStyle = g.strokeStyle = '#fff';
|
|
1903
|
+
g.lineJoin = 'round';
|
|
1904
|
+
g.lineWidth = fs * 0.02;
|
|
1905
|
+
lines.forEach((l, i) => {
|
|
1906
|
+
const y = CH / 2 + (i - (lines.length - 1) / 2) * fs * 1.12;
|
|
1907
|
+
g.fillText(l, 40, y);
|
|
1908
|
+
g.strokeText(l, 40, y);
|
|
1909
|
+
}); // left-aligned
|
|
1910
|
+
const px = g.getImageData(0, 0, CW, CH).data,
|
|
1911
|
+
a = new Float32Array(CW * CH);
|
|
1912
|
+
for (let i = 0; i < a.length; i++) a[i] = px[i * 4 + 3] / 255;
|
|
1913
|
+
const soft = blurInto(a, CW, CH, 3, 2),
|
|
1914
|
+
wide = blurInto(a, CW, CH, 22, 3);
|
|
1915
|
+
const data = new Uint8Array(CW * CH * 4);
|
|
1916
|
+
for (let y = 0; y < CH; y++)
|
|
1917
|
+
for (let x = 0; x < CW; x++) {
|
|
1918
|
+
const i = y * CW + x,
|
|
1919
|
+
o = ((CH - 1 - y) * CW + x) * 4; // flip: texture rows run bottom-up
|
|
1920
|
+
data[o] = a[i] * 255;
|
|
1921
|
+
data[o + 1] = soft[i] * 255;
|
|
1922
|
+
data[o + 2] = Math.min(1, wide[i] * 1.8) * 255;
|
|
1923
|
+
data[o + 3] = 255;
|
|
1924
|
+
}
|
|
1925
|
+
return { data, CW, CH };
|
|
1926
|
+
}
|
|
1927
|
+
// </fire-title>
|
|
1928
|
+
await Promise.race([
|
|
1929
|
+
document.fonts ? document.fonts.load('400 200px "Creepster"') : Promise.resolve(),
|
|
1930
|
+
new Promise((res) => setTimeout(res, 3000)),
|
|
1931
|
+
]);
|
|
1932
|
+
const titleMask = buildTitleMask('Happy\\nHalloween');
|
|
1933
|
+
const titleTex = new THREE.DataTexture(
|
|
1934
|
+
titleMask.data,
|
|
1935
|
+
titleMask.CW,
|
|
1936
|
+
titleMask.CH,
|
|
1937
|
+
THREE.RGBAFormat
|
|
1938
|
+
);
|
|
1939
|
+
titleTex.minFilter = titleTex.magFilter = THREE.LinearFilter;
|
|
1940
|
+
titleTex.generateMipmaps = false;
|
|
1941
|
+
titleTex.needsUpdate = true;
|
|
1942
|
+
const titlePass = new ShaderPass({
|
|
1943
|
+
uniforms: {
|
|
1944
|
+
tDiffuse: { value: null },
|
|
1945
|
+
tMask: { value: titleTex },
|
|
1946
|
+
uT: { value: 0 },
|
|
1947
|
+
uOn: { value: 0 },
|
|
1948
|
+
uAspect: { value: W / H },
|
|
1949
|
+
uRect: {
|
|
1950
|
+
value: new THREE.Vector4(
|
|
1951
|
+
TITLE_LEFT + TITLE_W / 2 - (40 / 2048) * TITLE_W,
|
|
1952
|
+
TITLE_CY,
|
|
1953
|
+
TITLE_W,
|
|
1954
|
+
(TITLE_W * (W / H)) / 4
|
|
1955
|
+
),
|
|
1956
|
+
},
|
|
1957
|
+
},
|
|
1958
|
+
vertexShader: \`varying vec2 vUv; void main(){ vUv = uv; gl_Position = projectionMatrix*modelViewMatrix*vec4(position,1.0); }\`,
|
|
1959
|
+
fragmentShader: TITLE_FRAG,
|
|
1960
|
+
});
|
|
1961
|
+
|
|
1962
|
+
/* ---------- "Applying Style....": a small loading line at the bottom centre ----------
|
|
1963
|
+
Text and dots are drawn once into a mipmapped mask (red = words, green = dots) so they stay
|
|
1964
|
+
crisp at a small size; the dots fill in one by one and reset, and a soft shimmer sweeps the words. */
|
|
1965
|
+
// <status-line>
|
|
1966
|
+
const STATUS_CY = 0.045,
|
|
1967
|
+
STATUS_H = 0.031; // centre (from bottom) and rect height, as fractions of the screen
|
|
1968
|
+
const STATUS_FRAG = \`
|
|
1969
|
+
uniform sampler2D tDiffuse, tStatus; uniform float uT, uOn, uDot0, uDotStep; uniform vec4 uRect; varying vec2 vUv;
|
|
1970
|
+
void main(){
|
|
1971
|
+
vec3 col = texture2D(tDiffuse, vUv).rgb;
|
|
1972
|
+
vec2 q = (vUv - uRect.xy)/uRect.zw + 0.5;
|
|
1973
|
+
if (uOn <= 0.0 || q.x < 0.0 || q.x > 1.0 || q.y < -0.2 || q.y > 1.0) { gl_FragColor = vec4(col, 1.0); return; }
|
|
1974
|
+
float appear = smoothstep(1.0, 1.8, uT);
|
|
1975
|
+
vec4 m = texture2D(tStatus, q);
|
|
1976
|
+
float phase = fract(uT/1.6)*5.0, i = floor((q.x - uDot0)/uDotStep);
|
|
1977
|
+
float dotA = smoothstep(i + 0.6, i + 1.0, phase)*(1.0 - smoothstep(4.55, 4.95, phase)); // dots fill in, then reset
|
|
1978
|
+
float sweep = exp(-pow((q.x - (fract(uT/2.4)*1.6 - 0.3))*7.0, 2.0)); // soft shimmer
|
|
1979
|
+
float a = (m.r*(0.6 + 0.4*sweep) + m.g*dotA*0.85)*appear;
|
|
1980
|
+
gl_FragColor = vec4(mix(col, vec3(0.93, 0.94, 0.97), a), 1.0);
|
|
1981
|
+
}\`;
|
|
1982
|
+
function buildStatusMask(words, dots) {
|
|
1983
|
+
const CW = 1024,
|
|
1984
|
+
CH = 128,
|
|
1985
|
+
c = document.createElement('canvas');
|
|
1986
|
+
c.width = CW;
|
|
1987
|
+
c.height = CH;
|
|
1988
|
+
const g = c.getContext('2d');
|
|
1989
|
+
g.fillStyle = '#000';
|
|
1990
|
+
g.fillRect(0, 0, CW, CH);
|
|
1991
|
+
g.font = '300 64px "Helvetica Neue", Helvetica, Arial, sans-serif';
|
|
1992
|
+
if ('letterSpacing' in g) g.letterSpacing = '2px';
|
|
1993
|
+
g.textBaseline = 'middle';
|
|
1994
|
+
const ww = g.measureText(words).width,
|
|
1995
|
+
dw = g.measureText('.').width + 4,
|
|
1996
|
+
x0 = (CW - (ww + dw * dots)) / 2;
|
|
1997
|
+
g.fillStyle = '#f00';
|
|
1998
|
+
g.fillText(words, x0, CH / 2);
|
|
1999
|
+
g.fillStyle = '#0f0';
|
|
2000
|
+
for (let i = 0; i < dots; i++) g.fillText('.', x0 + ww + i * dw, CH / 2);
|
|
2001
|
+
const tex = new THREE.CanvasTexture(c);
|
|
2002
|
+
tex.colorSpace = THREE.NoColorSpace;
|
|
2003
|
+
tex.generateMipmaps = true;
|
|
2004
|
+
tex.minFilter = THREE.LinearMipmapLinearFilter;
|
|
2005
|
+
tex.magFilter = THREE.LinearFilter;
|
|
2006
|
+
tex.anisotropy = 4;
|
|
2007
|
+
return { tex, dot0: (x0 + ww) / CW, dotStep: dw / CW, aspect: CW / CH };
|
|
2008
|
+
}
|
|
2009
|
+
// </status-line>
|
|
2010
|
+
const status = buildStatusMask('Applying Style', 4);
|
|
2011
|
+
const statusPass = new ShaderPass({
|
|
2012
|
+
uniforms: {
|
|
2013
|
+
tDiffuse: { value: null },
|
|
2014
|
+
tStatus: { value: status.tex },
|
|
2015
|
+
uT: { value: 0 },
|
|
2016
|
+
uOn: { value: 0 },
|
|
2017
|
+
uDot0: { value: status.dot0 },
|
|
2018
|
+
uDotStep: { value: status.dotStep },
|
|
2019
|
+
uRect: {
|
|
2020
|
+
value: new THREE.Vector4(
|
|
2021
|
+
0.5,
|
|
2022
|
+
STATUS_CY,
|
|
2023
|
+
(STATUS_H * status.aspect) / (W / H),
|
|
2024
|
+
STATUS_H
|
|
2025
|
+
),
|
|
2026
|
+
},
|
|
2027
|
+
},
|
|
2028
|
+
vertexShader: \`varying vec2 vUv; void main(){ vUv = uv; gl_Position = projectionMatrix*modelViewMatrix*vec4(position,1.0); }\`,
|
|
2029
|
+
fragmentShader: STATUS_FRAG,
|
|
2030
|
+
});
|
|
2031
|
+
|
|
2032
|
+
/* ---------- post: MSAA HDR -> depth of field -> ACES -> title -> status -> film ---------- */
|
|
2033
|
+
const rt = new THREE.WebGLRenderTarget(W * pixelRatio, H * pixelRatio, {
|
|
2034
|
+
type: THREE.HalfFloatType,
|
|
2035
|
+
samples: 4,
|
|
2036
|
+
});
|
|
2037
|
+
const composer = new EffectComposer(renderer, rt);
|
|
2038
|
+
composer.addPass(new RenderPass(scene, camera));
|
|
2039
|
+
const bokeh = new BokehPass(scene, camera, { focus: 10, aperture: 0.0004, maxblur: 0.009 });
|
|
2040
|
+
const bokehRender = bokeh.render.bind(bokeh);
|
|
2041
|
+
bokeh.render = (...a) => {
|
|
2042
|
+
mistGroup.visible = false;
|
|
2043
|
+
sky.visible = false;
|
|
2044
|
+
bokehRender(...a);
|
|
2045
|
+
mistGroup.visible = true;
|
|
2046
|
+
sky.visible = true;
|
|
2047
|
+
};
|
|
2048
|
+
composer.addPass(bokeh);
|
|
2049
|
+
const bloom = new UnrealBloomPass(
|
|
2050
|
+
new THREE.Vector2(W * pixelRatio, H * pixelRatio),
|
|
2051
|
+
0.55,
|
|
2052
|
+
0.6,
|
|
2053
|
+
0.95
|
|
2054
|
+
);
|
|
2055
|
+
composer.addPass(bloom);
|
|
2056
|
+
composer.addPass(new OutputPass());
|
|
2057
|
+
const filmPass = new ShaderPass({
|
|
2058
|
+
uniforms: {
|
|
2059
|
+
tDiffuse: { value: null },
|
|
2060
|
+
uTime: { value: 0 },
|
|
2061
|
+
uFade: { value: 0 },
|
|
2062
|
+
uRes: { value: new THREE.Vector2(W, H) },
|
|
2063
|
+
},
|
|
2064
|
+
vertexShader: \`varying vec2 vUv; void main(){ vUv = uv; gl_Position = projectionMatrix*modelViewMatrix*vec4(position,1.0); }\`,
|
|
2065
|
+
fragmentShader: \`uniform sampler2D tDiffuse; uniform float uTime, uFade; uniform vec2 uRes; varying vec2 vUv;
|
|
2066
|
+
float h(vec2 p){ return fract(sin(dot(p, vec2(12.9898, 78.233)))*43758.5453); }
|
|
2067
|
+
void main(){ vec2 c = vUv - 0.5; vec2 ca = c*vec2(uRes.x/uRes.y, 1.0); float r2 = dot(ca, ca);
|
|
2068
|
+
vec2 off = c*r2*0.006;
|
|
2069
|
+
vec3 col = vec3(texture2D(tDiffuse, vUv - off).r, texture2D(tDiffuse, vUv).g, texture2D(tDiffuse, vUv + off).b);
|
|
2070
|
+
col *= 1.0 - 0.58*smoothstep(0.12, 0.95, sqrt(r2));
|
|
2071
|
+
float g = h(floor(vUv*uRes) + fract(uTime*7.31)*vec2(91.7, 37.3)) - 0.5;
|
|
2072
|
+
col *= 1.0 + g*0.11;
|
|
2073
|
+
gl_FragColor = vec4(max(col, 0.0)*uFade, 1.0); }\`,
|
|
2074
|
+
});
|
|
2075
|
+
composer.addPass(titlePass);
|
|
2076
|
+
composer.addPass(statusPass);
|
|
2077
|
+
composer.addPass(filmPass);
|
|
2078
|
+
|
|
2079
|
+
/* ==========================================================================
|
|
2080
|
+
SEQUENCE — every value is a pure function of t
|
|
2081
|
+
========================================================================== */
|
|
2082
|
+
const tmpV = new THREE.Vector3(),
|
|
2083
|
+
faceW = new THREE.Vector3(),
|
|
2084
|
+
lookFar = new THREE.Vector3(0, 1.15, -30),
|
|
2085
|
+
lookDev = new THREE.Vector3(),
|
|
2086
|
+
Yup = new THREE.Vector3(0, 1, 0);
|
|
2087
|
+
const fogCol = new THREE.Color();
|
|
2088
|
+
|
|
2089
|
+
function update(t) {
|
|
2090
|
+
const out = t >= T.out;
|
|
2091
|
+
const on = out ? 0 : 1;
|
|
2092
|
+
|
|
2093
|
+
// world light: fades up from absolute zero; a cloud dims the moon as it arrives
|
|
2094
|
+
const reveal = smoother(T.revealIn, T.revealFull, t) * on;
|
|
2095
|
+
const cloud = 1 - 0.5 * smoother(9.5, 15.5, t) + 0.07 * (fbm1(t * 0.35) - 0.5);
|
|
2096
|
+
moon.intensity = K.moon * reveal * cloud;
|
|
2097
|
+
hemi.intensity = K.hemi * reveal * (0.7 + 0.3 * cloud);
|
|
2098
|
+
scene.environmentIntensity = K.env * reveal;
|
|
2099
|
+
fogCol.copy(FOG_BASE).multiplyScalar(reveal * (0.75 + 0.25 * cloud));
|
|
2100
|
+
scene.fog.color.copy(fogCol);
|
|
2101
|
+
scene.background.copy(fogCol);
|
|
2102
|
+
skyMat.uniforms.uFog.value.copy(fogCol);
|
|
2103
|
+
|
|
2104
|
+
// the monument wakes: edges and veins glow, the hat hovers and sways above it
|
|
2105
|
+
const glowLevel = smoother(2.5, 7.5, t) * on * (0.88 + 0.12 * Math.sin(t * 1.6));
|
|
2106
|
+
monUni.uGlow.value = glowLevel;
|
|
2107
|
+
monUni.uTime.value = t;
|
|
2108
|
+
monLights.forEach(([l, , k]) => {
|
|
2109
|
+
l.intensity = K.glow * k * glowLevel;
|
|
2110
|
+
});
|
|
2111
|
+
hat.position.y = HAT_Y + 0.06 * Math.sin(t * 1.25) + 0.02 * Math.sin(t * 2.7 + 1.0);
|
|
2112
|
+
hat.rotation.set(
|
|
2113
|
+
0.04 * Math.sin(t * 0.8 + 0.5),
|
|
2114
|
+
0.25 * Math.sin(t * 0.35),
|
|
2115
|
+
-0.08 + 0.05 * Math.sin(t * 0.95)
|
|
2116
|
+
);
|
|
2117
|
+
|
|
2118
|
+
// pumpkins kindle with the reveal and gutter toward the end
|
|
2119
|
+
const fear = smoother(10, 15.5, t);
|
|
2120
|
+
for (const p of pumpkins) {
|
|
2121
|
+
if (!p.faceMat) continue;
|
|
2122
|
+
const f =
|
|
2123
|
+
(0.78 + 0.22 * fbm1(t * 3.1 + p.seed) + 0.07 * noise1(t * 11 + p.seed)) *
|
|
2124
|
+
(1 - 0.45 * fear);
|
|
2125
|
+
const k = smoother(1.6, 6.0, t) * on * f;
|
|
2126
|
+
p.faceMat.color.setRGB(2.6 * k, 0.95 * k, 0.22 * k);
|
|
2127
|
+
if (p.light) p.light.intensity = K.pump * k;
|
|
2128
|
+
}
|
|
2129
|
+
|
|
2130
|
+
// camera: one continuous dolly, eased to an almost imperceptible landing
|
|
2131
|
+
const cu = easeLong(t / T.out);
|
|
2132
|
+
camera.position.set(0, lerp(CAM_Y0, CAM_Y1, cu), lerp(CAM_Z0, CAM_Z1, cu));
|
|
2133
|
+
const wLook = smoother(3.5, 13.8, t);
|
|
2134
|
+
lookDev.set(0, 1.7, MON_Z);
|
|
2135
|
+
camera.lookAt(tmpV.copy(lookFar).lerp(lookDev, wLook));
|
|
2136
|
+
camera.updateMatrixWorld();
|
|
2137
|
+
|
|
2138
|
+
// derived: focus on the point the camera is looking at
|
|
2139
|
+
faceW.set(0, 1.4, MON_Z + 0.3);
|
|
2140
|
+
mistUniforms.uTime.value = t;
|
|
2141
|
+
mistUniforms.uColor.value.copy(fogCol).multiplyScalar(1.7);
|
|
2142
|
+
mistUniforms.uCam.value.copy(camera.position);
|
|
2143
|
+
mistUniforms.uCandlePos.value.set(0, 1.2, MON_Z + 0.6);
|
|
2144
|
+
mistUniforms.uCandleCol.value.setRGB(0.42, 0.62, 1.0);
|
|
2145
|
+
mistUniforms.uCandleI.value = 1.2 * glowLevel;
|
|
2146
|
+
sky.position.copy(camera.position);
|
|
2147
|
+
const focus = -faceW.clone().applyMatrix4(camera.matrixWorldInverse).z;
|
|
2148
|
+
bokeh.uniforms.focus.value = focus;
|
|
2149
|
+
bokeh.uniforms.aperture.value = lerp(K.ap0, K.ap1, smoother(5, 15.5, t));
|
|
2150
|
+
|
|
2151
|
+
filmPass.uniforms.uTime.value = t;
|
|
2152
|
+
filmPass.uniforms.uFade.value = on;
|
|
2153
|
+
titlePass.uniforms.uT.value = t - TITLE_T0;
|
|
2154
|
+
titlePass.uniforms.uOn.value = on;
|
|
2155
|
+
statusPass.uniforms.uT.value = t;
|
|
2156
|
+
statusPass.uniforms.uOn.value = on;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
/* ---------- drive ---------- */
|
|
2160
|
+
function resize() {
|
|
2161
|
+
if (RENDER) return;
|
|
2162
|
+
W = innerWidth;
|
|
2163
|
+
H = innerHeight;
|
|
2164
|
+
camera.aspect = W / H;
|
|
2165
|
+
camera.updateProjectionMatrix();
|
|
2166
|
+
renderer.setPixelRatio(pixelRatio);
|
|
2167
|
+
renderer.setSize(W, H);
|
|
2168
|
+
composer.setPixelRatio(pixelRatio);
|
|
2169
|
+
composer.setSize(W, H);
|
|
2170
|
+
bokeh.uniforms.aspect.value = camera.aspect;
|
|
2171
|
+
filmPass.uniforms.uRes.value.set(W * pixelRatio, H * pixelRatio);
|
|
2172
|
+
titlePass.uniforms.uAspect.value = W / H;
|
|
2173
|
+
titlePass.uniforms.uRect.value.w = (TITLE_W * (W / H)) / 4;
|
|
2174
|
+
statusPass.uniforms.uRect.value.z = (STATUS_H * status.aspect) / (W / H);
|
|
2175
|
+
}
|
|
2176
|
+
filmPass.uniforms.uRes.value.set(W * pixelRatio, H * pixelRatio);
|
|
2177
|
+
addEventListener('resize', resize);
|
|
2178
|
+
|
|
2179
|
+
update(0);
|
|
2180
|
+
renderer.compile(scene, camera);
|
|
2181
|
+
|
|
2182
|
+
if (RENDER) {
|
|
2183
|
+
window.__renderAt = (t) => {
|
|
2184
|
+
update(t);
|
|
2185
|
+
composer.render();
|
|
2186
|
+
return true;
|
|
2187
|
+
};
|
|
2188
|
+
window.__duration = T.end;
|
|
2189
|
+
window.__renderAudio = renderSoundtrack; // base64 WAV, 48 kHz stereo, same timeline
|
|
2190
|
+
document.getElementById('hint').remove();
|
|
2191
|
+
window.__ready = true;
|
|
2192
|
+
} else {
|
|
2193
|
+
// Live: the timeline runs on the audio clock so picture and sound stay locked.
|
|
2194
|
+
// Browsers only allow sound after a gesture, so it waits on black for a click or key.
|
|
2195
|
+
const hint = document.getElementById('hint');
|
|
2196
|
+
let actx = null,
|
|
2197
|
+
outGain = null,
|
|
2198
|
+
cycleOut = null,
|
|
2199
|
+
cycleStart = 0,
|
|
2200
|
+
nextQueued = false,
|
|
2201
|
+
started = false,
|
|
2202
|
+
clockStart = 0,
|
|
2203
|
+
muted = false;
|
|
2204
|
+
let frames = 0,
|
|
2205
|
+
acc = 0,
|
|
2206
|
+
tuned = false,
|
|
2207
|
+
last = 0,
|
|
2208
|
+
introCompleteSent = false;
|
|
2209
|
+
const schedule = (at) => {
|
|
2210
|
+
const g = actx.createGain();
|
|
2211
|
+
g.connect(outGain);
|
|
2212
|
+
buildSound(actx, at, g);
|
|
2213
|
+
return g;
|
|
2214
|
+
};
|
|
2215
|
+
function begin() {
|
|
2216
|
+
hint.classList.add('gone');
|
|
2217
|
+
try {
|
|
2218
|
+
if (!actx) {
|
|
2219
|
+
actx = new (window.AudioContext || window.webkitAudioContext)();
|
|
2220
|
+
outGain = actx.createGain();
|
|
2221
|
+
outGain.connect(actx.destination);
|
|
2222
|
+
}
|
|
2223
|
+
actx.resume();
|
|
2224
|
+
} catch (e) {
|
|
2225
|
+
actx = null;
|
|
2226
|
+
}
|
|
2227
|
+
if (actx) {
|
|
2228
|
+
if (cycleOut) {
|
|
2229
|
+
const old = cycleOut;
|
|
2230
|
+
old.gain.setTargetAtTime(0, actx.currentTime, 0.04);
|
|
2231
|
+
setTimeout(() => old.disconnect(), 800);
|
|
2232
|
+
}
|
|
2233
|
+
cycleStart = actx.currentTime + 0.15;
|
|
2234
|
+
cycleOut = schedule(cycleStart);
|
|
2235
|
+
nextQueued = false;
|
|
2236
|
+
} else clockStart = performance.now();
|
|
2237
|
+
started = true;
|
|
2238
|
+
}
|
|
2239
|
+
function clock() {
|
|
2240
|
+
if (!actx) return (performance.now() - clockStart) / 1000;
|
|
2241
|
+
return actx.currentTime - cycleStart - (actx.outputLatency || actx.baseLatency || 0);
|
|
2242
|
+
}
|
|
2243
|
+
function frame(now) {
|
|
2244
|
+
let t = 0;
|
|
2245
|
+
if (started) {
|
|
2246
|
+
t = clock();
|
|
2247
|
+
if (actx && !nextQueued && t > T.loop - 0.6) {
|
|
2248
|
+
cycleOut = schedule(cycleStart + T.loop);
|
|
2249
|
+
nextQueued = true;
|
|
2250
|
+
}
|
|
2251
|
+
if (t >= T.loop) {
|
|
2252
|
+
if (actx) {
|
|
2253
|
+
cycleStart += T.loop;
|
|
2254
|
+
nextQueued = false;
|
|
2255
|
+
} else clockStart += T.loop * 1000;
|
|
2256
|
+
t -= T.loop;
|
|
2257
|
+
}
|
|
2258
|
+
t = Math.max(0, t);
|
|
2259
|
+
}
|
|
2260
|
+
update(t);
|
|
2261
|
+
composer.render();
|
|
2262
|
+
if (EMBED && started && !introCompleteSent && t >= T.end) {
|
|
2263
|
+
introCompleteSent = true;
|
|
2264
|
+
try {
|
|
2265
|
+
window.parent.postMessage(
|
|
2266
|
+
{ source: 'impact-ui-halloween-intro', type: 'complete' },
|
|
2267
|
+
'*'
|
|
2268
|
+
);
|
|
2269
|
+
} catch (_) {}
|
|
2270
|
+
}
|
|
2271
|
+
if (started && !tuned && t > 2) {
|
|
2272
|
+
acc += now - last;
|
|
2273
|
+
frames++;
|
|
2274
|
+
if (frames === 90) {
|
|
2275
|
+
tuned = true;
|
|
2276
|
+
if (acc / frames > 19 && pixelRatio > 1) {
|
|
2277
|
+
pixelRatio = 1;
|
|
2278
|
+
resize();
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
last = now;
|
|
2283
|
+
requestAnimationFrame(frame);
|
|
2284
|
+
}
|
|
2285
|
+
requestAnimationFrame(frame);
|
|
2286
|
+
if (EMBED) {
|
|
2287
|
+
setTimeout(begin, 150);
|
|
2288
|
+
} else {
|
|
2289
|
+
addEventListener('pointerdown', begin);
|
|
2290
|
+
addEventListener('keydown', (e) => {
|
|
2291
|
+
if (e.key === 'm' || e.key === 'M') {
|
|
2292
|
+
muted = !muted;
|
|
2293
|
+
if (outGain) outGain.gain.setTargetAtTime(muted ? 0 : 1, actx.currentTime, 0.05);
|
|
2294
|
+
} else if (e.key === ' ' || e.key === 'Enter') {
|
|
2295
|
+
e.preventDefault();
|
|
2296
|
+
begin();
|
|
2297
|
+
}
|
|
2298
|
+
});
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2301
|
+
<\/script>
|
|
2302
|
+
</body>
|
|
2303
|
+
</html>
|
|
2304
|
+
`;
|
|
2305
|
+
export {
|
|
2306
|
+
halloweenNightHtml as default
|
|
2307
|
+
};
|