Files
housesof/apps/website/src/components/organisms/InteractiveGlobe/InteractiveGlobe.scss

215 lines
4.8 KiB
SCSS

// Globe
.globe {
--width: clamp(700px, 100vw, 1315px);
position: relative;
z-index: 10;
user-select: none;
overflow: hidden;
// Canvas
&__canvas {
position: relative;
z-index: 2;
left: 50%;
transform: translateX(-50%) translateZ(0);
width: var(--width);
pointer-events: none;
@media (hover: hover) {
pointer-events: auto;
}
// Responsive square padding
&:after {
content: "";
display: block;
padding-bottom: 100%;
}
// Overlay
&:before {
content: "";
display: block;
position: absolute;
z-index: 21;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
pointer-events: none;
border-radius: 100%;
background: $color-primary;
transition: opacity 1.5s var(--ease-quart);
}
:global(canvas) {
position: absolute;
z-index: 10;
top: 0;
left: 0;
width: 100%;
height: 100%;
cursor: grab;
}
// Is faded under name
&:global(.is-faded:before) {
opacity: 0.65;
}
}
// Location name
&__location {
position: absolute;
z-index: 30;
top: 50%;
left: 0;
width: 100%;
padding-top: 0.25em;
overflow: hidden;
transform: translateY(-50%) translateZ(0);
pointer-events: none;
text-align: center;
:global(.char) {
transition: none;
}
:global(.name) {
font-family: $font-serif;
font-weight: 100;
letter-spacing: -0.035em;
line-height: 0.75;
color: $color-secondary;
font-size: clamp(#{rem(88px)}, 20vw, #{rem(320px)});
}
.country {
display: block;
text-transform: uppercase;
margin-top: 2em;
font-size: rem(14px);
color: $color-tertiary;
letter-spacing: 0.1em;
font-weight: 500;
@include bp (md) {
margin-top: 4em;
}
}
}
// Markers
&__markers {
position: relative;
z-index: 20;
pointer-events: none;
user-select: none;
li {
display: block;
margin: 0;
padding: 0;
}
}
// Marker
&__marker {
position: absolute;
top: 0;
left: 0;
user-select: none;
transform: translate3d(var(--x), var(--y), 0);
transition: opacity 0.4s var(--ease-quart);
a {
position: relative;
top: -8px;
left: -8px;
display: flex;
width: 16px;
height: 16px;
align-items: center;
justify-content: center;
text-decoration: none;
color: $color-secondary;
pointer-events: auto;
@include bp (md) {
top: -10px;
left: -10px;
width: 20px;
height: 20px;
}
// Dot
i {
display: block;
width: 6px;
height: 6px;
border-radius: 32px;
background: $color-secondary;
transition: box-shadow 0.4s var(--ease-quart), transform 0.4s var(--ease-quart);
transform-origin: 50% 50%;
@include bp (md) {
width: 10px;
height: 10px;
}
}
// Name
span {
display: none;
}
// Hover: Grow marker outline
&:hover {
i {
box-shadow: 0 0 0 8px rgba($color-tertiary, 0.25);
@include bp (md) {
box-shadow: 0 0 0 10px rgba($color-tertiary, 0.25);
}
}
}
}
// State: Is hidden
&:global(.is-hidden) {
opacity: 0;
i {
transform: scale(0) translateZ(0);
}
}
// State: Is disabled
&:global(.is-disabled a) {
pointer-events: none;
}
}
/*
** States and Variants
*/
// Cropped version
&.is-cropped {
overflow: hidden;
height: clamp(300px, 30vw, 500px);
}
// When dragging
:global(.is-grabbing) {
cursor: grabbing;
}
// Tweakpane
:global(.tp-rotv) {
position: absolute;
z-index: 10;
top: 0;
right: 0;
width: 300px;
}
}