From 7552219a2b9c5a049cee4aa2a5f5bc6e97f6e30e Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Tue, 1 Feb 2022 22:49:44 +0900 Subject: CSS モーションパスのプロパティの記事を移行 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- files/ja/web/css/offset-distance/index.html | 101 --------------- files/ja/web/css/offset-distance/index.md | 101 +++++++++++++++ files/ja/web/css/offset-path/index.html | 188 ---------------------------- files/ja/web/css/offset-path/index.md | 188 ++++++++++++++++++++++++++++ files/ja/web/css/offset-position/index.html | 111 ---------------- files/ja/web/css/offset-position/index.md | 111 ++++++++++++++++ files/ja/web/css/offset-rotate/index.html | 126 ------------------- files/ja/web/css/offset-rotate/index.md | 126 +++++++++++++++++++ files/ja/web/css/offset/index.html | 120 ------------------ files/ja/web/css/offset/index.md | 120 ++++++++++++++++++ 10 files changed, 646 insertions(+), 646 deletions(-) delete mode 100644 files/ja/web/css/offset-distance/index.html create mode 100644 files/ja/web/css/offset-distance/index.md delete mode 100644 files/ja/web/css/offset-path/index.html create mode 100644 files/ja/web/css/offset-path/index.md delete mode 100644 files/ja/web/css/offset-position/index.html create mode 100644 files/ja/web/css/offset-position/index.md delete mode 100644 files/ja/web/css/offset-rotate/index.html create mode 100644 files/ja/web/css/offset-rotate/index.md delete mode 100644 files/ja/web/css/offset/index.html create mode 100644 files/ja/web/css/offset/index.md (limited to 'files/ja/web/css') diff --git a/files/ja/web/css/offset-distance/index.html b/files/ja/web/css/offset-distance/index.html deleted file mode 100644 index d2493d811a..0000000000 --- a/files/ja/web/css/offset-distance/index.html +++ /dev/null @@ -1,101 +0,0 @@ ---- -title: offset-distance -slug: Web/CSS/offset-distance -tags: - - CSS - - CSS Motion Path - - CSS Property - - CSS プロパティ - - CSS モーションパス - - Experimental - - Motion Path - - Reference - - motion-offset - - offset-distance - - 'recipe:css-property' - - モーションパス -translation_of: Web/CSS/offset-distance ---- -
{{CSSRef}}
- -

offset-distance は CSS プロパティで、 {{CSSxRef("offset-path")}} 上の要素を配置する位置を指定します。

- -
{{EmbedInteractiveExample("pages/css/offset-distance.html")}}
- -

構文

- -
/* 既定値 */
-offset-distance: 0;
-
-/* offset-path の途中 */
-offset-distance: 50%;
-
-/* パス上の固定距離の位置 */
-offset-distance: 40px;
- -
-
{{cssxref('<length-percentage>')}}
-
要素が ({{cssxref('offset-path')}} で定義された) パス上のどのくらいの距離にあるかを指定する長さです。
-
100% はパスの全長を表します。 (offset-path が基本シェイプまたは path() として定義されている場合)。
-
- -

形式文法

- -{{CSSSyntax}} - -

- -

CSS モーションパスのモーションアスペクトは、一般に offset-distance プロパティのアニメーションから来ています。要素をパス全体の上でアニメーションさせたい場合は、その {{cssxref('offset-path')}} を定義し、 offset-distance0% から 100% までを取るアニメーションを設定してください。

- -

HTML

- -
<div id="motion-demo"></div>
-
- -

CSS

- -
#motion-demo {
-  offset-path: path('M20,20 C20,100 200,0 200,100');
-  animation: move 3000ms infinite alternate ease-in-out;
-  width: 40px;
-  height: 40px;
-  background: cyan;
-}
-
-@keyframes move {
-  0% {
-    offset-distance: 0%;
-  }
-  100% {
-    offset-distance: 100%;
-  }
-}
- -

結果

- -

{{EmbedLiveSample('Examples', '100%', 150)}}

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('Motion Path Level 1', '#offset-distance-property', 'offset-distance')}}{{Spec2('Motion Path Level 1')}}初回定義
- -

{{CSSInfo}}

- -

ブラウザーの互換性

- -

{{Compat("css.properties.offset-distance")}}

