Skip to content

Commit

Permalink
Merge pull request #5 from Salwa99/styling
Browse files Browse the repository at this point in the history
Bookstore: styling
  • Loading branch information
Salwa99 authored Jan 30, 2023
2 parents 2d5df29 + 898b818 commit 2ecf2eb
Show file tree
Hide file tree
Showing 12 changed files with 348 additions and 96 deletions.
260 changes: 238 additions & 22 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,39 +1,255 @@
.App {
text-align: center;
* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: sans-serif;
}

body {
background-color: rgb(236, 236, 236);
padding: 5%;
}

.main {
padding: 3%;
background: rgb(255, 255, 255);
}

.navbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1% 3%;
padding-bottom: 5%;
width: 100%;
height: 100%;
border-bottom: 1px solid rgb(211, 205, 205);
cursor: pointer;
background: rgb(255, 255, 255);
}

.navbar .logo-links,
ul {
display: flex;
gap: 25px;
align-items: center;
}

a {
color: #313030;
text-decoration: none;
cursor: pointer;
}

.avatar {
width: 50px;
height: 50px;
border-radius: 50%;
border: 2px solid grey;
}

.navbar .logo-links ul {
list-style: none;
}

.logo {
color: rgb(47, 136, 238);
font-size: 2.5rem;
font-weight: bolder;
}

.App-logo {
height: 40vmin;
pointer-events: none;
.main-container {
display: flex;
justify-content: space-between;
margin: 2% 5%;
padding: 3%;
border: 2px solid rgb(218, 212, 212);
border-radius: 10px;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
.info {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
padding-right: 9%;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
.info1 {
display: flex;
flex-direction: column;
gap: 20px;
}

.category {
font-size: 0.8rem;
font-weight: bolder;
color: rgb(133, 128, 128);
}

.title {
font-size: 1.8rem;
}

button {
cursor: pointer;
}

.author,
.buttons button {
font-size: 0.9rem;
color: rgb(94, 197, 245);
}

.buttons button {
background: #fff;
padding: 0 10px;
border: none;
border-left: 1px solid rgb(134, 139, 141);
}

.construction-container button {
width: 200px;
font-size: 1.5rem;
font-weight: bolder;
padding: 1%;
color: rgb(37, 144, 214);
background: rgb(255, 255, 255);
border: 3px solid rgb(37, 144, 214);
border-radius: 12px;
}

.buttons button:first-child {
border-left: none;
padding-left: 0;
}

.main-circle {
display: flex;
justify-content: center;
align-items: center;
}

.main-circle h3,
p {
font-size: 1.5rem;
font-weight: 300;
}

.box {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
font-size: calc(10px + 2vmin);
align-items: center;
}

.circle svg {
position: relative;
width: 110px !important;
height: 80px;
}

.circle svg circle {
transform: translate(5px, 5px);
}

.info2 {
display: flex;
flex-direction: column;
gap: 15px;
border-left: 2px solid #ccc;
padding-left: 5%;
}

.current {
color: rgb(136, 137, 138);
font-size: 0.8rem;
}

.chapter {
color: rgb(49, 50, 51);
}

.update {
border: none;
width: 200px;
padding: 5%;
color: white;
font-size: 0.9rem;
background: rgb(28, 172, 230);
}

.App-link {
color: #61dafb;
.main-container2 {
margin: 5%;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
.add-new {
margin: 15px 0;
font-size: 1.4rem;
border-top: 2px solid rgb(218, 221, 223);
padding-top: 20px;
color: rgb(156, 155, 155);
}

form {
display: flex;
align-items: center;
gap: 10px;
}

form input[type=text],
select,
.addBtn {
height: 50px;
width: 450px;
text-align: center;
font-size: 1rem;
border: 1px solid #ccc;
color: rgb(39, 37, 37);
-webkit-transition: 0.5s;
transition: 0.5s;
outline: none;
}

form input[type=text]:focus {
border: 1px solid rgb(31, 174, 199);
}

.addBtn {
width: 30%;
background: rgb(59, 155, 219);
color: rgb(255, 255, 255);
font-weight: bolder;
border: none;
}

.construction-container {
background: rgb(255, 255, 255);
padding: 3%;
display: flex;
flex-direction: column;
align-items: center;
gap: 30px;
}

.construction-container button:hover {
background: rgb(37, 144, 214);
color: rgb(255, 250, 250);
}

.construction-container img {
width: 50%;
height: 30%;
}

to {
transform: rotate(360deg);
}
.construction-container p {
font-size: 2rem;
font-weight: bolder;
color: rgb(255, 255, 255);
text-shadow:
-2px 1px 0 rgb(37, 144, 214),
1px 1px 0 rgb(37, 144, 214),
1px -1px 0 rgb(37, 144, 214),
-2px -1px 0 rgb(37, 144, 214);
}
Binary file added src/assets/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/underConstruction.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 37 additions & 31 deletions src/components/Book.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,54 @@
import React from 'react';
import React, { useState } from 'react';
import { useDispatch } from 'react-redux';
import PropTypes from 'prop-types';
import { removeBook } from '../redux/books/books';
import CircelProgress from './circleProgress';

function Book({
author, title, category, bookId,
}) {
const dispatch = useDispatch();
const [randomPercentage] = useState(
Math.floor(Math.random() * 90 + 10),
);
const removeBookAction = () => dispatch(removeBook(bookId));
return (
<>
<div>
<div>
<div>
<h4>
{category}
</h4>
<h3>
{title}
</h3>
<p>
Author&apos;s
{author}
</p>
<div className="main-container">
<div className="info">
<div className="info1">
<div>
<h4 className="category">{category}</h4>
<h3 className="title">{title}</h3>
<p className="author">{author}</p>
</div>
<div className="buttons">
<button type="button">Comments</button>
<button type="button" onClick={removeBookAction}>
Remove
</button>
<button type="button">Edit</button>
</div>
</div>
<div>
<button
type="button"
>
Comments
</button>
<button
type="button"
onClick={removeBookAction}
>
Remove
</button>
<button
type="button"
>
Edit
</button>
<div className="main-circle">
<CircelProgress percentage={randomPercentage} />
<div>
<h2>
{randomPercentage}
<span>%</span>
</h2>
<p>Completed</p>
</div>
</div>
</div>
<div className="info2">
<p className="current">CURRENT CHAPTER</p>
<p className="chapter">Chapter 17</p>
<button type="button" className="update">
{' '}
UPDATE PROGRESS
</button>
</div>
</div>
</>
);
Expand Down
6 changes: 3 additions & 3 deletions src/components/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ function Form() {
};

return (
<div>
<h2>ADD NEW BOOK</h2>
<div className="main-container2">
<h2 className="add-new">ADD NEW BOOK</h2>
<form onSubmit={addNewBook}>
<input type="text" placeholder="Book title" onChange={updateTitle} value={title} />
<input type="text" placeholder="Add author" onChange={updateAuthor} value={author} />
Expand All @@ -45,7 +45,7 @@ function Form() {
<option value="Physics">Physics</option>
<option value="Biography">Biography</option>
</select>
<button type="submit">ADD BOOK</button>
<button type="submit" className="addBtn">ADD BOOK</button>
</form>
</div>
);
Expand Down
Loading

0 comments on commit 2ecf2eb

Please sign in to comment.