-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
74f3e30
commit 4cd5885
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import CatalogView from '../view/CatalogView.ts'; | ||
|
||
class CatalogModel { | ||
private view = new CatalogView(); | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.view.getHTML(); | ||
} | ||
} | ||
|
||
export default CatalogModel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import createBaseElement from '@/shared/utils/createBaseElement.ts'; | ||
|
||
import styles from './catalogView.module.scss'; | ||
|
||
class CatalogView { | ||
private catalog: HTMLDivElement; | ||
|
||
private itemsList: HTMLUListElement; | ||
|
||
constructor() { | ||
this.itemsList = this.createItemsList(); | ||
this.catalog = this.createHTML(); | ||
} | ||
|
||
private createHTML(): HTMLDivElement { | ||
this.catalog = createBaseElement({ | ||
cssClasses: [styles.catalog], | ||
tag: 'div', | ||
}); | ||
this.catalog.append(this.itemsList); | ||
return this.catalog; | ||
} | ||
|
||
private createItemsList(): HTMLUListElement { | ||
this.itemsList = createBaseElement({ | ||
cssClasses: [styles.itemsList], | ||
tag: 'ul', | ||
}); | ||
return this.itemsList; | ||
} | ||
|
||
public getHTML(): HTMLDivElement { | ||
return this.catalog; | ||
} | ||
|
||
public getItemsList(): HTMLUListElement { | ||
return this.itemsList; | ||
} | ||
} | ||
|
||
export default CatalogView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.catalog { | ||
display: flex; | ||
width: 500px; | ||
height: 500px; | ||
background-color: var(--noble-gray-300); | ||
} | ||
|
||
.itemsList { | ||
width: 500px; | ||
height: 500px; | ||
background-color: var(--noble-gray-800); | ||
} |