Skip to content

Commit

Permalink
feat: rss logo
Browse files Browse the repository at this point in the history
  • Loading branch information
Kleostro committed Jun 15, 2024
1 parent 36d21ee commit 952557f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/pages/AboutUsPage/view/AboutUsPageView.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import LinkModel from '@/shared/Link/model/LinkModel.ts';
import getStore from '@/shared/Store/Store.ts';
import observeStore, { selectCurrentLanguage } from '@/shared/Store/observer.ts';
import { LINK_DETAILS } from '@/shared/constants/links.ts';
import { PAGE_DESCRIPTION } from '@/shared/constants/pages.ts';
import SVG_DETAILS from '@/shared/constants/svg.ts';
import createBaseElement from '@/shared/utils/createBaseElement.ts';
import createSVGUse from '@/shared/utils/createSVGUse.ts';

import styles from './aboutUsPageView.module.scss';

Expand Down Expand Up @@ -34,12 +38,27 @@ class AboutUsPageView {
tag: 'div',
});

this.page.append(this.createTitle(), this.cardsList);
this.page.append(this.createTitle(), this.cardsList, this.createRSSLogo().getHTML());
this.parent.append(this.page);

return this.page;
}

private createRSSLogo(): LinkModel {
const logo = new LinkModel({
attrs: {
href: 'https://rs.school',
target: LINK_DETAILS.BLANK,
},
classes: [styles.logo],
});

const svg = document.createElementNS(SVG_DETAILS.SVG_URL, 'svg');
svg.append(createSVGUse(SVG_DETAILS.RSS_LOGO));
logo.getHTML().append(svg);
return logo;
}

private createTitle(): HTMLHeadingElement {
const title = createBaseElement({
cssClasses: [styles.title],
Expand Down
25 changes: 25 additions & 0 deletions src/pages/AboutUsPage/view/aboutUsPageView.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,28 @@
justify-content: center;
}
}

.logo {
display: flex;
margin: 0 auto;
margin-top: var(--small-offset);
width: max-content;

svg {
width: 11rem;
height: 4rem;
transition: fill 0.1s;

use {
transition: fill 0.1s;
}
}

@media (hover: hover) {
&:hover {
svg {
fill: var(--steam-green-1200);
}
}
}
}
1 change: 1 addition & 0 deletions src/shared/constants/svg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const SVG_DETAILS = {
NOT_FOUND: 'notFound',
OPEN_EYE: 'openEye',
PROFILE: 'userCircle',
RSS_LOGO: 'rssLogo',
STAR: 'star',
SVG_URL: 'http://www.w3.org/2000/svg',

Expand Down
1 change: 1 addition & 0 deletions src/shared/img/svg/rssLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 952557f

Please sign in to comment.