.container
.container__elements
.pill
- for(var x = 1; x < 25; x++)
span(class='star star' + x)
img.lanternHills(
src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3522775/lanternHills.png"
)
.lanternContainer
- for(var x = 1; x < 7; x++)
div(class='lanternX' + x)
img(
class='lanternY' + x,
src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/3522775/LanternsLarge.png"
)
.social-icons
a.social-icon.social-icon--codepen(
href="https://codepen.io/braydoncoyer",
target="_blank"
)
i.fa.fa-codepen
.tooltip Codepen
a.social-icon.social-icon--twitter(
href="https://twitter.com/BraydonCoyer",
target="_blank"
)
i.fa.fa-twitter
.tooltip Twitter
View Compiled
$background: #ece8fc;
$white: white;
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
display: flex;
justify-content: center;
align-items: center;
min-height:100vh;
background: $background;
&__elements {
}
}
.pill {
position: relative;
width: 160px;
height: 335px;
background: linear-gradient(to bottom, #312952 0%, #5A4A94 35%, #7B6BC6 100%);
border-radius: 100px;
overflow: hidden;
}
.lanternHills {
position: absolute;
bottom: -1px;
width: 225px;
left: -25px;
}
.star {
background-color: $white;
position: absolute;
border-radius: 50%;
}
@for $i from 1 through 25 {
.star#{$i} {
$size: random(3) + px;
width: $size;
height: $size;
transform: scale(random(1) + 0.1);
left: random(175) + px;
top: random(230) + px;
}
}
@for $i from 1 through 10 {
$randomNum: random(50) + 30;
$size: $randomNum + px;
.lanternX#{$i} {
position: absolute;
bottom: -80px;
left: random(100) + px;
transform: translateX(0);
animation-name: lanternX#{$i};
animation-duration: random(5) + 5 + s;
animation-iteration-count: infinite;
animation-timing-function: ease-in-out;
}
.lanternY#{$i} {
display: inline block;
width: $size;
z-index: $randomNum * 1000;
animation-name: lanternY;
animation-duration: random(5) + 2 + s;
animation-iteration-count: infinite;
animation-timing-function: linear;
transform: translateY(0);
animation-delay: random(5) + 1 + s;
}
@keyframes lanternX#{$i} {
50% { transform: translateX(random(75) + px) }
}
@keyframes lanternY {
0% {
transform: translateY(0);
}
50% {
transform: translateY(-200px);
}
100% {
transform: translateY(-400px);
}
}
}
/* --------Social Icons-------- */
/* Color Variables */
$color-codepen: #000;
$color-twitter: #2b97f1;
/* Social Icon Mixin */
@mixin social-icon($color) {
background: $color;
color: #fff;
.tooltip {
background: $color;
color: currentColor;
&:after {
border-top-color: $color;
}
}
}
.social-icons {
display: flex;
position: absolute;
bottom: 25px;
right: 25px;
}
.social-icon {
display: flex;
align-items: center;
justify-content: center;
position: relative;
width: 40px;
height: 40px;
margin: 0 0.7rem;
border-radius: 50%;
cursor: pointer;
font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif;
font-size: 1.5rem;
text-decoration: none;
transition: all 0.15s ease;
&:hover {
color: #fff;
.tooltip {
visibility: visible;
opacity: 1;
transform: translate(-50%, -150%);
}
}
&:active {
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5) inset;
}
&--twitter { @include social-icon($color-twitter); }
&--codepen { @include social-icon($color-codepen); }
i {
position: relative;
top: 1px;
}
}
/* Tooltips */
.tooltip {
display: block;
position: absolute;
top: 0;
left: 50%;
padding: 0.4rem 0.6rem;
border-radius: 40px;
font-size: 0.4rem;
font-weight: bold;
opacity: 0;
pointer-events: none;
text-transform: uppercase;
transform: translate(-50%, -100%);
transition: all 0.3s ease;
z-index: 1;
&:after {
display: block;
position: absolute;
bottom: 1px;
left: 50%;
width: 0;
height: 0;
content: "";
border: solid;
border-width: 10px 10px 0 10px;
border-color: transparent;
transform: translate(-50%, 100%);
}
}
View Compiled
//based off of Tiantian Xu's 100 Days of Motion Design
// https://uxdesign.cc/100-days-of-motion-design-463526af852f
View Compiled
This Pen doesn't use any external CSS resources.