Comments (7)
Thanks @Fazarel
I'll take a look at it and try to implement it in the next version..
from grav-theme-future2021.
Thanks @pmoreno-rodriguez, so reactive!
from grav-theme-future2021.
Hi there,
2 suggestions.
-
The easiest one:
Simply add a glyph at the top of the menu. In templates/partials/sidebar_right.html.twig, just after<section id="menu">
, something like:
<a class="fa-xmark" href="#menu">Menu</a>
It works but I can't adapt the CSS to have the icon aligned to the right, in the same place and of the same size as the glyph of the 3 bars. -
A more elaborate and aesthetically pleasing solution
Could be inspired by this example: https://www.albatcp.org
I manage to get the 3 bars to become a cross.
HTML in templates/partials/header.html.twig:
<li class="menu">
<a href="#menu">
<button id="boton-menu" class="boton-menu">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
</button>
</a>
</li>
HTML in templates/partials/sidebar_right.html.twig
<a href="#menu">
<button id="boton-menu" class="boton-menu toggled">
<div class="bar1"></div>
<div class="bar2"></div>
<div class="bar3"></div>
</button>
</a>
CSS to be added:
/* Botón de Menú animado*/
.boton-menu {
position: fixed;
top: 0px;
right: 0px;
display: inline-block !important;
cursor: pointer;
z-index: 99999;
margin: 12px 24px;
background-color: #0000;
border: none;
}
.bar1, .bar2, .bar3 {
width: 35px;
height: 2px;
border-radius: 1px;
background-color: #cf293a;
margin: 9px 0;
transition: 0.4s;
}
/* Rotate first bar */
.toggled .bar1 {
-webkit-transform: rotate(-45deg) translate(-0px, 0px) ;
transform: rotate(-45deg) translate(-5px, 10px) ;
background-color: #333;
}
/* Fade out the second bar */
.toggled .bar2 {
opacity: 0;
}
/* Rotate last bar */
.toggled .bar3 {
-webkit-transform: rotate(45deg) translate(-0px, -0px) ;
transform: rotate(45deg) translate(-5px, -10px) ;
background-color: #333;
}
Once again, I'm having trouble with the CSS to get the animation and a nice integration with the Future2021 theme.
from grav-theme-future2021.
Hello @Fazarel
I am working on this improvement. If you want you can do it the following:
-
In sidebar_right.html.twig, bellow the
<section id="menu">
add this:
<div style="padding: 1.5em;"><a class="close" href="#menu" title="Menu"></a></div>
-
In menu.scss (in assets folder --> sass -> layout), beloww the line 40, add this:
>:nth-child(2) {
border-top: 0;
}
.close {
@include icon(false, solid);
@include vendor('transition', 'color #{_duration(transition)} ease-in-out');
border: 0;
color: _palette(fg-light);
cursor: pointer;
text-align: right;
&:before {
content: '\f00d';
display: block;
padding: 0.5em 1.5em;
}
&:hover {
color: inherit;
}
@include breakpoint('<=small') {
height: 4em;
line-height: 4em;
&:before {
padding: 0em;
}
}
}
- Compile the main.scss file to generate main.css file (for example, with VS Code using Watch Sass plugin).
After that, you can test the close button in the sidebar.
from grav-theme-future2021.
Thanks for your help.
I've applied the changes (assuming you meant in 1. "below <section id="menu">
") and recompiled the CSS, but the close button does not appear:
Tested with Firefox and Chromium.
from grav-theme-future2021.
Hi @Fazarel
I'll try to upload a new version shortly. Maybe you can try this changes.
from grav-theme-future2021.
@Fazarel , in new version 1.0.6 the crossmark to close side bar is ready to work.
from grav-theme-future2021.
Related Issues (20)
- Issues with login HOT 4
- HTML/CSS bugs HOT 9
- Issues with breadcrumbs and pagination in blog HOT 1
- Social Icons not visible HOT 10
- Bug with new "Show Image" functionality in default.html.twig HOT 3
- No Sidebar with demo files. HOT 5
- Faulty heading formatting HOT 6
- Width issue HOT 10
- Miniposts Template uses page object, instead of minipost object to parse date HOT 2
- Donation BuyMeACoffee HOT 3
- Sticky menu for blog posts HOT 7
- Suggestion: serve google fonts locally HOT 1
- How to properly delete the right toolbar ? HOT 5
- Cannot show any entry inside the "Featured" section HOT 4
- sort filter causes error when taxonomy is empty HOT 2
- suggestion HOT 2
- Improve Portfolio customization HOT 1
- Logo in image format to be implemented in the header HOT 2
- Demo site HOT 2
- Remove the menu 'hamburger' from the top bar HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grav-theme-future2021.