# Hai, Friend!

Hai! A cute fediverse client with more than just cute colors

Are there more powerful Mastodon clients out there? Yes.

But, remember in 2010, when twitter clients were fun, and a joy to use? Everything now is professional and gets the thing done.

Hai! is more than that. Hai! wants to make connecting with your friends delightful. Hai! wants to be friendly. Hai! is where you connect. It's your personal twitter client. With more than 6 built-in themes, font choices that don't normally show up, and near infinite customization via CSS, it's made for you, not for work.&#x20;

### Features

* Aggregated notifications: No 100-item list of notifications of different people liking your status
* Custom CSS: Make Hai yours with third party and custom themes you can browse and install (in progress)
* A gamut of font options including Atkinson Hyperlegible, OpenDyslexic and Lexend
* Styled post types: replies, mentions, shares etc can be highlighted as they should be.
* Text Contrast options
* Connect to your mastodon instance using just your username


# Getting Started ...

This kind of document used to exist in 100-page software user manuals with holograms embedded into the cover

The first thing Hai! will ask you to do is login. You can enter your Mastodon address here: name\@server. Hai will automatically get the connection information to the server. It will direct you to log into your instance, and provide permissions for use.

Currently, servers that use SSO, like Vivaldi, do not connect.

### Advanced - Not yet Implemented

If Hai! is unable to connect to your server, you can manually provide information in the advanced screen. Incomplete information will result in Hai! trying to fill in the blanks. For more advanced setups, you can setup oAuth separately, and enter the information into Hai! to connect.


# Settings

Superfluous customizations ... after launch

## Enable Dark Mode ™ TBA&#x20;

Dark mode signals to the theme it should use a dark mode setting.&#x20;

## Enable Visual Effects

Tells Hai! to cut back on Superfluous Animations and movement. On platforms where *Reduce Motion* is an option, the default value will be expected to be set to OS value (TBA)

## Enable Sounds

Tells Hai! to be quiet, even if your volume is up. This affects interface sounds.

## Enable Haptics - Depends on device

A buzz or tap when you touch a button. Useful on platforms with a taptic engine. Feature may be available on PWA.

## Background

Will allow a background to be used. Themes should support backgrounds.

## Show Actions on Posts

This will enable or disable the button bar on posts. To act on a post, you have to tap on it first to view it's thread, or display the button bar.

## Selected Theme

Prepackaged themes to dress up Hai! just the way you want. This will be replaced with a theme selector, but is a dropdown for now.

## Selected Font

Currently, OS/Browser limitations limit the options to fonts that can be loaded from the internet, or pre-packaged fonts. Only for now.

## Text Contrast

Signals the theme to adjust text according to the desired contrast setting. Options are Theme/Default, which uses whatever the theme has set, High, low and normal. Normal is the default iOS sharp text, Low has soft edges and includes more than just text, and High outlines text in white.

## Custom CSS

Enter any CSS here. Styles will be applied after the theme is, and should override the theme settings. See page on Custom CSS for details.

## Debug options:

These will not be included in the release version.

### dRef

Force reload Hai!

### dReset

Force Hai! to forget all settings and start with a clean slate. If there's been an update and you see "undefined" in places, you may need to use this button.


# Theme Previews

Previews of the built-in themes


# Custom CSS

Make it your own!

## Variables

`--accent-color`

## Highlight User Accounts

User accounts use a u-username class. To highlight a user with the username "bob", you would use the class `.u-bob`

For example, to change a post's background color, you can use:

```
article.card.u-bob {
  background-color: purple;
}
```


# Theming Hai!

Hai! uses regular CSS for theming, with a few special considerations unique to Hai!:

{% hint style="info" %}

## Things to keep in mind

* Backgrounds are added to `html`. Do not block html from being seen entirely. `body` can be use to apply a filter or effect over the image, and `background-filters` can be added to `html`.
* Fonts should not be defined in the theme: fonts are selected by the user, and will be overridden by their selection.
  {% endhint %}

## Special selectors

### `.animationOff { }`

Used to specifically define a class without animation. Hai! will attempt to disable most animations when the Visual Effects setting is switched off.

A good example of this might be the user experience when changing the Visual Effects setting in Hai!. When disabled, users can expect to see a less animated experience with fewer flashy visuals. This means that certain classes or design elements may be less flashy or less pronounced than usual. In other words, users can expect a toned-down UI when the Visual Effects setting is turned off.

### `.nc, .lc, .hc`

Hai! has 4 contrast settings: Default/Theme (no selector), High Contrast (.hc), Normal Contrast (.nc) and Low Contrast (.lc).&#x20;

