From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/ja/web/css/offset-distance/index.html | 103 ++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 files/ja/web/css/offset-distance/index.html (limited to 'files/ja/web/css/offset-distance/index.html') diff --git a/files/ja/web/css/offset-distance/index.html b/files/ja/web/css/offset-distance/index.html new file mode 100644 index 0000000000..f0c4b4f7e0 --- /dev/null +++ b/files/ja/web/css/offset-distance/index.html @@ -0,0 +1,103 @@ +--- +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")}}

-- cgit v1.2.3-54-g00ecf