Skip to content

Commit 3a6321d

Browse files
committed
restructuring code
Signed-off-by: amino19 <[email protected]>
1 parent 2814e18 commit 3a6321d

File tree

12 files changed

+226
-179
lines changed

12 files changed

+226
-179
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

CODE_OF_CONDUCT.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
2424
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
25+
- Focusing on what is best not just for us as individuals, but for the
2626
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
30+
- The use of sexualized language or imagery, and sexual attention or
3131
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
3535
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
36+
- Other conduct which could reasonably be considered inappropriate in a
3737
professional setting
3838

3939
## Enforcement Responsibilities
@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
106106
### 4. Permanent Ban
107107

108108
**Community Impact**: Demonstrating a pattern of violation of community
109-
standards, including sustained inappropriate behavior, harassment of an
109+
standards, including sustained inappropriate behavior, harassment of an
110110
individual, or aggression toward or disparagement of classes of individuals.
111111

112112
**Consequence**: A permanent ban from any sort of public interaction within

CONTRIBUTING.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,33 +4,39 @@
44

55
**1.** `Fork` the repository: Creates a replica of repository to your local environment.
66

7-
**2.** Local Machine setup:-
8-
```git
9-
git config --global user.name "GITHUB_USER_NAME"
10-
```
7+
**2.** Local Machine setup:-
8+
9+
```git
10+
git config --global user.name "GITHUB_USER_NAME"
11+
```
12+
1113
Enter your github user name instead of **GITHUB_USER_NAME**.
1214

13-
```git
14-
git config --global user.email "[email protected]"
15-
```
15+
```git
16+
git config --global user.email "[email protected]"
17+
```
18+
1619
Enter your email linked to github account instead of **[email protected]**.
1720

1821
```git
1922
git config -l
2023
```
2124

22-
**3.** Clone the repository -
25+
**3.** Clone the repository -
2326

2427
Downloads all repo files to your machine, using:-
28+
2529
```git
2630
git clone https://github.com/YOUR-USERNAME/newsXplorer
2731
```
28-
- Enter user_name
29-
- Press ok
30-
- Enter **access token** instead of password
31-
- Press ok
32+
33+
- Enter user_name
34+
- Press ok
35+
- Enter **access token** instead of password
36+
- Press ok
3237

3338
**4.** Set working directory to the root directory of the project.
39+
3440
```sh
3541
cd newsXplorer/
3642
```
@@ -40,31 +46,33 @@ cd newsXplorer/
4046
```bash
4147
pip install -r requriments.txt
4248
```
43-
- Run the app:-
49+
50+
- Run the app:-
51+
4452
```bash
4553
python main.py
4654
```
4755

48-
- And, open [127.0.0.1](127.0.0.1)
49-
56+
- And, open [127.0.0.1](127.0.0.1)
5057

5158
**6.** Cheers! 🎉 Now the repository has been setup in your local machine. Open your editor and start coding, & for visual studio code, run command in terminal:-
59+
5260
```sh
5361
code .
5462
```
5563

5664
**7.** Add a reference(remote) to the original repository.
65+
5766
```
5867
git remote add upstream https://github.com/devstrons/newsXplorer.git
5968
```
6069

6170
**8.** Perform your desired changes to the code base.
6271

63-
6472
**9.** Track your changes ✅
6573

6674
```
67-
git add .
75+
git add .
6876
```
6977

7078
**10.** Commit your changes.
@@ -94,14 +102,19 @@ git push -u origin <your_branch_name>
94102
**16.** Voila ❗️ You have made a PR to the website 💥 . Sit back patiently and relax while the project maintainers review your PR. Please understand, at timesthe time taken to review a PR can vary from a few hours to a few days.
95103

96104
**NOTE:-**
105+
97106
- If there is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details.
107+
98108
```sh
99109
git pull
100110
```
111+
101112
- If you wish to set tracking information for this branch you can do so with:
113+
102114
```sh
103115
git branch --set-upstream-to=/ main
104116
```
117+
105118
- Check the remotes for this repository.
106119

