From 0d495ad297d9e90ab35f54a822cd5e4e6a670713 Mon Sep 17 00:00:00 2001 From: MDN Date: Sun, 20 Jun 2021 00:37:04 +0000 Subject: [CRON] sync translated content --- files/ja/web/api/ambient_light_events/index.html | 69 ------------------------ files/ja/web/api/devicelightevent/index.html | 58 -------------------- 2 files changed, 127 deletions(-) delete mode 100644 files/ja/web/api/ambient_light_events/index.html delete mode 100644 files/ja/web/api/devicelightevent/index.html (limited to 'files/ja/web') diff --git a/files/ja/web/api/ambient_light_events/index.html b/files/ja/web/api/ambient_light_events/index.html deleted file mode 100644 index c39d45a614..0000000000 --- a/files/ja/web/api/ambient_light_events/index.html +++ /dev/null @@ -1,69 +0,0 @@ ---- -title: Ambient Light Events -slug: Web/API/Ambient_Light_Events -tags: - - Ambient Light -translation_of: Web/API/Ambient_Light_Events -original_slug: WebAPI/Using_Light_Events ---- -
{{DefaultAPISidebar("Ambient Light Events")}}{{SeeCompatTable}}
- -

ambient light event は、光の強さの変化をウェブページやアプリケーションに気づかせるのに便利な手段です。これによりユーザーインターフェイスのコントラストを変えたり写真を撮るために必要な露出時間を変えたりするなど、ウェブページやアプリケーションが光量の変化に対応できるようになります。

- -

Light Event

- -

端末の光センサーが光量の変化を検出すると、それをブラウザーに通知します。ブラウザーがその通知を受け取ると、正確な光の強度に関する情報を提供する {{domxref("DeviceLightEvent")}} イベントを発生させます。

- -

このイベントは {{domxref("EventTarget.addEventListener","addEventListener")}} メソッド (イベント名 {{event("devicelight")}} を使用) を使用するか、イベントハンドラーを {{domxref("window.ondevicelight")}} プロパティに接続することにより、 window オブジェクトレベルで取得できます。

- -

イベントを取得するとイベントオブジェクトの {{domxref("DeviceLightEvent.value")}} プロパティを通して、{{interwiki("wikipedia", "ルクス")}}で表した照度にアクセスできます。

- -

- -
if ('ondevicelight' in window) {
-  window.addEventListener('devicelight', function(event) {
-    var body = document.querySelector('body');
-    if (event.value < 50) {
-      body.classList.add('darklight');
-      body.classList.remove('brightlight');
-    } else {
-      body.classList.add('brightlight');
-      body.classList.remove('darklight');
-    }
-  });
-} else {
-  console.log('devicelight event not supported');
-}
-
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName("AmbientLight", "", "Ambient Light Events")}}{{Spec2("AmbientLight")}}初回定義
- -

ブラウザーの対応

- - - -

{{Compat("api.DeviceLightEvent")}}

- -

関連情報

- - diff --git a/files/ja/web/api/devicelightevent/index.html b/files/ja/web/api/devicelightevent/index.html deleted file mode 100644 index 58829fc7c3..0000000000 --- a/files/ja/web/api/devicelightevent/index.html +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: DeviceLightEvent -slug: Web/API/DeviceLightEvent -tags: - - API - - Ambient Light Events - - Experimental - - Interface -translation_of: Web/API/DeviceLightEvent ---- -
{{apiref("Ambient Light Events")}}{{SeeCompatTable}}
- -

DeviceLightEvent は、端末付近の環境光のレベルについての情報を、写真センサーやそれと類似した検知機を通してウェブ開発者に提供します。たとえば、このイベントは、エネルギーを節約したり、より良い視認性を提供したりするために、現在の環境光のレベルに応じて画面の明るさを調節するのに役立ちます。

- -

プロパティ

- -
-
{{domxref("DeviceLightEvent.value")}}
-
{{interwiki("wikipedia", "ルクス")}}で表した環境光のレベル
-
- -

- -
window.addEventListener('devicelight', function(event) {
-  console.log(event.value);
-});
- -

仕様書

- - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('AmbientLight', '', 'Ambient Light Events')}}{{Spec2('AmbientLight')}}初回定義
- -

ブラウザーの対応

- - - -

{{Compat("api.DeviceLightEvent")}}

- -

関連情報

- - -- cgit v1.2.3-54-g00ecf