File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,28 +42,89 @@ body {
4242
4343# multiple {
4444 display : none;
45- padding-top : 20px ;
46- text-align : center;
47- font-size : larger;
45+ }
46+
47+ .multiple-heading {
48+ font-size : 20px ;
49+ font-weight : bold;
50+ color : var (--pola-text );
51+ margin : 0 0 0.3em ;
52+ }
53+
54+ .multiple-subtitle {
55+ font-size : 13px ;
56+ font-weight : 600 ;
57+ color : var (--pola-text );
58+ margin : 0 0 1em ;
4859}
4960
5061# multiple-ul {
5162 list-style : none;
52- padding : 0 ;
63+ padding : 2 px ;
5364 margin : 0 ;
54- width : 100% ;
55- overflow : auto;
56- max-height : 250px ;
65+ overflow-y : auto;
66+ max-height : 290px ;
67+ display : flex;
68+ flex-direction : column;
69+ gap : 8px ;
70+ }
71+
72+ # multiple-ul li {
73+ margin : 0 ;
74+ padding : 0 ;
5775}
5876
5977# multiple-ul button {
78+ display : flex;
79+ align-items : center;
80+ gap : 10px ;
81+ width : 100% ;
82+ padding : 12px 14px ;
83+ background : var (--pola-light-gray );
84+ border : none;
85+ border-radius : 12px ;
86+ box-shadow : 0 2px 6px rgba (0 , 0 , 0 , 0.07 );
87+ font-family : inherit;
88+ font-size : 15px ;
89+ font-weight : 700 ;
90+ color : var (--pola-text );
91+ text-align : left;
6092 cursor : pointer;
61- width : 90% ;
62- padding : 5px ;
93+ transition : background 0.15s ease;
6394}
6495
65- # multiple-ul li {
66- padding : 5px ;
96+ # multiple-ul button : hover {
97+ background : var (--pola-friend-bg );
98+ }
99+
100+ # multiple-ul button : hover .code-chevron {
101+ background-color : var (--pola-red );
102+ }
103+
104+ .code-icon {
105+ width : 18px ;
106+ height : 18px ;
107+ flex-shrink : 0 ;
108+ background-color : var (--pola-red );
109+ -webkit-mask : url(../ icons/barcode.svg) no-repeat center / contain;
110+ mask : url(../ icons/barcode.svg) no-repeat center / contain;
111+ }
112+
113+ .code-value {
114+ flex : 1 ;
115+ min-width : 0 ;
116+ overflow : hidden;
117+ text-overflow : ellipsis;
118+ }
119+
120+ .code-chevron {
121+ width : 16px ;
122+ height : 16px ;
123+ flex-shrink : 0 ;
124+ background-color : var (--pola-inactive );
125+ -webkit-mask : url(../ icons/chevron-right.svg) no-repeat center / contain;
126+ mask : url(../ icons/chevron-right.svg) no-repeat center / contain;
127+ transition : background-color 0.15s ease;
67128}
68129
69130# result-name {
Original file line number Diff line number Diff line change 1111 < div id ="loading "> Ładowanie...</ div >
1212 < div id ="null "> Nie znaleziono kodu na stronie</ div >
1313 < div id ="multiple ">
14- Wybierz kod:
14+ < h3 class ="multiple-heading "> Wybierz kod</ h3 >
15+ < p class ="multiple-subtitle "> Na tej stronie znaleźliśmy kilka kodów kreskowych. Wybierz jeden, aby zobaczyć informacje o producencie.</ p >
1516 < ul id ="multiple-ul ">
1617
1718 </ ul >
Original file line number Diff line number Diff line change 7272 for ( let ean of eans ) {
7373 let li = document . createElement ( 'li' ) ;
7474 let button = document . createElement ( 'button' ) ;
75- let t = document . createTextNode ( ean ) ;
76- button . appendChild ( t ) ;
75+ let icon = document . createElement ( 'span' ) ;
76+ icon . className = 'code-icon' ;
77+ let value = document . createElement ( 'span' ) ;
78+ value . className = 'code-value' ;
79+ value . textContent = ean ;
80+ let chevron = document . createElement ( 'span' ) ;
81+ chevron . className = 'code-chevron' ;
82+ button . append ( icon , value , chevron ) ;
7783 button . addEventListener ( 'click' , this . setEan . bind ( this , ean ) ) ;
7884 li . appendChild ( button ) ;
7985 ul . appendChild ( li ) ;
8389 if ( ! url ) {
8490 return false ;
8591 }
86- try {
87- const u = new URL ( url ) ;
88- if ( u . protocol !== 'http:' && u . protocol !== 'https:' ) {
89- return false ;
90- }
91- const host = u . hostname . toLowerCase ( ) ;
92- return host !== 'example.pl' && host !== 'example.com' && ! host . endsWith ( '.example.pl' ) && ! host . endsWith ( '.example.com' ) ;
93- } catch {
94- return false ;
95- }
92+ try {
93+ const u = new URL ( url ) ;
94+ if ( u . protocol !== 'http:' && u . protocol !== 'https:' ) {
95+ return false ;
96+ }
97+ const host = u . hostname . toLowerCase ( ) ;
98+ return host !== 'example.pl' && host !== 'example.com' && ! host . endsWith ( '.example.pl' ) && ! host . endsWith ( '.example.com' ) ;
99+ } catch {
100+ return false ;
101+ }
96102 }
97103 restartAnimation ( el ) {
98104 el . classList . remove ( 'animate' ) ;
You can’t perform that action at this time.
0 commit comments