Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
ea8b247
added node.js, nvm and bootstrap
KineOnes Mar 20, 2024
d92f3a3
added bootstrap and a form
KineOnes Mar 20, 2024
52cf133
messing around, making new branch
KineOnes Apr 3, 2024
38180ff
added post form and corrected colors
KineOnes Apr 4, 2024
d1fca05
added .scss to bootstrap link import
KineOnes Apr 4, 2024
7d1c849
adjustet margin, content i the middle
KineOnes Apr 4, 2024
be39b0e
added background color in scss
KineOnes Apr 4, 2024
500a60b
added new buttons and icons. New form on profile and index
KineOnes Apr 5, 2024
cd1edf9
added content to feed profiles
KineOnes Apr 5, 2024
0eae953
Add user posts and icons
KineOnes Apr 5, 2024
2c93891
added more information to package.json
KineOnes Apr 5, 2024
c416989
correct active page when viewed either profile or feed
KineOnes Apr 6, 2024
bcd85e6
added content to README.md
KineOnes Apr 6, 2024
30150c0
added icons on post from other users
KineOnes Apr 6, 2024
23d2ca0
add number next to likes, and follower and following count to profile
KineOnes Apr 7, 2024
7ff6d1d
add unfollow icon to profile
KineOnes Apr 7, 2024
540601d
Add missing live-server dependency
KineOnes Apr 9, 2024
9dffa92
Compress thumbnail images to under 200kb
KineOnes Apr 9, 2024
2329a93
Empty scss, src/scss to create new styles the right way
KineOnes Apr 11, 2024
0fafb52
Empty style folders and files
KineOnes Apr 11, 2024
101fb64
Add default bootstrap styling with import in index.scss
KineOnes Apr 11, 2024
61eebfb
Import scss, and variables, variables-dark. Add font the font Playfai…
KineOnes Apr 12, 2024
8ad5351
Add background to, border radius to form and one card
KineOnes Apr 12, 2024
02be232
Add grid and rounded images
KineOnes Apr 12, 2024
7cf3b02
Change primary to brighter
KineOnes Apr 12, 2024
fb085e9
Adjust width of form on index
KineOnes Apr 12, 2024
46c0d53
Add margin to bottom of form on index
KineOnes Apr 12, 2024
483a88a
Add margin to sides and bottom of images in feed. Add margin to sides…
KineOnes Apr 13, 2024
4b540b6
Add sort function to feed page
KineOnes Apr 19, 2024
fb46098
Fix placement of sort function
KineOnes Apr 19, 2024
969b450
Add html validation to form
KineOnes Apr 25, 2024
b0e9bcc
Correct hamburgermenu on smaller screen
KineOnes Apr 25, 2024
88ce3bb
Fix hamburger menu and sort function to work after deploying
KineOnes Apr 25, 2024
5f69b1f
Add margin bottom 3 under Login button
KineOnes Apr 25, 2024
bd7ee42
Comment out style link in head to make primary color on btn work
KineOnes Apr 25, 2024
42aaf9a
Add bootstrap js link in head on index for burger menu to work
KineOnes May 7, 2024
3d1f8f9
Add media sort function
KineOnes May 7, 2024
016393f
Add action atribute to submit btn
KineOnes May 15, 2024
e9b9dd6
Add api and js and index.js to src folder
KineOnes May 16, 2024
5cc3d04
Add register user functionality
KineOnes May 16, 2024
2bd4dda
Add required pattern to email input
KineOnes May 16, 2024
ec78090
Add required pattern to email input on login form
KineOnes May 16, 2024
6ead75d
Add correct favicon to each html head
KineOnes May 16, 2024
15d3a5f
Add correct pattern for email input
KineOnes May 16, 2024
a69c336
Add login functionality
KineOnes May 16, 2024
d309ef8
Add correct script module syntax for script link in head, all pages
KineOnes May 19, 2024
cd3a443
Add Correct export/import in index js from login.js. Not finished
KineOnes May 20, 2024
848908a
Add import and export from login js to index js
KineOnes May 20, 2024
0017066
Add type module to script link in header on register page
KineOnes May 20, 2024
858048d
Add mjs behind all js files
KineOnes May 21, 2024
337895a
Structure folders and files according to modules, set up modules, fun…
KineOnes May 22, 2024
e84d9c7
Add margin between buttons on feed and profileImage and text
KineOnes May 22, 2024
868b5bc
Add user profile info to profile page
KineOnes May 22, 2024
058a518
Add follow and unfollow buttons to profile page
KineOnes May 22, 2024
c46b418
Add basic feed search capabilities
KineOnes May 22, 2024
85b1e2b
Fix flex issues
KineOnes May 22, 2024
89e25f8
Increase default post limit to 100
KineOnes May 22, 2024
4713e6e
Replace dropdown sort with a form select
KineOnes May 22, 2024
76efd01
Add basic filter box for filtering posts depending on media images
KineOnes May 23, 2024
7a39eb0
Add logout button to navbar
KineOnes May 23, 2024
701a242
Add create post feature. Add preliminary edit/delete post buttons
KineOnes May 23, 2024
7155951
Rename love button to like button
KineOnes May 23, 2024
de382e7
Add created by info in posts
KineOnes May 23, 2024
85dbae5
Fix search form handler not handling missing post body
KineOnes May 23, 2024
3d7775b
Add delete post feature
KineOnes May 23, 2024
86b9ba3
Change default profile picture to freeimage
KineOnes May 24, 2024
19d5737
Add view single post by id
KineOnes May 24, 2024
841ee30
Add placeholder text in inputfield login form
KineOnes May 24, 2024
91f82df
Add placeholder text in input field on register form
KineOnes May 24, 2024
ac09ab2
Remove search in navbar
KineOnes May 24, 2024
98b733a
Update Readme file with brief
KineOnes May 24, 2024
edfbbdc
Temporary fix for login page when opening in live server
KineOnes May 25, 2024
686b8fa
Add update post feature
KineOnes May 25, 2024
b0d4831
Refactor create post form html
KineOnes May 25, 2024
31afcd7
Remove navbar items and hamburger menu from login and registration pages
KineOnes May 25, 2024
27603a6
Final changes
KineOnes May 25, 2024
e38d067
Add Trello link to ReadMe
KineOnes May 25, 2024
24399ae
Used jsdocs to document function for getAllPosts, requirement
KineOnes May 25, 2024
062d085
Create a jsdocs documentation for the function fetching a single page…
KineOnes May 25, 2024
8417d3e
correct jsdoc documentation to function get all posts
KineOnes May 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 47 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,47 @@
# css-frameworks-ca
Replace this text with a description of your social media project.
# js2-ca

