summaryrefslogtreecommitdiff
path: root/frontend/app/views/tile/forms/tile.form.misc.js
blob: 68b659ccaaf34f74630524092a71f23a6d2b07cc (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
129
import React from 'react'

import {
  TextInput,
  Select, Checkbox, Slider,
} from 'app/common'

import { UNITS, NO_POPUP } from './tile.constants'

export default function TileMiscForm({ tile, parent, popupList }) {
  return (
    <div>
      <div className='row single'>
        <Select
          name='units'
          selected={tile.settings.units || 'px'}
          options={UNITS}
          title='Units'
          onChange={parent.handleSettingsSelect}
        />
      </div>
      {tile.settings.units === "video" && (
        <Checkbox
          label="Scale to video"
          name="scale_to_video"
          className='short'
          checked={tile.settings.scale_to_video}
          onChange={parent.handleSettingsSelect}
          autoComplete="off"
        />
      )}
      <Slider
        title='Opacity'
        name='opacity'
        value={tile.settings.opacity}
        onChange={parent.handleSettingsSelect}
        min={0.0}
        max={1.0}
        step={0.01}
      />
      <Slider
        title='Scale'
        name='scale'
        value={tile.settings.scale}
        onChange={parent.handleSettingsSelect}
        min={0.01}
        max={10.0}
        step={0.01}
      />
      <Slider
        title='Rotation'
        name='rotation'
        value={tile.settings.rotation}
        onChange={parent.handleSettingsSelect}
        min={-180.0}
        max={180.0}
        step={1}
        type='int'
      />
      <Checkbox
        label="Element is a Popup"
        name="is_popup"
        className='short'
        checked={tile.settings.is_popup}
        onChange={parent.handleSettingsSelect}
        autoComplete="off"
      />
      {tile.settings.is_popup && (
        <div className='row single_text'>
          <TextInput
            title="Popup group"
            name="popup_group"
            placeholder="Enter group name"
            data={tile.settings}
            onChange={parent.handleSettingsChange}
            autoComplete="off"
          />
        </div>
      )}
      <Checkbox
        label="Wait to appear"
        name="wait_to_appear"
        className='short'
        checked={tile.settings.wait_to_appear}
        onChange={parent.handleSettingsSelect}
        autoComplete="off"
      />
      {tile.settings.wait_to_appear && (
        <div className='row single_text'>
          <TextInput
            title="Appear after"
            name="appear_after"
            placeholder="0:00"
            data={tile.settings}
            onChange={parent.handleSettingsChange}
            autoComplete="off"
          />
        </div>
      )}
      <Checkbox
        label="Show popup on hover"
        name="show_popup_on_hover"
        className='short'
        checked={tile.settings.show_popup_on_hover}
        onChange={parent.handleSettingsSelect}
        autoComplete="off"
      />
      {tile.settings.show_popup_on_hover && (
        <div className='row single'>
          <Select
            title="Popup"
            name='on_hover_popup'
            selected={tile.settings.on_hover_popup || NO_POPUP}
            options={popupList}
            onChange={parent.handleSettingsSelect}
          />
        </div>
      )}
      <Checkbox
        label="Hide on click"
        name="hide_on_click"
        className='short'
        checked={tile.settings.hide_on_click}
        onChange={parent.handleSettingsSelect}
        autoComplete="off"
      />
    </div>
  )
}