This repository was archived by the owner on May 29, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +35
-14
lines changed Expand file tree Collapse file tree 1 file changed +35
-14
lines changed Original file line number Diff line number Diff line change 33 < style >
44 /* Add basic styles for tabs */
55 .tab {
6- display : flex;
7- cursor : pointer;
8- padding : 10px ;
9- background-color : # f1f1f1 ;
10- border : 1px solid # ccc ;
11- margin-right : 5px ;
12- }
6+ background : # f7f7f7 ;
7+ border : 1px solid # bbb ;
8+ border-bottom : none;
9+ border-radius : 8px 8px 0 0 ;
10+ padding : 8px 28px ;
11+ margin-right : 4px ;
12+ font-family : sans-serif;
13+ font-size : 15px ;
14+ box-shadow : 0 2px 4px 0 rgba (0 , 0 , 0 , 0.04 );
15+ cursor : pointer;
16+ position : relative;
17+ top : 1px ;
18+ transition : background 0.2s ;
19+ }
1320
14- .tab : hover {
15- background-color : # ddd ;
16- }
21+ .tab .active {
22+ background : # fff ;
23+ font-weight : bold;
24+ border-color : # 888 # 888 # fff # 888 ;
25+ z-index : 1 ;
26+ }
27+
28+ .tab : not (.active ): hover {
29+ background : # ececec ;
30+ }
1731
1832 .tab-content {
1933 display : none;
133147 }
134148 }
135149
136- // Tab logic (unchanged)
150+ // Tab logic
137151 function showTabContent ( tabId ) {
138- document . querySelectorAll ( '.tab-content' ) . forEach (
139- c => c . classList . remove ( 'active' ) ) ;
140- document . getElementById ( tabId ) . classList . add ( 'active' ) ;
152+ document . querySelectorAll ( '.tab-content' ) . forEach (
153+ c => c . classList . remove ( 'active' ) ) ;
154+ document . getElementById ( tabId ) . classList . add ( 'active' ) ;
155+ // Add this to update tab styling
156+ document . querySelectorAll ( '#tabs .tab' ) . forEach ( tab => tab . classList . remove ( 'active' ) ) ;
157+ if ( tabId === 'tab1' ) {
158+ document . querySelectorAll ( '#tabs .tab' ) [ 0 ] . classList . add ( 'active' ) ;
159+ } else {
160+ document . querySelectorAll ( '#tabs .tab' ) [ 1 ] . classList . add ( 'active' ) ;
141161 }
162+ }
142163</ script >
143164</ html >
144165
You can’t perform that action at this time.
0 commit comments