Giter VIP home page Giter VIP logo

resume's Introduction

README

This repository contains my personal portfolio website, showcasing my skills as a full stack developer. It includes my resume, work history, and a collection of projects that highlight my technical expertise and problem-solving abilities. Explore my portfolio to learn more about my work and experience in the field of web development.

Links

How I Built This Website with Web Components


Building this website was made seamless and modular through the use of Web Components. Web Components are a set of web platform APIs that allow you to create reusable custom elements with encapsulated functionality and styling.

Technologies Used

  • Web Components: Leveraged the power of Web Components to create modular and reusable UI elements.

  • Custom Elements: Defined custom HTML elements like <t-header> and <t-footer> to encapsulate specific parts of the page and functionality.

  • Shadow DOM: You can also utilized Shadow DOM to encapsulate the styles of individual components, preventing external styles from affecting their design. But I didn't go that far since I didn't really need to.

Web Components Details

It's still my first time using Web Components, but I feel like it's pretty simple. I haven't used every single feature it has, but all in all, it's perfect for my setup. I'm currently in the process of creating my portfolio using Web Components, also deployed on GitHub, and I find the experience to be quite straightforward. Having used the Angular framework before, I appreciate the simplicity of Web Components, especially for something as simple as this.

Before delving deeper, it's important to clarify that I might have used Web Components in a non-conventional way. However, my primary goal is to simplify my development process by creating small files and seamlessly connecting them. For instance, the Index page is a collection of components, where each component is essentially an HTML page with specific information. The aim is to avoid redundant repetition across every web page, and Web Components have effectively fulfilled this requirement for me.

Lifecycle Callbacks

Web Components lifecycle callbacks such as connectedCallback and disconnectedCallback allow's developers to execute code at specific points in the component's lifecycle.

connectedCallback() {
  // Code to run when the element is added
}

disconnectedCallback() {
  // Code to run when the element is removed
}

Header Component

The <t-header> component displays the navigation bar and the Top Banner, showing a link where there is a downloadable pdf file of my CV. It is dynamically loads content from an external HTML file.

In a file named 't_header.js', create a custom header class.

class HeaderComponent extends HTMLElement {
	// ConnectedCallback is called when the element is connected to the DOM.
	connectedCallback() {
		this.loadContent();
	}
	async loadContent() {
		this.content = this.innerHTML || "";
		const html = await fetch("components/header.html"); //Load html file.
		this.innerHTML =
			(await html.text()) +
			`<h1>${this.content}</h1>`;
	}
}
// Define the custom element with the tag name "t-header."
customElements.define("t-header", HeaderComponent);
<t-header>Content...</t-header>

Footer Component

The <t-footer> component provides a footer section for the website.

class FooterComponent extends HTMLElement {
	connectedCallback() {
		const html = await fetch(`/components/footer.html`);
		this.innerHTML = await html.text();
	}
}

customElements.define("t-footer", FooterComponent);
  • Here I didn't need to add content between <t-footer><t-footer>

Importing Components

This is how components are easily imported on every page where you want to use them

<head>
	<script type="module" src="components/t_header.js"></script>
	...
</head>
...
<body>
	<t-header></t-header>
</body>

Benefits of using Web Components

Web Components offer a high degree of reusability, allowing components to be seamlessly utilized across different pages or projects. This becomes particularly advantageous when the goal is to quickly build a website for something straightforward, such as a portfolio. Unlike relying on entire libraries or frameworks like React or Angular for simpler projects, Web Components provide a lightweight solution. This simplicity is especially beneficial when the main objective is a swift development process.

By choosing Web Components, its not only about reusability, but you will also gain a deeper understanding of component-based architecture. This knowledge extends beyond the specific implementation of Web Components and can contribute to a broader comprehension of how other, more comprehensive frameworks operate.

Using Web Components for non expensive or complex projects it will both, satisfies the immediate requirements for simplicity, reusability and also represents a significant educational pursuit. It provides insights into principles of component-based design.

Additional Resources

For more information on Web Components, I referred to the WebComponents WebDocs on Mozilla Developer Network (MDN). The documentation provided comprehensive guidance and examples, making the development process smooth and efficient.

LINKS

Github Link: https://github.com/omar0ali/resume

resume's People

Contributors

omar0ali avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.