Remove old Globe

This commit is contained in:
2022-09-25 13:23:55 +02:00
parent bae3b4cdf7
commit 193f6dc2ee
47 changed files with 301 additions and 9037 deletions

View File

@@ -1,209 +1,188 @@
// Globe
.globe {
--width: clamp(700px, 100vw, 1315px);
position: relative;
z-index: 2;
width: 1315px;
height: clamp(700px, 100vw, 1315px);
overflow: hidden;
margin-left: auto;
margin-right: auto;
cursor: grab;
z-index: 10;
user-select: none;
overflow: hidden;
// @include bp (sm) {
// height: 130vw;
// }
// @include bp (md) {
// height: 112vw;
// }
// @include bp (xl) {
// height: 100vw;
// }
// Canvas
&__canvas {
position: relative;
z-index: 2;
left: 50%;
transform: translateX(-50%) translateZ(0);
width: var(--width);
// DEBUG //
// background: rgba(red, 0.2);
// &:after {
// content: "";
// display: block;
// position: absolute;
// top: 50%;
// left: 0;
// background: blue;
// width: 100%;
// height: 2px;
// margin-top: -1px;
// }
// END DEBUG //
// 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%;
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;
color: $color-secondary;
font-size: clamp(#{rem(88px)}, 20vw, #{rem(320px)});
}
.country {
display: block;
text-transform: uppercase;
font-size: rem(14px);
color: $color-tertiary;
letter-spacing: 0.1em;
font-weight: 500;
}
}
// 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: -10px;
left: -10px;
display: block;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
color: $color-secondary;
pointer-events: auto;
// Dot
i {
display: block;
width: 10px;
height: 10px;
border-radius: 32px;
background: $color-secondary;
transition: box-shadow 0.4s var(--ease-quart), transform 0.4s var(--ease-quart);
transform-origin: 50% 50%;
}
// Name
span {
display: none;
}
// Hover: Grow marker outline
&:hover {
i {
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
*/
// When dragging
&:global(.is-grabbing) {
cursor: grabbing;
}
// Cropped globe
&-cropped {
// Cropped version
&.is-cropped {
overflow: hidden;
height: clamp(300px, 30vw, 500px);
}
}
// Canvas
:global(.globe-canvas) {
transition: opacity 0.2s var(--ease-quart);
// Hidden state
&:global(.is-hidden) {
opacity: 0;
transform: translate3d(0, 24px, 0);
// When dragging
:global(.is-grabbing) {
cursor: grabbing;
}
}
/*
** Markers
*/
:global(.globe-markers) {
z-index: 2;
// Marker
:global(.marker) {
// Tweakpane
:global(.tp-rotv) {
position: absolute;
z-index: 2;
cursor: pointer;
display: block;
top: -4px;
left: -4px;
padding: 4px;
opacity: 1;
will-change: transform;
// Dot
&:before {
content: "";
display: block;
position: absolute;
top: 0;
left: 0;
width: 8px;
height: 8px;
background: $color-secondary;
border-radius: 100%;
}
}
// Hover glow effect
:global(.hover) {
&:before {
animation: markerPulse 1s;
}
}
// Label
:global(.marker__label) {
position: absolute;
bottom: 16px;
left: 0px;
color: transparent;
pointer-events: none;
transition: color 0.4s var(--ease-quart), opacity 0.3s var(--ease-quart), transform 0.3s var(--ease-quart);
}
// Location city
:global(.marker__city) {
font-family: $font-serif;
font-size: rem(18px);
line-height: 1;
@include bp (sm) {
font-size: rem(24px);
}
}
// Location country
:global(.marker__country) {
display: block;
opacity: 0.8;
font-family: $font-sans;
font-size: rem(8px);
line-height: 1;
text-transform: uppercase;
letter-spacing: 1px;
@include bp (sm) {
font-size: rem(10px);
}
}
// Active
:global(.is-active) {
opacity: 1;
:global(span) {
opacity: 1;
}
:global(.marker__city) {
color: $color-secondary;
}
:global(.marker__country) {
color: $color-text;
}
}
// Is light
:global(.is-light) {
:global(.is-active) {
:global(.marker__city) {
color: #fff;
}
:global(.marker__country) {
color: #d2b7e4;
}
}
}
// Left positioned
:global(.is-left) {
:global(.marker__city) {
left: auto;
right: 32px;
}
:global(.marker__country) {
text-align: right;
}
}
// Marker is close to another one
// Show the marker infos only on hover
:global(.is-close) {
// Dot
&:before {
width: 7px;
height: 7px;
}
// Label
:global(.marker__label) {
opacity: 0;
transform: translate3d(0, 4px, 0);
}
// Show labels on hover
&:hover {
:global(.marker__label) {
opacity: 1;
transform: translate3d(0,0,0);
}
}
}
}
// Pulse animation
@keyframes markerPulse {
0% {
box-shadow: 0 0 0 0 rgba($color-secondary, 1);
}
100% {
box-shadow: 0 0 0 32px rgba(#fff, 0);
z-index: 10;
top: 0;
right: 0;
width: 300px;
}
}

View File

@@ -1,188 +0,0 @@
// 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);
// 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%;
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;
color: $color-secondary;
font-size: clamp(#{rem(88px)}, 20vw, #{rem(320px)});
}
.country {
display: block;
text-transform: uppercase;
font-size: rem(14px);
color: $color-tertiary;
letter-spacing: 0.1em;
font-weight: 500;
}
}
// 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: -10px;
left: -10px;
display: block;
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
text-decoration: none;
color: $color-secondary;
pointer-events: auto;
// Dot
i {
display: block;
width: 10px;
height: 10px;
border-radius: 32px;
background: $color-secondary;
transition: box-shadow 0.4s var(--ease-quart), transform 0.4s var(--ease-quart);
transform-origin: 50% 50%;
}
// Name
span {
display: none;
}
// Hover: Grow marker outline
&:hover {
i {
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;
}
}