aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/css/offset-rotate/index.html
blob: 8b0742cf80ebae0b3f7091529bfd9cd5b458d73b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
---
title: offset-rotate
slug: Web/CSS/offset-rotate
tags:
  - CSS
  - CSS Motion Path
  - CSS Property
  - CSS プロパティ
  - CSS モーションパス
  - Experimental
  - Reference
  - offset-rotate
  - 'recipe:css-property'
translation_of: Web/CSS/offset-rotate
---
<div>{{CSSRef}}</div>

<p><strong><code>offset-rotate</code></strong> は CSS のプロパティで、要素が {{cssxref("offset-path")}} に沿って配置された場合の向き/方向を定義します。</p>

<div>{{EmbedInteractiveExample("pages/css/offset-rotate.html")}}</div>

<div class="blockIndicator note">
<p><strong></strong>: 初期のころの仕様書では、このプロパティを <code>motion-rotation</code> と呼んでいました。</p>
</div>

<h2 id="Syntax" name="Syntax">構文</h2>

<pre class="brush: css notranslate">/* パスの方向に従い、任意で角度を追加 */
offset-rotate: auto;
offset-rotate: auto 45deg;

/* パスの方向に従うが、 auto とは逆の方向を向く */
offset-rotate: reverse;

/* パスの位置に関係なく、決められた回転を維持する */
offset-rotate: 90deg;
offset-rotate: .5turn;</pre>

<dl>
 <dt><code><dfn>auto</dfn></code></dt>
 <dd>
 <p>要素は正方向の X 軸から見た {{cssxref("offset-path")}} 方向の角度で回転します。これが既定値です。</p>
 </dd>
 <dt><code>{{cssxref("&lt;angle&gt;")}}</code></dt>
 <dd>
 <p>要素は指定された回転角によって、時計方向に固定値で回転変換されます。</p>
 </dd>
 <dt><code><dfn>auto &lt;angle&gt;</dfn></code></dt>
 <dd>
 <p><code>auto</code>{{cssxref("&lt;angle&gt;")}} が続いた場合、<span class="production" id="ref-for-angle-value①③" title="Expands to: turn | rad | grad | deg">その角度</span><code>auto</code>の計算値に加算されます。</p>
 </dd>
 <dt><code><dfn>reverse</dfn></code></dt>
 <dd>
 <p>要素は <code>auto</code> と同様に回転しますが、反対方向を向きます。 <code>auto 180deg</code> の値を指定したのと同等です。</p>
 </dd>
 <dd></dd>
</dl>

<h3 id="Formal_syntax" name="Formal_syntax">形式文法</h3>

<pre class="syntaxbox notranslate">{{csssyntax}}</pre>

<h2 id="Examples" name="Examples"></h2>

<h3 id="HTML" name="HTML">HTML</h3>

<pre class="brush: html notranslate">&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;</pre>

<h3 id="CSS" name="CSS">CSS</h3>

<pre class="brush: css notranslate">div {
  width: 40px;
  height: 40px;
  background: #2BC4A2;
  margin: 20px;
  clip-path: polygon(0% 0%, 70% 0%, 100% 50%, 70% 100%, 0% 100%, 30% 50%);
  animation: move 5000ms infinite alternate ease-in-out;

  offset-path: path('M20,20 C20,50 180,-10 180,20');
}
div:nth-child(1) {
  offset-rotate: auto;
}
div:nth-child(2) {
  offset-rotate: auto 90deg;
}
div:nth-child(3) {
  offset-rotate: 30deg;
}

@keyframes move {
  100% {
    offset-distance: 100%;
  }
}</pre>

<h3 id="Result" name="Result">結果</h3>

<p>{{EmbedLiveSample('Examples', '100%', '200')}}</p>

<h2 id="Specifications" name="Specifications">仕様書</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">仕様書</th>
   <th scope="col">状態</th>
   <th scope="col">備考</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('Motion Path Level 1', '#offset-rotate-property', 'offset-rotate')}}</td>
   <td>{{Spec2('Motion Path Level 1')}}</td>
   <td>初回定義</td>
  </tr>
 </tbody>
</table>

<p>{{cssinfo}}</p>

<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2>

<div class="hidden">このページの互換性一覧表は構造化データから生成されています。データに協力していただけるのであれば、 <a class="external" href="https://github.com/mdn/browser-compat-data">https://github.com/mdn/browser-compat-data</a> をチェックアウトしてプルリクエストを送信してください。</div>

<p>{{Compat("css.properties.offset-rotate")}}</p>