diff --git a/files/ja/web/css/offset-distance/index.md b/files/ja/web/css/offset-distance/index.md new file mode 100644 index 0000000000..d2493d811a --- /dev/null +++ b/files/ja/web/css/offset-distance/index.md @@ -0,0 +1,101 @@ +--- +title: offset-distance +slug: Web/CSS/offset-distance +tags: + - CSS + - CSS Motion Path + - CSS Property + - CSS プロパティ + - CSS モーションパス + - Experimental + - Motion Path + - Reference + - motion-offset + - offset-distance + - 'recipe:css-property' + - モーションパス +translation_of: Web/CSS/offset-distance +--- +
{{CSSRef}}
+ +

offset-distance は CSS プロパティで、 {{CSSxRef("offset-path")}} 上の要素を配置する位置を指定します。

+ +
{{EmbedInteractiveExample("pages/css/offset-distance.html")}}
+ +

構文

+ +
/* 既定値 */
+offset-distance: 0;
+
+/* offset-path の途中 */
+offset-distance: 50%;
+
+/* パス上の固定距離の位置 */
+offset-distance: 40px;
+ +
+
{{cssxref('<length-percentage>')}}
+
要素が ({{cssxref('offset-path')}} で定義された) パス上のどのくらいの距離にあるかを指定する長さです。
+
100% はパスの全長を表します。 (offset-path が基本シェイプまたは path() として定義されている場合)。
+
+ +

形式文法

+ +{{CSSSyntax}} + +

+ +

CSS モーションパスのモーションアスペクトは、一般に offset-distance プロパティのアニメーションから来ています。要素をパス全体の上でアニメーションさせたい場合は、その {{cssxref('offset-path')}} を定義し、 offset-distance0% から 100% までを取るアニメーションを設定してください。

+ +

HTML

+ +
<div id="motion-demo"></div>
+
+ +

CSS

+ +
#motion-demo {
+  offset-path: path('M20,20 C20,100 200,0 200,100');
+  animation: move 3000ms infinite alternate ease-in-out;
+  width: 40px;
+  height: 40px;
+  background: cyan;
+}
+
+@keyframes move {
+  0% {
+    offset-distance: 0%;
+  }
+  100% {
+    offset-distance: 100%;
+  }
+}
+ +

結果

+ +

{{EmbedLiveSample('Examples', '100%', 150)}}

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Motion Path Level 1', '#offset-distance-property', 'offset-distance')}}{{Spec2('Motion Path Level 1')}}初回定義
+ +

{{CSSInfo}}

+ +

ブラウザーの互換性

+ +

{{Compat("css.properties.offset-distance")}}

diff --git a/files/ja/web/css/offset-path/index.html b/files/ja/web/css/offset-path/index.html deleted file mode 100644 index c71d2ff8b7..0000000000 --- a/files/ja/web/css/offset-path/index.html +++ /dev/null @@ -1,188 +0,0 @@ ---- -title: offset-path -slug: Web/CSS/offset-path -tags: - - CSS - - CSS Motion Path - - CSS モーションパス - - Experimental - - Motion Path - - Reference - - motion-path - - offset-path - - 'recipe:css-property' - - モーションパス -translation_of: Web/CSS/offset-path ---- -
{{cssref}}
- -

offset-pathCSS のプロパティで、要素がたどる移動経路と、親コンテナーまたは SVG 座標系の中での要素の配置を指定します。

- -
{{EmbedInteractiveExample("pages/css/offset-path.html")}}
- -

構文