107120
```

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@
99
</div>
1010

1111
## Inspiration:
12+
1213
Unfortunately, many people complain they don't have enough time in their day-to-day lives to read.
1314
It’ll feel difficult at first to make reading part of your daily habit, especially if you aren’t used to it already. But with patience and consistency, you’ll remember that you love to read & update yourselves, and forget about all the reasons you made excuses not to.
1415
Always use to navigate through different platforms, to read vary news.
1516

1617
## What it does?
18+
1719
To overcome through this major problem description, we came up with an idea to get the impressive User Interface/ User Experience (UI/UX) for the readers to attract them read daily. Also, readers can find a mixture of all news at one place at a time, just they need to navigate through bars at top. As a developer, we came up with hackers news as well to justify & fulfil the requirements.
1820

1921
## How we built it?
22+
2023
<code><a href="#"><img height="40" width="40" src="https://raw.githubusercontent.com/devstrons/newsXplorer/master/static/assets/img/html.png"></a></code>
2124
<code><a href="#"><img height="40" width="40" src="https://raw.githubusercontent.com/devstrons/newsXplorer/master/static/assets/img/flask.png"></a></code>
2225
<code><a href="#"><img height="40" width="45" src="https://cdn.iconscout.com/icon/free/png-256/figma-682083.png"></a></code>
@@ -26,7 +29,7 @@ To overcome through this major problem description, we came up with an idea to g
2629
<h1 align="center" style="font-weight:bold">Contribution Guidelines 🏗</h1>
2730
Are we missing any of your favorite features, which you think you can add to it❓ We invite you to contribute to this project and improve it further
2831

29-
To start contributing, follow the below guidelines:
32+
To start contributing, follow the below guidelines:
3033

3134
🌟 Star the project to bookmark and appreciate the work.
3235

main.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
import os
2-
from flask import Flask, render_template, url_for, request
2+
from flask import Flask, render_template, request
33
import requests
4-
from pprint import pprint as p
5-
from sawo import createTemplate, getContext, verifyToken
4+
from sawo import createTemplate, verifyToken
65
import json
76
from dotenv import load_dotenv
87

98
load_dotenv()
109
API_KEY = os.getenv("API_KEY")
11-
print("ffff")
12-
print(API_KEY)
1310

1411
app = Flask(__name__)
1512
# using flask = True generates flask template
16-
13+
1714
load = ''
1815
loaded = 0
1916

@@ -62,7 +59,7 @@ def home():
6259
hacker_posts=hacker_posts,
6360
)
6461

65-
@app.route("/login_page")
62+
@app.route("/login")
6663
def login_page():
6764
setLoaded()
6865
setPayload(load if loaded<2 else '')

static/script/script.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
const body = document.querySelector("body");
2-
const navbar = document.querySelector(".navbar");
3-
const menu = document.querySelector(".menu-list");
4-
const menuBtn = document.querySelector(".menu-btn");
5-
const cancelBtn = document.querySelector(".cancel-btn");
6-
console.log("Working");
7-
menuBtn.onclick = ()=>{
8-
menu.classList.add("active");
9-
menuBtn.classList.add("hide");
10-
cancelBtn.classList.add("show");
11-
body.classList.add("disabledScroll");
12-
}
13-
cancelBtn.onclick = ()=>{
14-
menu.classList.remove("active");
15-
menuBtn.classList.remove("hide");
16-
cancelBtn.classList.remove("show");
17-
body.classList.remove("disabledScroll");
18-
}
2+
const navbar = document.querySelector(".navbar");
3+
const menu = document.querySelector(".menu-list");
4+
const menuBtn = document.querySelector(".menu-btn");
5+
const cancelBtn = document.querySelector(".cancel-btn");
6+
console.log("Working");
7+
menuBtn.onclick = () => {
8+
menu.classList.add("active");
9+
menuBtn.classList.add("hide");
10+
cancelBtn.classList.add("show");
11+
body.classList.add("disabledScroll");
12+
}
13+
cancelBtn.onclick = () => {
14+
menu.classList.remove("active");
15+
menuBtn.classList.remove("hide");
16+
cancelBtn.classList.remove("show");
17+
body.classList.remove("disabledScroll");
18+
}
1919

20-
window.onscroll = ()=>{
21-
this.scrollY > 20 ? navbar.classList.add("sticky") : navbar.classList.remove("sticky");
22-
}
20+
window.onscroll = () => {
21+
this.scrollY > 20 ? navbar.classList.add("sticky") : navbar.classList.remove("sticky");
22+
}

0 commit comments

Comments
 (0)