File: passcode_input.html

package info (click to toggle)
chromium 138.0.7204.157-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,864 kB
  • sloc: cpp: 34,936,859; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,967; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (141 lines) | stat: -rw-r--r-- 3,431 bytes parent folder | download | duplicates (4)
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
130
131
132
133
134
135
136
137
138
139
140
141
<style include="cr-shared-style">
  :host {
    --passcode-input-active-color: var(--color-sys-primary-container);
    --passcode-input-background-color: var(--color-textfield-filled-background);
    --passcode-input-background-color-focused: var(--color-sys-state-hover);
    --passcode-input-color: var(--cr-primary-text-color);
    --passcode-input-color-disabled: var(--color-sys-state-disabled);
    --passcode-input-focus-color: var(--color-sys-primary);
    --passcode-input-border-radius: 12px;
  }

  @keyframes blink {
    from {
      background-color: var(--passcode-input-focus-color);
    }
    to {
      background-color: var(--passcode-input-focus-color);
    }
    50% {
      background-color: transparent;
    }
  }

  #container {
    height: 48px;
    position: relative;
    text-align: unset;
  }

  .char {
    color: var(--passcode-input-color);
    margin: auto;
  }

  .char-box {
    background-color: var(--passcode-input-background-color);
    border-radius: var(--passcode-input-border-radius);
    font-family: inherit;
    font-size: 20px;
    height: 40px;
    line-height: 40px;
    margin: 4px;
    position: relative;
    text-align: center;
    transition: background-color 120ms ease-out;
    vertical-align: middle;
    width: 40px;
  }

  .char-box-container {
    display: flex;
    margin-inline-start: 14px;
    position: absolute;
  }

  .char-box-focus {
    background-color: transparent;
    border-radius: var(--passcode-input-border-radius);
    display: block;
    inset: 0;
    pointer-events: none;
    position: absolute;
    transition: background-color 120ms ease-in;
  }

  .cursor-filled::after {
    animation: 1s blink step-end infinite;
    background-color: var(--passcode-input-focus-color);
    content: '';
    height: 20px;
    margin-inline-start: 2px;
    position: absolute;
    top: 10px;
    width: 2px;
  }

  .cursor-empty::before {
    animation: 1s blink step-end infinite;
    background-color: var(--passcode-input-focus-color);
    content: '';
    height: 20px;
    margin-inline-start: -1px;
    position: absolute;
    top: 10px;
    width: 2px;
  }

  .cursor-start::before {
    animation: 1s blink step-end infinite;
    background-color: var(--passcode-input-focus-color);
    content: '';
    height: 20px;
    margin-inline-start: -4px;
    position: absolute;
    top: 10px;
    width: 2px;
  }

  .disabled {
    color: var(--passcode-input-color-disabled);
  }

  .char-box.focused:not(.active) > .char-box-focus {
    background-color: var(--passcode-input-background-color-focused);
    transition: background-color 120ms ease-in;
  }

  .active {
    background-color: var(--passcode-input-active-color);
  }

  .hidden-input {
    font-family: monospace;
    font-size: 20px;
    letter-spacing: 36px;
    opacity: 0;
    padding: 11px;
    position: absolute;
    z-index: 100;
  }
</style>
<div id='container'>
  <input
      aria-label="[[ariaLabel]]"
      autocomplete="off"
      class="hidden-input"
      disabled="[[disabled]]"
      id="inputElement"
      spellcheck="false"
      type="text"
  >
  <div class="char-box-container" aria-hidden="true">
    <template is="dom-repeat" items="[[charDisplayBoxes]]" as="charBox">
      <div class="char-box" id="char-box-[[index]]">
        <div class="char-box-focus">
          <p class="char" id="char-[[index]]"></p>
        </div>
      </div>
    </template>
  </div>
</div>