- -
/* 既定値 */
-offset-path: none;
-
-/* 関数値 */
-offset-path: ray(45deg closest-side contain);
-
-/* URL */
-offset-path: url(#path);
-
-/* 図形 */
-offset-path: circle(50% at 25% 25%);
-offset-path: inset(50% 50% 50% 50%);
-offset-path: polygon(30% 0%, 70% 0%, 100% 50%, 30% 100%, 0% 70%, 0% 30%);
-offset-path: path('M 0,200 Q 200,200 260,80 Q 290,20 400,0 Q 300,100 400,200');
-
-/* 位置ボックス */
-offset-path: margin-box;
-offset-path: stroke-box;
-
-/* グローバル値 */
-offset-path: inherit;
-offset-path: initial;
-offset-path: unset;
-
- -

- -
-
ray()
-
最大3つの値を取り、ボックスの位置から始まり、指定された角度で定義された方向に進む線分であるパスを定義します。定義は角度で、 CSS のグラデーションの角度と同様に、 0deg を上にして正の角度を時計回り方向に増加させます。続く寸法の値は CSS の半径方向のグラデーションの寸法の値に似ており、 closest-side から farthest-corner まで、そしてキーワード contain です。
-
url()
-
SVG 図形の ID の参照です。 -- circle, ellipse, line, path, polygon, polyline, rect -- のいずれかで、図形の形状をパスとして使用します。
-
<basic-shape>
-
CSS シェイプ、たとえば circle(), ellipse(), inset(), polygon(), path() を指定します。
-
-
-
path()
-
SVG 座標の構文で定義されたパス文字列です。
-
-
-
none
-
モーションパスを全く定義しません。
-
- -

形式文法

- -{{csssyntax}} - -

解説

- -

このプロパティは、移動する要素がたどることができる経路を定義します。オフセットの経路は1つまたは複数のサブ経路で指定された経路か、スタイル付けされていない基本図形の形状で指定します。オフセット経路上の要素の正確な位置は、 {{cssxref("offset-distance")}} プロパティで決定されます。それぞれの図形または経路は、初期位置を {{cssxref("offset-distance")}} の 0 の計算値で定義し、オブジェクトの回転方向を指定する初期方向を初期位置にします。

- -

: 仕様書の初期の版では、このプロパティを motion-path と呼んでいました。It was changed to offset-path because the property describe static positions, not motion.

- -

- -

以下の例は CodePen の例から抜粋しています。対応ブラウザーではライブ編集が可能です。

- -

CSS コードサンプルの offset-path プロパティは、 SVG の <path> 要素と同じモーションパスを定義しています。このパスは、 SVG コードのレンダリングを見てもわかるように、煙突のある家の線画になっています。

- -

CSS

- -
.scissorHalf {
-  offset-path: path('M900,190  L993,245 V201  A11,11 0 0,1 1004,190  H1075  A11,11 0 0,1 1086,201  V300  L1294,423 H1216  A11,11 0 0,0 1205,434  V789  A11,11 0 0,1 1194,800  H606  A11,11 0 0,1 595,789  V434  A11,11 0 0,0 584,423  H506 L900,190');
-  animation: followpath 4s linear infinite;
-}
-
-@keyframes followpath {
-   to {
-     motion-offset: 100%;
-     offset-distance: 100%;
-   }
-}
- -

SVG

- -

ハサミの上半分と下半分は、 offset-path で定義されたモーションパスの始点に沿って配置されていなければ、キャンバスの左上に表示されます。

- -
<svg xmlns="http://www.w3.org/2000/svg"
-     width="700"
-     height="450"
-     viewBox="350 0 1400 900">
-  <title>House and Scissors</title>
-  <rect x="595"
-        y="423"
-        width="610"
-        height="377"
-        fill="blue" />
-  <polygon points="506,423 900,190 1294,423"
-           fill="yellow" />
-  <polygon points="993,245 993,190 1086,190 1086,300"
-           fill="red" />
-  <path id="house" d="M900,190 L993,245 V201 A11,11 0 0,1 1004,190 H1075 A11,11 0 0,1 1086,201 V300 L1294,423 H1216 A11,11 0 0,0 1205,434 V789 A11,11 0 0,1 1194,800 H606 A11,11 0 0,1 595,789 V434 A11,11 0 0,0 584,423 H506 L900,190"
-        fill="none"
-        stroke="black"
-        stroke-width="13"
-        stroke-linejoin="round"
-        stroke-linecap="round" />
-  <path id="firstScissorHalf" class="scissorHalf"
-        d="M30,0 H-10 A10,10 0 0,0 -20,10 A20,20 0 1,1 -40,-10 H20 A10,10 0 0,1 30,0 M-40,20 A10,10 1 0,0 -40,0 A10,10 1 0,0 -40,20 M0,0"
-        transform="translate(0,0)"
-        fill="green"
-        stroke="black"
-        stroke-width="5"
-        stroke-linejoin="round"
-        stroke-linecap="round"
-        fill-rule="evenodd" />
-  <path id="secondScissorHalf" class="scissorHalf"
-        d="M30,0 H-10 A10,10 0 0,1 -20,-10 A20,20 0 1,0 -40,10 H20 A10,10 0 0,0 30,0 M-40,-20 A10,10 1 0,0 -40,0 A10,10 1 0,0 -40,-20 M0,0"
-        transform="translate(0,0)"
-        fill="forestgreen"
-        stroke="black"
-        stroke-width="5"
-        stroke-linejoin="round"
-        stroke-linecap="round"
-        fill-rule="evenodd" />
-</svg>
- -

ライブ結果

- -

{{EmbedLiveSample('Examples', '100%', '450')}}

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('Motion Path Level 1', '#offset-path-property', 'offset-path')}}{{Spec2('Motion Path Level 1')}}初回定義
- -

