css – How to resize HTML div/link between two values by blog counts?

0
75
html - Animation after toggling doesn't apply the second style


I would like to enlarge or reduce the tag boxes of categories using transform: scale(1.x). For example;

A tag --> 8 blogs,
B tag --> 4 blogs,
C tag --> 3 blogs,
D tag --> 2 blogs,
E tag --> 0 blog

When the blog counts that have tags count have been like this, the scales can be like this;

8 blogs--> 1.5,
4 blogs --> 1.4,
3 blogs --> 1.3
2 blogs --> 1.2,
0 blog --> 1.0

sad

    @foreach (var item in Model.BlogTag)
                {
                    var tagCounts = Model.BlogTag.GroupBy(p=>p.BlogTagRelation).Select(p=>p.Key);
                    int tagCount = item.BlogTagRelation.Distinct().Count();
                    //0-5 arasında değişkenlik göstermeli!
                    int item_scale_by_count = 0;
                    if (tagCount > 1)
                    {
                        for (int i = 0; i < tagCounts.Count(); i++)
                        {

                        }
                    }

                    <a  style="transform:scale([email protected]_scale_by_count)" href="@item.Sitemap.Permalink" class="category_box__tag_link mr-2 mb-2">@item.Title (@tagCount)</a>
                }

But I would like to change the tag box scale between 1.0 and 1.5. How can I do this dynamically?

enter image description here



Source link

Leave a reply

Please enter your comment!
Please enter your name here