Template:Sandbox/Aurelain/Hint/styles.css: Difference between revisions

From Heroes of Might and Magic: Olden Era Official Wiki
No edit summary
No edit summary
Line 86: Line 86:
.wiki-hint-left .wiki-hint-floating {
.wiki-hint-left .wiki-hint-floating {
     top: 50%;
     top: 50%;
     right: 105%;
     right: 110%;
     transform: translateY(-50%);
     transform: translateY(-50%);
}
}
Line 100: Line 100:
.wiki-hint-right .wiki-hint-floating {
.wiki-hint-right .wiki-hint-floating {
     top: 50%;
     top: 50%;
     left: 105%;
     left: 110%;
     transform: translateY(-50%);
     transform: translateY(-50%);
}
}

Revision as of 11:08, 23 June 2026

/* Container for the hint */
.wiki-hint {
    position: relative;
    display: inline;
    border-bottom: 1px dotted #555; /* Visual cue that it's hoverable */
    cursor: help;
}

.wiki-hint-no-border {
    border-bottom: none;
}

/* The hidden floating text */
.wiki-hint-floating {
    visibility: hidden;
    opacity: 0;

    /* Positioning */
    position: absolute;
    z-index: 100;

    /* Styling */
    width:max-content;
    max-width: 200px;
    background-color: #191b2c;
    border: solid 1px #d6bc7c;
    color: #fff;
    text-align: center;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    line-height: 1.2;

    /* Smooth fade-in transition */
    transition: opacity 0.2s ease, visibility 0.2s ease;

    /* Box shadow for a clean look */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Little arrow pointing down at the content */
.wiki-hint-floating::after {
    content: "";
    position: absolute;
    border-width: 5px;
    border-style: solid;
    border-color: transparent;
}

/* Reveal on hover */
.wiki-hint:hover .wiki-hint-floating {
    visibility: visible;
    opacity: 1;
}

/* Placement: top */
.wiki-hint-top .wiki-hint-floating {
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
}

.wiki-hint-top .wiki-hint-floating::after {
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-top-color: #d6bc7c;
}

/* Placement: bottom */
.wiki-hint-bottom .wiki-hint-floating {
    top: 130%;
    left: 50%;
    transform: translateX(-50%);
}

.wiki-hint-bottom .wiki-hint-floating::after {
    top: 0;
    left: 50%;
    margin-left: -5px;
    margin-top:-10px;
    border-bottom-color: #d6bc7c;
}

/* Placement: left */
.wiki-hint-left .wiki-hint-floating {
    top: 50%;
    right: 110%;
    transform: translateY(-50%);
}

.wiki-hint-left .wiki-hint-floating::after {
    top: 50%;
    left: 100%;
    margin-top:-5px;
    border-left-color: #d6bc7c;
}

/* Placement: right */
.wiki-hint-right .wiki-hint-floating {
    top: 50%;
    left: 110%;
    transform: translateY(-50%);
}

.wiki-hint-right .wiki-hint-floating::after {
    top: 50%;
    left: 0;
    margin-left: -10px;
    margin-top: -5px;
    border-right-color: #d6bc7c;
}