{{cssinfo}}

- -

ブラウザーの互換性

- -

{{Compat("css.properties.offset-path")}}

- -

関連情報

- - - -

その他のデモ:

- - diff --git a/files/ja/web/css/offset-path/index.md b/files/ja/web/css/offset-path/index.md new file mode 100644 index 0000000000..c71d2ff8b7 --- /dev/null +++ b/files/ja/web/css/offset-path/index.md @@ -0,0 +1,188 @@ +--- +title: offset-path +slug: Web/CSS/offset-path +tags: + - CSS + - CSS Motion Path + - CSS モーションパス + - Experimental + - Motion Path + - Reference + - motion-path + - offset-path + - 'recipe:css-property' + - モーションパス +translation_of: Web/CSS/offset-path +--- +
{{cssref}}
+ +

offset-pathCSS のプロパティで、要素がたどる移動経路と、親コンテナーまたは SVG 座標系の中での要素の配置を指定します。

+ +
{{EmbedInteractiveExample("pages/css/offset-path.html")}}
+ +

構文

+ +
/* 既定値 */
+offset-path: none;
+
+/* 関数値 */
+offset-path: ray(45deg closest-side contain);
+
+/* URL */
+offset-path: url(#path);
+
+/* 図形 */
+offset-path: circle(50% at 25% 25%);
+offset-path: inset(50% 50% 50% 50%);
+offset-path: polygon(30% 0%, 70% 0%, 100% 50%, 30% 100%, 0% 70%, 0% 30%);
+offset-path: path('M 0,200 Q 200,200 260,80 Q 290,20 400,0 Q 300,100 400,200');
+
+/* 位置ボックス */
+offset-path: margin-box;
+offset-path: stroke-box;
+
+/* グローバル値 */
+offset-path: inherit;
+offset-path: initial;
+offset-path: unset;
+
+ +

+ +
+
ray()
+
最大3つの値を取り、ボックスの位置から始まり、指定された角度で定義された方向に進む線分であるパスを定義します。定義は角度で、 CSS のグラデーションの角度と同様に、 0deg を上にして正の角度を時計回り方向に増加させます。続く寸法の値は CSS の半径方向のグラデーションの寸法の値に似ており、 closest-side から farthest-corner まで、そしてキーワード contain です。
+
url()
+
SVG 図形の ID の参照です。 -- circle, ellipse, line, path, polygon, polyline, rect -- のいずれかで、図形の形状をパスとして使用します。
+
<basic-shape>
+
CSS シェイプ、たとえば circle(), ellipse(), inset(), polygon(), path() を指定します。
+
+
+
path()
+
SVG 座標の構文で定義されたパス文字列です。
+
+
+
none
+
モーションパスを全く定義しません。
+
+ +

形式文法

+ +{{csssyntax}} + +

解説

+ +

このプロパティは、移動する要素がたどることができる経路を定義します。オフセットの経路は1つまたは複数のサブ経路で指定された経路か、スタイル付けされていない基本図形の形状で指定します。オフセット経路上の要素の正確な位置は、 {{cssxref("offset-distance")}} プロパティで決定されます。それぞれの図形または経路は、初期位置を {{cssxref("offset-distance")}} の 0 の計算値で定義し、オブジェクトの回転方向を指定する初期方向を初期位置にします。

+ +

: 仕様書の初期の版では、このプロパティを motion-path と呼んでいました。It was changed to offset-path because the property describe static positions, not motion.

+ +

+ +

以下の例は CodePen の例から抜粋しています。対応ブラウザーではライブ編集が可能です。

+ +

CSS コードサンプルの offset-path プロパティは、 SVG の <path> 要素と同じモーションパスを定義しています。このパスは、 SVG コードのレンダリングを見てもわかるように、煙突のある家の線画になっています。

+ +

CSS

+ +
.scissorHalf {
+  offset-path: path('M900,190  L993,245 V201  A11,11 0 0,1 1004,190  H1075  A11,11 0 0,1 1086,201  V300  L1294,423 H1216  A11,11 0 0,0 1205,434  V789  A11,11 0 0,1 1194,800  H606  A11,11 0 0,1 595,789  V434  A11,11 0 0,0 584,423  H506 L900,190');
+  animation: followpath 4s linear infinite;
+}
+
+@keyframes followpath {
+   to {
+     motion-offset: 100%;
+     offset-distance: 100%;
+   }
+}
+ +

SVG

+ +

ハサミの上半分と下半分は、 offset-path で定義されたモーションパスの始点に沿って配置されていなければ、キャンバスの左上に表示されます。

+ +
<svg xmlns="http://www.w3.org/2000/svg"
+     width="700"
+     height="450"
+     viewBox="350 0 1400 900">
+  <title>House and Scissors</title>
+  <rect x="595"
+        y="423"
+        width="610"
+        height="377"
+        fill="blue" />
+  <polygon points="506,423 900,190 1294,423"
+           fill="yellow" />
+  <polygon points="993,245 993,190 1086,190 1086,300"
+           fill="red" />
+  <path id="house" d="M900,190 L993,245 V201 A11,11 0 0,1 1004,190 H1075 A11,11 0 0,1 1086,201 V300 L1294,423 H1216 A11,11 0 0,0 1205,434 V789 A11,11 0 0,1 1194,800 H606 A11,11 0 0,1 595,789 V434 A11,11 0 0,0 584,423 H506 L900,190"
+        fill="none"
+        stroke="black"
+        stroke-width="13"
+        stroke-linejoin="round"
+        stroke-linecap="round" />
+  <path id="firstScissorHalf" class="scissorHalf"
+        d="M30,0 H-10 A10,10 0 0,0 -20,10 A20,20 0 1,1 -40,-10 H20 A10,10 0 0,1 30,0 M-40,20 A10,10 1 0,0 -40,0 A10,10 1 0,0 -40,20 M0,0"
+        transform="translate(0,0)"
+        fill="green"
+        stroke="black"
+        stroke-width="5"
+        stroke-linejoin="round"
+        stroke-linecap="round"
+        fill-rule="evenodd" />
+  <path id="secondScissorHalf" class="scissorHalf"
+        d="M30,0 H-10 A10,10 0 0,1 -20,-10 A20,20 0 1,0 -40,10 H20 A10,10 0 0,0 30,0 M-40,-20 A10,10 1 0,0 -40,0 A10,10 1 0,0 -40,-20 M0,0"
+        transform="translate(0,0)"
+        fill="forestgreen"
+        stroke="black"
+        stroke-width="5"
+        stroke-linejoin="round"
+        stroke-linecap="round"
+        fill-rule="evenodd" />
+</svg>
+ +

ライブ結果

+ +

{{EmbedLiveSample('Examples', '100%', '450')}}

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Motion Path Level 1', '#offset-path-property', 'offset-path')}}{{Spec2('Motion Path Level 1')}}初回定義
+ +

{{cssinfo}}

+ +

ブラウザーの互換性

+ +

{{Compat("css.properties.offset-path")}}

+ +

関連情報

+ + + +

その他のデモ:

+ + diff --git a/files/ja/web/css/offset-position/index.html b/files/ja/web/css/offset-position/index.html deleted file mode 100644 index 7c63dde0e9..0000000000 --- a/files/ja/web/css/offset-position/index.html +++ /dev/null @@ -1,111 +0,0 @@ ---- -title: offset-position -slug: Web/CSS/offset-position -tags: - - CSS - - CSS Motion Path - - CSS Property - - Experimental - - Property - - offset-position - - 'recipe:css-property' -translation_of: Web/CSS/offset-position ---- -
{{CSSRef}}{{seecompattable}}
- -

offset-position は CSS のプロパティで、 {{cssxref("offset-path")}} の初期位置を定義します。

- -

構文

- -
/* キーワード値 */
-offset-position: auto;
-offset-position: top;
-offset-position: bottom;
-offset-position: left;
-offset-position: right;
-offset-position: center;
-
-/* <percentage> 値 */
-offset-position: 25% 75%;
-
-/* <length> 値 */
-offset-position: 0 0;
-offset-position: 1cm 2cm;
-offset-position: 10ch 8em;
-
-/* 辺とオフセット値 */
-offset-position: bottom 10px right 20px;
-offset-position: right 3em bottom 10px;
-offset-position: bottom 10px right;
-offset-position: top right 10px;
-
-/* グローバル値 */
-offset-position: inherit;
-offset-position: initial;
-offset-position: unset;
-
- -

- -
-
auto
-
初期位置は {{cssxref("position")}} プロパティで指定されたボックスの位置です。
-
<position>
-
{{cssxref("<position>")}} です。位置は x/y 座標を定義し、要素のボックスの辺から相対的にアイテムを配置します。1つから4つの値を使って定義することができます。キーワード以外の値を2つ指定した場合、1つ目の値は水平方向の位置を、2つ目の値は垂直方向の位置を表します。1つの値のみを指定した場合は、2番目の値は center とみなされます。3 つまたは 4 つの値が使用される場合、長さとパーセントの値は、前のキーワード値からのオフセットとなります。これらの値タイプの詳細については、 {{cssxref("background-position")}} を参照してください。
-
- -

公式定義

- -

{{cssinfo}}

- -

形式文法

- -{{csssyntax}} - -

- -

初期オフセット位置の設定

- -
<div id="motion-demo"></div>
-
- -
#motion-demo {
-  offset-path: path('M20,20 C20,100 200,0 200,100');
-  offset-position: left top;
-  animation: move 3000ms infinite alternate ease-in-out;
-  width: 40px;
-  height: 40px;
-  background: cyan;
-}
-
-@keyframes move {
-  0% {
-    offset-distance: 0%;
-  }
-  100% {
-    offset-distance: 100%;
-  }
-}
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('Motion Path Level 1', '#offset-position-property', 'offset-position')}}{{Spec2('Motion Path Level 1')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("css.properties.offset-position")}}

