Skip to content

Commit

Permalink
Visual updates
Browse files Browse the repository at this point in the history
  • Loading branch information
amits97 committed Nov 25, 2024
1 parent a8453a0 commit 1eddc7b
Show file tree
Hide file tree
Showing 16 changed files with 218 additions and 88 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "naadan-chords",
"version": "0.85.2",
"version": "0.85.3",
"homepage": "https://www.naadanchords.com/",
"private": true,
"dependencies": {
Expand Down
2 changes: 2 additions & 0 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url> <loc>https://www.naadanchords.com/</loc> </url>
<url> <loc>https://www.naadanchords.com/chuttamalle-devara-part-1</loc> </url>
<url> <loc>https://www.naadanchords.com/en-jeevan-theri</loc> </url>
<url> <loc>https://www.naadanchords.com/athimanoharam-vaazha</loc> </url>
<url> <loc>https://www.naadanchords.com/poove-poove-devadoothan</loc> </url>
Expand Down Expand Up @@ -304,6 +305,7 @@
<url> <loc>https://www.naadanchords.com/album/24</loc> </url>
<url> <loc>https://www.naadanchords.com/album/96</loc> </url>
<url> <loc>https://www.naadanchords.com/album/1983</loc> </url>
<url> <loc>https://www.naadanchords.com/album/devara-part-1</loc> </url>
<url> <loc>https://www.naadanchords.com/album/theri</loc> </url>
<url> <loc>https://www.naadanchords.com/album/vaazha</loc> </url>
<url> <loc>https://www.naadanchords.com/album/devadoothan</loc> </url>
Expand Down
10 changes: 10 additions & 0 deletions src/components/GlobalStyles.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const GlobalStyles = createGlobalStyle`
font-size: 0.95rem;
background: ${({ theme }) => theme.body};
border: 1px solid ${({ theme }) => theme.border};
border-radius: 8px;
}
/* Needed to have the triangle match the background of the popover */
Expand Down Expand Up @@ -63,13 +64,18 @@ export const GlobalStyles = createGlobalStyle`
}
}
.modal-content {
border-radius: 15px;
}
.modal-content, .dropdown-menu {
background: ${({ theme }) => theme.body};
color: ${({ theme }) => theme.text};
}
.dropdown-menu {
border: 1px solid ${({ theme }) => theme.border};
border-radius: 8px;
}
.App .navbar .navbar-nav .dropdown-item {
Expand Down Expand Up @@ -158,6 +164,10 @@ export const GlobalStyles = createGlobalStyle`
border-top: 1px solid ${({ theme }) => theme.border};
}
.btn {
border-radius: 8px;
}
.border {
border: 1px solid ${({ theme }) => theme.border} !important;
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/Themes.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export const lightTheme = {
linkMuted: "#888888",
alertLink: "#777777",
alertLinkHover: "#555",
secondaryText: "#999999",
secondaryText: "#666666",
secondaryHeading: "#777",
secondaryAltHeading: "#555",
border: "#DEE2E6",
backgroundLight: "#F8F9FA",
border: "#D0D5D9",
backgroundLight: "#E8EAEC",
backgroundHighlight: "#EFEFEF",
disabledInput: "#E9ECEF",
searchFocus: "#FFF",
Expand Down
9 changes: 7 additions & 2 deletions src/containers/ChordControls.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
height: 26px;
z-index: 2;
right: -1rem;
border-radius: 5px 5px 0 0;
border-radius: 8px 8px 0 0;
}

.ChordControls.minimized .controls-tray {
border-radius: 8px 0 0 0;
}

.ChordControls .tray-saver button {
Expand All @@ -36,6 +40,7 @@
height: 55px;
margin-left: -1rem;
margin-right: -1rem;
border-radius: 8px;
}

.ChordControls .controls-container-holder {
Expand Down Expand Up @@ -83,7 +88,7 @@

.ChordControls .tray-control {
font-size: 25px;
padding-top: 5px;
padding-top: 3px;
}

/* Small devices (landscape phones, less than 768px) */
Expand Down
135 changes: 102 additions & 33 deletions src/containers/ChordControls.js
Original file line number Diff line number Diff line change
@@ -1,110 +1,179 @@
import React, {Component} from "react";
import {ButtonGroup, Button} from "react-bootstrap";
import React, { Component } from "react";
import { ButtonGroup, Button } from "react-bootstrap";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faPlus, faMinus, faCaretDown, faCaretUp } from "@fortawesome/free-solid-svg-icons";
import {
faPlus,
faMinus,
faCaretDown,
faCaretUp,
} from "@fortawesome/free-solid-svg-icons";
import * as Styles from "./Styles";
import "./ChordControls.css";

export default class ChordControls extends Component {
handleTransposeClick = (transposeAmount) => {
this.props.transposeChords(transposeAmount);
}
};

handleFontSizeClick = (sizeAmount) => {
this.props.changeFontSize(sizeAmount);
}
};

handleScrollAmountClick = (scrollAmount) => {
this.props.changeScrollAmount(scrollAmount);
}
};

checkFontSize = (button) => {
if(button === "up") {
if (button === "up") {
return this.props.fontSize > 20;
} else if(button === "down") {
} else if (button === "down") {
return this.props.fontSize < 12;
}
}
};

checkScrollAmount = (button) => {
if(button === "up") {
if (button === "up") {
return this.props.scrollAmount > 4;
} else if(button === "down") {
} else if (button === "down") {
return this.props.scrollAmount < 1;
}
}
};

computeFontAmount = () => {
return (this.props.fontSize - 15) / 2;
}
};

toggleTray = () => {
const { isChordControlsTrayMaximized, setIsChordControlsTrayMaximized } = this.props;
const { isChordControlsTrayMaximized, setIsChordControlsTrayMaximized } =
this.props;
let newTrayState = !isChordControlsTrayMaximized;

setIsChordControlsTrayMaximized(newTrayState);
}
};

render() {
let { transposeAmount, fontSize, scrollAmount, theme, isChordControlsTrayMaximized: isTrayMaximized } = this.props;
let {
transposeAmount,
fontSize,
scrollAmount,
theme,
isChordControlsTrayMaximized: isTrayMaximized,
} = this.props;

return (
<Styles.ChordControlsContainer className={`ChordControls ${this.props.className} ${isTrayMaximized ? '' : 'minimized'}`}>
<div className={`tray-saver ${isTrayMaximized ? 'd-none' : ''}`}>
<Button variant="link" className="tray-control" onClick={() => this.toggleTray()}>
<Styles.ChordControlsContainer
className={`ChordControls ${this.props.className} ${
isTrayMaximized ? "" : "minimized"
}`}
>
<div className={`tray-saver ${isTrayMaximized ? "d-none" : ""}`}>
<Button
variant="link"
className="tray-control"
onClick={() => this.toggleTray()}
>
<FontAwesomeIcon icon={faCaretUp} />
</Button>
</div>
<div className="controls-tray">
<div className="controls-container-holder">
<div className="controls-container transpose-container">
<span className="feature-label">
TRANSPOSE <span className="amount text-primary">{transposeAmount ? transposeAmount : ''}</span>
Transpose{" "}
<span className="amount text-primary">
{transposeAmount ? transposeAmount : ""}
</span>
</span>
<ButtonGroup className={`${transposeAmount ? 'ml-3' : '' }`}>
<Button variant={`outline-${theme.name === 'light' ? 'dark' : 'light'}`} onClick={() => this.handleTransposeClick(1)}>
<ButtonGroup className={`${transposeAmount ? "ml-3" : ""}`}>
<Button
variant={`outline-${
theme.name === "light" ? "dark" : "light"
}`}
onClick={() => this.handleTransposeClick(1)}
>
<FontAwesomeIcon icon={faPlus} />
</Button>
<Button variant={`outline-${theme.name === 'light' ? 'dark' : 'light'}`} onClick={() => this.handleTransposeClick(-1)}>
<Button
variant={`outline-${
theme.name === "light" ? "dark" : "light"
}`}
onClick={() => this.handleTransposeClick(-1)}
>
<FontAwesomeIcon icon={faMinus} />
</Button>
</ButtonGroup>
</div>

<div className="controls-container scroll-container">
<span className="feature-label">
SCROLL <span className="amount text-primary">{scrollAmount ? scrollAmount : ''}</span>
Scroll{" "}
<span className="amount text-primary">
{scrollAmount ? scrollAmount : ""}
</span>
</span>
<ButtonGroup className={`${scrollAmount ? 'ml-3' : '' }`}>
<Button variant={`outline-${theme.name === 'light' ? 'dark' : 'light'}`} onClick={() => this.handleScrollAmountClick(1)} disabled={this.checkScrollAmount("up")}>
<ButtonGroup className={`${scrollAmount ? "ml-3" : ""}`}>
<Button
variant={`outline-${
theme.name === "light" ? "dark" : "light"
}`}
onClick={() => this.handleScrollAmountClick(1)}
disabled={this.checkScrollAmount("up")}
>
<FontAwesomeIcon icon={faPlus} />
</Button>
<Button variant={`outline-${theme.name === 'light' ? 'dark' : 'light'}`} onClick={() => this.handleScrollAmountClick(-1)} disabled={this.checkScrollAmount("down")}>
<Button
variant={`outline-${
theme.name === "light" ? "dark" : "light"
}`}
onClick={() => this.handleScrollAmountClick(-1)}
disabled={this.checkScrollAmount("down")}
>
<FontAwesomeIcon icon={faMinus} />
</Button>
</ButtonGroup>
</div>

<div className="controls-container font-size-container">
<span className="feature-label">
FONT <span className="amount text-primary" key={fontSize}>{fontSize === 15 ? '' : this.computeFontAmount()}</span>
Text{" "}
<span className="amount text-primary" key={fontSize}>
{fontSize === 15 ? "" : this.computeFontAmount()}
</span>
</span>
<ButtonGroup className={`${fontSize === 15 ? '' : 'ml-3' }`}>
<Button variant={`outline-${theme.name === 'light' ? 'dark' : 'light'}`} onClick={() => this.handleFontSizeClick(2)} disabled={this.checkFontSize("up")}>
<ButtonGroup className={`${fontSize === 15 ? "" : "ml-3"}`}>
<Button
variant={`outline-${
theme.name === "light" ? "dark" : "light"
}`}
onClick={() => this.handleFontSizeClick(2)}
disabled={this.checkFontSize("up")}
>
<FontAwesomeIcon icon={faPlus} />
</Button>
<Button variant={`outline-${theme.name === 'light' ? 'dark' : 'light'}`} onClick={() => this.handleFontSizeClick(-2)} disabled={this.checkFontSize("down")}>
<Button
variant={`outline-${
theme.name === "light" ? "dark" : "light"
}`}
onClick={() => this.handleFontSizeClick(-2)}
disabled={this.checkFontSize("down")}
>
<FontAwesomeIcon icon={faMinus} />
</Button>
</ButtonGroup>
</div>
</div>

<Button variant="link" className={`float-right tray-control ${isTrayMaximized ? '' : 'd-none'}`} onClick={() => this.toggleTray()}>
<Button
variant="link"
className={`float-right tray-control ${
isTrayMaximized ? "" : "d-none"
}`}
onClick={() => this.toggleTray()}
>
<FontAwesomeIcon icon={faCaretDown} />
</Button>
</div>
</Styles.ChordControlsContainer>
);
}
}
}
2 changes: 1 addition & 1 deletion src/containers/Content.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
border-radius: 0px;
font-weight: bold;
color: #ffffff;
border-radius: 15px;
}

.Content .post h2 {
Expand All @@ -110,7 +111,6 @@
}

.Content .post small {
color: #999999;
font-size: 90%;
display: inline-block;
}
Expand Down
14 changes: 8 additions & 6 deletions src/containers/Content.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ export default class Content extends Component {
};

renderTitle = (title, isUserPosts, isCategory, posts, authorCreateDate) => {
let displayTitle = title ? title : "LATEST";
let displayTitle = title ? title : "Latest";
if (isUserPosts) {
displayTitle = posts[0].authorName;

Expand Down Expand Up @@ -250,7 +250,7 @@ export default class Content extends Component {
color={theme.backgroundHighlight}
highlightColor={theme.body}
>
<Styles.PostItemContainer className="pt-1 pb-1 no-hover">
<Styles.PostItemContainer className="pt-1 pb-1 no-hover loading">
<h5>
<Skeleton />
</h5>
Expand Down Expand Up @@ -453,8 +453,9 @@ export default class Content extends Component {
>
<span>
<StarRatings
starRatedColor="#FFD700"
starHoverColor="#FFD700"
starEmptyColor="#999999"
starRatedColor="#E8C406"
starHoverColor="#E8C406"
starDimension={`${isPostList ? "15px" : "18px"}`}
starSpacing="0.5px"
numberOfStars={5}
Expand Down Expand Up @@ -627,8 +628,9 @@ export default class Content extends Component {
<h6 className="rate-heading">RATE THIS POST</h6>
<div className="rate-inner-container">
<StarRatings
starRatedColor="#FFD700"
starHoverColor="#FFD700"
starEmptyColor="#999999"
starRatedColor="#E8C406"
starHoverColor="#E8C406"
starDimension="25px"
starSpacing="1px"
numberOfStars={5}
Expand Down
Loading

0 comments on commit 1eddc7b

Please sign in to comment.