File tree Expand file tree Collapse file tree 5 files changed +62
-77
lines changed
src-theme/src/routes/clickgui Expand file tree Collapse file tree 5 files changed +62
-77
lines changed Original file line number Diff line number Diff line change 133133</div >
134134
135135<style lang =" scss" >
136- @use " ../../colors.scss" as * ;
136+ @use " ../../colors" as * ;
137+ @use " ./icon-settings-expand" as * ;
137138
138139 .module {
139140 position : relative ;
178179
179180 & .has-settings {
180181 .name ::after {
181- content : " " ;
182- display : block ;
183- position : absolute ;
184- height : 10px ;
185- width : 10px ;
186- right : 15px ;
187- top : 50% ;
188- background-image : url (" /img/clickgui/icon-settings-expand.svg" );
189- background-position : center ;
190- background-repeat : no-repeat ;
182+ @include icon-settings-expand ($right : 15px );
191183 opacity : 0.5 ;
192- transform-origin : 50% 50% ;
193- transform : translateY (-50% ) rotate (-90deg );
194- transition : ease opacity 0.2s ,
195- ease transform 0.4s ;
196184 }
197185
198186 & .expanded .name ::after {
Original file line number Diff line number Diff line change 1+ /* !
2+ * This file is part of LiquidBounce (https://github.com/CCBlueX/LiquidBounce)
3+ *
4+ * Copyright (c) 2015 - 2025 CCBlueX
5+ *
6+ * LiquidBounce is free software: you can redistribute it and/or modify
7+ * it under the terms of the GNU General Public License as published by
8+ * the Free Software Foundation, either version 3 of the License, or
9+ * (at your option) any later version.
10+ *
11+ * LiquidBounce is distributed in the hope that it will be useful,
12+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
13+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14+ * GNU General Public License for more details.
15+ *
16+ * You should have received a copy of the GNU General Public License
17+ * along with LiquidBounce. If not, see <https://www.gnu.org/licenses/>.
18+ */
19+
20+ @mixin icon-settings-expand (
21+ $size : 10px ,
22+ $right : 10px ,
23+ $rotate : -90deg ,
24+ ) {
25+ content : " " ;
26+ display : block ;
27+ position : absolute ;
28+ height : $size ;
29+ width : $size ;
30+ right : $right ;
31+ top : 50% ;
32+ background-image : url (" /img/clickgui/icon-settings-expand.svg" );
33+ background-position : center ;
34+ background-repeat : no-repeat ;
35+ transform-origin : 50% 50% ;
36+ transform : translateY (-50% ) rotate ($rotate );
37+ transition : ease opacity 0.2s , ease transform 0.4s ;
38+ }
Original file line number Diff line number Diff line change 3838 }
3939 </script >
4040
41- <button on:click |stopPropagation ={switchAction }>
41+ <!-- svelte-ignore a11y_consider_explicit_label -->
42+ <button style ="--direction: {direction }" on:click |stopPropagation ={switchAction }>
4243 <span class =" chosen-holder" >
4344 {#key chosen }
4445 <span
4950 {/ key }
5051 </span >
5152
52- <span class ="arrow-wrapper" class:jiggle bind:this ={arrowWrapper }>
53- <ExpandArrow
54- expanded ={false }
55- expandable ={false }
56- compact ={true }
57- dimmed ={true }
58- />
53+ <span class ="arrow arrow-right" class:jiggle bind:this ={arrowWrapper }>
5954 </span >
6055</button >
6156
6257<style lang =" scss" >
6358 @use " ../../../../colors" as * ;
59+ @use " ../../icon-settings-expand" as * ;
6460
65- @keyframes jiggle-right {
61+ @keyframes jiggle {
6662 0% { transform : translateX (0 ); }
67- 50% { transform : translateX (2px ); }
63+ 50% { transform : translateX (calc ( var ( --direction ) * 2px ) ); }
6864 100% { transform : translateX (0 ); }
6965 }
7066
71- .arrow-wrapper {
72- display : flex ;
67+ .arrow {
68+ width : 10px ;
69+
70+ & .arrow-right ::after {
71+ @include icon-settings-expand ($size : 10px , $right : auto );
72+ color : $clickgui-text-dimmed-color ;
73+ }
7374
7475 & .jiggle {
75- animation : jiggle- right 200ms ease ;
76+ animation : jiggle 200ms ease ;
7677 }
7778 }
7879
Original file line number Diff line number Diff line change 5353
5454<style lang =" scss" >
5555 @use " ../../../../colors.scss" as * ;
56+ @use " ../../icon-settings-expand" as * ;
5657
5758 .dropdown {
5859 position : relative ;
9091 }
9192
9293 .text ::after {
93- content : " " ;
94- display : block ;
95- position : absolute ;
96- height : 10px ;
97- width : 10px ;
98- right : 10px ;
99- top : 50% ;
100- background-image : url (" /img/clickgui/icon-settings-expand.svg" );
101- background-position : center ;
102- background-repeat : no-repeat ;
103- transform-origin : 50% 50% ;
104- transform : translateY (-50% ) rotate (-90deg );
105- transition : ease opacity 0.2s ,
106- ease transform 0.4s ;
94+ @include icon-settings-expand ();
10795 }
10896 }
10997
Original file line number Diff line number Diff line change 22 import {createEventDispatcher } from " svelte" ;
33
44 export let expanded: boolean ;
5- export let expandable: boolean = true ;
6- export let compact = false ;
7- export let dimmed = false ;
85
96 const dispatch = createEventDispatcher ();
107
118 function handleClick() {
12- if (expandable ) {
13- expanded = ! expanded ;
14- dispatch (" click" );
15- }
9+ expanded = ! expanded ;
10+ dispatch (" click" );
1611 }
1712 </script >
1813
1914<!-- svelte-ignore a11y_consider_explicit_label -->
20- <button class ="arrow" class:expanded class:compact class:dimmed on:click ={handleClick }
15+ <button class ="arrow" class:expanded on:click ={handleClick }
2116></button >
2217
2318<style lang =" scss" >
24- @use " ../../../../colors " as * ;
19+ @use " ../../icon-settings-expand " as * ;
2520
2621 .arrow {
2722 width : 20px ;
3025 background-color : transparent ;
3126 border : none ;
3227
33- & .compact {
34- width : 10px ;
35- }
36-
37- & .dimmed {
38- color : $clickgui-text-dimmed-color ;
39- }
40-
4128 & ::after {
42- content : " " ;
43- display : block ;
44- position : absolute ;
45- height : 10px ;
46- width : 10px ;
47- right : 0 ;
48- top : 50% ;
49- background-image : url (" /img/clickgui/icon-settings-expand.svg" );
50- background-position : center ;
51- background-repeat : no-repeat ;
52- transform-origin : 50% 50% ;
53- transform : translateY (-50% ) rotate (-90deg );
54- transition : ease opacity 0.2s ,
55- ease transform 0.4s ;
56- }
57-
58- & ::after .compact {
59- right : auto ;
29+ @include icon-settings-expand ($right : 0 );
6030 }
6131
6232 & .expanded ::after {
You can’t perform that action at this time.
0 commit comments