diff --git a/.github/workflows/tidy.yml b/.github/workflows/tidy.yml new file mode 100644 index 0000000..f7d3f28 --- /dev/null +++ b/.github/workflows/tidy.yml @@ -0,0 +1,22 @@ +name: Tidy document +on: + workflow_dispatch: {} + push: + branches: + - gh-pages + paths: + - index.html + +jobs: + tidy: + name: Tidy up + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - run: brew install tidy-html5 + - run: tidy -config tidyconfig.txt -o index.html index.html + - uses: peter-evans/create-pull-request@v6 + with: + title: "Tidied up document using tidy-html5" + commit-message: "chore: tidy up index.html" + branch: html-tidy diff --git a/index.html b/index.html index aedc92f..1a60a77 100644 --- a/index.html +++ b/index.html @@ -1062,14 +1062,14 @@
- Array of {{Gamepad/GamepadHapticEffectType}} values representing all - the types of haptic effects that the actuator supports. This + Array of {{Gamepad/GamepadHapticEffectType}} values representing + all the types of haptic effects that the actuator supports. This property lists the {{Gamepad/GamepadHapticEffectType}} values that the actuator supports, unless the [=user agent=] does not support playing effects of that type. @@ -1166,8 +1167,8 @@
- The {{GamepadHapticActuator/playEffect()}} method steps, called with - {{GamepadHapticEffectType}} |type:GamepadHapticEffectType| and + The {{GamepadHapticActuator/playEffect()}} method steps, called + with {{GamepadHapticEffectType}} |type:GamepadHapticEffectType| and {{GamepadEffectParameters}} |params:GamepadEffectParameters |, are:
To stop haptic effects on an actuator, the [=user agent=] @@ -1339,20 +1350,20 @@
- When the |document|'s [=Document/visibility state=] becomes `"hidden"`, run - these steps for each {{GamepadHapticActuator}} + When the |document|'s [=Document/visibility state=] becomes + `"hidden"`, run these steps for each {{GamepadHapticActuator}} |actuator:GamepadHapticActuator|:
A new |gamepadHapticActuator:GamepadHapticActuator| representing a - {{Gamepad}}'s primary vibration actuator is constructed by - performing the following steps: + {{Gamepad}}'s primary vibration actuator is constructed by performing + the following steps:
enum GamepadHapticEffectType { - "dual-rumble" + "dual-rumble", + "trigger-rumble" };
- {{GamepadHapticEffectType/"dual-rumble"}} describes a haptics - configuration with an eccentric rotating mass (ERM) vibration - motor in each handle of a standard gamepad. In this - configuration, either motor is capable of vibrating the whole - gamepad. The vibration effects created by each motor are unequal - so that the effects of each can be combined to create more - complex haptic effects. + {{GamepadHapticEffectType/"dual-rumble"}} describes a haptic + configuration with an eccentric rotating mass (ERM) vibration motor + in each handle of a standard gamepad. In this configuration, either + motor is capable of vibrating the whole gamepad. The vibration + effects created by each motor are unequal so that the effects of + each can be combined to create more complex haptic effects.
A {{GamepadHapticEffectType/"dual-rumble"}} effect is a @@ -1467,22 +1476,72 @@
{{GamepadEffectParameters/strongMagnitude}} and - {{GamepadEffectParameters/weakMagnitude}} set the - intensity levels for the low-frequency and high-frequency - vibrations, normalized to the range `[0,1]`, defaulting to 0. + {{GamepadEffectParameters/weakMagnitude}} set the intensity levels + for the low-frequency and high-frequency vibrations, normalized to + the range `[0,1]`, defaulting to 0.
Given {{GamepadEffectParameters}} |params:GamepadEffectParameters|, - a valid dual-rumble effect must have a valid - duration, a valid startDelay, and both the + a valid dual-rumble effect must have a [=valid + effect|valid=] {{GamepadEffectParameters/duration}}, a [=valid + effect|valid=] {{GamepadEffectParameters/startDelay}}, and both the {{GamepadEffectParameters/strongMagnitude}} and the {{GamepadEffectParameters/weakMagnitude}} must be in the range `[0,1]`.
+ {{GamepadHapticEffectType/"trigger-rumble"}} describes a haptics + configuration with a vibration motor in each of the bottom front + buttons of a [=Standard Gamepad=] (buttons with [=canonical + indices=] 6 and 7) in addition to the two handle motors used for + {{GamepadHapticEffectType/"dual-rumble"}}. These buttons most + commonly take the form of spring-loaded triggers. In this + configuration, either motor is capable of providing localized + haptic feedback on the button's surface. +
++ A {{GamepadHapticEffectType/"trigger-rumble"}} effect is a + fixed-duration, constant-intensity vibration effect intended for an + actuator of this type. {{GamepadHapticEffectType/"trigger-rumble"}} + effects are defined by {{GamepadEffectParameters/startDelay}}, + {{GamepadEffectParameters/duration}}, + {{GamepadEffectParameters/strongMagnitude}}, + {{GamepadEffectParameters/weakMagnitude}}, + {{GamepadEffectParameters/leftTrigger}}, and + {{GamepadEffectParameters/rightTrigger}}, none of which are + required because they default to 0. +
++ {{GamepadEffectParameters/startDelay}}, + {{GamepadEffectParameters/duration}}, + {{GamepadEffectParameters/strongMagnitude}}, + {{GamepadEffectParameters/weakMagnitude}} share the same definition + with {{GamepadHapticEffectType/"dual-rumble"}}. + {{GamepadEffectParameters/leftTrigger}} and + {{GamepadEffectParameters/rightTrigger}}, respectively, set the + intensity levels for the left and right bottom front buttons + vibrations, normalized to the range `[0,1]`, defaulting to 0. +
++ Given {{GamepadEffectParameters}} |params:GamepadEffectParameters|, + a valid trigger-rumble effect must have a [=valid + effect|valid=] {{GamepadEffectParameters/duration}}, a [=valid + effect|valid=] {{GamepadEffectParameters/startDelay}}, and the + {{GamepadEffectParameters/strongMagnitude}}, + {{GamepadEffectParameters/weakMagnitude}}, + {{GamepadEffectParameters/leftTrigger}}, and + {{GamepadEffectParameters/rightTrigger}} must be in the range + `[0,1]`. +
+- To mitigate unwanted long-running effects, the [=user agent=] MAY - limit the total effect duration for a [=valid effect=] to some - maximum duration. It is RECOMMENDED that the [=user agent=] use a - maximum of 5 seconds. + To mitigate unwanted long-running effects, the [=user agent=] MAY limit + the total effect duration for a [=valid effect=] to some maximum + duration. It is RECOMMENDED that the [=user agent=] use a maximum of 5 + seconds.
dictionary GamepadEffectParameters { @@ -1503,6 +1562,8 @@unsigned long long startDelay = 0; double strongMagnitude = 0.0; double weakMagnitude = 0.0; + double leftTrigger = 0.0; + double rightTrigger = 0.0; };
If an axis or button input represents a [=Standard Gamepad=] axis or - button, then its canonical index is the index of the - corresponding [=Standard Gamepad=] axis or button. + button, then its canonical index + is the index of the corresponding [=Standard Gamepad=] axis or button.