To modernize your website and fix the issue with social icons not displaying, we'll address both aspects step-by-step. Below are comprehensive instructions and updated code snippets to help you achieve a more modern look and ensure your social icons render correctly.
1. Fixing Social Icons Not Showing
a. Ensure Font Awesome is Properly Loaded
The social icons rely on Font Awesome. If they're not displaying, it might be due to incorrect link configuration or version mismatch. Here's how to ensure Font Awesome is correctly integrated:
-
Verify the CDN Link:
- Integrity Attribute: The
integrity attribute ensures the fetched resource hasn't been tampered with. An incorrect hash can prevent the stylesheet from loading.
- Solution: Temporarily remove the
integrity and crossorigin attributes to test if Font Awesome loads correctly.
-
Use the Official Font Awesome CDN:
Replace your existing Font Awesome CDN link with the official one to ensure compatibility.
link: [
{ rel: "shortcut icon", type: "image/svg", href: "/assets/logo.svg" },
{
rel: "stylesheet",
href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
},
{
href: "https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap",
rel: "stylesheet"
}
]
-
Alternatively, Use NPM Package:
If you prefer managing dependencies via NPM:
npm install @fortawesome/fontawesome-free
Then, import it in your script setup:
import "@fortawesome/fontawesome-free/css/all.min.css";
b. Verify Icon Classes
Ensure the icon classes used in your template match those available in Font Awesome 6.6.0. Below are the correct classes:
<div class="social-icons">
<a title="Discord / Community" href="https://discord.gg/Jk93kePyty" target="_blank">
<i class="fab fa-discord"></i>
</a>
<a title="Source Code" href="https://github.com/blazium-engine/blazium" target="_blank">
<i class="fab fa-github"></i>
</a>
<a title="Twitter / X" href="https://x.com/BlaziumEngine" target="_blank">
<i class="fab fa-twitter"></i>
</a>
<a title="Documentation" href="https://docs.blazium.app" target="_blank">
<i class="fas fa-book"></i>
</a>
</div>
Note: Ensure that the fa-discord, fa-github, fa-twitter, and fa-book classes exist in Font Awesome 6.6.0.
c. Check for CSS Conflicts
Ensure your custom CSS isn't hiding the icons. For example, confirm that <i> elements are not set to display: none or have conflicting colors.
2. Modernizing the Website Design
Modern design often emphasizes clean layouts, responsive design, smooth animations, and appealing typography. Here’s how to enhance your website’s appearance:
a. Enhance Typography
Use modern, clean fonts like Montserrat for a professional look.
Add Google Fonts Link:
<link
href="https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap"
rel="stylesheet">
Update CSS to Use the New Font:
body {
font-family: 'Montserrat', sans-serif;
}
b. Improve Layout and Spacing
Refine your layout for better readability and aesthetics.
Updated CSS:
:root {
--background-color: #1e1e1e;
--text-color: #f0f0f0;
--accent-color: #e83951;
--font-family: 'Montserrat', sans-serif;
}
.wrap {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
background-color: var(--background-color);
color: var(--text-color);
text-align: center;
padding: 2rem;
position: relative;
overflow: hidden;
}
#logo img {
width: 120px;
transition: transform 0.5s ease;
}
#logo img:hover {
transform: rotate(20deg) scale(1.1);
}
.intro-title {
font-family: var(--font-family);
font-weight: 700;
margin: 1em 0;
font-size: 2em;
}
.social-icons {
display: flex;
justify-content: center;
margin: 1em 0;
}
.social-icons a {
font-size: 1.5em;
color: var(--accent-color);
margin: 0 1rem;
transition: color 0.3s, transform 0.3s;
}
.social-icons a:hover {
color: #ffffff;
transform: translateY(-5px);
}
#release-info {
margin-top: 20px;
}
.release-title {
font-family: var(--font-family);
font-size: 1.5em;
margin-bottom: 0.5em;
}
/* Responsive Design */
@media (max-width: 600px) {
.intro-title {
font-size: 1.5em;
}
.social-icons a {
font-size: 1.2em;
margin: 0 0.5rem;
}
#logo img {
width: 100px;
}
}
c. Add Smooth Animations
Subtle animations can enhance user experience without being distracting.
Example: Animated Logo on Hover
#logo img {
width: 120px;
transition: transform 0.5s ease;
}
#logo img:hover {
transform: rotate(20deg) scale(1.1);
}
Example: Hover Effects on Social Icons
.social-icons a {
transition: color 0.3s, transform 0.3s;
}
.social-icons a:hover {
color: #ffffff;
transform: translateY(-5px);
}
d. Optimize Background Effects
If you're using multiple triangles for background effects, it might clutter the design. Consider reducing the number or opting for a more modern effect like subtle gradients or particle animations.
Example: Reducing the Number of Triangles
<div class="tri" v-for="n in 64" :key="n"></div>
Alternatively, switch to a gradient background:
.wrap {
background: linear-gradient(135deg, #1e1e1e 0%, #121212 100%);
}
3. Updated Component Code
Here's the revised component incorporating all the fixes and enhancements:
<template>
<div class="wrap">
<!-- Optional: Reduce or customize the triangle background effect -->
<div class="tri" v-for="n in 64" :key="n"></div>
<!-- Logo Image -->
<div id="logo">
<img src="/assets/logo_white_outline.svg" alt="Blazium Engine Logo" />
</div>
<!-- Intro Section -->
<div id="intro">
<h2 class="intro-title">Blazium Engine</h2>
<hr />
<div class="social-icons">
<a
title="Discord / Community"
href="https://discord.gg/Jk93kePyty"
target="_blank"
rel="noopener noreferrer"
>
<i class="fab fa-discord"></i>
</a>
<a
title="Source Code"
href="https://github.com/blazium-engine/blazium"
target="_blank"
rel="noopener noreferrer"
>
<i class="fab fa-github"></i>
</a>
<a
title="Twitter / X"
href="https://x.com/BlaziumEngine"
target="_blank"
rel="noopener noreferrer"
>
<i class="fab fa-twitter"></i>
</a>
<a
title="Documentation"
href="https://docs.blazium.app"
target="_blank"
rel="noopener noreferrer"
>
<i class="fas fa-book"></i>
</a>
</div>
</div>
<!-- Release Information Box -->
<div id="release-info">
<h3 class="release-title">Blazium Engine Release Info</h3>
<p id="release-message">Loading release information...</p>
</div>
</div>
</template>
<script setup>
// Importing CSS files
import "@/public/assets/css/style.css";
import "@/public/assets/css/effects.css";
import "@fortawesome/fontawesome-free/css/all.min.css";
// Load JavaScript background script
if (process.client) {
import("@/public/assets/js/background.js");
}
</script>
<script>
export default {
head() {
return {
title: "Blazium Engine",
meta: [
{ charset: "utf-8" },
{ name: "viewport", content: "width=device-width, initial-scale=1.0" },
{
name: "description",
content: "Blazium Engine - A powerful and flexible game engine for developers."
},
{
name: "keywords",
content: "Blazium, Game Engine, Game Development, Blazium Engine, Blazium App"
},
{ name: "robots", content: "index, follow" },
{ name: "author", content: "Blazium Team" },
{ name: "theme-color", content: "#000000" },
{ property: "og:title", content: "Blazium Engine" },
{
property: "og:description",
content: "Blazium Engine - A powerful and flexible game engine for developers."
},
{ property: "og:url", content: "https://blazium.app/" },
{ property: "og:image", content: "https://blazium.app/static/assets/logo.svg" },
{ property: "og:type", content: "website" },
{ property: "og:site_name", content: "Blazium Engine" },
{ name: "twitter:card", content: "summary_large_image" },
{ name: "twitter:title", content: "Blazium Engine" },
{
name: "twitter:description",
content: "Blazium Engine - A powerful and flexible game engine for developers."
},
{ name: "twitter:image", content: "https://blazium.app/static/assets/logo.svg" },
{ name: "twitter:url", content: "https://blazium.app/" },
],
link: [
{ rel: "shortcut icon", type: "image/svg+xml", href: "/assets/logo.svg" },
{
rel: "stylesheet",
href: "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css"
},
{
href: "https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap",
rel: "stylesheet"
}
]
}
}
}
</script>
<style>
/* CSS Variables for easy theming */
:root {
--background-color: #1e1e1e;
--text-color: #f0f0f0;
--accent-color: #e83951;
--font-family: 'Montserrat', sans-serif;
}
/* Wrapper styling */
.wrap {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
background-color: var(--background-color);
color: var(--text-color);
text-align: center;
padding: 2rem;
position: relative;
overflow: hidden;
}
/* Optional: Reduce number of triangle effects for cleaner look */
.tri {
/* Customize or remove as needed */
}
/* Logo styling with hover animation */
#logo img {
width: 120px;
transition: transform 0.5s ease;
}
#logo img:hover {
transform: rotate(20deg) scale(1.1);
}
/* Intro title styling */
.intro-title {
font-family: var(--font-family);
font-weight: 700;
margin: 1em 0;
font-size: 2em;
}
/* Social icons container */
.social-icons {
display: flex;
justify-content: center;
margin: 1em 0;
}
/* Social icons styling */
.social-icons a {
font-size: 1.5em;
color: var(--accent-color);
margin: 0 1rem;
transition: color 0.3s, transform 0.3s;
}
.social-icons a:hover {
color: #ffffff;
transform: translateY(-5px);
}
/* Release info section */
#release-info {
margin-top: 20px;
}
/* Release title styling */
.release-title {
font-family: var(--font-family);
font-size: 1.5em;
margin-bottom: 0.5em;
}
/* Responsive Design */
@media (max-width: 600px) {
.intro-title {
font-size: 1.5em;
}
.social-icons a {
font-size: 1.2em;
margin: 0 0.5rem;
}
#logo img {
width: 100px;
}
}
</style>
4. Additional Recommendations
a. Use Semantic HTML
Ensure your HTML structure is semantic for better accessibility and SEO. For example, wrap your intro section in a <section> tag.
<section id="intro">
<!-- Content -->
</section>
b. Optimize Images
Ensure your logo and other images are optimized for web to reduce loading times. Use formats like SVG for logos to maintain quality at any size.
c. Enhance Accessibility
-
ARIA Labels: Add aria-label attributes to your links for screen readers.
<a
title="Discord / Community"
href="https://discord.gg/Jk93kePyty"
target="_blank"
rel="noopener noreferrer"
aria-label="Discord Community"
>
<i class="fab fa-discord"></i>
</a>
-
Focus States: Ensure interactive elements have visible focus states for keyboard navigation.
.social-icons a:focus {
outline: 2px solid var(--accent-color);
outline-offset: 2px;
}
d. Implement Lazy Loading
For better performance, especially if you have many background effects or images, implement lazy loading.
<img
src="/assets/logo_white_outline.svg"
alt="Blazium Engine Logo"
loading="lazy"
/>
e. Test Across Browsers and Devices
Ensure your website looks and functions correctly across different browsers and devices. Use tools like Chrome DevTools to emulate various screen sizes.
By following these steps, you'll not only fix the issue with the social icons but also enhance the overall modern aesthetic and functionality of your website. If you encounter further issues or need more specific assistance, feel free to ask!