Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Koray-frontend-changes #45

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Binary file added .DS_Store
Binary file not shown.
3 changes: 1 addition & 2 deletions Documentation/documentation.html
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ <h3 class="description">Documentation v1.2.0</h3>
document.write(new Date().getFullYear());
</script>
made with <i class="tim-icons icon-heart-2"></i> by
<a href="javascript:void(0)" target="_blank">Creative Tim</a> for a
better web.
<a href="javascript:void(0)" target="_blank">Koray Barkın</a>
</div>
</div>
</footer>
Expand Down
10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@
"homepage": "https://demos.creative-tim.com/black-dashboard-react/#/admin/dashboard",
"dependencies": {
"@fortawesome/fontawesome-free": "6.4.0",
"axios": "^1.5.0",
"body-parser": "^1.20.2",
"bootstrap": "4.6.2",
"chart.js": "3.9.1",
"classnames": "2.3.2",
"cors": "^2.8.5",
"express": "^4.18.2",
"perfect-scrollbar": "1.5.5",
"prop-types": "15.8.1",
"react": "18.2.0",
"react": "^18.2.0",
"react-chartjs-2": "3.3.0",
"react-dom": "18.2.0",
"react-dom": ">=16.8.0",
"react-notification-alert": "0.0.13",
"react-router-dom": "6.11.1",
"react-scripts": "5.0.1",
"react-toastify": "^9.1.3",
"sass": "1.62.1"
},
"scripts": {
Expand All @@ -31,7 +36,6 @@
"extends": "react-app"
},
"peerDependencies": {
"react": ">=16.8.0",
"react-dom": ">=16.8.0"
},
"browserslist": [
Expand Down
11 changes: 11 additions & 0 deletions public/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<IfModule mod_rewrite.c>

RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule . /index.html [L]

</IfModule>
Binary file added public/dollar-icon-png-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
rel="icon"
sizes="76x76"
type="image/png"
href="%PUBLIC_URL%/favicon.png"
href="%PUBLIC_URL%/dollar-icon-png-2.png"
/>
<link
rel="apple-touch-icon"
Expand All @@ -56,7 +56,7 @@
href="https://fonts.googleapis.com/css?family=Poppins:200,300,400,600,700,800"
rel="stylesheet"
/>
<title>Black Dashboard React by Creative Tim</title>
<title>Ne Zaman Milyoner?</title>
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_KEY_HERE"></script>
</head>
<body>
Expand Down
37 changes: 37 additions & 0 deletions quotes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[{
"person": "Elon Musk",
"quote": "If you get up in the morning and think the future is going to be better, it is a bright day. Otherwise, it’s not.",
"image": "assets/img/elon.png",
"title": "CEO of Tesla & SpaceX"
},
{
"person": "Warren Buffett",
"quote": "We simply attempt to be fearful when others are greedy and to be greedy only when others are fearful",
"image": "assets/img/buffett.png",
"title": "Investor"
},
{
"person": "Warren Buffett",
"quote": "Never depend on a single income. Make an investment to create a second source.",
"image": "assets/img/buffett.png",
"title": "Investor"
},
{
"person": "Bill Gates",
"quote": "I'm a quote",
"image": "assets/img/gates.png",
"title": "Founder of Microsoft"
},
{
"person": "Jeff Bezos",
"quote": "Given a 10% chance of a 100 times payoff, you should take that bet every time.",
"image": "assets/img/bezos.png",
"title": "Founder & CEO of Amazon"
},
{
"person": "Mark Zuckerberg",
"quote": "The biggest risk is not taking any risk in a world that is changing really quickly, the only strategy that is guaranteed to fail is not taking risks.",
"image": "assets/img/zuckerberg.png",
"title": "Founder & CEO of Facebook"
}
]
Binary file added src/.DS_Store
Binary file not shown.
57 changes: 57 additions & 0 deletions src/assets/css/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100;300;400;500;700;900&display=swap");

* {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: "Roboto", sans-serif;

}

h1 {
font-weight: 900;
color: #f38b2a;
font-size: 50px;
}

h2 {
font-weight: 900;
color: #353535;
}

.moeda-app {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 64px;
color: #fff;
}

.moeda-search {
margin-bottom: 70px;
display: flex;
flex-direction: column;
justify-content: center;
align-content: center;
}

.moeda-text {
margin-bottom: 32px;
text-align: center;
}

.moeda-input {
padding-left: 16px;
width: 500px;
outline: none;
height: 50px;
border: 2px solid transparent;
border-radius: 19px;
border-color: #1b1d6e;
background-color: #fff;
box-shadow: 0 0 0 rgba(0, 0, 0, 0.1), 0 5px 5px rgba(0, 0, 0, 0.1);
}

.moeda-input::placeholder {
color: rgb(170, 170, 170);
}
68 changes: 68 additions & 0 deletions src/assets/css/Moeda.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
.moeda-container {
display: flex;
justify-content: center;
}

.moeda-row {
display: flex;
flex-direction: row;
justify-content: start;
align-items: center;
height: 80px;
border-bottom: 1px solid #d7d7d7;
width: 900px;
}

.moeda {
display: flex;
align-items: center;
padding-right: 24px;
min-width: 300px;
}

.moeda h2 {
font-size: 16px;
width: 150px;
}

.moeda img {
height: 30px;
width: 30px;
margin-right: 10px;
}

.moeda-symbol {
text-transform: uppercase;
}

.moeda-data {
display: flex;
text-align: right;
justify-content: space-between;
width: 100%;
}

.moeda-price {
width: 110px;
}

.moeda-volume {
width: 155px;
}

.moeda-marketcap {
width: 230px;
}

.moeda-percent {
width: 100px;
}

.red {
color: #f00606;
}

.green {
color: #1fa710;
}

10 changes: 5 additions & 5 deletions src/assets/css/black-dashboard-react.css

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

Binary file added src/assets/img/buffett.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/img/dollar-icon-png-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/assets/scss/black-dashboard-react/custom/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
}

