// Animates the logo image's mask.
animate('#mask-box', {
rotate: 1440, // Rotate's the box 4 times (1440 degrees / 360 degrees = 4 rotations)
transformOrigin: '50% 50%', // I do not remember ever adding this but it seems to help fix the rotation issue.
scale: [0, 1, 1, 1, 1, 1, 1, 1, 0], // Scaling and Descaling (0 = 0% size, 1 = 100% size. All the repeated 1's extends the time as 100% size. Sine effect allows the ending effect to be smooth.)
duration: 20000, // Animation time (20 seconds, 20000 ms): https://animejs.com/documentation/animation/tween-parameters/duration
loop: true, // Loops the animation forever (true is the same as Infinity): https://animejs.com/documentation/timeline/timeline-playback-settings/loop
easing: 'easeInOutSine', // Uses the Ease In and Out Sine: https://animejs.com/easing-editor/sine/inoutsine
});
// Each of the following 4 setInterval function checks if header items are hovered. This then triggers arrow animations
const fps = 60;
setInterval(function() {
if(getComputedStyle(document.getElementById('head-dir-about')).getPropertyValue('--hovered-about') == 1) {
document.getElementById('headAboutMega').style.zIndex = -10;
document.getElementById('headAboutMega').style.display = "flex";
animate('#head-dir-about-arrow',{
rotate: 0,
duration: 300,
loop: false,
easing: 'easeIn',
});
animate('#headAboutMega',{
y: 0,
duration: dropdownMovingSpeed,
loop: false,
easing: 'easeOut',
});
} else {
document.getElementById('headAboutMega').style.zIndex = -100;
animate('#head-dir-about-arrow',{
rotate: -90,
duration: 300,
loop: false,
easing: 'easeIn',
});
animate('#headAboutMega',{
y: dropdownMovingPos/1.5,
duration: dropdownMovingSpeed,
loop: false,
easing: 'easeIn',
});
};
}, 1000 / fps);
// getComputedStyle(document.getElementById('headDirMega')).getPropertyValue('--hovered-dir-dd')
setInterval(function() {
if(getComputedStyle(document.getElementById('head-dir-dir')).getPropertyValue('--hovered-dir') == 1 ) {
document.getElementById('headDirMega').style.zIndex = -10;
document.getElementById('headDirMega').style.display = "flex";
animate('#head-dir-dir-arrow',{
rotate: 0,
duration: 300,
loop: false,
easing: 'easeIn',
});
animate('#headDirMega',{
y: 0,
duration: dropdownMovingSpeed,
loop: false,
easing: 'easeIn',
});
} else {
document.getElementById('headDirMega').style.zIndex = -100;
animate('#head-dir-dir-arrow',{
rotate: -90,
duration: 300,
loop: false,
easing: 'easeIn',
});
animate('#headDirMega',{
y: dropdownMovingPos/1.5,
duration: dropdownMovingSpeed,
loop: false,
easing: 'easeIn',
});
};
}, 1000 / fps);
setInterval(function() {
if(getComputedStyle(document.getElementById('head-dir-shop')).getPropertyValue('--hovered-shop') == 1) {
document.getElementById('headShopMega').style.zIndex = -10;
document.getElementById('headShopMega').style.display = "flex";
document.getElementById('debugVar').innerHTML = "shop yes";
animate('#head-dir-shop-arrow',{
rotate: 0,
duration: 300,
loop: false,
easing: 'easeIn',
});
animate('#headShopMega',{
y: 0,
duration: 700,
loop: false,
easing: 'easeIn',
});
} else {
document.getElementById('headShopMega').style.zIndex = -100;
document.getElementById('debugVar').innerHTML = "shop no";
animate('#head-dir-shop-arrow',{
rotate: -90,
duration: 300,
loop: false,
easing: 'easeIn',
});
animate('#headShopMega',{
y: dropdownMovingPos/1.5,
duration: dropdownMovingSpeed,
loop: false,
easing: 'easeIn',
});
};
}, 1000 / fps);
*{
margin: 0; /* Fixes the header */
padding: 0; /* Put here for good measure */
box-sizing: border-box; /* Something to do with preventing an unexpected layout. */
font-family: MaxwellRegular, MaxwellBold, Minecraft, sans-serif; /* Basic font family order */
/* Creates a cool gradient that I am going to copy and paste around the website because I am lazy but clean. */
/* Supports IE6+ with the extra gradient variations. */
--gradient: linear-gradient(
45deg,
rgba(206, 121, 219, 1) 0%,
rgba(182, 0, 227, 1) 16%,
rgba(100, 5, 232, 1) 37%,
rgba(0, 29, 245, 1) 50%,
rgba(0, 115, 255, 1) 66%,
rgba(0, 183, 255, 1) 83%,
rgba(83, 234, 237, 1) 100%
);
--m-gradient: -moz-linear-gradient(
45deg,
rgba(206, 121, 219, 1) 0%,
rgba(182, 0, 227, 1) 16%,
rgba(100, 5, 232, 1) 37%,
rgba(0, 29, 245, 1) 50%,
rgba(0, 115, 255, 1) 66%,
rgba(0, 183, 255, 1) 83%,
rgba(83, 234, 237, 1) 100%
);
--w-gradient: -webkit-linear-gradient(
45deg,
rgba(206, 121, 219, 1) 0%,
rgba(182, 0, 227, 1) 16%,
rgba(100, 5, 232, 1) 37%,
rgba(0, 29, 245, 1) 50%,
rgba(0, 115, 255, 1) 66%,
rgba(0, 183, 255, 1) 83%,
rgba(83, 234, 237, 1) 100%
);
}
/* Import fonts */
@font-face {
font-family: MaxwellBold;
src: url("https://rawcdn.githack.com/MindaManOfficial/mindamanofficial.github.io/03db4b61551a2936a785500ad4eb7c7f7d39d86d/MAXWELL%20BOLD.ttf")
format("truetype");
}
@font-face {
font-family: MaxwellRegular;
src: url("https://rawcdn.githack.com/MindaManOfficial/mindamanofficial.github.io/03db4b61551a2936a785500ad4eb7c7f7d39d86d/MAXWELL%20REGULAR.ttf")
format("truetype");
}
@font-face {
font-family: MaxwellLight;
src: url("https://rawcdn.githack.com/MindaManOfficial/mindamanofficial.github.io/03db4b61551a2936a785500ad4eb7c7f7d39d86d/MAXWELL%20LIGHT.ttf")
format("truetype");
}
@font-face {
font-family: Minecraft;
src: url("https://rawcdn.githack.com/MindaManOfficial/mindamanofficial.github.io/07345fe43bd27eeec13f46f411d02efb2a5dd2db/assets/MinecraftRegular-Bmg3.otf")
format("opentype");
}
/* Checks to see if the CSS file is working or loaded correctly. */
/* If it is not visible, then the CSS file is working as intended. If it is visible, either someone is cheating and being a nerd or I screwed up somewhere. */
.css-checker{
display: none;
}
header {
display: flex;
padding-left: 1.1%;
padding-right: 1.1%;
width: 100%;
background: black;
justify-content: space-between;
align-items: center;
z-index: -998;
}
/* Full Logo Wrapper */
.head-logo{
position: relative;
display: flex;
flex-direction: row;
text-decoration: none;
}
/* i dont remember what this was lol this comment has been left blank for so long it was annoying */
.head-logo-mask{
position: absolute;
}
/* General wrapper for the images. Does NOT include the text. */
.head-logo-wrap {
display: flex;
align-items: center;
justify-content: center;
}
/* Ensure the character stays centered within the SVG coordinate system */
.logo-image {
object-fit: cover;
}
/* This will make the mask rotate around its own center */
#mask-box {
transform-origin: center;
transform-box: fill-box;
}
/* Additionally, we make sure that the container does not cut off the edges during rotation. */
.logo-container {
overflow: visible !important;
}
/* Sets text styles for the "MindaMan" in the header. */
.head-name{
padding-left: 0.4vw;
font-family: MaxwellBold;
font-size: 3.5vw;
color: transparent;
background: #682a9b;
/* The extra backgrounds / filters add IE6+ compatability. */
background: var(--gradient);
background: var(--m-gradient);
background: var(--w-gradient);
/* Allows the font to have the gradient rather than just giving a background. */
background-position: bottom;
background-size: cover;
background-clip: text;
}
/* Sets general styles for the head-dir area */
.head-dir{
display: inline-flex;
font-size: 2.5vw;
color: white;
justify-content: center;
}
.head-dir li{
list-style: none;
}
/* Controls the individual wrappers for the directory links*/
.head-dir li a{
font-family: MaxwellBold;
color: white;
text-decoration: none;
}
/* Controls the dropdown of the directory tab. */
.head-dir-about-dd{
display: none;
margin-left: -15vw;
padding: 3%;
background-color: #000000;
top: 3.7vw;
position: absolute;
flex-direction: column;
border-radius: 2vw;
z-index: -999;
}
/* Controls the dropdown of the directory tab. */
.head-dir-dir-dd{
display: none;
margin-left: -22vw;
padding: 3%;
background-color: #000000;
top: 3.7vw;
position: absolute;
flex-direction: column;
border-radius: 2vw;
z-index: -998;
}
/* Controls the dropdown of the directory tab. */
.head-dir-shop-dd{
display: none;
margin-left: -35vw;
padding: 3%;
background-color: #000000;
top: 3.7vw;
position: absolute;
flex-direction: column;
border-radius: 2vw;
z-index: -997;
}
.head-dir-dd-head{
padding-top: 1.5vw;
font-family: MaxwellBold;
}
.head-dir-dd-head li{
list-style: none;
}
.head-dir-dd-head li a{
text-decoration: underline;
}
.head-dd-items{
display: flex;
flex-direction: row;
}
.head-dd-items li{
padding-left: 3vw;
}
.head-dd-items li a{
font-family: MaxwellRegular;
font-size: 2vw;
}
/* Defines the part of the header that actually triggers the dropdowns */
.head-dir-main-link{
padding: 1.4vw;
list-style: none;
}
.head-dir-main-link li a{
text-decoration: underline;
}
/* Modifies the images of the directory */
.head-dir a img{
width: 2vw;
padding-right: 0.2vw;
image-rendering: pixelated;
}
/* A controller for the About part of head-dir */
#head-dir-about {
--hovered-about:0;
}
#head-dir-about:hover {
--hovered-about:1;
}
/* A controller for the Directory part of head-dir */
#head-dir-dir{
--hovered-dir:0;
}
#head-dir-dir:hover{
--hovered-dir:1;
}
/* A controller for the Shop part of head-dir */
#head-dir-shop {
--hovered-shop:0;
}
#head-dir-shop:hover {
--hovered-shop:1;
}
/* The general wrapper for head-social-dropdown */
.head-social{
display: flex;
color: white;
padding-right: 3vw; /* Fixes some boundary issues */
}
.head-social img{
width: 3vw;
image-rendering: pixelated;
}
<!-- The website stylesheet -->
<link rel="stylesheet" href="/style.css" />
<!-- JAVASCRIPT FILES -->
<!-- The website JavaScript file -->
<script src="/main.js" type="module"></script>
<!-- Twitch Stream Embed JavaScript link-->
<script type="text/javascript" src="https://embed.twitch.tv/embed/v1.js"></script>
<!-- Latest YouTube Video Grabber JavaScript link-->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<!-- Latest jQuery module-->
<header id="header">
<!-- Header Logo (Contains both the Logo, Logo Mask Box, and Name which can be changed at any time) -->
<!-- FIX THE ISSUE WHERE THE MASK DIMS THE IMAGE -->
<a class="head-logo" id="headLogo" href="https://mindaman.com">
<div class="head-logo-wrap">
<svg viewBox="0 0 100 100" class="logo-container" style="width: 3.5vw; height: 3.5vw; overflow: visible;">
<defs>
<mask id="logoMask">
<!-- Create the mask image (Added id directly for animation )-->
<image
id="mask-box"
href="/logo-box.svg"
width="100"
height="100"
x="0"
y="0"
/>
</mask>
</defs>
<!-- Set the image to get masked -->
<image
id="mindamanChangingLogo"
class="logo-image"
href="/little-critter.png"
width="100"
height="100"
mask="url(#logoMask)"
/>
</svg>
</div>
<div class="head-name" id="mindamanTitle">MindaMan</div> <!-- Add the text back into the header logo -->
</a>
<!-- Header Directory (Contains multiple dropnavs for "About", "Directory", and "Shop") -->
<!-- FUTURE: Consider maybe animating the little icons by the titles -->
<ul class="head-dir">
<li class="head-dir-main-link" id="head-dir-about">
<a href="https://mindaman.com/about"><img src="/about.png"> About<img src="/dir-arrow.svg" id="head-dir-about-arrow"></a>
<ul class="head-dir-about-dd" id="headAboutMega">
<li class="head-dir-dd-head">
All About Me
<ul class="head-dd-items">
<li><a href="https://mindaman.com/about">About Me</a></li>
<li><a href="https://mindaman.com/timeline">History Timeline</a></li>
<li><a href="https://mindaman.com/pronunciation">Pronunciation</a></li>
<li><a href="https://mindaman.com/faq">FAQ</a></li>
</ul>
</li>
<li class="head-dir-dd-head">
Community Info
<ul class="head-dd-items">
<li><a href="https://"></a></li>
<li><a href="https://mindaman.com/guidelines">Community Guidelines</a></li>
<li><a href="https://mindaman.com/policies">Art Polices</a></li>
<li><a href="https://info.mindaman.com/oc">OC Info</a></li>
<li><a href="https://info.mindaman.com">MindaMan Info</a></li>
<li><a href="https://"></a></li>
</ul>
</li>
<li class="head-dir-dd-head">
Website Info
<ul class="head-dd-items">
<li><a href="https://mindaman.com/credits">Credits</a></li>
<li><a href="https://mindaman.com/log">Devlog</a></li>
<li><a href="https://mindaman.com/guide">Website Guide</a></li>
<li><a href="https://mindaman.com/cookies">Cookie Information</a></li>
<li><a href="https://mindaman.com/resources/deps">Website Dependencies</a></li>
</ul>
</li>
<li class="head-dir-dd-head-link"><a href="https://mindaman.com/about">See my About Me page...</a></li>
</ul>
</li>
<!-- Header Directory Tab -->
<li class="head-dir-main-link" id="head-dir-dir">
<a href="https://mindaman.com/dir" ><img src="/dir.png"> Directory<img src="/dir-arrow.svg" id="head-dir-dir-arrow"></a>
<ul class="head-dir-dir-dd" id="headDirMega">
<li class="head-dir-dd-head">
User / Community Areas
<ul class="head-dd-items">
<li><a href="https://"></a></li>
<li><a href="https://"></a></li>
<li><a href="https://"></a></li>
<li><a href="https://submissions.mindaman.com">MindaMan Submissions</a></li>
<li><a href="https://mindaman.com/commands">Stream Commands</a></li>
<li><a href="https://mindaman.com/commands/sfx">Stream SFX</a></li>
</ul>
</li>
<li class="head-dir-dd-head">
Developer Tools / Resources
<ul class="head-dd-items">
<li><a href="https://dev.mindaman.com">Developer Page</a></li>
<li><a href="https://api.mindaman.com">MindaMan API</a></li>
<li><a href="https://projects.mindaman.com">Projects</a></li>
<li><a href="https://mindaman.com/resources">MindaMan Resources</a></li>
<li><a href="https://cdn.mindaman.com">CDN</a></li>
<li><a href="https://status.mindaman.com">Status</a></li>
</ul>
</li>
<li class="head-dir-dd-head">
Other Important Sub-domains
<ul class="head-dd-items">
<li><a href="https://"></a></li>
<li><a href="https://wiki.mindaman.com">MindaMan Wiki</a></li>
<li><a href="https://social.mindaman.com">Official Socials</a></li>
<li><a href="https://archive.mindaman.com">MindaMan Archive</a></li>
<li><a href="https://assets.mindaman.com">MindaMan Assets</a></li>
</ul>
</li>
<li class="head-dir-dd-head-link"><a href="https://mindaman.com/dir">See full website directory...</a></li>
</ul>
</li>
<li class="head-dir-main-link" id="head-dir-shop">
<!-- Header Shop Tab -->
<a href="https://shop.mindaman.com"><img src="/shop.png"> Shop<img src="/dir-arrow.svg" id="head-dir-shop-arrow"></a>
<ul class="head-dir-shop-dd" id="headShopMega">
<li class="head-dir-dd-head">
Featured Collections
<ul class="head-dd-items">
<li><a href="https://shop.mindaman.com/collections/mindaman-full-collection">All MindaMan Products</a></li>
<li><a href="https://">Critter Chaos</a></li>
<li><s><a href="https://shop.mindaman.com/collections/">The Two Steps Collection</a></s></li>
</ul>
</li>
<li class="head-dir-dd-head">
Featured Merch (Little Critter Themed)
<ul class="head-dd-items">
<li><a href="https://shop.mindaman.com/products/critter-stickers-edition-1">Stickers</a></li>
<li><a href="https://shop.mindaman.com/products/embroidered-mindaman-logo-hoodie">Hoodie</a></li>
<li><a href="https://shop.mindaman.com/products/helmet-grid-t-shirt">Helmet Grid Shirt</a></li>
<li><a href="https://shop.mindaman.com/products/embroidered-mindaman-logo-beanie">Beanie</a></li>
<li><a href="https://shop.mindaman.com/products/little-critter-notebook">Notebook</a></li>
</ul>
</li>
<li class="head-dir-dd-head">
Account Pages & Legal
<ul class="head-dd-items">
<li><a href="https://">Account</a></li>
<li><a href="https://shop.mindaman.com/supporters">Members Area</a></li>
<li><a href="https://shop.mindaman.com/pages/returns-faq">Return Policy & FAQ</a></li>
<li><a href="https://shop.mindaman.com/terms-of-service">ToS</a></li>
<li><a href="https://shop.mindaman.com/privacy-policy">Privacy Policy</a></li>
</ul>
</li>
<li class="head-dir-dd-head-link"><a href="https://shop.mindaman.com">See full store page...</a></li>
</ul>
</li>
<li class="head-dir-main-link"><a href="https://mindaman.com/contact" id="head-dir-contact"><img src="/contact.png"> Contact</a></li>
</ul>
<!-- Header Social -->
<!-- FUTURE: Dropdown from one icon, contains a link at the bottom for more social links. When each icon is hovered, it extends out to the left with the social media name, and handle. when clicked it redirects -->
<div class="head-social">
<a href="https://youtube.com/@mindaman?sub_confirmation=1"><img src="https://cdn.mindaman.com/website-assets/pixel-social-icons/youtube_icon_bg.png"></a>
<a href="https://twitch.tv/mindamanreal"><img src="https://cdn.mindaman.com/website-assets/pixel-social-icons/twitch-v2.png"></a>
<a href="https://redirect.mindaman.com/discord"><img src="https://cdn.mindaman.com/website-assets/pixel-social-icons/discord_icon_bg.png"></a>
<a href="https://github.com/MindaManOfficial"><img src="https://cdn.mindaman.com/website-assets/pixel-social-icons/github_icon_bg.png"></a>
</div>
</header>