Commit Graph

85 Commits

Author SHA1 Message Date
Sped0n
2e3fc3d7b6 feat(reset.scss): add new CSS reset file to reset default styles and improve cross-browser consistency
The new CSS reset file is added to the project. This file is used to reset default styles applied by the user agent stylesheet and provide a clean starting point for styling. The reset file includes various CSS rules to remove default styles and improve cross-browser consistency.

Some of the changes made in the reset.scss file include:
- Removing all styles of the "User-Agent-Stylesheet" except for the 'display' property to solve Firefox SVG sprite bug and prevent a bug in Chrome that breaks the CSS hyphens property.
- Setting the box-sizing property to border-box for all elements and pseudo-elements to ensure consistent box sizing.
- Fixing the increase in font-size on mobile Safari in landscape mode.
- Reapplying the pointer cursor for anchor tags and buttons.
- Removing list styles (bullets/numbers) from ordered lists, unordered lists, menus, and summary elements.
- Setting max-inline-size and max-block-size properties to 100% for images to prevent them from exceeding their container.
- Removing spacing between cells in tables.
- Fixing an issue in Safari where the user-select:none property doesn't work on the <body> text input.
- Reverting the 'white-space' property for textarea elements on Safari.
- Applying minimum styles to allow styling of the meter element.
- Reverting all styles for preformatted text.
- Resetting the default text opacity of input placeholders.
- Fixing the 'hidden' attribute to use display: none instead of the attribute itself.
- Fixing a bug in Chromium browsers where the content editable attribute doesn't work properly.
- Applying the draggable feature for elements with the draggable attribute set to 'true'.
- Reverting the native behavior of modal dialogs.

These changes are made to ensure a consistent and predictable starting point for styling in the project and improve cross-browser compatibility.
2023-10-29 22:10:02 +08:00
Sped0n
ca4f2d2902 feat(scss): add core base styles
Add a new file `_base.scss` to the `_core` directory. This file contains base styles for the entire application. The styles include setting font smoothing properties, setting the background color of the body, and disabling overscroll behavior on the html and body elements. Additionally, the styles set the cursor property to pointer for anchor tags and buttons.

feat(scss): add core font styles

Add a new file `_font.scss` to the `_core` directory. This file defines the `HelveticaNow` font face and specifies the font weight and style.

feat(scss): add core mixins

Add a new file `_mixins.scss` to the `_core` directory. This file defines mixins for working with breakpoints. The mixins allow for specifying styles based on minimum and maximum widths of breakpoints defined in the `$breakpoints` map.

feat(scss): add core typography styles

Add a new file `_typography.scss` to the `_core` directory. This file defines typography styles for the body element. The styles set the line height, font size, and font family. Additionally, the styles use the `min-width` mixin to increase the font size at tablet and laptop breakpoints.

feat(scss): add partial customCursor styles

Add a new file `_customCursor.scss` to the `_partial` directory. This file defines styles for a custom cursor. The styles position the cursor element, set its color and blend mode, and define an inner element for the cursor.

feat(scss): add partial stage styles

Add a new file `_stage.scss` to the `_partial` directory. This file defines styles for a stage element. The styles position the stage element, set its width and height, and define styles for an image element within the stage.

feat(scss): add partial stageNav styles

Add a new file `_stageNav.scss` to the `_partial` directory. This file defines styles for a stage navigation overlay. The styles position the overlay element and set its width and height. The styles also define an inactive state for the overlay.

feat(scss): add variables

Add a new file `_variables.scss` to the root directory. This file defines CSS variables for various aspects of the application, such as window height, navigation height, spacing, and z-index values.

feat(scss): import styles in main style.scss

