Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
monnaie-libre-fr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Léo El Amri
monnaie-libre-fr
Commits
260bbf90
Commit
260bbf90
authored
3 years ago
by
Emmanuel Salomon
Browse files
Options
Downloads
Patches
Plain Diff
refactoring: rename and move flat plan component
parent
52bb312a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
components/app/AppFlatPlan.vue
+0
-173
0 additions, 173 deletions
components/app/AppFlatPlan.vue
pages/_slug.vue
+1
-1
1 addition, 1 deletion
pages/_slug.vue
pages/index.vue
+1
-1
1 addition, 1 deletion
pages/index.vue
with
2 additions
and
175 deletions
components/app/AppFlatPlan.vue
deleted
100644 → 0
+
0
−
173
View file @
52bb312a
<
template
>
<nav>
<nuxt-link
v-if=
"showNext && nextPage"
class=
"text-3xl pb-3 mb-3 block group"
:to=
"nextPage.to"
>
<span
class=
"opacity-75"
>
Page suivante
</span>
<fa
icon=
"arrow-right"
class=
"mx-4"
></fa>
<span
class=
"font-semibold group-hover:underline"
>
{{
nextPage
.
title
}}
</span>
</nuxt-link>
<section
class=
"section-flatplan gap-6 grid lg:grid-cols-4 md:grid-cols-2 group"
>
<nuxt-link
v-for=
"(section, i) in sections"
:key=
"i"
:to=
"section.to"
class=
"bg-blue-100 dark:bg-blue-900 px-4 py-4 pb-3 rounded transition hover:shadow-xl transform hover:-translate-y-0.5"
:class=
"
showNext &&
(nextPage && nextPage.to === section.to
? 'ring-4 ring-blue-200 dark:ring-blue-800'
: 'bg-opacity-80 dark:bg-opacity-80 group-hover:bg-opacity-100')
"
>
<div
class=
"flex items-center justify-between"
>
<h2
class=
"font-semibold text-lg"
>
{{
section
.
title
}}
</h2>
<fa
icon=
"arrow-right"
class=
"ml-4"
></fa>
</div>
<ul
class=
"mt-1 font-light list-flatplan"
>
<li
v-for=
"(item, ii) in section.children"
:key=
"ii"
>
{{
item
}}
</li>
</ul>
</nuxt-link>
</section>
</nav>
</
template
>
<
script
>
export
default
{
props
:
{
plan
:
{
type
:
String
,
required
:
true
,
},
showNext
:
{
type
:
Boolean
,
default
:
false
,
},
},
data
()
{
return
{
sections
:
[],
}
},
async
fetch
()
{
const
document
=
await
this
.
$content
(
this
.
plan
).
fetch
()
// This is ugly, but I don't found another way to extract title, link and li elements.
// It's work with 'content:file:beforeParse' nuxt-content hook. See in config.nuxt.js
this
.
sections
=
document
.
body
.
children
.
filter
((
item
)
=>
item
.
tag
===
'
section
'
)
.
map
((
item
)
=>
{
const
title
=
item
.
children
.
filter
((
item
)
=>
item
.
type
===
'
element
'
)[
0
]
.
children
[
1
]
const
children
=
item
.
children
.
filter
((
item
)
=>
item
.
type
===
'
element
'
)[
1
]
.
children
.
filter
((
item
)
=>
item
.
type
===
'
element
'
)
.
map
((
li
)
=>
li
.
children
[
0
].
value
)
return
{
children
,
title
:
title
.
children
[
0
].
value
,
to
:
title
.
props
.
to
,
}
})
},
computed
:
{
nextPage
()
{
const
index
=
this
.
sections
.
findIndex
(
(
index
)
=>
index
.
to
===
this
.
$route
.
fullPath
)
return
this
.
sections
[
index
+
1
]
?
this
.
sections
[
index
+
1
]
:
null
},
},
}
</
script
>
<
style
lang=
"postcss"
scoped
>
.list-flatplan > li {
position: relative;
padding-left: 1.75em;
margin: 0.5em 0;
line-height: 1.2em;
}
.list-flatplan > li::before {
content: '';
position: absolute;
background-color: #3b82f6;
border-radius: 50%;
width: 0.375em;
height: 0.375em;
top: 0.375em;
left: 0.25em;
}
.section-flatplan .svg-inline--fa {
animation: shake 10s cubic-bezier(0.36, 0.07, 0.19, 0.97) infinite;
animation-delay: 5s;
}
.section-flatplan > a:nth-child(2) .svg-inline--fa {
animation-delay: 5.5s;
}
.section-flatplan > a:nth-child(3) .svg-inline--fa {
animation-delay: 6s;
}
.section-flatplan > a:nth-child(4) .svg-inline--fa {
animation-delay: 6.5s;
}
@keyframes shake {
0% {
-webkit-transform: translate(2px, 1px) rotate(0deg);
}
1% {
-webkit-transform: translate(-1px, -2px) rotate(-3deg);
}
2% {
-webkit-transform: translate(-3px, 0px) rotate(3deg);
}
3% {
-webkit-transform: translate(0px, 2px) rotate(0deg);
}
4% {
-webkit-transform: translate(1px, -1px) rotate(3deg);
}
5% {
-webkit-transform: translate(-1px, 2px) rotate(-3deg);
}
6% {
-webkit-transform: translate(-3px, 1px) rotate(0deg);
}
7% {
-webkit-transform: translate(2px, 1px) rotate(-3deg);
}
8% {
-webkit-transform: translate(-1px, -1px) rotate(3deg);
}
9% {
-webkit-transform: translate(2px, 2px) rotate(0deg);
}
10% {
-webkit-transform: translate(1px, -2px) rotate(-3deg);
}
11% {
transform: translate(0, 0) rotate(0deg);
}
}
</
style
>
This diff is collapsed.
Click to expand it.
pages/_slug.vue
+
1
−
1
View file @
260bbf90
...
...
@@ -10,7 +10,7 @@
</
template
>
<
template
#footer
>
<
App
FlatPlan
<
Page
FlatPlan
v-if=
"document.plan"
:plan=
"document.plan"
class=
"border-t mt-20 py-6"
...
...
This diff is collapsed.
Click to expand it.
pages/index.vue
+
1
−
1
View file @
260bbf90
...
...
@@ -2,7 +2,7 @@
<div>
<HomeHero
:document=
"hero"
/>
<
App
FlatPlan
class=
"container mb-12"
plan=
"ui/main-flatplan"
/>
<
Page
FlatPlan
class=
"container mb-12"
plan=
"ui/main-flatplan"
/>
<HomeSearchInput
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment