File tree Expand file tree Collapse file tree 3 files changed +44
-2
lines changed
_files/js/inforge/gridshow Expand file tree Collapse file tree 3 files changed +44
-2
lines changed Original file line number Diff line number Diff line change 1+ function if_gs_fit_text ( )
2+ {
3+ var titles = $ ( ".if-gs-widget" ) . find ( ".if-gs-tile-title" ) ;
4+ titles . each ( function ( ) {
5+ var mul = 0.05 + 0.02 * $ ( this ) . text ( ) . length ;
6+ var size = Math . max ( Math . min ( $ ( this ) . width ( ) / ( mul * 10 ) ) ) ;
7+ var min_size = 5 + 0.05 * $ ( this ) . width ( ) ;
8+ if ( min_size < 9 )
9+ min_size = 9 ;
10+ if ( size < min_size )
11+ size = min_size ;
12+ if ( size > 25 )
13+ size = 25 ;
14+ $ ( this ) . css ( "font-size" , size ) ;
15+ } ) ;
16+ }
17+
118function if_gs_set_classes ( tiles , pattern )
219{
320 var spans = pattern . split ( " " , tiles . length ) ;
@@ -60,4 +77,7 @@ function if_gs_arrange_tiles()
6077 }
6178 if_gs_set_classes ( tiles , pattern ) ;
6279 widget . show ( ) ;
80+ if_gs_fit_text ( ) ;
6381}
82+
83+ window . addEventListener ( "resize" , if_gs_fit_text ) ;
Original file line number Diff line number Diff line change 1717 "public/if_gs_gridshow_widget.less" : {
1818 "version_id" : 1000070 ,
1919 "version_string" : " 1.0.0" ,
20- "hash" : " c03ad39c486c7890e8c0a1c648705b23 "
20+ "hash" : " 8e249ea26ff6eb3461a6eccfcfdf7ee9 "
2121 }
2222}
Original file line number Diff line number Diff line change 1212.if-gs-tile {
1313 position : relative ;
1414 background-size : cover ;
15+ background-position : center ;
16+ background-repeat : no-repeat ;
1517 border-radius : 5px ;
1618 box-sizing : border-box ;
1719 cursor : pointer ;
1820 overflow : hidden ;
21+ transition : all .5s ;
22+ z-index : auto ;
23+ }
24+
25+ .if-gs-tile :hover {
26+ transform : scale (1.03 );
27+ border-radius : 10px ;
28+ z-index : 50 ;
1929}
2030
2131.if-gs-tile-category {
2232 font-size : .8em ;
2333 position : absolute ;
2434 top : 5px ;
2535 left : 5px ;
26- border-radius : 2 px ;
36+ border-radius : 3 px ;
2737 color : #FFF ;
2838 padding : 4px 10px ;
2939 background : #173854 ;
3040}
3141
3242.if-gs-tile-title {
3343 position : absolute ;
44+ left : 5px ;
3445 bottom : 10px ;
3546 padding : 6px 10px ;
47+ max-height : 75% ;
48+ max-width : 100% ;
3649 font-size : 1.4em ;
50+ overflow : hidden ;
3751 color : #FFF ;
52+ text-shadow : 0.05em 0 black ,
53+ 0 0.05em black ,
54+ -0.05em 0 black ,
55+ 0 -0.05em black ,
56+ -0.05em -0.05em black ,
57+ -0.05em 0.05em black ,
58+ 0.05em -0.05em black ,
59+ 0.05em 0.05em black ;
3860}
3961
4062.if-gs-tile-span2h {
You can’t perform that action at this time.
0 commit comments