diff --git a/files/ja/web/css/offset-position/index.md b/files/ja/web/css/offset-position/index.md new file mode 100644 index 0000000000..7c63dde0e9 --- /dev/null +++ b/files/ja/web/css/offset-position/index.md @@ -0,0 +1,111 @@ +--- +title: offset-position +slug: Web/CSS/offset-position +tags: + - CSS + - CSS Motion Path + - CSS Property + - Experimental + - Property + - offset-position + - 'recipe:css-property' +translation_of: Web/CSS/offset-position +--- +
{{CSSRef}}{{seecompattable}}
+ +

offset-position は CSS のプロパティで、 {{cssxref("offset-path")}} の初期位置を定義します。

+ +

構文

+ +
/* キーワード値 */
+offset-position: auto;
+offset-position: top;
+offset-position: bottom;
+offset-position: left;
+offset-position: right;
+offset-position: center;
+
+/* <percentage> 値 */
+offset-position: 25% 75%;
+
+/* <length> 値 */
+offset-position: 0 0;
+offset-position: 1cm 2cm;
+offset-position: 10ch 8em;
+
+/* 辺とオフセット値 */
+offset-position: bottom 10px right 20px;
+offset-position: right 3em bottom 10px;
+offset-position: bottom 10px right;
+offset-position: top right 10px;
+
+/* グローバル値 */
+offset-position: inherit;
+offset-position: initial;
+offset-position: unset;
+
+ +