By default, Low Contrast makes all elements and text softer. Normal removes any modifications to text including text-shadows. High Contrast adds outlines to the text.

Default/Theme has no selector, as is the default for what fits your theme best.

### `[scroller=`*`left,top`*`] { }`

The navigation bar can be made to overflow and scroll. Some buttons will not be visible until scrolled to.. When the user taps on one of the navigation buttons, the viewport for the navigation area can be made to scroll to the button that was pressed.&#x20;

This selector accepts no rules, and acts like a flag to enable this behavior. The options for it are `left` or `top`

Hai! looks for this option as the second selector in the theme file. If it is not present there, the effect will not be enabled. The included *WP7* theme uses this for it's Metro-style navigation bar.

### `.isVisible {}`

Post content has the class `.isVisible` added to it when it starts to become visible in the timeline. This can be used for arranging or animating incoming posts. The platforms this works on are limited to mostly the iPhone at the moment.

### `.action_boost, .action_fav, .action_unboost, .action_unfav`

When a button on a post is pressed, `.action` classes are added to the `body`. The included *Cute* theme uses these to create full window animations using `.action_{action}::after`

### `.notification.favourite, notification.reply, .notification.share`

Styles applied to notifications to indicate type

### `.shared, .favorited {}`

Classes added to the the boost and favourite buttons to indicate their state&#x20;

### `.sk-grid, .sk-grid-cube {}`

These make up the waiting animations while Hai! is in a loading state. The animation appears when `.showLoad` is attached to `.sk-grid`.

### `.deleteVisualItem {}`

This class is attached on any element that is being deleted.&#x20;

## `.spoiler_text, .spoiler_text.ns`

.spoiler\_text.ns is used when the post is hidden (usually behind .spoiler\_text). Styles for when the post is visible are .spoiler\_text.

## .`isDesktop`

Yes, yes, user agent sniffing is bad. However, using media queries, if the device being used is deemed to be a desktop (or iPad at the moment), the class `.isDesktop` will be added to the body.

## Included Animations

