mirror of
https://gitea.smigz.com/smiggiddy/odin-codeprojects.git
synced 2024-12-26 06:20:42 -05:00
feat: carousel class
This commit is contained in:
parent
0d843d6aa3
commit
2562bd4188
5 changed files with 5092 additions and 5065 deletions
3
dynamicProgrammingExamples/.prettierrc
Normal file
3
dynamicProgrammingExamples/.prettierrc
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"tabWidth": 4
|
||||
}
|
10080
dynamicProgrammingExamples/package-lock.json
generated
10080
dynamicProgrammingExamples/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -1,26 +1,26 @@
|
|||
{
|
||||
"name": "webpack-template",
|
||||
"version": "1.0.0",
|
||||
"description": "Vanilla template for webpack",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "webpack serve --open --config webpack.dev.js",
|
||||
"build": "webpack --config webpack.prod.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"css-loader": "^6.8.1",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"html-webpack-plugin": "^5.6.0",
|
||||
"prettier": "3.1.1",
|
||||
"style-loader": "^3.3.3",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-dev-server": "^4.15.1",
|
||||
"webpack-merge": "^5.10.0"
|
||||
}
|
||||
"name": "webpack-template",
|
||||
"version": "1.0.0",
|
||||
"description": "Vanilla template for webpack",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "webpack serve --open --config webpack.dev.js",
|
||||
"build": "webpack --config webpack.prod.js"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"css-loader": "^6.8.1",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-config-prettier": "^9.1.0",
|
||||
"html-webpack-plugin": "^5.6.0",
|
||||
"prettier": "3.1.1",
|
||||
"style-loader": "^3.3.3",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-dev-server": "^4.15.1",
|
||||
"webpack-merge": "^5.10.0"
|
||||
}
|
||||
}
|
||||
|
|
21
dynamicProgrammingExamples/src/components/imageCarousel.js
Normal file
21
dynamicProgrammingExamples/src/components/imageCarousel.js
Normal 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 };
|
|
@ -1,3 +1,4 @@
|
|||
import { Carousel } from "./components/imageCarousel";
|
||||
import { DropDown } from "./components/dropDown";
|
||||
import { Menu } from "./components/mobileMenu";
|
||||
import "./style.css";
|
||||
|
@ -14,14 +15,16 @@ function website() {
|
|||
const _menu = ["main", "about", "store", "blog", "contact"];
|
||||
const dropdown = new DropDown(_menu);
|
||||
const mobile = new Menu(_menu);
|
||||
const carouselObj = new Carousel();
|
||||
|
||||
const div = dropdown.dropdownComponent();
|
||||
const h1 = document.createElement("h1");
|
||||
const carousel = carouselObj.getCarousel();
|
||||
h1.textContent = "DEEZ NUTS MAN";
|
||||
|
||||
const menuMobile = mobile.buildMenu();
|
||||
|
||||
document.body.append(menuMobile, div, h1);
|
||||
document.body.append(menuMobile, div, h1, carousel);
|
||||
}
|
||||
|
||||
fontAwesome();
|
||||
|
|
Loading…
Reference in a new issue