+ +
+
auto
+
初期位置は {{cssxref("position")}} プロパティで指定されたボックスの位置です。
+
<position>
+
{{cssxref("<position>")}} です。位置は x/y 座標を定義し、要素のボックスの辺から相対的にアイテムを配置します。1つから4つの値を使って定義することができます。キーワード以外の値を2つ指定した場合、1つ目の値は水平方向の位置を、2つ目の値は垂直方向の位置を表します。1つの値のみを指定した場合は、2番目の値は center とみなされます。3 つまたは 4 つの値が使用される場合、長さとパーセントの値は、前のキーワード値からのオフセットとなります。これらの値タイプの詳細については、 {{cssxref("background-position")}} を参照してください。
+
+ +

公式定義

+ +

{{cssinfo}}

+ +

形式文法

+ +{{csssyntax}} + +

+ +

初期オフセット位置の設定

+ +
<div id="motion-demo"></div>
+
+ +
#motion-demo {
+  offset-path: path('M20,20 C20,100 200,0 200,100');
+  offset-position: left top;
+  animation: move 3000ms infinite alternate ease-in-out;
+  width: 40px;
+  height: 40px;
+  background: cyan;
+}
+
+@keyframes move {
+  0% {
+    offset-distance: 0%;
+  }
+  100% {
+    offset-distance: 100%;
+  }
+}
+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Motion Path Level 1', '#offset-position-property', 'offset-position')}}{{Spec2('Motion Path Level 1')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("css.properties.offset-position")}}

diff --git a/files/ja/web/css/offset-rotate/index.html b/files/ja/web/css/offset-rotate/index.html deleted file mode 100644 index dc424f3a88..0000000000 --- a/files/ja/web/css/offset-rotate/index.html +++ /dev/null @@ -1,126 +0,0 @@ ---- -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 ---- -
{{CSSRef}}
- -

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

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

