Improved UX and visuals of embedded URLs
authorAlexander Ebert <ebert@woltlab.com>
Fri, 4 Jun 2021 11:45:09 +0000 (13:45 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 4 Jun 2021 11:45:09 +0000 (13:45 +0200)
The link now has a proper title and the tab focus will highlight the headline.

com.woltlab.wcf/templates/unfurlUrl.tpl
wcfsetup/install/files/style/ui/unfurlUrl.scss

index 3d85f6bafb6890654135aa0a672fdf768fc1633d..0258cc8ad762634a768bcd3486cf09fae83c90ed 100644 (file)
                                <img src="{$object->getImageUrl()}" height="{$object->height}" width="{$object->width}" class="unfurlUrlImage" alt="" loading="lazy">
                        {/if}
                        <div class="unfurlUrlInformation">
-                               <div class="unfurlUrlTitle">{$object->title}</div>
+                               <a class="unfurlUrlTitle" {anchorAttributes url=$object->url appendClassname=false isUgc=$enableUgc}>{$object->title}</a>
                                <div class="unfurlUrlDescription">{$object->description}</div>
                                <div class="unfurlUrlHost">{$object->getHost()}</div>
                        </div>
-                       <a class="unfurlUrlLinkShadow" {anchorAttributes url=$object->url appendClassname=false isUgc=$enableUgc}></a>
                </div>
        {/if}
 {else}
index f02fc763a5126d60b59690f563c18df56a361315..8f3ee3409a149db52e7e39cb07fc7e68a1c8231f 100644 (file)
@@ -61,7 +61,6 @@
 }
 
 .unfurlUrlInformation {
-       position: relative;
        padding: 10px 10px 25px 10px;
 }
 
        @include wcfFontHeadline;
        @include wcfFontBold;
 
+       color: inherit;
        display: -webkit-box;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
+       
+       &::before {
+               bottom: 0;
+               content: "";
+               left: 0;
+               position: absolute;
+               right: 0;
+               top: 0;
+       }
+
+       &:hover,
+       &:focus {
+               color: inherit;
+       }
 }
 
 .unfurlUrlDescription {
 
        bottom: 5px;
        color: $wcfContentDimmedText;
-       float: right;
        position: absolute;
        right: 5px;
 
                height: 12px !important;
        }
 }
-
-.unfurlUrlLinkShadow {
-       bottom: 0;
-       left: 0;
-       position: absolute;
-       right: 0;
-       top: 0;
-}