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
 
(18 intermediate revisions by the same user not shown)
Line 5: Line 5:
     border-bottom: 1px dotted #555; /* Visual cue that it's hoverable */
     border-bottom: 1px dotted #555; /* Visual cue that it's hoverable */
     cursor: help;
     cursor: help;
}
.wiki-hint-no-border {
    border-bottom: none;
}
}


/* The hidden floating text */
/* The hidden floating text */
.wiki-hint .wiki-hint-floating {
.wiki-hint-floating {
     visibility: hidden;
     visibility: hidden;
     opacity: 0;
     opacity: 0;
   
 
     /* Positioning */
     /* Positioning */
     position: absolute;
     position: absolute;
    bottom: 130%; /* Places it right above the text */
    left: 50%;
    transform: translateX(-50%);
     z-index: 100;
     z-index: 100;
   
 
     /* Styling */
     /* Styling */
    width:max-content;
    max-width: 200px;
     background-color: #191b2c;
     background-color: #191b2c;
    border: solid 1px #d6bc7c;
     color: #fff;
     color: #fff;
     text-align: center;
     text-align: center;
     padding: 6px 10px;
     padding: 6px 10px;
     border-radius: 4px;
     border-radius: 4px;
    white-space: nowrap; /* Prevents awkward wrapping */
     font-size: 0.9em;
     font-size: 0.9em;
     line-height: 1.2;
     line-height: 1.2;
   
 
     /* Smooth fade-in transition */
     /* Smooth fade-in transition */
     transition: opacity 0.2s ease, visibility 0.2s ease;
     transition: opacity 0.2s ease, visibility 0.2s ease;
   
 
     /* Box shadow for a clean look */
     /* Box shadow for a clean look */
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
Line 37: Line 40:


/* Little arrow pointing down at the content */
/* Little arrow pointing down at the content */
.wiki-hint .wiki-hint-floating::after {
.wiki-hint-floating::after {
     content: "";
     content: "";
     position: absolute;
     position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
     border-width: 5px;
     border-width: 5px;
     border-style: solid;
     border-style: solid;
     border-color: #333 transparent transparent transparent;
     border-color: transparent;
}
}


Line 52: Line 52:
     visibility: visible;
     visibility: visible;
     opacity: 1;
     opacity: 1;
}
/* Placement: top */
.wiki-hint-top .wiki-hint-floating {
    bottom: calc(100% + 8px);
    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: calc(100% + 8px);
    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: calc(100% + 8px);
    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: calc(100% + 8px);
    transform: translateY(-50%);
}
.wiki-hint-right .wiki-hint-floating::after {
    top: 50%;
    left: 0;
    margin-left: -10px;
    margin-top: -5px;
    border-right-color: #d6bc7c;
}
}

Latest revision as of 10:53, 1 July 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: calc(100% + 8px);
    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: calc(100% + 8px);
    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: calc(100% + 8px);
    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: calc(100% + 8px);
    transform: translateY(-50%);
}

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