-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.html
194 lines (193 loc) · 5.34 KB
/
popup.html
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
<!DOCTYPE html>
<html>
<head>
<title>Tana Helper</title>
<style>
body {
width: 300px;
padding: 10px;
font-family: Arial, sans-serif;
background-color: #f0f0f0;
}
h2, h3, h4 {
color: #333;
text-align: center;
}
button {
width: 100%;
padding: 10px;
margin-top: 10px;
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
border-radius: 5px;
transition: background-color 0.3s;
}
button:hover {
background-color: #45a049;
}
#tanaTools, #webCapture {
display: none;
}
#statusMessage {
text-align: center;
margin-top: 10px;
font-weight: bold;
}
#settings {
display: none;
margin-top: 20px;
border-top: 1px solid #ccc;
padding-top: 10px;
}
label {
display: block;
margin-top: 10px;
}
input {
width: 100%;
padding: 5px;
margin-top: 5px;
}
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
visibility: hidden;
width: 200px;
background-color: #555;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 5px;
position: absolute;
z-index: 1;
left: 50%;
transform: translateX(-50%);
opacity: 0;
transition: opacity 0.3s;
/* New styles for better visibility */
top: -5px;
margin-top: -40px; /* Adjust this value as needed */
max-height: 80px;
overflow-y: auto;
word-wrap: break-word;
}
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}
.toggle-switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
}
input:checked + .slider {
background-color: #2196F3;
}
input:checked + .slider:before {
transform: translateX(26px);
}
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
</style>
</head>
<body>
<h2>Tana Helper</h2>
<div id="webCapture">
<button id="captureButton">Capture Page</button>
<label for="highlightToggle" class="toggle-switch">
<input type="checkbox" id="highlightToggle">
<span class="slider round"></span>
Highlight Mode
</label>
</div>
<div id="tanaTools">
<h3>Tana Tools</h3>
<button id="fsrsButton">Start FSRS Review</button>
<!-- Add more Tana-specific tool buttons here -->
</div>
<p id="statusMessage"></p>
<button id="toggleSettings">Settings</button>
<div id="settings">
<h3>Settings</h3>
<label for="tanaApiKey" class="tooltip">
Tana API Key:
<span class="tooltiptext">Find your API key in Tana's settings under the "API" section.</span>
</label>
<input type="password" id="tanaApiKey">
<label for="inboxNodeId" class="tooltip">
Inbox Node ID:
<span class="tooltiptext">Right-click on your Inbox node in Tana and select "Copy node ID".</span>
</label>
<input type="text" id="inboxNodeId">
<h4>FSRS Settings</h4>
<label for="decayFactor" class="tooltip">
Decay Factor:
<span class="tooltiptext">Controls how quickly item difficulty and stability decay. Default: 0.9</span>
</label>
<input type="number" id="decayFactor" min="0.1" max="1" step="0.1" value="0.9">
<label for="difficultyAddition" class="tooltip">
Difficulty Addition:
<span class="tooltiptext">Controls how much difficulty increases for incorrect responses. Default: 0.2</span>
</label>
<input type="number" id="difficultyAddition" min="0.1" max="1" step="0.1" value="0.2">
<label for="stabilityAddition" class="tooltip">
Stability Addition:
<span class="tooltiptext">Controls how much stability increases for correct responses. Default: 0.2</span>
</label>
<input type="number" id="stabilityAddition" min="0.1" max="1" step="0.1" value="0.2">
<label for="reviewsPerSession" class="tooltip">
Reviews Per Session:
<span class="tooltiptext">Maximum number of items to review in one session. Default: 20</span>
</label>
<input type="number" id="reviewsPerSession" min="1" max="100" value="20">
<h4>Highlight Settings</h4>
<label for="highlightBackgroundColor" class="tooltip">
Highlight Background Color:
<span class="tooltiptext">Choose the background color for highlights.</span>
</label>
<input type="color" id="highlightBackgroundColor" value="#ffff00">
<label for="highlightTextColor" class="tooltip">
Highlight Text Color:
<span class="tooltiptext">Choose the text color for highlights.</span>
</label>
<input type="color" id="highlightTextColor" value="#000000">
<button id="saveSettings">Save Settings</button>
</div>
<script type="module" src="popup.js"></script>
</body>
</html>