Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
CSS Pop Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Markshall" data-source="post: 440860" data-attributes="member: 1872"><p>Much like my <a href="https://devbest.com/threads/simple-hero-header-animation.87222" target="_blank">other post</a>, I saw another nice effect I saw on a website a while ago that I wanted to replicate.</p><p></p><p>I've not focused much on the styling of it (there's some basic styling but it still looks ugly), but more on the functionality. No JavaScript is involved as it uses a checkbox to determine whether the pop-menu button has been clicked.</p><p></p><p>It's a nice effect on a mobile phone bottom-menu bar if used and styled correctly.</p><p></p><p><a href="https://codepen.io/Markshall/pen/qQjwQz" target="_blank">https://codepen.io/Markshall/pen/qQjwQz</a></p><p></p><p><img src="https://i.sharefa.st/Obs5Ygh12HD3.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /><img src="https://i.sharefa.st/ASMR3Fy62HD3.png" alt="" class="fr-fic fr-dii fr-draggable " style="" /></p><p></p><p>CSS:</p><p>[PHP]body, html {</p><p> position: relative;</p><p> height: 100vh;</p><p> width: 100vw;</p><p> background-color: #efefef;</p><p> margin: 0;</p><p> padding: 0;</p><p>}</p><p></p><p>#app {</p><p> position: absolute;</p><p> top: 50%; left: 50%;</p><p> transform: translate(-50%, -50%);</p><p>}</p><p></p><p>.phone-outline {</p><p> height: 570px;</p><p> width: 300px;</p><p> background-color: #cecece;</p><p> border-radius: 15px;</p><p> position: relative;</p><p>}</p><p></p><p>.screen-outline {</p><p> height: 96%;</p><p> width: 94%;</p><p> position: absolute;</p><p> border-radius: 8px;</p><p> top: 2%; left: 3%;</p><p> background-color: #fff;</p><p>}</p><p></p><p>.pop-menu--wrapper {</p><p> position: absolute;</p><p> bottom: 10px; left: 50%;</p><p> transform: translateX(-50%);</p><p>}</p><p></p><p>.pop-menu--listener {</p><p> -webkit-appearance: none;</p><p> position: absolute;</p><p> top: 0; left: 0;</p><p> width: 100%;</p><p> height: 100%;</p><p> margin: 0;</p><p> background-color: #6483ca;</p><p> border-radius: 50%;</p><p> height: 50px;</p><p> width: 50px;</p><p> border: 1px solid #6483ca;</p><p> border-bottom: 2px solid #4e6aab;</p><p> box-shadow: inset 0px 1px 4px rgba(255,255,255,.4), 0 2px 7px rgba(0,0,0,.3);</p><p> cursor: pointer;</p><p> transition: all .1s ease-in-out;</p><p> position: relative;</p><p> outline: none;</p><p>}</p><p></p><p>.pop-menu--listener:active {</p><p> box-shadow: inset 0px 1px 2px rgba(255,255,255,.2), 0 3px 5px rgba(0,0,0,.3);</p><p>}</p><p></p><p>.pop-menu--listener ~ i {</p><p> position: absolute;</p><p> color: #fff;</p><p> top: 50%; left: 50%;</p><p> transform: translate(-50%,-50%);</p><p> font-size: 20px;</p><p> pointer-events: none;</p><p>}</p><p></p><p>.pop-menu--button {</p><p> height: 30px;</p><p> width: 30px;</p><p> display: block;</p><p> border-radius: 50%;</p><p> background-color: #7c9add;</p><p> color: #fff;</p><p> position: absolute;</p><p> border: 1px solid #6483ca;</p><p> border-bottom: 2px solid #4e6aab;</p><p> box-shadow: inset 0px 1px 4px rgba(255,255,255,.4), 0 2px 7px rgba(0,0,0,.3);</p><p> top: 50%; left: 50%;</p><p> transform: translate(-50%, -50%);</p><p> opacity: 0;</p><p> pointer-events: none;</p><p> transition: all .3s cubic-bezier(0.58, 0.04, 0.1, 0.54);</p><p>}</p><p></p><p>.pop-menu--button i {</p><p> position: absolute;</p><p> top: 50%; left: 50%;</p><p> transform: translate(-50%,-50%);</p><p>}</p><p></p><p>.pop-menu--button:nth-of-type(1) {</p><p> transition-delay: .6s;</p><p>}</p><p></p><p>.pop-menu--button:nth-of-type(2) {</p><p> transition-delay: .2s;</p><p>}</p><p></p><p>.pop-menu--button:nth-of-type(3) {</p><p> transition-delay: .3s;</p><p>}</p><p></p><p>.pop-menu--listener:checked ~ .pop-menu--button {</p><p> pointer-events: all;</p><p> opacity: 1;</p><p>}</p><p></p><p>.pop-menu--listener:checked ~ .pop-menu--button:nth-of-type(1) {</p><p> top: -6px; left: -18px;</p><p>}</p><p></p><p>.pop-menu--listener:checked ~ .pop-menu--button:nth-of-type(2) {</p><p> top: -30px;</p><p>}</p><p></p><p>.pop-menu--listener:checked ~ .pop-menu--button:nth-of-type(3) {</p><p> top: -6px; left: calc(100% + 18px);</p><p>}[/PHP]</p><p></p><p>HTML:</p><p>[PHP]<div id="app"></p><p> <div class="phone-outline"></p><p> <div class="screen-outline"></p><p> <div class="pop-menu--wrapper"></p><p> <input type="checkbox" name="pop-menu--listener" id="pop-menu--listener" class="pop-menu--listener" /></p><p> <i class="fa fa-share"></i></p><p> <a href="#twitter" class="pop-menu--button"><i class="fab fa-twitter"></i></a></p><p> <a href="#fb" class="pop-menu--button"><i class="fab fa-facebook"></i></a></p><p> <a href="#insta" class="pop-menu--button"><i class="fab fa-instagram"></i></a></p><p> </div></p><p> </div></p><p> </div></p><p></div>[/PHP]</p></blockquote><p></p>
[QUOTE="Markshall, post: 440860, member: 1872"] Much like my [URL='https://devbest.com/threads/simple-hero-header-animation.87222']other post[/URL], I saw another nice effect I saw on a website a while ago that I wanted to replicate. I've not focused much on the styling of it (there's some basic styling but it still looks ugly), but more on the functionality. No JavaScript is involved as it uses a checkbox to determine whether the pop-menu button has been clicked. It's a nice effect on a mobile phone bottom-menu bar if used and styled correctly. [URL]https://codepen.io/Markshall/pen/qQjwQz[/URL] [IMG]https://i.sharefa.st/Obs5Ygh12HD3.png[/IMG][IMG]https://i.sharefa.st/ASMR3Fy62HD3.png[/IMG] CSS: [PHP]body, html { position: relative; height: 100vh; width: 100vw; background-color: #efefef; margin: 0; padding: 0; } #app { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .phone-outline { height: 570px; width: 300px; background-color: #cecece; border-radius: 15px; position: relative; } .screen-outline { height: 96%; width: 94%; position: absolute; border-radius: 8px; top: 2%; left: 3%; background-color: #fff; } .pop-menu--wrapper { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); } .pop-menu--listener { -webkit-appearance: none; position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; background-color: #6483ca; border-radius: 50%; height: 50px; width: 50px; border: 1px solid #6483ca; border-bottom: 2px solid #4e6aab; box-shadow: inset 0px 1px 4px rgba(255,255,255,.4), 0 2px 7px rgba(0,0,0,.3); cursor: pointer; transition: all .1s ease-in-out; position: relative; outline: none; } .pop-menu--listener:active { box-shadow: inset 0px 1px 2px rgba(255,255,255,.2), 0 3px 5px rgba(0,0,0,.3); } .pop-menu--listener ~ i { position: absolute; color: #fff; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 20px; pointer-events: none; } .pop-menu--button { height: 30px; width: 30px; display: block; border-radius: 50%; background-color: #7c9add; color: #fff; position: absolute; border: 1px solid #6483ca; border-bottom: 2px solid #4e6aab; box-shadow: inset 0px 1px 4px rgba(255,255,255,.4), 0 2px 7px rgba(0,0,0,.3); top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; transition: all .3s cubic-bezier(0.58, 0.04, 0.1, 0.54); } .pop-menu--button i { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); } .pop-menu--button:nth-of-type(1) { transition-delay: .6s; } .pop-menu--button:nth-of-type(2) { transition-delay: .2s; } .pop-menu--button:nth-of-type(3) { transition-delay: .3s; } .pop-menu--listener:checked ~ .pop-menu--button { pointer-events: all; opacity: 1; } .pop-menu--listener:checked ~ .pop-menu--button:nth-of-type(1) { top: -6px; left: -18px; } .pop-menu--listener:checked ~ .pop-menu--button:nth-of-type(2) { top: -30px; } .pop-menu--listener:checked ~ .pop-menu--button:nth-of-type(3) { top: -6px; left: calc(100% + 18px); }[/PHP] HTML: [PHP]<div id="app"> <div class="phone-outline"> <div class="screen-outline"> <div class="pop-menu--wrapper"> <input type="checkbox" name="pop-menu--listener" id="pop-menu--listener" class="pop-menu--listener" /> <i class="fa fa-share"></i> <a href="#twitter" class="pop-menu--button"><i class="fab fa-twitter"></i></a> <a href="#fb" class="pop-menu--button"><i class="fab fa-facebook"></i></a> <a href="#insta" class="pop-menu--button"><i class="fab fa-instagram"></i></a> </div> </div> </div> </div>[/PHP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
CSS Pop Menu
Top