|
| 1 | +/* Accordion-style assistant toggle tab */ |
1 | 2 | .assistant-toggle { |
2 | | - display: none; |
3 | 3 | position: fixed; |
4 | | - right: 20px; |
5 | | - top: 20px; |
| 4 | + right: 0; |
| 5 | + top: 50%; |
| 6 | + transform: translateY(-50%); |
6 | 7 | z-index: 1001; |
7 | | - padding: 8px 16px; |
| 8 | + padding: 12px 8px; |
8 | 9 | background-color: #2980b9; |
9 | 10 | color: white; |
10 | 11 | border: none; |
11 | | - border-radius: 4px; |
| 12 | + border-radius: 8px 0 0 8px; |
12 | 13 | cursor: pointer; |
13 | 14 | font-size: 14px; |
| 15 | + font-weight: bold; |
| 16 | + writing-mode: vertical-rl; |
| 17 | + text-orientation: mixed; |
| 18 | + box-shadow: -2px 0 5px rgba(0,0,0,0.2); |
| 19 | + transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out, right 0.3s ease-in-out, box-shadow 0.3s ease-in-out; |
| 20 | + min-height: 80px; |
| 21 | + display: flex; |
| 22 | + align-items: center; |
| 23 | + justify-content: center; |
14 | 24 | } |
15 | 25 |
|
16 | | -/* Hide button when assistant is open */ |
| 26 | +.assistant-toggle:hover { |
| 27 | + background-color: #3498db; |
| 28 | + transform: translateY(-50%) translateX(-2px); |
| 29 | + box-shadow: -4px 0 8px rgba(0,0,0,0.3); |
| 30 | +} |
| 31 | + |
| 32 | +/* Change tab appearance when assistant is open */ |
17 | 33 | .assistant-container.show ~ .assistant-toggle { |
18 | | - display: none !important; |
| 34 | + background-color: #e74c3c; |
| 35 | + right: 400px; |
19 | 36 | } |
20 | 37 |
|
21 | | -.assistant-toggle:hover { |
22 | | - background-color: #3498db; |
| 38 | +.assistant-container.show ~ .assistant-toggle { |
| 39 | + font-size: 0; /* Hide original text */ |
| 40 | +} |
| 41 | + |
| 42 | +.assistant-container.show ~ .assistant-toggle::before { |
| 43 | + content: "Close Assistant"; |
| 44 | + font-size: 14px; /* Restore font size for the pseudo-element */ |
| 45 | +} |
| 46 | + |
| 47 | +.assistant-container.show ~ .assistant-toggle:hover { |
| 48 | + background-color: #c0392b; |
23 | 49 | } |
24 | 50 |
|
25 | 51 | .assistant-container { |
26 | | - display: none; |
| 52 | + position: fixed; |
| 53 | + right: 0; |
| 54 | + top: 0; |
| 55 | + width: 0; |
| 56 | + height: 100vh; |
| 57 | + z-index: 1000; |
| 58 | + background: white; |
| 59 | + border-left: 1px solid #ddd; |
| 60 | + box-shadow: -2px 0 10px rgba(0,0,0,0.1); |
| 61 | + transition: width 0.3s ease-in-out; |
| 62 | + overflow: hidden; |
| 63 | +} |
| 64 | + |
| 65 | +.assistant-container.show { |
| 66 | + width: 400px; |
27 | 67 | } |
28 | 68 |
|
29 | | -@media (min-width: 1300px) { |
| 69 | +.assistant-iframe { |
| 70 | + width: 400px; |
| 71 | + height: 100%; |
| 72 | + border: none; |
| 73 | + background: white; |
| 74 | +} |
| 75 | + |
| 76 | +/* Add close button inside the assistant */ |
| 77 | +.assistant-close { |
| 78 | + position: absolute; |
| 79 | + top: 10px; |
| 80 | + right: 10px; |
| 81 | + background: #e74c3c; |
| 82 | + color: white; |
| 83 | + border: none; |
| 84 | + border-radius: 50%; |
| 85 | + width: 30px; |
| 86 | + height: 30px; |
| 87 | + cursor: pointer; |
| 88 | + font-size: 18px; |
| 89 | + line-height: 1; |
| 90 | + z-index: 1002; |
| 91 | + display: flex; |
| 92 | + align-items: center; |
| 93 | + justify-content: center; |
| 94 | +} |
| 95 | + |
| 96 | +.assistant-close:hover { |
| 97 | + background: #c0392b; |
| 98 | +} |
| 99 | + |
| 100 | +/* Adjust main content when assistant is open */ |
| 101 | +.wy-nav-content { |
| 102 | + transition: margin-right 0.3s ease-in-out; |
| 103 | +} |
| 104 | + |
| 105 | +.assistant-container.show ~ .wy-nav-content { |
| 106 | + margin-right: 400px; |
| 107 | +} |
| 108 | + |
| 109 | +/* Tablet and medium screens */ |
| 110 | +@media (max-width: 1200px) and (min-width: 768px) { |
| 111 | + .assistant-container.show { |
| 112 | + width: 350px; |
| 113 | + } |
| 114 | + |
| 115 | + .assistant-iframe { |
| 116 | + width: 350px; |
| 117 | + } |
| 118 | + |
| 119 | + .assistant-container.show ~ .wy-nav-content { |
| 120 | + margin-right: 350px; |
| 121 | + } |
| 122 | + |
| 123 | + .assistant-container.show ~ .assistant-toggle { |
| 124 | + right: 350px; |
| 125 | + } |
| 126 | +} |
| 127 | + |
| 128 | +/* Mobile devices - full overlay */ |
| 129 | +@media (max-width: 767px) { |
30 | 130 | .assistant-toggle { |
31 | | - display: block; |
| 131 | + right: 10px; |
| 132 | + top: 20px; |
| 133 | + transform: none; |
| 134 | + writing-mode: horizontal-tb; |
| 135 | + text-orientation: unset; |
| 136 | + border-radius: 4px; |
| 137 | + padding: 8px 12px; |
| 138 | + min-height: auto; |
32 | 139 | } |
33 | 140 |
|
34 | | - .assistant-container { |
35 | | - display: block; |
36 | | - visibility: hidden; |
| 141 | + .assistant-toggle:hover { |
| 142 | + transform: translateX(-2px); |
| 143 | + } |
| 144 | + |
| 145 | + .assistant-container.show ~ .assistant-toggle { |
37 | 146 | position: fixed; |
38 | | - right: 0; |
39 | | - top: 0; |
40 | | - width: calc(100vw - 1140px); |
41 | | - height: 100vh; |
42 | | - z-index: 1000; |
43 | | - transform: translateX(100%); |
44 | | - transition: transform 0.3s ease-in-out, visibility 0.3s ease-in-out; |
| 147 | + right: 10px; |
| 148 | + top: 20px; |
| 149 | + transform: none; |
| 150 | + z-index: 1003; |
| 151 | + } |
| 152 | + |
| 153 | + .assistant-container { |
| 154 | + width: 0; |
| 155 | + border-left: none; |
45 | 156 | } |
46 | 157 |
|
47 | 158 | .assistant-container.show { |
48 | | - visibility: visible; |
49 | | - transform: translateX(0); |
| 159 | + width: 100vw; |
50 | 160 | } |
51 | 161 |
|
52 | 162 | .assistant-iframe { |
53 | | - width: 100%; |
54 | | - height: 100%; |
55 | | - border: none; |
56 | | - background: white; |
| 163 | + width: 100vw; |
57 | 164 | } |
58 | 165 |
|
59 | | - .wy-nav-content { |
60 | | - transition: margin-right 0.3s ease-in-out; |
| 166 | + .assistant-container.show ~ .wy-nav-content { |
| 167 | + margin-right: 0; |
61 | 168 | } |
| 169 | +} |
62 | 170 |
|
| 171 | +/* For very large screens, use more space */ |
| 172 | +@media (min-width: 1400px) { |
| 173 | + .assistant-container.show { |
| 174 | + width: calc(100vw - 1140px); |
| 175 | + max-width: 600px; |
| 176 | + } |
| 177 | + |
| 178 | + .assistant-iframe { |
| 179 | + width: calc(100vw - 1140px); |
| 180 | + max-width: 600px; |
| 181 | + } |
| 182 | + |
63 | 183 | .assistant-container.show ~ .wy-nav-content { |
64 | 184 | margin-right: calc(100vw - 1140px); |
| 185 | + max-margin-right: 600px; |
| 186 | + } |
| 187 | + |
| 188 | + .assistant-container.show ~ .assistant-toggle { |
| 189 | + right: calc(100vw - 1140px); |
| 190 | + max-right: 600px; |
65 | 191 | } |
66 | 192 | } |
0 commit comments