: 初期のころの仕様書では、このプロパティを motion-rotation と呼んでいました。

-
- -

構文

- -
/* パスの方向に従い、任意で角度を追加 */
-offset-rotate: auto;
-offset-rotate: auto 45deg;
-
-/* パスの方向に従うが、 auto とは逆の方向を向く */
-offset-rotate: reverse;
-
-/* パスの位置に関係なく、決められた回転を維持する */
-offset-rotate: 90deg;
-offset-rotate: .5turn;
- -
-
auto
-
-

要素は正方向の X 軸から見た {{cssxref("offset-path")}} 方向の角度で回転します。これが既定値です。

-
-
{{cssxref("<angle>")}}
-
-

要素は指定された回転角によって、時計方向に固定値で回転変換されます。

-
-
auto <angle>
-
-

auto に {{cssxref("<angle>")}} が続いた場合、その角度autoの計算値に加算されます。

-
-
reverse
-
-

要素は auto と同様に回転しますが、反対方向を向きます。 auto 180deg の値を指定したのと同等です。

-
-
-
- -

形式文法

- -{{csssyntax}} - -

- -

HTML

- -
<div></div>
-<div></div>
-<div></div>
- -

CSS

- -
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%;
-  }
-}
- -

結果

- -

{{EmbedLiveSample('Examples', '100%', '200')}}

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('Motion Path Level 1', '#offset-rotate-property', 'offset-rotate')}}{{Spec2('Motion Path Level 1')}}初回定義
- -

{{cssinfo}}

- -

ブラウザーの互換性

- -

{{Compat("css.properties.offset-rotate")}}

diff --git a/files/ja/web/css/offset-rotate/index.md b/files/ja/web/css/offset-rotate/index.md new file mode 100644 index 0000000000..dc424f3a88 --- /dev/null +++ b/files/ja/web/css/offset-rotate/index.md @@ -0,0 +1,126 @@ +--- +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 +--- +
{{CSSRef}}
+ +

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

+ +
{{EmbedInteractiveExample("pages/css/offset-rotate.html")}}
+ +
+

: 初期のころの仕様書では、このプロパティを motion-rotation と呼んでいました。

+
+ +

構文

+ +
/* パスの方向に従い、任意で角度を追加 */
+offset-rotate: auto;
+offset-rotate: auto 45deg;
+
+/* パスの方向に従うが、 auto とは逆の方向を向く */
+offset-rotate: reverse;
+
+/* パスの位置に関係なく、決められた回転を維持する */
+offset-rotate: 90deg;
+offset-rotate: .5turn;
+ +
+
auto
+
+

要素は正方向の X 軸から見た {{cssxref("offset-path")}} 方向の角度で回転します。これが既定値です。

+
+
{{cssxref("<angle>")}}
+
+

要素は指定された回転角によって、時計方向に固定値で回転変換されます。

+
+
auto <angle>
+
+

auto に {{cssxref("<angle>")}} が続いた場合、その角度autoの計算値に加算されます。

+
+
reverse
+
+

要素は auto と同様に回転しますが、反対方向を向きます。 auto 180deg の値を指定したのと同等です。

+
+
+
+ +

形式文法

+ +{{csssyntax}} + +

+ +

HTML

+ +
<div></div>
+<div></div>
+<div></div>
+ +

CSS

+ +
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%;
+  }
+}
+ +

結果

+ +

{{EmbedLiveSample('Examples', '100%', '200')}}

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Motion Path Level 1', '#offset-rotate-property', 'offset-rotate')}}{{Spec2('Motion Path Level 1')}}初回定義
+ +

{{cssinfo}}

+ +

ブラウザーの互換性

+ +

{{Compat("css.properties.offset-rotate")}}

diff --git a/files/ja/web/css/offset/index.html b/files/ja/web/css/offset/index.html deleted file mode 100644 index be1f419806..0000000000 --- a/files/ja/web/css/offset/index.html +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: offset -slug: Web/CSS/offset -tags: - - CSS - - CSS Motion Path - - CSS Property - - Experimental - - Reference - - 'recipe:css-shorthand-property' -translation_of: Web/CSS/offset ---- -

{{CSSRef}}

- -

offset は CSS の一括指定プロパティで、要素を定義された経路に沿って動かすのに必要なすべてのプロパティを設定します。

- -
-

: 仕様書の早期の版では、このプロパティを motion と呼んでいました。

-
- -

構成要素のプロパティ

- -

