daniel-fiuk_simple-map/styles.css

241 lines
4.1 KiB
CSS

/* region map layout */
.fantasy-map-container {
position: relative;
width: 100%;
overflow: hidden;
border-radius: 4px;
}
.fantasy-map-wrapper {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
.fantasy-map-background {
position: absolute;
inset: 0;
width: 100%;
height: 100%;
background-position: 0 0;
background-repeat: repeat;
transform: none;
z-index: 0;
}
.fantasy-map-tiles {
position: absolute;
inset: 0;
transform-origin: top left;
z-index: 1;
}
.fm-tile {
position: absolute;
width: 100%;
height: 100%;
background-position: 0 0;
background-repeat: no-repeat;
background-size: 100% 100%;
}
.fantasy-map-container,
.fantasy-map-background,
.fantasy-map-tiles,
.fm-tile {
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
-webkit-user-drag: none;
-khtml-user-drag: none;
-moz-user-drag: none;
user-drag: none;
cursor: grab;
}
.fantasy-map-container:active,
.fantasy-map-background:active,
.fantasy-map-tiles:active,
.fm-tile:active {
cursor: grabbing;
}
/* endregion */
/* region toolbar */
.fantasy-map-toolbar {
position: absolute;
bottom: 5px;
left: 5px;
z-index: 10;
display: flex;
flex-direction: row;
align-items: center;
gap: 5px;
padding: 5px;
background-color: var(--background-secondary);
border: 1px solid var(--background-modifier-border);
border-radius: 4px;
opacity: 0;
transition: opacity 150ms ease;
}
.fantasy-map-container:hover .fantasy-map-toolbar,
.fantasy-map-container:focus-within .fantasy-map-toolbar {
opacity: 1;
}
.fantasy-map-toolbar button {
padding: 0.1rem 0.4rem;
font-size: 0.9rem;
}
.fantasy-map-toolbar input.fm-zoom-step {
width: 4rem;
font-size: 0.9rem;
}
/* endregion */
/* region pins */
.map-pin {
position: absolute;
width: fit-content;
height: fit-content;
overflow: visible;
z-index: 5;
}
.map-pin-icon {
position: relative;
width: 24px;
height: auto;
}
.map-pin-icon svg,
.map-pin-icon img {
display: block;
position: absolute;
bottom: 0;
width: 100%;
height: auto;
transform-origin: center bottom;
transform: translateX(-50%);
transition: transform 120ms ease, filter 120ms ease;
}
.map-pin-icon svg {
fill: var(--text-accent);
}
.map-pin-icon:hover {
cursor: pointer;
}
.map-pin-icon:hover svg,
.map-pin-icon:hover img {
transform: translateX(-50%) translateY(-10%) scale(1.1);
filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5));
}
.map-pin-icon:hover svg {
fill: var(--text-accent-hover);
}
/* endregion */
/* region page previews */
.fantasy-map-hover-preview {
position: fixed;
width: min(520px, calc(100vw - 24px));
height: fit-content;
padding: 12px 14px;
border-radius: 8px;
background-color: var(--background-secondary);
color: var(--text-normal);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
opacity: 0;
pointer-events: none;
transform: translateY(4px);
transition: opacity 120ms ease, transform 120ms ease;
z-index: 9999;
overflow: hidden;
}
.fantasy-map-hover-preview.is-visible {
opacity: 1;
pointer-events: auto;
transform: translateY(0);
}
.fm-hover-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 6px;
gap: 8px;
}
.fantasy-map-hover-preview .fm-hover-title {
display: inline-block;
margin: 0;
font-size: var(--h1-size);
font-weight: var(--h3-weight, 700);
text-decoration: none;
}
.fantasy-map-hover-preview a.internal-link {
text-decoration: underline;
}
.fm-hover-open {
font-size: 0.85rem;
cursor: pointer;
opacity: 0.7;
}
.fm-hover-open:hover {
opacity: 1;
}
.fm-hover-content {
max-height: 260px;
overflow-y: auto;
font-size: 0.9rem;
line-height: 1.4;
padding-right: 4px;
}
.fantasy-map-hover-preview .fm-hover-content img,
.fantasy-map-hover-preview .fm-hover-content svg,
.fantasy-map-hover-preview .fm-hover-content video,
.fantasy-map-hover-preview .fm-hover-content .internal-embed img {
display: block;
max-width: 100%;
height: auto;
}
.fantasy-map-hover-preview .fm-hover-content .internal-embed,
.fantasy-map-hover-preview .fm-hover-content .image-embed {
max-width: 100%;
overflow: hidden;
}
.fantasy-map-hover-preview .fm-hover-content p {
overflow-wrap: anywhere;
}
/* endregion */