|
2 | 2 | Animations
|
3 | 3 | ==========
|
4 | 4 |
|
5 |
| -Odoo uses eye-catching animations that can bring your website to life. By default, we can use two |
| 5 | +Odoo uses eye-catching animations that can bring your website to life. By default, we can use three |
6 | 6 | kinds of animations:
|
7 | 7 |
|
8 | 8 | - Animations on appearance
|
9 | 9 | - Animations on scroll
|
| 10 | +- Animations on hover |
10 | 11 |
|
11 | 12 | .. _website_themes/animations/appearance:
|
12 | 13 |
|
@@ -78,9 +79,87 @@ Additionally, we can also set an `in` or `out` effect, an animation `direction`
|
78 | 79 | <p>Write one or two paragraphs describing your product or services.</p>
|
79 | 80 | </div>
|
80 | 81 |
|
| 82 | +.. list-table:: |
| 83 | + :header-rows: 1 |
| 84 | + :stub-columns: 1 |
| 85 | + :widths: 30 50 50 |
| 86 | + |
| 87 | + * - Option |
| 88 | + - Data attribute |
| 89 | + - Value type |
| 90 | + * - Intensity |
| 91 | + - `--wanim-intensity` |
| 92 | + - Integer (in the CSS) |
| 93 | + * - Scroll Zone Start |
| 94 | + - `data-scroll-zone-start` |
| 95 | + - Integer |
| 96 | + * - Scroll Zone End |
| 97 | + - `data-scroll-zone-end` |
| 98 | + - Integer |
| 99 | + |
81 | 100 | .. image:: animations/scroll.png
|
82 | 101 | :alt: Animation on scroll options
|
83 | 102 |
|
84 | 103 | .. seealso::
|
85 | 104 | `Website Animate
|
86 | 105 | <https://github.com/odoo/odoo/blob/34c0c9c1ae00aba391932129d4cefd027a9c6bbd/addons/website/static/src/scss/website.scss#L1638>`_
|
| 106 | + |
| 107 | +.. _website_themes/animations/hover: |
| 108 | + |
| 109 | +On hover |
| 110 | +======== |
| 111 | + |
| 112 | +This third kind of animations is only related to images and triggered every time we hover on the |
| 113 | +animated image. |
| 114 | + |
| 115 | +We can add 6 animation on hover effects: |
| 116 | + |
| 117 | +- Overlay |
| 118 | +- Zoom In |
| 119 | +- Zoom Out |
| 120 | +- Dolly Zoom |
| 121 | +- Outline |
| 122 | +- Mirror Blur |
| 123 | + |
| 124 | +**Use** |
| 125 | + |
| 126 | +Enable animations on hover by adding the `o_animate_on_hover` class on your image tag. You can |
| 127 | +also define the type of animation in the `data-hover-effect` attribute. |
| 128 | + |
| 129 | +.. code-block:: xml |
| 130 | +
|
| 131 | + <img |
| 132 | + src="..." alt="..." |
| 133 | + class="img img-fluid o_we_custom_image o_animate_on_hover" |
| 134 | + data-hover-effect="overlay" |
| 135 | + data-hover-effect-color="rgba(0, 0, 0, 0.25)" |
| 136 | + /> |
| 137 | +
|
| 138 | +.. list-table:: |
| 139 | + :header-rows: 1 |
| 140 | + :stub-columns: 1 |
| 141 | + :widths: 30 50 50 |
| 142 | + |
| 143 | + * - Option |
| 144 | + - Data attribute |
| 145 | + - Value type |
| 146 | + * - Animation |
| 147 | + - `data-hover-effect` |
| 148 | + - String |
| 149 | + * - Intensity |
| 150 | + - `data-hover-effect-intensity` |
| 151 | + - Integer |
| 152 | + * - Overlay / Stroke color |
| 153 | + - `data-hover-effect-color` |
| 154 | + - Hexadecimal or RGBA value |
| 155 | + * - Stroke width |
| 156 | + - `data-hover-stroke-width` |
| 157 | + - Integer (saved as `px`) |
| 158 | + |
| 159 | +.. image:: animations/hover.png |
| 160 | + :width: 300 |
| 161 | + :alt: Animation on hover options |
| 162 | + |
| 163 | +.. seealso:: |
| 164 | + `Hover effect options |
| 165 | + <https://github.com/odoo/odoo/blob/f43fbf67c98236434429e26d9d93de71ddb06790/addons/website/views/snippets/snippets.xml#L405>`_ |
0 commit comments