.card-description, .card-category{
color: rgba($white, 0.6);
color: rgba($white, 0.9);
font-size: 20px;
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
}
.sidebar,
.off-canvas-sidebar{
@include linear-gradient($primary-states, $primary);
//@include linear-gradient( #263148, #344675);
background: #263148;
height: calc(100vh - 90px);
width: 230px;
position: fixed;
Expand Down
79 changes: 79 additions & 0 deletions src/backend/calculate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');

const app = express();
app.use(cors());

function calculateGoal(initialSavings, monthlyDeposit, monthlyProfit, invest, goalAmount) {
if (initialSavings >= goalAmount) {
return {
months: 0,
weeks: 0,
days: 0,
}; // Already reached the goal.
}

initialSavings = parseFloat(initialSavings);
monthlyDeposit = parseFloat(monthlyDeposit);
monthlyProfit = parseFloat(monthlyProfit);
goalAmount = parseFloat(goalAmount);

let months = 0;
let weeks = 0;
let days = 0;
let currentSavings = initialSavings;

while (currentSavings < goalAmount) {
const monthlyGrowth = (currentSavings + monthlyDeposit) * (monthlyProfit / 100);

currentSavings += monthlyDeposit + monthlyGrowth;
months++;

if (months % 4 === 0) {
weeks++;
}
}

days = months * 30; // Assuming an average of 30 days per month

return {
months,
weeks,
days,
};
}

app.use(bodyParser.json());

app.post('/calculate', (req, res) => {
try {
const { months, weeks, days } = calculateGoal(
req.body.initialSaving,
req.body.monthlyDeposit,
req.body.investmentProfit,
req.body.invest,
req.body.targetAmount
);

console.log(`It will take ${months} months, ${weeks} weeks, and ${days} days to reach your goal of $${req.body.targetAmount}.`);
res.json({ months, weeks, days });
} catch (error) {
res.status(400).json({ error: error.message });
}
});

app.use((req, res) => {
res.status(404).json({ error: 'Not Found' });
});

app.use((error, req, res, next) => {
console.error(error.stack);
res.status(500).json({ error: 'Internal Server Error' });
});

const PORT = process.env.PORT || 3005;

app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from "contexts/BackgroundColorContext";

export default function BackgroundColorWrapper(props) {
const [color, setColor] = useState(backgroundColors.blue);
const [color, setColor] = useState(backgroundColors.dark);

function changeColor(color) {
setColor(color);
Expand Down
Loading