## Brief

To apply knowledge of JavaScript techniques to implement the front-end functionality for a social media application.

This assignment is building on my css-framework ca.

## Required features

Required features
The following user stories are required for a passing submission:

- User with @noroff.no or @stud.noroff.no email can register profile
- Registered user can login
- User can view a post content feed
- User can filter the post content feed
- User can search the post content feed
- User can view a post content item by ID
- User can create a post content item
- User can update a post content item
- User can delete a post content item

## Built With

- Figma (prototyping)
- HTML
- Bootstrap
- SASS
- JavaScript

## Getting Started

### Installing

Clone the repo:

```
git@github.com:KineOnes/css-frameworks-ca.git

The branch: js2

```

## Trello board for project planning:

https://trello.com/b/Ui6nlMjg/javascript2
112 changes: 112 additions & 0 deletions feed/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>FEED</title>
<link rel="icon" href="/images/beige-knit.png" type="image" />
<link rel="stylesheet" href="/dist/css/index.css" />
<script src="/src/js/index.mjs" type="module"></script>

<script
src="/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
defer></script>
</head>
<body
data-bs-theme="dark"
style="min-height: 100vh"
class="d-flex flex-column">
<header>
<div class="container">
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="/profile">NØSTE</a>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="/profile">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/feed"
>Feed</a
>
</li>
<li class="nav-item">
<a class="nav-link" href="/">Logout</a>
</li>
</ul>
</div>
</div>
</nav>
</div>
</header>

<main>
<div class="container" style="max-width: 700px">
<div class="create-post">
<h1 class="title d-flex justify-content-center mt-3">Create post</h1>
<form id="createPostForm">
<div class="mb-3">
<input
type="text"
class="form-control"
name="title"
placeholder="Title"
required />
</div>
<div class="mb-3">
<textarea
class="form-control"
name="body"
rows="3"
placeholder="What's on you mind?"></textarea>
</div>
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
<button class="btn btn-primary me-md-2" type="submit">
Post
</button>
</div>
</form>
</div>
</div>

