Adding navbar and post Button #17

Merged
corentin.richard merged 1 commits from navigation into master 10 months ago

@ -160,3 +160,72 @@ html {
calc(2*var(--s)) calc(9*var(--s)/4),
calc(2*var(--s)) calc(3*var(--s)/4);
}
header {
background-color: #bda3b6;
padding: 4px;
border-radius: 10px;
border-style: solid;
border-color: #1a2c4c;
border-width: 2px;
}
nav {
display: flex;
justify-content: space-between;
align-items: center;
}
.nav-logo{
text-decoration: none;
color: #333;
margin-left: 15px;
}
.nav-link{
text-decoration: none;
color: #333;
margin-right: 30px;
}
nav img {
height: 40px;
}
.nav-links {
display: flex;
align-items: center;
}
.floating-button {
position: fixed;
bottom: 20px;
right: 20px;
width: 60px;
height: 60px;
background-color: #bda3b6;
border: none;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
font-size: 24px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
cursor: pointer;
transition: background-color 0.3s;
border-style: solid;
border-color: #1a2c4c;
border-width: 4px;
padding-bottom: 10px;
font-size: 50px;
color: #1a2c4c;
}
.nav-links a:hover {
color: #494949;
}
.floating-button:hover {
background-color: #72606d;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

@ -21,7 +21,11 @@ class ProfilController extends AbstractController
#[Route(path:"/profil", name:"profil_perso", methods: ["GET"])]
public function baseProfil(): Response
{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED');
try{
$this->denyAccessUnlessGranted('IS_AUTHENTICATED');
}catch (\Exception $e){
return $this->redirectToRoute('app_login');
}
return $this->redirectToRoute('profil_show', ['id' => $this->getUser()->getId()]);
}
#[Route('/profil/{id}',name:'profil_show', requirements: ['page' => '\d+'])]

@ -12,6 +12,23 @@
{% endblock %}
</head>
<body>
<header>
<nav>
<div class="nav-links">
<a class="nav-logo" href="/">
<img src="{{ asset('images/logo.jpg') }}" alt="Logo">
</a>
<a class="nav-link" href="/"><h1>FukaFukashita</h1></a>
</div>
<div class="nav-links">
<a href="/" class="nav-link">Abonnements</a>
<a href="/profil" class="nav-link">Compte</a>
{% if is_granted('ROLE_USER') %}
<a href="/logout" class="nav-link">Se déconnecter</a>
{% endif %}
</div>
</nav>
</header>
{% block body %}{% endblock %}
</body>
<button class="floating-button" onclick="location.href='/post/new'">+</button>
</html>

@ -1,7 +1,12 @@
{% extends 'base.html.twig' %}
{% block body %}
<link rel="stylesheet" href="{{ asset('css/components/post_mini.css') }}">
<link rel="stylesheet" href="{{ asset('css/components/post_all.css') }}">
<div id="wrapper">
<h1>All posts</h1>
@ -9,3 +14,4 @@
{% include 'post/post_mini.html.twig' with {'post' : post} %}
{% endfor %}
</div>
{% endblock %}

@ -1 +1,5 @@
{% extends 'base.html.twig' %}
{% block body %}
{{ form(form) }}
{% endblock %}

@ -1,3 +1,5 @@
{% extends 'base.html.twig' %}
<link rel="stylesheet" href="{{ asset('css/components/post.css') }}">
<title>{{ post.title }}</title>

@ -1,3 +1,4 @@
{% block body %}
<div id="post-wrapper">
<div id="post">
<div id="post-info">
@ -11,3 +12,4 @@
<p>{{ post.text|u.truncate(150, true, '...') }}</p>
</div>
</div>
{% endblock %}
Loading…
Cancel
Save