aboutsummaryrefslogtreecommitdiff
path: root/components/manga/modals/shortcutModal.js
blob: 28790a191e45d8b693ccd3c4cb09eec894a59b94 (plain) (blame)
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
import { Dialog, Transition } from "@headlessui/react";
import {
  ArrowSmallDownIcon,
  ArrowSmallLeftIcon,
  ArrowSmallRightIcon,
  ArrowSmallUpIcon,
} from "@heroicons/react/24/solid";
import { Fragment } from "react";

export default function ShortCutModal({ isOpen, setIsOpen }) {
  function closeModal() {
    setIsOpen(false);
  }

  return (
    <>
      <Transition appear show={isOpen} as={Fragment}>
        <Dialog as="div" className="relative z-10" onClose={closeModal}>
          <Transition.Child
            as={Fragment}
            enter="ease-out duration-300"
            enterFrom="opacity-0"
            enterTo="opacity-100"
            leave="ease-in duration-200"
            leaveFrom="opacity-100"
            leaveTo="opacity-0"
          >
            <div className="fixed inset-0 bg-black bg-opacity-50" />
          </Transition.Child>

          <div className="fixed inset-0 overflow-y-auto">
            <div className="flex min-h-full items-center justify-center p-4 text-center">
              <Transition.Child
                as={Fragment}
                enter="ease-out duration-300"
                enterFrom="opacity-0 scale-95"
                enterTo="opacity-100 scale-100"
                leave="ease-in duration-200"
                leaveFrom="opacity-100 scale-100"
                leaveTo="opacity-0 scale-95"
              >
                <Dialog.Panel className="w-full max-w-lg transform overflow-hidden rounded-2xl bg-secondary p-6 text-left align-middle shadow-xl transition-all">
                  <Dialog.Title
                    as="h3"
                    className="flex gap-2 items-center text-xl font-semibold leading-6 text-gray-100"
                  >
                    Keyboard Shortcuts{" "}
                    <div className="flex gap-2 text-white text-xs">
                      <div className="bg-[#424245] text-white px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                        CTRL
                      </div>
                      <div className="bg-[#424245] text-white px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                        /
                      </div>
                    </div>
                  </Dialog.Title>
                  <div className="mt-3 w-full bg-gray-500 h-[1px]" />
                  <div className="mt-2 flex flex-col flex-wrap gap-10">
                    <div className="space-y-1">
                      <label className="text-gray-100 font-bold">
                        VERTICAL
                      </label>
                      <p className="text-sm text-gray-400">
                        these shorcuts only work when focused on vertical mode.
                      </p>
                      <div className="space-y-2">
                        <div className="space-y-2">
                          <label className="text-gray-400 text-sm font-karla font-extrabold">
                            SCROLL
                          </label>
                          <div className="flex gap-2">
                            <div className="bg-[#424245] text-white px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                              <ArrowSmallUpIcon className="w-5 h-5" />
                            </div>
                            <div className="bg-[#424245] text-white px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                              <ArrowSmallDownIcon className="w-5 h-5" />
                            </div>
                          </div>
                        </div>
                        <div className="space-y-2">
                          <label className="text-gray-400 text-sm font-karla font-extrabold">
                            SCALE IMAGE
                          </label>
                          <div className="flex items-center gap-2">
                            <div className="flex items-center gap-2">
                              <div className="bg-[#424245] text-white text-sm font-bold px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                                <span>SHIFT</span>
                              </div>
                              <div className="bg-[#424245] text-white px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                                <ArrowSmallUpIcon className="w-5 h-5" />
                              </div>
                            </div>
                            <div className="font-bold text-gray-400 text-sm">
                              |
                            </div>
                            <div className="flex items-center gap-2">
                              <div className="bg-[#424245] text-white text-sm font-bold px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                                <span>SHIFT</span>
                              </div>
                              <div className="bg-[#424245] text-white px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                                <ArrowSmallDownIcon className="w-5 h-5" />
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>

                    {/* Right to Left */}
                    <div className="space-y-1">
                      <label className="text-gray-100 font-bold">
                        RIGHT TO LEFT
                      </label>
                      {/* <p className="text-sm text-gray-400 w-[18rem]">
                        these shorcuts only work when focused on Right to Left
                        mode.
                      </p> */}
                      <div className="space-y-2">
                        <label className="text-gray-400 text-sm font-karla font-extrabold uppercase">
                          Navigate Through Panels
                        </label>
                        <div className="flex gap-2">
                          <div className="bg-[#424245] text-white px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                            <ArrowSmallLeftIcon className="w-5 h-5" />
                          </div>
                          <div className="bg-[#424245] text-white px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                            <ArrowSmallRightIcon className="w-5 h-5" />
                          </div>
                        </div>
                      </div>
                    </div>

                    {/* works anywhere */}
                    <div className="space-y-3">
                      <label className="text-gray-100 font-bold">
                        WORKS ANYWHERE
                      </label>

                      <div className="space-y-4">
                        <div className="space-y-2">
                          <label className="text-gray-400 text-sm font-karla font-extrabold uppercase">
                            Navigate Through Chapters
                          </label>
                          <div className="flex items-center gap-2">
                            <div className="flex items-center gap-2">
                              <div className="bg-[#424245] text-white text-sm font-bold px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                                <span>CTRL</span>
                              </div>
                              <div className="bg-[#424245] text-white px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                                <ArrowSmallLeftIcon className="w-5 h-5" />
                              </div>
                            </div>
                            <div className="font-bold text-gray-400 text-sm">
                              |
                            </div>
                            <div className="flex items-center gap-2">
                              <div className="bg-[#424245] text-white text-sm font-bold px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                                <span>CTRL</span>
                              </div>
                              <div className="bg-[#424245] text-white px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                                <ArrowSmallRightIcon className="w-5 h-5" />
                              </div>
                            </div>
                          </div>
                        </div>
                        <div className="space-y-2">
                          <label className="text-gray-400 text-sm font-karla font-extrabold uppercase">
                            Show/Hide SideBar
                          </label>
                          <div className="flex">
                            <div className="bg-[#424245] text-white text-sm font-bold px-2 py-1 shadow-md shadow-[#141415] rounded-md">
                              F
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>

                  <div className="mt-4 text-right">
                    <button
                      type="button"
                      className="inline-flex justify-center rounded-md border border-transparent bg-orange-100 px-4 py-2 text-sm font-medium text-orange-900 hover:bg-orange-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-orange-500 focus-visible:ring-offset-2"
                      onClick={closeModal}
                    >
                      Got it, thanks!
                    </button>
                  </div>
                </Dialog.Panel>
              </Transition.Child>
            </div>
          </div>
        </Dialog>
      </Transition>
    </>
  );
}