<div class="container mt-5" style="max-width: 700px">
<div class="row">
<div class="col">
<h3 class="title">Latest posts</h3>
</div>
<div class="col-auto">
<select class="form-select" id="selectForm">
<option value="all">All</option>
<option value="media">With media</option>
<option value="no-media">Without media</option>
</select>
</div>
<form id="searchForm" class="d-flex col">
<input
name="searchQuery"
class="form-control me-2"
type="text"
placeholder="Search"
aria-label="Search" />
<button type="submit" class="btn btn-primary">Search</button>
</form>
</div>
</div>

<div id="feed">
<!-- JS generated content -->
</div>
</main>
</body>
</html>
58 changes: 58 additions & 0 deletions feed/post/edit/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>EDIT POST</title>
<link rel="icon" href="/images/beige-knit.png" type="image" />
<link rel="stylesheet" href="/dist/css/index.css" />
<script src="/src/js/index.mjs" type="module"></script>

<script
src="/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
defer></script>
</head>
<body
data-bs-theme="dark"
style="min-height: 100vh"
class="d-flex flex-column">
<header>
<div class="container">
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="/profile">NØSTE</a>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="/profile">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/feed"
>Feed</a
>
</li>
<li class="nav-item">
<a class="nav-link" href="/">Logout</a>
</li>
</ul>
</div>
</div>
</nav>
</div>
</header>
<main>
<h1 class="title d-flex justify-content-center mt-3">Edit post</h1>
<!-- JS generated content -->
</main>
</body>
</html>
65 changes: 65 additions & 0 deletions feed/post/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>POST</title>
<link rel="icon" href="/images/beige-knit.png" type="image" />
<link rel="stylesheet" href="/dist/css/index.css" />
<script src="/src/js/index.mjs" type="module"></script>

<script
src="/node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
defer></script>
</head>
<body
data-bs-theme="dark"
style="min-height: 100vh"
class="d-flex flex-column">
<header>
<div class="container">
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="/profile">NØSTE</a>
<button
class="navbar-toggler"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" href="/profile">Profile</a>
</li>
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="/feed"
>Feed</a
>
</li>
<li class="nav-item">
<a class="nav-link" href="/">Logout</a>
</li>
</ul>
<form class="d-flex" role="search">
<input
class="form-control me-2"
type="search"
placeholder="Search"
aria-label="Search" />
<button type="button" class="btn btn-primary">Search</button>
</form>
</div>
</div>
</nav>
</div>
</header>
<main>
<!-- JS generated content -->
</main>
</body>
</html>
Binary file added images/beige-knit.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 images/blue-knit-png.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 images/green-knit.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 images/thumbnail1.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 images/thumbnail2.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 images/thumbnail3.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 images/thumbnail4.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 images/thumbnail5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added images/thumbnails
Empty file.
Binary file added images/userImageDefault.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: 68 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>HOME</title>
<link rel="icon" href="images/beige-knit.png" type="image" />
<!--To remove error favicon in console-->
<link rel="stylesheet" href="dist/css/index.css" />
<script src="src/js/index.mjs" type="module"></script>

<script
src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"
defer></script>
</head>
<body
data-bs-theme="dark"
style="min-height: 100vh"
class="d-flex flex-column">
<header>
<div class="container">
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container-fluid">
<a class="navbar-brand" href="/">NØSTE</a>
</div>
</nav>
</div>
</header>

<main class="container flex-grow-1" style="max-width: 700px">
<div class="row justify-content-center border rounded-3 mt-3 mb-3">
<div class="title d-flex justify-content-center mt-3 mb-3">
<h1>Login</h1>
</div>
<div class="col-12 col md-6">
<form id="loginForm">
<div class="form-group mb-3">
<label for="email">Email</label>
<input
class="form-control"
type="email"
required
pattern="^[\w\-.]+@(stud\.)?noroff\.no$"
required
name="email"
placeholder="noroff valid email only" />
</div>
<div class="form-group mb-3">
<label for="password">Password</label>
<input
class="form-control"
required
type="password"
name="password"
minlength="8"
placeholder="minimum length of 8 characters" />
</div>
<button type="submit" class="btn btn-primary mb-3">Login</button>
</form>

<form id="signupForm" action="/profile/registration">
<button class="btn btn-primary mb-3">Sign up!</button>
</form>
</div>
</div>
</main>
</body>
</html>
Loading