Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
l3m-website
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
3
Issues
3
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Corentin Bettiol
l3m-website
Commits
6088891e
Commit
6088891e
authored
Mar 02, 2019
by
Corentin Bettiol
💻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add hamburger menu (css) & add auto renaming for url slugs
parent
12c6acd2
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
90 additions
and
5 deletions
+90
-5
css/design.css
css/design.css
+50
-1
img/mobile-menu-icon-close.png
img/mobile-menu-icon-close.png
+0
-0
img/mobile-menu-icon.png
img/mobile-menu-icon.png
+0
-0
site/controller/mainController.php
site/controller/mainController.php
+2
-0
site/model/Base.php
site/model/Base.php
+1
-1
site/model/BlogManager.php
site/model/BlogManager.php
+13
-0
site/model/ProjectsManager.php
site/model/ProjectsManager.php
+14
-1
site/view/public/about.php
site/view/public/about.php
+1
-1
site/view/public/changelog.php
site/view/public/changelog.php
+9
-1
No files found.
css/design.css
View file @
6088891e
...
...
@@ -251,6 +251,12 @@ form .small{
transition
:
background-color
0.3s
,
color
0.3s
,
border
0.0.5s
,
padding
0.05s
;
}
#toggle
,
.nav-label
{
height
:
0
;
display
:
none
;
background-color
:
#f0f0f0
;
}
/*
====
Media Queries
...
...
@@ -314,9 +320,38 @@ Media Queries
width
:
45px
;
height
:
45px
;
}
/* hamburger menu - taken on https://actudiant.fr/ - from an old version of https://scotch.io/tutorials/building-a-morphing-hamburger-menu-with-css */
#toggle
{
position
:
absolute
;
left
:
-9999px
;
}
.nav-label
{
position
:
fixed
;
top
:
0
;
display
:
inline-block
;
width
:
50px
;
height
:
50px
;
padding
:
0
;
opacity
:
0.6
;
background-image
:
url('/img/mobile-menu-icon.png')
;
background-size
:
50px
50px
;
transition
:
transform
0.3s
ease
;
background-size
:
50px
50px
;
}
#listMenu
{
width
:
8
0%
;
width
:
10
0%
;
margin
:
auto
;
background-color
:
#f0f0f0
;
border-bottom
:
5px
solid
#ccc
;
position
:
fixed
;
top
:
0
;
max-height
:
0
;
overflow
:
hidden
;
opacity
:
0
;
transition
:
max-height
0.30s
ease
,
opacity
0.30s
;
}
#listMenu
li
{
margin
:
3px
auto
;
...
...
@@ -328,6 +363,20 @@ Media Queries
border
:
none
;
background-color
:
#ccc
;
}
#toggle
:checked
~
#listMenu
{
max-height
:
300px
;
opacity
:
1
;
transition
:
max-height
0.45s
ease-out
,
opacity
0.30s
;
}
#toggle
:checked
~
.nav-label
{
background-image
:
url('/img/mobile-menu-icon-close.png')
;
transform
:
rotate
(
180deg
);
transition
:
transform
0.3s
ease
;
background-size
:
50px
50px
;
}
}
/*
...
...
img/mobile-menu-icon-close.png
0 → 100644
View file @
6088891e
1.27 KB
img/mobile-menu-icon.png
0 → 100644
View file @
6088891e
763 Bytes
site/controller/mainController.php
View file @
6088891e
...
...
@@ -59,6 +59,7 @@ function getPageName(){
// affiche le menu du site (avec le titre de la page)
function
writeMenu
(
$pageName
){
?>
<input
id=
"toggle"
type=
"checkbox"
/>
<ul
id=
'listMenu'
>
<?php
if
(
$pageName
==
'Administration'
){
?>
...
...
@@ -72,6 +73,7 @@ function writeMenu($pageName){
<li><h2><a
href=
"/projects"
title=
"Projets"
<?php
if
(
$pageName
==
'Projets'
||
$pageName
==
'Projet'
){
?>
class=
"selected"
<?php
}
?>
>
Projets
</a></h2></li>
<li><h2><a
href=
"/contact"
title=
"Contact"
<?php
if
(
$pageName
==
'Contact'
){
?>
class=
"selected"
<?php
}
?>
>
Contact
</a></h2></li>
</ul>
<label
class=
"nav-label"
for=
"toggle"
></label>
<?php
}
// affiche la page du blog
...
...
site/model/Base.php
View file @
6088891e
...
...
@@ -15,6 +15,6 @@ class Base
$slug
=
preg_replace
(
'/[-\s]+/'
,
'-'
,
$slug
);
$slug
=
preg_replace
(
'/-$/'
,
''
,
$slug
);
$slug
=
preg_replace
(
'/[^a-z0-9-]+/'
,
''
,
$slug
);
return
$slug
;
return
$slug
;
}
}
\ No newline at end of file
site/model/BlogManager.php
View file @
6088891e
...
...
@@ -73,6 +73,19 @@ class BlogManager extends Base
$this
->
slug
=
$this
->
slugify
(
$this
->
title
);
$db
=
$this
->
dbConnect
();
$i
=
1
;
$slug
=
$this
->
slug
;
do
{
$req
=
$db
->
prepare
(
'SELECT slug FROM l3m_blog WHERE slug = ?'
);
$req
->
execute
([
$this
->
slug
]);
$slugExist
=
$req
->
fetch
();
if
(
$slugExist
==
true
){
$i
++
;
$this
->
slug
=
$slug
.
"-"
.
$i
;
}
}
while
(
$slugExist
!=
false
);
$req
=
$db
->
prepare
(
'INSERT INTO l3m_blog(time, title, slug, content, shortContent) VALUES(:time, :title, :slug, :content, :shortContent)'
);
$req
->
execute
([
'time'
=>
$this
->
time
,
...
...
site/model/ProjectsManager.php
View file @
6088891e
...
...
@@ -61,7 +61,20 @@ class ProjectManager extends Base
}
$this
->
slug
=
$this
->
slugify
(
$this
->
name
);
$db
=
$this
->
dbConnect
();
$db
=
$this
->
dbConnect
();
$i
=
1
;
$slug
=
$this
->
slug
;
do
{
$req
=
$db
->
prepare
(
'SELECT slug FROM l3m_projects WHERE slug = ?'
);
$req
->
execute
([
$this
->
slug
]);
$slugExist
=
$req
->
fetch
();
if
(
$slugExist
==
true
){
$i
++
;
$this
->
slug
=
$slug
.
"-"
.
$i
;
}
}
while
(
$slugExist
!=
false
);
$req
=
$db
->
prepare
(
'INSERT INTO l3m_projects(name, slug, link, content, shortcontent) VALUES(:name, :slug, :link, :content, :shortContent)'
);
$req
->
execute
([
'name'
=>
$this
->
name
,
...
...
site/view/public/about.php
View file @
6088891e
...
...
@@ -16,7 +16,7 @@
Il me sert de point de centralisation de plusieurs de mes projets, et me permet de faire quelques tests pas forcément référencés.
</p>
<p>
Il en est à
c
a cinquième refonte.
Il en est à
s
a cinquième refonte.
</p>
</article>
...
...
site/view/public/changelog.php
View file @
6088891e
<article>
<h3><a
href=
""
>
01/03/19
</a>
(encore)
</h3>
<h3><a
href=
""
>
02/03/19
</a></h3>
<ul>
<li>
Ajout du menu hamburger pour les smartphones
</li>
<li>
Ajout du renommage automatique de l'url d'un post/projet pour toujours avoir des url différentes même si plusieurs posts/projets on le même nom
</li>
</ul>
</article>
<article>
<h3><a
href=
"https://git.bitmycode.com/sodimel/l3m-website/commit/e7ffa7e6fa4c07537014c0cf4e3ffd7a47a91de3"
>
01/03/19
</a>
(encore)
</h3>
<ul>
<li>
Réorganisation de la gestion des url des pages :
<ul>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment