Skip to content

Commit

Permalink
big changes
Browse files Browse the repository at this point in the history
  • Loading branch information
antoinebou12 committed Nov 1, 2024
1 parent 6db0067 commit ba0b3b5
Show file tree
Hide file tree
Showing 19 changed files with 5,022 additions and 445 deletions.
100 changes: 63 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,73 @@
# GRAPHQUON Website

![GitHub last commit](https://img.shields.io/github/last-commit/GRAPHQUON/graphquon.github.io)
![GitHub license](https://img.shields.io/github/license/GRAPHQUON/graphquon.github.io)
![GitHub last commit](https://img.shields.io/github/last-commit/GRAPHQUON/graphquon.github.io)
![GitHub license](https://img.shields.io/github/license/GRAPHQUON/graphquon.github.io)
![GitHub contributors](https://img.shields.io/github/contributors/GRAPHQUON/graphquon.github.io)
![Website visits](https://img.shields.io/badge/dynamic/json?color=blue&label=Visits&query=value&url=https://api.countapi.xyz/hit/GRAPHQUON/graphquon.github.io)

This repository contains the code for the **GRAPHQUON** (formerly **MOTOGRAPH**) website. The site is hosted on **GitHub Pages** and automatically deployed from the `main` branch with every push.
This repository contains the codebase for the **GRAPHQUON** website, an event hub for the technology and creative industries. Previously known as **MOTOGRAPH**, the site is designed to be flexible and adaptable for future GRAPHQUON events. It is hosted on **GitHub Pages** and automatically deploys from the `main` branch with every push.

GRAPHQUON is a technology and creative industry event, and this codebase is designed to be flexible for future events, regardless of the hosting institution.
---

## 📅 Event Information

For each GRAPHQUON event, the following details are vital to include:

1. **Where**: The event's location, whether it's a physical venue or an online link for virtual events.
2. **When**: Clear dates and times, with time zones if it's online.
3. **Who**: A list of key speakers, panelists, and hosts to generate interest in the event.
4. **Conversations Over Good Food**: Highlights of any special meal-based networking sessions, such as luncheons, dinners, or coffee breaks, to encourage informal discussions and deeper networking.

---

## 🚀 Quick Start

### Install the HTTP Server
To run the site locally, you'll need a basic HTTP server to avoid CORS issues.
To set up the site locally, you'll need an HTTP server. This will help you avoid CORS issues that might otherwise occur during local testing.

### 1. Install the HTTP Server

Use **npm** to install a basic HTTP server:
```bash
npm install http-server
```

### Run the Local Server
### 2. Run the Local Server

Start the server with:
```bash
http-server
```

### 4. Access the Site
Navigate to `http://localhost:8080` to see the site running locally.
### 3. Access the Site

Visit `http://localhost:8080` in your browser to see the site in action.

> **Tip**: Alternatively, you can use the **Live Server** extension in Visual Studio Code to serve the site locally without additional setup.
---

## 🛠️ Project Structure

Here is the structure of the repository:
The repository is organized as follows:

```
├── components
│ ├── app.js # Main app component
│ ├── privacy/
│ │ └── privacy.js # Privacy section
│ ├── app.js # Main application component
│ ├── sections/
│ │ ├── about/ # About section
│ │ ├── contact/ # Contact section
│ │ ├── about/ # About section component
│ │ ├── contact/ # Contact section component
│ │ ├── footer/ # Footer component
│ │ ├── header/ # Header component
│ │ ├── hero/ # Hero section
│ │ ├── keynote/ # Keynote section
│ │ ├── schedule/ # Schedule section
│ │ └── terms/ # Terms section
├── res/ # Resources (images, fonts)
├── favicon.png # Website favicon
├── index.html # Main HTML file
├── index.js # Entry JavaScript file
├── lib/
│ │ ├── hero/ # Hero section component
│ │ ├── keynote/ # Keynote section component
│ │ ├── schedule/ # Schedule section component
│ │ ├── terms/ # Terms and conditions section component
│ │ ├── privacy/
├── res/ # Resources (e.g., images, fonts)
├── lib/ # Libraries used in the project
├── favicon.png
├── index.html # Main HTML entry point
├── index.js # JavaScript entry point
├── privacy.html # Privacy policy page
└── terms.html # Terms and conditions page
```
Expand All @@ -58,37 +76,45 @@ Here is the structure of the repository:

## 🔄 Updating for Future Events

To adapt the website for future editions of GRAPHQUON, you need to update a few files and sections:
GRAPHQUON’s codebase is built to facilitate easy updates for future events. To tailor the website to a new event:

## 💻 Local Development
- Update content files such as `index.html` for the homepage.
- Edit `schedule.json` to reflect the latest event details.
- Adjust any necessary CSS or style-related files for the new design theme.

This website is straightforward to maintain and develop locally. Using **npm** and **http-server**, you can run a local version of the site to preview changes.
---

To test changes:
## 💻 Local Development

1. Make necessary updates to files like `index.html`, `schedule.json`, or styles.
2. Start the server using:
Developing locally is efficient with **npm** and **http-server**. Follow these steps to preview and test changes before pushing them live:

1. Modify relevant files, such as `index.html`, event data in `schedule.json`, or stylesheets.
2. Start the server with:
```bash
http-server
```
3. View the site locally at `http://localhost:8080`.
3. Open the site at `http://localhost:8080` in your browser to view the changes in real time.

> **Note**: **Live Server** in Visual Studio Code is a great alternative for a smoother local preview experience.
---

## 🚢 Deployment

The website is hosted on **GitHub Pages**, and any push to the `main` branch automatically triggers a deployment. This ensures that the site is always up-to-date after edits.
The site is deployed via **GitHub Pages**. Any push to the `main` branch will automatically redeploy the latest version.

Steps for deployment:
**Deployment Steps:**

1. Commit your changes.
2. Push to the `main` branch.
3. GitHub Pages will automatically deploy the latest version of the site.
1. Commit your changes to your local repository.
2. Push your changes to the `main` branch on GitHub.
3. GitHub Pages will automatically build and deploy the latest version of the site.

---

## 🛡 License

This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
This project is licensed under the MIT License. For detailed information, refer to the [LICENSE](LICENSE) file in the repository.

---

Happy coding and welcome to the world of GRAPHQUON
138 changes: 138 additions & 0 deletions components/background/background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
import { LitElement, html, css } from 'https://unpkg.com/lit@2.2.7?module';
import 'https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.min.js';
import 'https://threejs.org/examples/js/loaders/FBXLoader.js';

class PiranhaAnimation extends LitElement {
static styles = css`
:host {
display: block;
position: relative;
width: 100vw;
height: 100vh;
}
canvas {
display: block;
width: 100%;
height: 100%;
}
`;

constructor() {
super();
this.scene = null;
this.camera = null;
this.renderer = null;
this.piranha = null;
this.animationId = null;
}

firstUpdated() {
this.initThreeJS();
}

async initThreeJS() {
// Create Scene
this.scene = new THREE.Scene();

// Create Camera
this.camera = new THREE.PerspectiveCamera(75, this.clientWidth / this.clientHeight, 0.1, 1000);
this.camera.position.set(0, 1, 5);

// Create Renderer
this.renderer = new THREE.WebGLRenderer({
canvas: this.renderRoot.querySelector('#bg-canvas'),
alpha: true,
antialias: true
});
this.renderer.setSize(this.clientWidth, this.clientHeight);
this.renderer.setPixelRatio(window.devicePixelRatio);

// Load Piranha Model using fetch and createObjectURL
const fbxUrl = await this.loadFBXModel('./components/background/source/piranha.fbx');
const loader = new THREE.FBXLoader();
loader.load(fbxUrl, (object) => {
this.piranha = object;
this.piranha.scale.set(0.05, 0.05, 0.05);
this.scene.add(this.piranha);

// Apply textures using fetch
this.applyTextures();
});

// Lighting
const ambientLight = new THREE.AmbientLight(0x404040, 2);
this.scene.add(ambientLight);
const directionalLight = new THREE.DirectionalLight(0xffffff, 1);
directionalLight.position.set(5, 5, 5).normalize();
this.scene.add(directionalLight);

// Handle Window Resize
window.addEventListener('resize', this.onWindowResize.bind(this), false);

// Start Animation
this.animate();
}

async loadFBXModel(url) {
// Fetch the model as a Blob and convert it to an Object URL
const response = await fetch(url);
const blob = await response.blob();
return URL.createObjectURL(blob);
}

async loadTexture(url) {
// Fetch the texture as a Blob and convert it to an Object URL
const response = await fetch(url);
const blob = await response.blob();
return new THREE.TextureLoader().load(URL.createObjectURL(blob));
}

async applyTextures() {
const textureMap = await this.loadTexture('./components/background/textures/pir_Colourc.jpg');
const normalMap = await this.loadTexture('./components/background/textures/pir_Bump.jpg');
const specularMap = await this.loadTexture('./components/background/textures/pir_Spec.jpg');
const roughnessMap = await this.loadTexture('./components/background/textures/pir_occ.jpg');

// Traverse through piranha model and apply textures
this.piranha.traverse((child) => {
if (child.isMesh) {
child.material.map = textureMap;
child.material.normalMap = normalMap;
child.material.specularMap = specularMap;
child.material.roughnessMap = roughnessMap;
}
});
}

animate() {
this.animationId = requestAnimationFrame(this.animate.bind(this));

// Piranha swimming motion
if (this.piranha) {
this.piranha.rotation.y += 0.01;
this.piranha.position.x = Math.sin(Date.now() * 0.001) * 2;
this.piranha.position.y = Math.sin(Date.now() * 0.0005) * 0.5;
}

this.renderer.render(this.scene, this.camera);
}

onWindowResize() {
this.camera.aspect = this.clientWidth / this.clientHeight;
this.camera.updateProjectionMatrix();
this.renderer.setSize(this.clientWidth, this.clientHeight);
}

disconnectedCallback() {
super.disconnectedCallback();
cancelAnimationFrame(this.animationId);
this.renderer.dispose();
window.removeEventListener('resize', this.onWindowResize.bind(this));
}

render() {
return html`<canvas id="bg-canvas"></canvas>`;
}
}

customElements.define('piranha-animation', PiranhaAnimation);
Binary file added components/background/source/piranha.fbx
Binary file not shown.
Binary file added components/background/textures/pir_Bump.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added components/background/textures/pir_Colourc.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added components/background/textures/pir_Colourss.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added components/background/textures/pir_FinB.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added components/background/textures/pir_Spec.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added components/background/textures/pir_occ.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added components/background/textures/ptera_eye_03.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added components/background/textures/teeth.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion components/sections/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class HeaderComponent extends LitElement {
return html`
<header aria-label="Main Navigation">
<nav>
<a href="#home" class="logo" aria-label="Site Logo" @click=${this.handleClick}>GRAPHQUON</div>
<a href="#home" class="logo" aria-label="Site Logo" @click=${this.handleClick}>GRAPHQUON</a>
<div class="nav-links">
<a href="#about" class="scroll-link" @click=${this.handleClick}>About</a>
<a href="#keynote" class="scroll-link" @click=${this.handleClick}>Keynote</a>
Expand Down Expand Up @@ -126,6 +126,9 @@ class HeaderComponent extends LitElement {
}
}

sendEmail() {
window.location.href = 'mailto:graphquon@etsmtl.ca';
}
}

customElements.define('header-component', HeaderComponent);
Loading

0 comments on commit ba0b3b5

Please # to comment.