Skip to content

Commit

Permalink
prettier added
Browse files Browse the repository at this point in the history
  • Loading branch information
Fokarr committed Sep 14, 2023
1 parent a9ce71c commit 1adeb8b
Show file tree
Hide file tree
Showing 19 changed files with 5,040 additions and 4,975 deletions.
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"trailingComma": "es5",
"tabWidth": 4,
"semi": true,
"singleQuote": false
}
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ Built by [Fokarr](https://github.com/Fokarr) and used by [EXØRD](https://exord.
This repository contains a Creative Coding Boilerplate, which serves as a starting point for creating interactive and visually appealing projects using various creative coding frameworks and libraries. It provides a structured foundation and helpful utilities to simplify the development process.

## Features

Built-in Server: The boilerplate includes a simple development server to serve your creative coding projects locally.
Asset Management: The boilerplate offers a convenient way to manage your project's assets, such as images, fonts, and other resources.
Code Bundling: It utilizes [Vite.js](https://vitejs.dev/) as a bundling tool to combine and optimize your code, making it more efficient and easier to distribute.
Template System: The boilerplate incorporates a template engine called [handlebars](https://handlebarsjs.com/)
Smooth Scrolling: For Scrolling we use [studio-freight/lenis](https://lenis.studiofreight.com/). <- Thanks for the awesome library! :)
Page Transitions: [Barba.js](https://barba.js.org/) is initialized and working as intented.
Animations: For Animations the template uses [motion.dev](https://motion.dev/) since it is much smaller and has all the features you need.
Animations: For Animations the template uses [motion.dev](https://motion.dev/) since it is much smaller and has all the features you need.

Getting Started
To get started with the Creative Coding Boilerplate, follow these steps:
Expand Down Expand Up @@ -71,20 +72,24 @@ The structure of the Creative Coding Boilerplate is organized as follows:
└── ...
```

### app
### app

This directory contains all of the .js files which get bundled for the frontend. Such as pagetransition, animations or smoothscrolling files. The main.js is the entrypoint and will initialize everything.

### assets

This directory is used to store project assets, such as fonts, images, and other public resources.

### src

This directory contains the source code of your project. Such as API-Management (if you need one) and all of the template files in the views directory. The template engine which gets used is Handlebars.

### styles
styles: Holds stylesheets for styling your creative coding project in scss the index.scss is the entrypoint.

styles: Holds stylesheets for styling your creative coding project in scss the index.scss is the entrypoint.

Feel free to modify the project structure as per your requirements and add additional files, directories, or libraries as needed.

#### Contributing

Contributions to the Creative Coding Boilerplate are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.
43 changes: 25 additions & 18 deletions app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import express from "express";
import { engine, create } from 'express-handlebars';
import { engine, create } from "express-handlebars";
import path from "path";
import { fileURLToPath } from 'url';
import { fileURLToPath } from "url";

const app = express();
const port = 3001;
Expand All @@ -10,30 +10,37 @@ const __dirname = path.dirname(__filename);

// Specify helpers which are only registered on this instance.
const hbs = create({
helpers: {
foo() { return 'FOO!'; },
bar() { return 'BAR!'; }
}
helpers: {
foo() {
return "FOO!";
},
bar() {
return "BAR!";
},
},
});

// handlebars
app.set('views', path.join(__dirname, './src/pages'));
app.engine('handlebars', engine({
layoutsDir: path.join(__dirname, './src/pages/layouts'), // Pfad für Layouts, relativ zu __dirname
partialsDir: path.join(__dirname, './src/components'),
}));
app.set('view engine', 'handlebars');
app.set("views", path.join(__dirname, "./src/pages"));
app.engine(
"handlebars",
engine({
layoutsDir: path.join(__dirname, "./src/pages/layouts"), // Pfad für Layouts, relativ zu __dirname
partialsDir: path.join(__dirname, "./src/components"),
})
);
app.set("view engine", "handlebars");
app.use("/public", express.static(path.join(__dirname, "./public")));
app.use("/dist", express.static(path.join(__dirname, "./dist")));

app.get("/", (req, res) => {
res.render("home", { title: "Creative Coding Boilerplate by" });
})
res.render("home", { title: "Creative Coding Boilerplate by" });
});

app.get("/contact", (req, res) => {
res.render("contact/contact", { title: "Contact us at:" });
})
res.render("contact/contact", { title: "Contact us at:" });
});

app.listen(port, () => {
console.log(`Example app listening on port ${port}`)
})
console.log(`Example app listening on port ${port}`);
});
Loading

0 comments on commit 1adeb8b

Please sign in to comment.