Add import statements for the newly created files in the `style.scss` file. This ensures that the
2023-10-29 22:09:36 +08:00
Sped0n
2025a57ae4 fix(customCursor.ts): fix variable declaration and initialization for cursor and cursorInner to improve code readability and maintainability
feat(customCursor.ts): add support for setting custom text for cursorInner to display different cursor text
fix(stage.ts): fix variable declaration and initialization for imgs, last, cordHist, isOpen, isAnimating, and active to improve code readability and maintainability
feat(stage.ts): add support for minimizing image and initialize stage with image JSON data
fix(stageNav.ts): fix variable declaration and initialization for navItems to improve code readability and maintainability
feat(stageNav.ts): add support for handling click and key events for stage navigation
fix(nav.ts): fix variable declaration and initialization for thresholdDiv and indexDispNums to improve code readability and maintainability
feat(nav.ts): initialize nav and update threshold text
2023-10-29 15:09:10 +08:00
Sped0n
6848e413ca chore(utils.ts): add custom helpers and types for better code organization and reusability 2023-10-29 14:54:52 +08:00
Sped0n
a60ff94c7c feat(customCursor.ts): add custom cursor functionality to improve user experience
feat(stage.ts): implement stage functionality to display images and handle mouse events
feat(stageNav.ts): add stage navigation functionality to navigate between images and close the stage
fix(main.ts): fix import paths for customCursor, stage, and stageNav modules
2023-10-29 14:52:43 +08:00
Spedon
4387abe52f Gsap (#120)
* feat: add gsap to deps

* chore: migrate to pnpm

* refractor: change var name

* chore(.idea): remove unnecessary files and configurations

Remove the following files and configurations from the .idea directory:
- .gitignore: Remove default ignored files.
- bridget.iml: Remove module file.
- codeStyles/Project.xml: Remove project code style configuration.
- codeStyles/codeStyleConfig.xml: Remove project code style configuration.
- inspectionProfiles/Project_Default.xml: Remove project inspection profile.
- jsLibraryMappings.xml: Remove JavaScript library mappings.
- jsLinters/eslint.xml: Remove ESLint configuration.
- modules.xml: Remove project module configuration.
- vcs.xml: Remove VCS directory mapping.
- watcherTasks.xml: Remove project tasks options.

* chore(.prettierrc.json): update Prettier configuration to include support for go-template files and improve code formatting settings

The Prettier configuration file (.prettierrc.json) has been updated with the following changes:
- `useTabs` is set to `false` to use spaces for indentation
- `tabWidth` is set to `2` to specify the number of spaces for each indentation level
- `printWidth` is set to `88` to limit the line length to 88 characters
- `singleQuote` is set to `true` to use single quotes for strings
- `trailingComma` is set to `none` to remove trailing commas in arrays and objects
- `bracketSpacing` is set to `true` to add spaces inside brackets
- `semi` is set to `false` to remove semicolons at the end of statements
- `plugins` is added to include the "prettier-plugin-go-template" plugin for go-template files
- `overrides` is added to specify the parser as "go-template" for files with the ".html" extension

* chore(base.scss): improve font rendering by adding font smoothing properties to all elements
feat(base.scss): add user-select: none to body to disable text selection
feat(base.scss): add overscroll-behavior-y: none to html and body to disable vertical scrolling on overscroll
feat(base.scss): add cursor: pointer to anchor tags and buttons for better user experience
feat(font.scss): add font-face declaration for HelveticaNow font
refactor(media.scss): remove unused file
feat(mixins.scss): add min-width and max-width mixins for responsive design
feat(reset.scss): add the new CSS reset version 1.8.4
feat(reset.scss): remove all styles from User-Agent-Stylesheet except for the display property
feat(reset.scss): set box-sizing: border-box for all elements
feat(reset.scss): revert cursor style for anchor tags and buttons
feat(reset.scss): remove list styles (bullets/numbers) from ol, ul, and menu
feat(reset.scss): set max-inline-size and max-block-size to 100% for images
feat(reset.scss): set border-collapse: collapse for tables
feat(reset.scss): set -webkit-user-select: auto for input and textarea to fix Safari issue
feat(reset.scss): revert white-space property for textarea on Safari
feat(reset.scss): set -webkit-appearance: revert for meter element
feat(reset.scss): revert all styles for preformatted text
feat(reset.scss): unset color for input placeholder
feat(reset.scss): remove default dot sign for lists
feat(reset.scss): set display: none for elements with hidden attribute
feat(reset.scss): revert styles for contenteditable elements
feat(reset.scss): set -webkit-user-drag: element for draggable elements
feat(reset.scss): revert native behavior for modal dialogs
feat(typography.scss): set line-height, font-size, and font-family for body
feat(typography.scss): increase font-size for tablet and laptop breakpoints

* feat: add custom cursor styles

Add a new file `_customCursor.scss` to the `assets/css/_partial` directory. This file contains styles for a custom cursor. The `.cursor` class is used to position the cursor and set its appearance. The `.active` class is used to display the cursor. The `.cursorInner` class is used to position the inner content of the cursor.

---

refactor: remove unused footer styles

Delete the file `_footer.scss` from the `assets/css/_partial` directory. This file contains styles for the footer section of the page. The styles are no longer used and can be safely removed.

---

refactor: remove unused image styles

Delete the files `_imagesDesktop.scss` and `_imagesMobile.scss` from the `assets/css/_partial` directory. These files contain styles for displaying images on desktop and mobile devices. The styles are no longer used and can be safely removed.

---

feat: add navigation styles

Add a new file `_nav.scss` to the `assets/css/_partial` directory. This file contains styles for the navigation bar. The styles define the layout and appearance of the navigation bar, including its position, background color, and alignment of its contents. The styles also include media queries to adjust the layout for smaller screens.

---

refactor: remove unused overlay styles

Delete the file `_overlay.scss` from the `assets/css/_partial` directory. This file contains styles for an overlay element. The styles are no longer used and can be safely removed.

---

feat: add stage styles

Add a new file `_stage.scss` to the `assets/css/_partial` directory. This file contains styles for the stage element, which is used to display images. The styles define the position and size of the stage, as well as the appearance of the images within it.

---

feat: add stage navigation overlay styles

Add a new file `_stageNav.scss` to the `assets/css/_partial` directory. This file contains styles for the stage navigation overlay. The styles define the position and size of the overlay, as well as its appearance and behavior. The overlay is used for navigation within the stage.

* chore(variables.scss): update variable names and values for better readability and consistency
chore(style.scss): reorganize import statements for better organization and readability

* fix(main.ts): import correct functions from utils module
feat(stage.ts): implement stage navigation functionality
feat(stageNav.ts): implement stage navigation overlay functionality
feat(state.ts): implement state management for index and threshold
feat(utils.ts): add utility functions for increment and decrement

* fix(index.html): fix doctype declaration to use lowercase 'doctype' for HTML5 compliance
fix(index.html): fix meta tag indentation for better readability
fix(index.html): fix indentation of head and body tags for better readability
fix(index.html): fix indentation of header, main, and footer sections for better readability
fix(index.html): fix indentation of script tag for better readability
fix(index.html): fix indentation of closing div tag for better readability
fix(index.html): fix indentation of closing body and html tags for better readability
feat(index.html): add partial for navigation bar to improve website navigation
fix(head.html): fix indentation of esBuildOpts variable for better readability
fix(head.html): fix indentation of script tag for better readability
feat(nav.html): add navigation bar partial to improve website navigation

* refactor(stage.ts): change cordHist, isOpen, isAnimating, and active variables to instances of the watchable class to improve semantics and encapsulation

* refactor(customCursor.ts): rename addActiveCallback to active.addWatcher for better readability and consistency
refactor(stageNav.ts): rename getIsAnimating to isAnimating.get for better readability and consistency
refactor(stageNav.ts): rename addActiveCallback to active.addWatcher for better readability and consistency
feat(stageNav.ts): add check for isOpen.get() and isAnimating.get() before handling key events to prevent unwanted actions

* chore(package.json): add prettier-plugin-go-template as a dev dependency to enable formatting of Go templates with Prettier

* chore: add helvetica now font

* chore(tsconfig.json): add "moduleResolution" property with value "node" to improve module resolution in the project configuration

* refactor(stage.ts): rename class 'watchable' to 'Watchable' for consistency and clarity
feat(utils.ts): add Watchable class to provide a generic watchable object with getter, setter, and watcher functionality
2023-10-29 12:39:56 +08:00
Spedon
5679c5e39c import imagesMobile style 2023-05-04 12:35:13 +08:00
Spedon
823502839f debugging 2023-05-04 12:34:32 +08:00
Spedon
a6648c7c2f finish the basic scroll logic 2023-05-04 12:34:17 +08:00
Spedon
c8f2ecad84 style for mobile gallery component 2023-05-04 12:33:38 +08:00
Spedon
c610f01d51 separate desktop component to imagesDesktop 2023-05-04 12:33:01 +08:00
Spedon
448710a77d change overlay cursor z index 2023-03-28 18:56:17 +08:00
Spedon
5e311692f4 add stack update the refresh components 2023-03-28 18:55:53 +08:00
Spedon
404c0870c7 modify the z index of footer 2023-03-28 18:54:48 +08:00
Spedon
44a8d0c544 change function name 2023-03-28 18:37:25 +08:00
Spedon
9a6f141533 optimize reused code fragments 2023-03-28 17:00:14 +08:00
Spedon
823de500d7 add comments for the code 2023-03-28 16:59:15 +08:00
Spedon
de692352f2 combine handle next/prev click code into one function 2023-03-28 14:14:41 +08:00
Spedon
42a8bb8bc8 fix the bug of transition not working when changing from display none to block 2023-03-26 23:32:12 +08:00
Spedon
7f6cfe4366 add comments 2023-03-26 20:52:29 +08:00
Spedon
3ba067b19e add enter overlay event listener now is a function 2023-03-25 18:14:15 +08:00
Spedon
7262a43fae move pushIndex function to utils.ts 2023-03-24 17:17:57 +08:00
Spedon
5b172414ec now the overlay delay time will change with the stack depth 2023-03-24 16:53:31 +08:00
Spedon
26661911dc shrink the size of displaying images 2023-03-24 16:49:14 +08:00
Spedon
bd34d5c911 delete deprecated css style for image containers 2023-03-24 16:46:40 +08:00
Spedon
e897561afa initial version of transition toward image elements 2023-03-24 16:11:00 +08:00
Spedon
56fd85e875 set the layer 0 as stack top 2023-03-21 12:00:22 +08:00
Spedon
7da5c2228a now html element can be generated by typescript 2023-03-21 11:55:05 +08:00
Spedon
bedc7c7691 remove unused part for createImgElement 2023-03-20 22:25:39 +08:00
Spedon
93c2ef3517 add doc for the code 2023-03-20 22:21:04 +08:00
Spedon
401d6254db dump layerPosSet, now FIFO can handle most part of position passing 2023-03-20 22:18:43 +08:00
Spedon
023aa36c3f components update 2023-03-20 21:58:34 +08:00
Spedon
eabecd860c disable preloader 2023-03-20 21:57:51 +08:00
Spedon
4e98152859 optimize animation 2023-03-20 21:57:14 +08:00
Spedon
1e74555d86 dev 2023-03-20 20:19:37 +08:00
Spedon
3247219da8 update overlay design 2023-03-18 01:12:01 +08:00
Spedon
28ad9cb099 fix lazy load placeholder display bug 2023-03-16 21:42:59 +08:00
Spedon
944af06dc4 now position of div is changed by translate instead of left/top 2023-03-16 21:42:28 +08:00
Spedon
19e89db88a change function style to const 2023-03-16 20:18:11 +08:00
Spedon
96b75abc7d optimize coding style of image.scss 2023-03-16 00:08:16 +08:00
Spedon
27d4cb0277 create mobile.ts 2023-03-16 00:07:42 +08:00
Spedon
9b5b5a758a get device type 2023-03-16 00:07:23 +08:00
Spedon
4d6f75d50f rename import 2023-03-16 00:07:09 +08:00
Spedon
87b4453e64 rename 2023-03-16 00:06:21 +08:00
Spedon
81477f0ed8 add lazyload background 2023-03-14 23:31:20 +08:00
Spedon
37d62f85fb add image cache function 2023-03-14 23:31:02 +08:00
Spedon
7a99f099cb add box shadow to prevent webkit from partly repainting the frame 2023-03-14 23:29:51 +08:00
Spedon
6cc03a3fc9 add time delay to overlay enable 2023-03-14 13:16:12 +08:00
Spedon
533ab5fb35 add the function of clicking prev and next to control displaying image 2023-03-14 12:00:48 +08:00
Spedon
95cc8e6971 prevent webkit from partly repainting the frame 2023-03-14 11:55:21 +08:00