Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
mmahalwy committed Aug 7, 2016
1 parent eab6d45 commit 0ded384
Show file tree
Hide file tree
Showing 78 changed files with 93 additions and 47 deletions.
2 changes: 1 addition & 1 deletion bootstrap.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ module.exports = {
"alerts": false,
"progress-bars": false,
"media": false,
"list-group": false,
"list-group": true,
"panels": true,
"wells": false,
"close": true,
Expand Down
14 changes: 14 additions & 0 deletions compress-images.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const imagemin = require('imagemin');
const imageminMozjpeg = require('imagemin-mozjpeg');
const imageminPngquant = require('imagemin-pngquant');
const imageminJpegRecompress = require('imagemin-jpeg-recompress');


imagemin(['./static/images/background/*.jpeg'], './static/images/background/compressed', {
plugins: [
imageminJpegRecompress({quality: 'low', min: 1, max: 10}),
// imageminMozjpeg(),
]
}).then(files => {
console.log('Done!', files);
}).catch(err => console.log(err));
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"dev": "env NODE_PATH='./src' PORT=8000 UV_THREADPOOL_SIZE=100 node webpack/webpack-dev-server.js & env NODE_PATH='./src' PORT=8000 APIPORT=8080 node bin/server.js & env APIPORT=8080 NODE_PATH='./api' node bin/api.js",
"test": "karma start",
"test-node": "./node_modules/mocha/bin/mocha $(find api -name '*-test.js') --compilers js:babel-core/register",
"test-node-watch": "./node_modules/mocha/bin/mocha $(find api -name '*-test.js') --compilers js:babel-core/register --watch"
"test-node-watch": "./node_modules/mocha/bin/mocha $(find api -name '*-test.js') --compilers js:babel-core/register --watch",
"compress-images": "node compress-images.js"
},
"betterScripts": {
"start-prod": {
Expand Down Expand Up @@ -160,6 +161,12 @@
"eslint-plugin-react": "^3.5.0",
"font-awesome": "^4.4.0",
"font-awesome-webpack": "0.0.4",
"imagemin": "^5.2.2",
"imagemin-jpeg-recompress": "^5.1.0",
"imagemin-jpegoptim": "^5.0.0",
"imagemin-jpegtran": "^5.0.2",
"imagemin-mozjpeg": "^6.0.0",
"imagemin-pngquant": "^5.0.0",
"json-loader": "^0.5.4",
"karma": "^0.13.10",
"karma-cli": "^0.1.1",
Expand Down
4 changes: 4 additions & 0 deletions src/components/Audioplayer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ export default class Audioplayer extends Component {
render() {
const { file, progress, qari, surah } = this.props; // eslint-disable-line no-shadow

if (!qari || !surah) {
return <noscript />;
}

return (
<Row>
<Col md={12}>
Expand Down
11 changes: 8 additions & 3 deletions src/containers/Home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Nav from 'react-bootstrap/lib/Nav';
import NavItem from 'react-bootstrap/lib/NavItem';

const styles = require('./style.scss');
const images = Array(33).join(',').split(',').map((__, index) => require(`../../../static/images/background/compressed/${index + 1}.jpeg`));

@connect(
state => ({
Expand Down Expand Up @@ -63,9 +64,13 @@ export default class Home extends Component {
<Row>
{
Object.values(qaris).filter(qari => qari.sectionId === section).sort((prev, next) => next.name > prev.name ? -1 : 1).map(qari => (
<Col md={4} key={qari.id}>
<Link to={`/quran/${qari.id}`}>
{qari.name}
<Col md={3} key={qari.id}>
<Link
className={styles.reciter}
to={`/quran/${qari.id}`}
style={{background: `url(${images[qari.id % images.length]}) center center no-repeat`, backgroundSize: 'cover'}}>
<div className={styles.overlay} />
<div className={styles.text}>{qari.name}</div>
</Link>
</Col>
))
Expand Down
38 changes: 38 additions & 0 deletions src/containers/Home/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,41 @@
padding-top: 1.5rem;
padding-bottom: 2rem;
}

.reciter{
height: 150px;
display: block;
color: #fff;
position: relative;
margin-top: 15px;
margin-bottom: 15px;

&:hover{
color: #fff;

.overlay{
background: rgba(0,0,0,0.25);
}
}

.text{
text-align: center;
position: absolute;
top: 50%;
transform: translateY(-50%);
width: 100%;
font-size: 2rem;
padding-left: 10px;
padding-right: 10px;
}

.overlay{
position: absolute;
top: 0px;
bottom: 0px;
left: 0px;
right: 0px;
background: rgba(0,0,0,0.65);
transition: all 0.5s;
}
}
6 changes: 5 additions & 1 deletion src/containers/Qari/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ export default class Qaris extends Component {

render() {
const { surahs, qari, files } = this.props;
const image = require(`../../../static/images/background/${(parseInt(qari.id, 10) + 1) % 33}.jpeg`);

return (
<div>
<Grid fluid className={`${styles.reciterBackground} ${qari.sectionId === 2 && styles.meccaBg}`}>
<Grid
fluid
className={`${styles.reciterBackground} ${qari.sectionId === 2 && styles.meccaBg}`}
style={{background: `url(${image}) center top no-repeat`}}>
<Row>
<Col md={12} className="text-center">
<h1>
Expand Down
25 changes: 14 additions & 11 deletions src/containers/Qari/style.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
@import "../../styles/variables.scss";

.reciterBackground{
background: url('../../../static/images/2.jpeg') center center no-repeat;
background-size: cover;
min-height: 300px;
min-height: 30vh;
Expand Down Expand Up @@ -38,12 +37,23 @@


:global(.list-group-item){
:global(.fa-play-circle){
display: none;
}

}

:global(.list-group-item:hover){

}
}
.row{
cursor: pointer;

:global(.fa-play-circle){
display: none;
}

&:hover{
background-color: #f7f7f7;

:global(.fa-play-circle){
display: inline;
line-height: 0.5em;
Expand All @@ -56,10 +66,3 @@
}
}
}
.row{
cursor: pointer;

&:hover{
background-color: #f7f7f7;
}
}
1 change: 1 addition & 0 deletions src/helpers/Html.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default class Html extends Component {
{head.script.toComponent()}

<link rel="shortcut icon" href="/favicon.ico" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
{/* styles (will be present only in production with webpack extract text plugin) */}
{Object.keys(assets.styles).map((style, key) =>
Expand Down
18 changes: 0 additions & 18 deletions src/styles/font-awesome.config.js

This file was deleted.

7 changes: 0 additions & 7 deletions src/styles/font-awesome.config.less

This file was deleted.

5 changes: 0 additions & 5 deletions src/styles/font-awesome.config.prod.js

This file was deleted.

File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added static/images/background/compressed/1.jpeg
Binary file added static/images/background/compressed/10.jpeg
Binary file added static/images/background/compressed/11.jpeg
Binary file added static/images/background/compressed/12.jpeg
Binary file added static/images/background/compressed/13.jpeg
Binary file added static/images/background/compressed/14.jpeg
Binary file added static/images/background/compressed/15.jpeg
Binary file added static/images/background/compressed/16.jpeg
Binary file added static/images/background/compressed/17.jpeg
Binary file added static/images/background/compressed/18.jpeg
Binary file added static/images/background/compressed/19.jpeg
Binary file added static/images/background/compressed/2.jpeg
Binary file added static/images/background/compressed/20.jpeg
Binary file added static/images/background/compressed/21.jpeg
Binary file added static/images/background/compressed/22.jpeg
Binary file added static/images/background/compressed/23.jpeg
Binary file added static/images/background/compressed/24.jpeg
Binary file added static/images/background/compressed/25.jpeg
Binary file added static/images/background/compressed/26.jpeg
Binary file added static/images/background/compressed/27.jpeg
Binary file added static/images/background/compressed/28.jpeg
Binary file added static/images/background/compressed/29.jpeg
Binary file added static/images/background/compressed/3.jpeg
Binary file added static/images/background/compressed/30.jpeg
Binary file added static/images/background/compressed/31.jpeg
Binary file added static/images/background/compressed/32.jpeg
Binary file added static/images/background/compressed/33.jpeg
Binary file added static/images/background/compressed/4.jpeg
Binary file added static/images/background/compressed/5.jpeg
Binary file added static/images/background/compressed/6.jpeg
Binary file added static/images/background/compressed/7.jpeg
Binary file added static/images/background/compressed/8.jpeg
Binary file added static/images/background/compressed/9.jpeg

0 comments on commit 0ded384

Please sign in to comment.