このプロパティは以下の CSS プロパティの一括指定です。

- - - -

構文

- -
/* オフセット位置 */
-offset: auto;
-offset: 10px 30px;
-offset: none;
-
-/* オフセット経路 */
-offset: ray(45deg closest-side);
-offset: path('M 100 100 L 300 100 L 200 300 z');
-offset: url(arc.svg);
-
-/* オフセット経路に距離と回転が加わったもの */
-offset: url(circle.svg) 100px;
-offset: url(circle.svg) 40%;
-offset: url(circle.svg) 30deg;
-offset: url(circle.svg) 50px 20deg;
-
-/* オフセットアンカーを含む */
-offset: ray(45deg closest-side) / 40px 20px;
-offset: url(arc.svg) 2cm / 0.5cm 3cm;
-offset: url(arc.svg) 30deg / 50px 100px;
-
- -

公式定義

- -

{{cssinfo}}

- -

形式文法

- -{{csssyntax}} - -

- -

経路に沿って要素を動かす

- -

HTML

- -
<div id="offsetElement"></div>
-
- -

CSS

- -
@keyframes move {
-  from {
-    offset-distance: 0%;
-  }
-
-  to {
-    offset-distance: 100%;
-  }
-}
-
-#offsetElement {
-  width: 50px;
-  height: 50px;
-  background-color: blue;
-  offset: path("M 100 100 L 300 100 L 200 300 z") auto;
-  animation: move 3s linear infinite;
-}
-
- -

結果

- -

{{EmbedLiveSample("Animating_an_element_along_a_path", 350, 350)}}

- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('Motion Path Level 1', '#offset-shorthand', 'offset')}}{{Spec2('Motion Path Level 1')}}初回定義
- -

ブラウザーの互換性

- -

{{Compat("css.properties.offset")}}

diff --git a/files/ja/web/css/offset/index.md b/files/ja/web/css/offset/index.md new file mode 100644 index 0000000000..be1f419806 --- /dev/null +++ b/files/ja/web/css/offset/index.md @@ -0,0 +1,120 @@ +--- +title: offset +slug: Web/CSS/offset +tags: + - CSS + - CSS Motion Path + - CSS Property + - Experimental + - Reference + - 'recipe:css-shorthand-property' +translation_of: Web/CSS/offset +--- +

{{CSSRef}}

+ +

offset は CSS の一括指定プロパティで、要素を定義された経路に沿って動かすのに必要なすべてのプロパティを設定します。

+ +
+

: 仕様書の早期の版では、このプロパティを motion と呼んでいました。

+
+ +

構成要素のプロパティ

+ +

このプロパティは以下の CSS プロパティの一括指定です。

+ + + +

構文

+ +
/* オフセット位置 */
+offset: auto;
+offset: 10px 30px;
+offset: none;
+
+/* オフセット経路 */
+offset: ray(45deg closest-side);
+offset: path('M 100 100 L 300 100 L 200 300 z');
+offset: url(arc.svg);
+
+/* オフセット経路に距離と回転が加わったもの */
+offset: url(circle.svg) 100px;
+offset: url(circle.svg) 40%;
+offset: url(circle.svg) 30deg;
+offset: url(circle.svg) 50px 20deg;
+
+/* オフセットアンカーを含む */
+offset: ray(45deg closest-side) / 40px 20px;
+offset: url(arc.svg) 2cm / 0.5cm 3cm;
+offset: url(arc.svg) 30deg / 50px 100px;
+
+ +

公式定義

+ +

{{cssinfo}}

+ +

形式文法

+ +{{csssyntax}} + +

+ +

経路に沿って要素を動かす

+ +

HTML

+ +
<div id="offsetElement"></div>
+
+ +

CSS

+ +
@keyframes move {
+  from {
+    offset-distance: 0%;
+  }
+
+  to {
+    offset-distance: 100%;
+  }
+}
+
+#offsetElement {
+  width: 50px;
+  height: 50px;
+  background-color: blue;
+  offset: path("M 100 100 L 300 100 L 200 300 z") auto;
+  animation: move 3s linear infinite;
+}
+
+ +

結果

+ +

{{EmbedLiveSample("Animating_an_element_along_a_path", 350, 350)}}

+ +

仕様書

+ + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('Motion Path Level 1', '#offset-shorthand', 'offset')}}{{Spec2('Motion Path Level 1')}}初回定義
+ +

ブラウザーの互換性

+ +

{{Compat("css.properties.offset")}}

-- cgit v1.2.3-54-g00ecf