[***Animate.css***](https://animate.style) animations are built into Hai! In addition, these animations can also be used:&#x20;

* `crumple`
* `attentionShake`

## Classes

## Structure


# Color Settings

Themes should use color variables as much as possible.&#x20;

Information on this TBA


# Notifications

Notifications are checked every minute by default.&#x20;


# Release Notes

Release notes for Hai! are now on itch.io! https\://antijingoist.itch.io/hai

## 2023-03-03 - Beta 17

* Minor fixes for dialogs and transitions.
* support for --instanceName, --wallpaperImage variables in themes
* fix for freezing when tapping card in the 'wrong' place
* Changes to fetch timelines to also get previous and next pages, and additional metadata as needed
* code formatting
* improved wallpaper support. Set wallpaper via variable to prevent safari from crashing.
* New theme, magic, based on RPG card deck
* support for dynamic type: in iOS you can change the text size via the Control Center or Settings, and Hai! will use that value.&#x20;
* Sound effects fix again... re: sounds disabled after backgrounding application.
* text shadow fixes
* add additional animations for actions
* switch to webp for remaining images
* Add resources folder for built-in themes
* continued progress on plain theme
* Adding excessive visual effects to Glass theme, and fixing selecting an imaege.
* Reposition dialog so it's not obscured by keyboard on smaller phones
* Add search button
* Add error checking for loading a timeline
* function to process adding a post using deep link
* Checks for Re in the spoiler text before adding a second "Re: ". Adds a Re if there is a spoiler.
* Contrast setting was being saved in the wrong area.
* Enter key submits on login screen.
* meta tags, opengraph
* fix html size

  create new post with hai://new\_post/?post=

## 2023-02-24 - Beta 16

* fix background section in settings
* swap novel heme for plain
* starting deep link support
* adding icons and additional metadata
* search icon - no search yet
* Adding various icon sizes for pwa
* ui improvements: adding styles for the file input
* remove wallpaper button added
* fix contrast never setting on new install
* other ui improvements
* fix for bug where selecting the same page a second time removes its visual effects
* added selector to detect if wallpaper is chosen
* high contrast text fixes
* Fix in themes for floating close button
* Visual effects fix High Contrast option fixes
* floating close button fix moved link image to main css
* Moving settings buttons fix
* Visual effect updates: return of the visual effects
* use a visible color for account names
* sightly smaller care warning area
* remove extra space from participants. do not add current user to reply list
* Fix fetching local timeline
* fixing covering of arrows on posts
* fixing detection of post-types
* New theme: glass
* Adding "Re: " before spoiler text on replies

## 2023-02-20 - Beta 15

* fix for shares and likes not applying
* initial wallpaper support. You can select a wallpaper from your device.
* Fixes for spoilers on wp7 and yesterday themes.
* Support for playing videos - tap on a post to view videos
* fix for no sounds after multitasking
* moving mastodon api code&#x20;
* Switching to local storage. Using objects for settings and account information

  formatting
* Fixes for people on Beta 14 not being able to log in

## 2023-02-15 - Beta 14

* fixed tabbar showing on top of full screen images
* when opening a post that is large enough to scroll in place, the post expands in the thread view.
* adding login error on first run
* added sound on error
* Clicking on a post is handled by an event listener that properly opens URLs instead of ignoring them.
* Spinning refresh icon now continues until the page is refreshed.
* Added an error when mistyping your login information on firstrun
* switching between pages slides pages side to side now instead of pulling and pushing the page.
* Load additional pages in background on mobile after first page load.

  cleaning up older unused code, and refactoring for performance improvements.
* added support for deeplinks
* Adding help link to the add account dialog, and to error messeges
* Changing where the app domain points when registering on a mastodon server.
* Fixed error were referencing a non-existent object would prevent you from viewing the single user page.

## 2023-02-13 - Beta 13.5

* fix for persistent spoiler warning
* ui fixes and cleanup
* stupid off centered images

## 2023-02-13 - Beta 13.0

* Using webP for many images now.&#x20;
* Layout fixes and adjustments needed after rebuilding the UI structure.,&#x20;
* Refresh button replaces pull to refresh (at least temporarily). Pressing the tab bar button twice also refreshes.
* Moved App layout from being built in js to a mustache template.&#x20;
* Moved more actions from the dom to event listeners. scroll effects adjusted to use less math and affect only the container being acted on.&#x20;
* Adjusting opacities, moving some rendering to gpu, some off gpu.&#x20;
* Manifest.json added.&#x20;
* Loads fewer posts by default. Even fewer on desktops/old iPads: it's an in-progress thing, I can't gauge speed on those right now.&#x20;
* Adding names to buttons.&#x20;
* Multicolumn on iPad has horizontal scroll snapping


# 2023-02-10 - Beta 12

* remove second media
* Turn off some extra visual effects on ipad and desktop
* Enable multicolumn on ipad
* Try to avoid sudden accidental refreshes
* Setting to hide actions on posts
* Fixed spelling error that kept sound switch from working
* Multiple scroll fixes on smaller devices
* Fix for sound settings,
* Added setting for cardbutton visibility
* Added scrollable settings to fit on the smaller displays and iphonex - thanks @<meguria@tenforward.social> and s. Murphy
* Multicolumn desktop mode, Resized widgets for desktop
* Adjusted behavior for desktop
* Local column pull to refresh
* Individual pull to refresh displays.
* Merge branch 'refs/heads/windowing-system'
* Fixed columns to be proper columns
* Cross-device support
* Small device changes
* Ui bugfixes
* Fixes for default, palm and shoebox themes
* Starting adjustments on login screen.
* Fix for dissapearing shared messages
* Fixed inability to post
* Reply button moved to eventlistener
* Care warnings carried over into replies
* Spinner should work without looking weird
* Default theme no longer named modern but default.
* Spinkit inclusion
* Vercel nobuild test
* Some themes had squished emoji
* Vercel check
* Follow support
* Relationship support
* Moving away from onclick
* Moving click events to one location


# 2023-02-23 - Beta 11

* Preperation for backgrounds new alert sound for notifications fixing some scrolling follows AND follow request open user page.
* more emojis, return of sounds, notifications, user pages


# Troubleshooting

Known issues and workarounds

## Account Blocked/can't log in with error message

Screenshot the reason and publicly mention `@antijingoist@hackers.town` to resolve.

## Can't see the close button on settings

Try scrolling up, and if you can't scroll up, send  screenshot with an image of the settings screen, along with your phone model and OS details.

## Single Sign On

Single Sign On is currently unsupported, but is on the roadmap. Vivaldi should work tho.

## Vivaldi.social

For now, enter your account name as <user@social.vivaldi.net>

## Sounds not playing&#x20;

A fixable bug is causing sounds to stop playing after Hai! loses focus. If you want sounds back, quit and reopen Hai!

## Multiple Accounts&#x20;

Currently an in-progress feature

## Media Uploads

In progress

## Viewing gifs/videos/sounds in posts

In progress


