PHP Ghost Crypt
Read more at http://www.phpclasses.org/package/9381-PHP-Encrypt-PHP-code-and-generate-self-decrypting-code.html#2015-11-18-09:00:09
Flexbox is a powerful new way for building layouts that makes some of the most challenging aspects of web development trivial. Nearly all browsers that are used today support it, so it is a good time to see how it can fit in your typical day-to-day frontend work.
This is why in this quick tutorial we’re going to build a comment section using flexbox. We’ll take a look at some of the more interesting properties that the flexbox layout mode has to offer and show you how to take full advantage of it.
Flexbox consists of a number of CSS properties, some of which we are going to use today:
display: flex
– This activates the flex layout mode and makes the element’s children follow flexbox rules.justify-content
– This property defines where the children of a flexbox element will align to (this is similar to text-align, read more here).order
– Flexbox gives us control on the exact position elements are displayed at. We use this powerful tool in our comment section to switch the text and photo around (find out more here).flex-wrap
– Controls the wrapping of the elements within the flex element. We use this to force the avatars to show beneath the comment text on small screens (flex-wrap on MDN).We want our comment section to meet the following requirements:
All of this can be made with a few lines of CSS with flexbox. Let’s move on the the code!
Our HTML is pretty straightforward. We’ll have a list of comments with a basic form for writing new comments at the end.
<ul class="comment-section"> <li class="comment user-comment"> <div class="info"> <a href="#">Anie Silverston</a> <span>4 hours ago</span> </div> <a class="avatar" href="#"> <img src="images/avatar_user_1.jpg" width="35" alt="Profile Avatar" title="Anie Silverston" /> </a> <p>Suspendisse gravida sem?</p> </li> <li class="comment author-comment"> <div class="info"> <a href="#">Jack Smith</a> <span>3 hours ago</span> </div> <a class="avatar" href="#"> <img src="images/avatar_author.jpg" width="35" alt="Profile Avatar" title="Jack Smith" /> </a> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse gravida sem sit amet molestie portitor.</p> </li> <!-- More comments --> <li class="write-new"> <form action="#" method="post"> <textarea placeholder="Write your comment here" name="comment"></textarea> <div> <img src="images/avatar_user_2.jpg" width="35" alt="Profile of Bradley Jones" title="Bradley Jones" /> <button type="submit">Submit</button> </div> </form> </li> </ul>
If you look closely at the above code, you’ll notice that apart from having different classes, the HTML for the user comments and the author comments are practically the same. All of the stylistic and layout differences between the two, will be handled solely by CSS applied to the .user-comment
and .author-comment
classes.
Here we’re going to look at flexbox-related techniques we’ve used when building the layout. If you want to examine the stylesheet in full detail, download the whole CSS file from the button near the top of the article.
First off, we are going to give all comments display: flex
, which will enable us to use the flexbox properties on the comments and their child elements.
.comment{ display: flex; }
These flex containers span the full width of our comment section and hold the user info, avatar and message. Since we want the comments written by the author to be aligned to the right, we can use the following flex property and align everything towards the end of our container.
.comment.author-comment{ justify-content: flex-end; }
This will leave the comments looking like this:
Now we have the author comment aligned on the right, but we also want to have the elements inside the container in reverse order, so that the message comes first, then the avatar and the info on the far right. To do this we will take advantage of the order
property.
.comment.author-comment .info{ order: 3; } .comment.author-comment .avatar{ order: 2; } .comment.author-comment p{ order: 1; }
As you can see, with the help of flexbox, the whole thing couldn’t be any easier.
Our comment section looks just like we wanted it to. The only thing left to do is make sure that it looks good on smaller devices as well. Since there won’t be as much available space on a narrower screen, we’ll have to do some rearrangements to the layout and make our content more easily readable.
We set up a media query that makes the comment paragraphs expand, taking up the whole width of the container. This will lead to the avatar and user info moving to the next line, since the comments have their flex-wrap
property set to wrap
.
@media (max-width: 800px){ /* Reverse the order of elements in the user comments, so that the avatar and info appear after the text. */ .comment.user-comment .info{ order: 3; } .comment.user-comment .avatar{ order: 2; } .comment.user-comment p{ order: 1; } /* Make the paragraph in the comments take up the whole width, forcing the avatar and user info to wrap to the next line*/ .comment p{ width: 100%; } /* Align toward the beginning of the container (to the left) all the elements inside the author comments. */ .comment.author-comment{ justify-content: flex-start; } }
The difference can be spotted right away by comparing this screen capture with the one above. You can also try opening the demo and resizing your browser to watch the comment section adapt accordingly to the size of the window.
This sums up our tutorial. We hope that this gave you a practical example on how to use flexbox when building real layouts. If you’re curious what else is possible, here are a few great resources that you’ll like:
Although there are many icon font sets (such as Font Awesome and Iconic) that you can readily use in your UI designs, there are times when you might want to generate your own custom icon font. For instance, you might have icons that you have designed that you would like to convert into an icon font set, or perhaps you would like to combine icons from various icon font sets.
Fortunately, creating icon fontsis fairly simple. Here are some free icon font generators that allow you to create your own icon fonts.
Fontello offers a simple platform you can use to generate your own icon font. To create your icon font, simply drag SVG files from your computer and drop them on the area located under the “Custom Icons” heading. You can also incorporate icons from free icon sets by selecting them in Fontello.
The IcoMoon App allows you to import your own icons as well as include icons from the IcoMoon icon set and other free icon sets. The total number of icons available within the IcoMoon App is in the thousands.
To generate your own icon font with Icon Vault, you first have to download their template package. Then just follow the instructions included in the template package. Once you’re done, upload your icons onto Icon Vault.
The Pictonic Fontbuilder allows you to choose from Pictonic’s free and paid icons in order to build your own customized Pictonic icon font. Pictonic has over 2,700 icons to choose from, and over 300 of them are free. Accessing the Pictonic Fontbuilder requires account sign-up.
When you go to Glyphter, you will see a character grid on the left. The right side of the screen, called the “icon shelf”, is where you will find free icons and a search bar. Simply drag and drop the icons you want to use from the icon shelf, into one of the boxes on the grid. You can also upload your own SVG icon files by clicking on the boxes on the grid. You can have up to 88 icons in your icon font for free. If you need to have more icons, you will need to sign up for a premium account.
To generate your own icon font with Fontastic, select icons from the available free icon sets (such as Streamline Icons and Entypo) and/or upload your own custom SVG icons. Once you’re all set, go to the “Publish” tab, where you will have the option to host your icon font on Fontastic’s Icon Cloud or download your icon font. Accessing the Fontastic icon font generator requires account sign-up.
The post 6 Free Tools for Creating Your Own Icon Font appeared first on WebFX Blog.
One of the biggest things you’ll notice in material design is the use of bold, vibrant colors.
Material design’s color guidelines describe the color style as being “inspired by bold hues juxtaposed with muted environments, deep shadows, and bright highlights.”
If you need to generate material design color palettes, these online tools will help.
In this tool, you start by picking your primary color and accent color. Afterwards, it will show you a live preview of the generated color palette and offer you a variety of ways to download it.
This is a nifty “cheatsheet” that presents all of the material design colors in one page.
Do you want to let fate decide what your color palette should be? Use this tool to randomly choose your material design colors.
If you’re interested in creating a custom, material-design-like color palette, check out this tool. First, you need to specify a color — and it doesn’t have to be one of the official material design colors — using a color picker dialog window similar to the ones you can find in your favorite graphics editor. The Material Design Palette Generator will then generate color swatches based on your chosen color.
This useful tool shows all material design colors in a conveniently compact grid layout. Click on a primary color and accent color to preview and generate your color palette.
This tool displays just the 500 and A200 colors of material design color swatches.
This is another simple tool for visualizing material design colors. It shows the primary colors side-by-side. Clicking on a “color bar” shows all of the color swatches associated with that color.
This tool displays just the material design 500 colors.
This simple tool helps you visualize all the material design color swatches along with their official names (e.g. Pink, Light Blue, etc.).
If web tools aren’t your thing, you can instead install a plugin/extension that integrates the material design color swatches right into your design software.
The post 9 Useful Tools for Creating Material Design Color Palettes appeared first on WebFX Blog.