feat: carousel class

This commit is contained in:
Mike 2024-01-10 01:15:11 -05:00
parent 0d843d6aa3
commit 2562bd4188
5 changed files with 5092 additions and 5065 deletions

View file

@ -0,0 +1,3 @@
{
"tabWidth": 4
}

File diff suppressed because it is too large Load diff

View file

@ -1,26 +1,26 @@
{ {
"name": "webpack-template", "name": "webpack-template",
"version": "1.0.0", "version": "1.0.0",
"description": "Vanilla template for webpack", "description": "Vanilla template for webpack",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1", "test": "echo \"Error: no test specified\" && exit 1",
"start": "webpack serve --open --config webpack.dev.js", "start": "webpack serve --open --config webpack.dev.js",
"build": "webpack --config webpack.prod.js" "build": "webpack --config webpack.prod.js"
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"devDependencies": { "devDependencies": {
"css-loader": "^6.8.1", "css-loader": "^6.8.1",
"eslint": "^8.56.0", "eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"html-webpack-plugin": "^5.6.0", "html-webpack-plugin": "^5.6.0",
"prettier": "3.1.1", "prettier": "3.1.1",
"style-loader": "^3.3.3", "style-loader": "^3.3.3",
"webpack": "^5.89.0", "webpack": "^5.89.0",
"webpack-cli": "^5.1.4", "webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1", "webpack-dev-server": "^4.15.1",
"webpack-merge": "^5.10.0" "webpack-merge": "^5.10.0"
} }
} }

View file

@ -0,0 +1,21 @@
class Carousel {
constructor() {
this.container = document.createElement("div");
this.setupCarouselStructure();
}
setupCarouselStructure() {
this.container.classList.add("container");
this.container.style.height = "60vh";
this.carousel = document.createElement("div");
this.carousel.classList.add("carousel");
this.container.append(this.carousel);
}
getCarousel = () => this.container;
}
export { Carousel };

View file

@ -1,3 +1,4 @@
import { Carousel } from "./components/imageCarousel";
import { DropDown } from "./components/dropDown"; import { DropDown } from "./components/dropDown";
import { Menu } from "./components/mobileMenu"; import { Menu } from "./components/mobileMenu";
import "./style.css"; import "./style.css";
@ -14,14 +15,16 @@ function website() {
const _menu = ["main", "about", "store", "blog", "contact"]; const _menu = ["main", "about", "store", "blog", "contact"];
const dropdown = new DropDown(_menu); const dropdown = new DropDown(_menu);
const mobile = new Menu(_menu); const mobile = new Menu(_menu);
const carouselObj = new Carousel();
const div = dropdown.dropdownComponent(); const div = dropdown.dropdownComponent();
const h1 = document.createElement("h1"); const h1 = document.createElement("h1");
const carousel = carouselObj.getCarousel();
h1.textContent = "DEEZ NUTS MAN"; h1.textContent = "DEEZ NUTS MAN";
const menuMobile = mobile.buildMenu(); const menuMobile = mobile.buildMenu();
document.body.append(menuMobile, div, h1); document.body.append(menuMobile, div, h1, carousel);
} }
fontAwesome(); fontAwesome();