The Hypertext Zone Subscribe to us with a feed reader, such as Feedly or Akregator. Note that some images on this site don't work in feedreaders. The main page https://hypertextzone.net/ Tue, 23 Jul 2019 00:45:13 +0000 Tue, 23 Jul 2019 00:45:13 +0000 Pico Redesign! Sun, 09 Jun 2019 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/redesign <p>You may have noticed that the site has been redesigned!</p> <p>I was already considering redesigning hypertextzone.net, but didn't know how to go forward. Eventually I settled on using a diagonal menu in the design, and a variation on KDE's Breeze color scheme. All I needed to use to create the menu was a <code>transform: skewY(-5%)</code> and an SVG.</p> <p>The icon at the top of the screen is the icon I usually use on social media. Sometime in the future, I'll put my actual face there. But not now.</p> <p>The redesign is still in development and I look forward to adding/readding more features.</p> https://hypertextzone.net/blog/ivans1/redesign Is StoneToss A Nazi? generator Wed, 29 May 2019 00:00:00 +0000 https://hypertextzone.net/blog/writeups/rockthrow <h2>Who is StoneToss?</h2> <p>This recent video by Thought Slime explains who StoneToss is and why he's a Nazi:</p> <iframe width="560" height="315" src="https://www.youtube.com/embed/XdbwZbK7kGo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> <p>StoneToss is a webcomic believed to be a continuation of another webcomic called RedPanels. The comic and its predecessor are known for regularly including references to holocaust denial, anti-Semitism, and assorted fascist nonsense. Despite clearly being a fascist and admitting to at least allying with them, StoneToss himself claims to be a libertarian.</p> <p>There is an online community, <a href="https://reddit.com/r/antifastonetoss">r/antifastonetoss</a>, that makes edits of StoneToss comics favoring the opposite message (anti-fascism). Often StoneToss gets nicknames there such as RockThrow and PebbleHeave. My latest project is a generator for StoneToss's nicknames, and a reminder that StoneToss is a Nazi, in the vein of <a href="http://www.isxkcdshittytoday.com/">isxkcdshittytoday.com</a>.</p> <p>Find it here: <a href="/projects/funthings/is-stonetoss-a-nazi.html">Is StoneToss a Nazi?</a></p> <h2>The Writeup</h2> <p>This page actually uses the StoneToss font (Catatan Perjalanan Regular). An animation is used, a transition from <code>opacity: 0; transform: scale(0.1);</code> to <code>opacity: 1; transform: scale(1)</code>.</p> <p>The main point of interest comes within the JavaScript. I used UnderscoreJS's <code>_.shuffle()</code> function to pick a random nickname for StoneToss.</p> https://hypertextzone.net/blog/writeups/rockthrow Animations are hard Tue, 23 Apr 2019 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/jqueryanimation <h2>New project</h2> <p>I was making another project for Spanish class, and I wanted to make the text fade in line by line. Unfortunately, my experience with jQuery consists of just a few weird experiments, and I wasn't entirely sure how to do it. Plus I had very little time to complete the project. To be honest, I just looked on StackOverflow.</p> <p>Nonetheless, I'm going to attempt to explain the code here. The result is <a href="/projects/family-en-espanol">here</a> if you want to view it.</p> <h2>The Code</h2> <pre><code>$(document).ready(function(){ var lines = $('#slide1text').text().split("_"); var timer, displayLine = function(){ var nextLine = lines.shift(); var bodyText = $('#slide1-textbody'); if(nextLine){ console.log('line'); var newLine = $('&lt;span class="line"&gt;' + nextLine + '&lt;/span&gt;'); $('#slide1-heading').append(newLine); $('#slide1-heading').append($('&lt;br/&gt;'));               newLine.animate({ 'opacity':1 }, 2000); timer = setTimeout(displayLine,1000); } else { bodyText.animate({ 'opacity':1 }, 1000); } } timer = setTimeout(displayLine,1000); })</code></pre> <h2>Explainer</h2> <pre><code class="language-javascript">$(document).ready(function(){</code></pre> <p>Apparently if you look for an element before it loads, it will return null, so I needed to wrap the entire thing in a document.ready so that the animation only started when the document loaded.</p> <pre><code class="language-javascript">var lines = $('#slide1text').text().split("_");</code></pre> <p>I have an invisible div id, #slide1text, which contains the text that will be loaded, and this splits the inner text into lines. I had some issues loading text from the div, which made me think the problem was using line breaks as separators. Turns out that wasn't the problem, but the decision to use underscores stuck.</p> <pre><code>var timer, displayLine = function(){ var nextLine = lines.shift();</code></pre> <p>This is where the StackOverflow content starts. This starts by initializing a timer, attaching it to a function, and selecting a single line from the lines created earlier.</p> <pre><code class="language-javascript">var newLine = $('&lt;span class="line"&gt;' + nextLine + '&lt;/span&gt;');</code></pre> <p>Each line needs to be its own span so that they can be managed individually.</p> <pre><code class="language-javascript">$('#slide1-heading').append(newLine); $('#slide1-heading').append($('&lt;br/&gt;'));</code></pre> <p>I now add the new line to my actual heading, which has opacity set to 0. I also add a line break so it has the same lines at any screen size.</p> <pre><code class="language-javascript">newLine.animate({ 'opacity':1 }, 2000); timer = setTimeout(displayLine,1000)</code></pre> <p>I now apply the actual animation, by revealing it gradually, then waiting.</p> <pre><code class="language-javascript">else { bodyText.animate({ 'opacity':1 }, 1000); }</code></pre> <p>Once I'm done animating the header, I reveal the main text.</p> <h2>The other animations</h2> <p>The other thing I tried was to make the first slide darken as I scrolled to the second. This time, it's entirely my own code:</p> <pre><code class="language-javascript">$(document).ready(function(){ var timertwo, darkenOnScroll = function(){ var newOpacity= 1 - ($(document).scrollTop() / $('#firstslide').height()); $('#firstslide').css({'opacity' : newOpacity}); timertwo = setTimeout(darkenOnScroll, 0.5); } timertwo = setTimeout(darkenOnScroll, 0.5); })</code></pre> <p>Basically what this does is use the same timers from the previous function, except this time it calculates how far I've scrolled compared to the size of the first slide, then changes the opacity accordingly. There is a bit of lag but that's to be expected.</p> https://hypertextzone.net/blog/ivans1/jqueryanimation HTML5 Video Backgrounds Wed, 06 Mar 2019 00:00:00 +0000 https://hypertextzone.net/blog/writeups/espana <h2>Spain Project</h2> <p>I made a quick website for Spanish class that you can see here: <a href="/projects/espana">Hola, España</a>. There's not much of a writeup needed here, as a lot of the design aspects were reused from the Geneaology Project. However, there is one interesting new thing: the background video. Using video backgrounds allows one to create advanced animations without using Javascript. They can be found on the websites for <a href="https://magic.wizards.com">Magic: The Gathering</a> and <a href="https://webflow.com">Webflow</a></p> <h2>Make anything a background</h2> <p>CSS has a very useful property <code>z-index</code>. If you want one element to appear behind the rest, set a negative z-index. If you want one element to appear above the rest, set a positive one. This way, anything with a very low z-index can be effectively in the background.</p> <h2>The <code>&lt;video&gt;</code> Tag</h2> <p>The <code>&lt;video&gt;</code> tag was introduced in HTML 5. It's one of the more difficult-to-use tags, as unlike <code>&lt;img&gt;</code>, an<code>src</code> attribute won't set the source of the video. You have to include a <code>&lt;source&gt;</code> tag inside the video, and that has the <code>src</code> attribute. Furthermore, you have to explicitly set how the video will play as a series of attributes - <code>&lt;video controls&gt;</code> is a video using the browser's built-in controls, and <code>&lt;video autoplay loop&gt;</code> has the video automatically start and loop.</p> <p>That may seem unnecessarily difficult, but it does have one key advantage - the user can set multiple sources, so if the browser cannot render the video from one source, then it can switch to another. Furthermore, if the <code>&lt;video&gt;</code> tag is unsupported, the content inside the tag will appear as text, allowing sites to send errors when video, or indeed HTML5 in general, is unsupported.</p> <p>Videos, like images, can have width and height set as attributes or as CSS properties, and the z-index can be applied, but if you apply width, height, and z-index, you might notice that it's still being sized improperly. The fix for this is the <code>object-fit</code> property. As it turns out the property is very similar to <code>background-size</code>, so setting it to <code>cover</code> will fix the problem.</p> https://hypertextzone.net/blog/writeups/espana The story of u/ObviousReplyBot Sat, 09 Feb 2019 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/reddit <h2>Hello reddit!</h2> <p>If you're reading this, you probably found a backlink to my site. Furthermore, I'm going to guess it's from somewhere on Reddit. In that case, hello, Redditor! If you've looked on the comments section of anything with more than 1000 upvotes in the last few days, you might have seen my bot, u/obviousreplybot. You probably hated it, or maybe you thought it was funny. Either way, I'm writing this article.</p> <p>Let it be understood that this bot was not created out of malice towards the subreddits I replied with, nor was it created out of a desire to troll anyone. Mainly, I wanted to see what would happen, and I was not disappointed.</p> <h2>The Beginning</h2> <p>On Reddit, there is a subreddit called r/thirdsub, a subreddit that essentially just replies whenever there is a chain of multiple subreddits. Since its inception, r/thirdsub has become the laughingstock of Reddit. Subreddits like r/ShootingFishInABarrel make fun of how easy it is to reply with r/thirdsub, and popular instances get replies asking them to edit the screenshot when posting it to the actual r/thirdsub.</p> <p>Now somebody, somewhere, thought: this sub is such an automatic reply, I can make a bot do it! Subreddits usually allow bots to automatically do their work, usually having useful functions like previewing subreddits. Replying to every subreddit chain with r/thirdsub was not that. Nonetheless, the u/thirdsub_bot made a splash.</p> <p>Another incident that occured: there's a subreddit, making fun of replies like r/thirdsub, called r/everyfuckingthread. Somebody, somewhere, thought it would be funny to link to r/everyfuckingthread in every actual fucking thread. And so, EFTBot was created. It got banned almost immediately from almost everywhere. but it had a good run.</p> <p>I thought recently that r/thirdsub isn't the only automatic reply. There are also subs like r/TwentyCharacterLimit, which is automatically replied when a fake subreddit name exceeds the 21-character limit on subreddit names. I'd already made a news bot for GNU social/Mastodon (albeit I used someone else's code), so how hard could it be? I decided to make a bot that covered as many of these cases as I could.</p> <h2>Let's make a bot!</h2> <p>To start with, I created the accound u/obviousreplybot and an API account to go along with it. Next, I created the subreddit r/ivanastantest so as to avoid spamming subreddits (until I launched, that is). Last, I programmed the bot, based on the <a href="https://praw.readthedocs.io/en/latest/tutorials/reply_bot.html">LMGTFY bot</a>'s source code. I started with r/TwentyCharacterLimit, then r/SubsYouFellFor, then r/itswooooshwith4os. It worked pretty smoothly so I started testing it on r/memes. </p> <p>I realised I forgot to inhibit duplicate replies, so I added that feature, thankfully before unleashing it on r/all. The rate limiting on reddit for accounts with only 1 karma was oddly useful in testing since it helped me avoid making too many comments during my test.</p> <p>Another issue I ran into was that determining when to reply was much harder than I thought. I thought that r/TwentyCharacterLimit would work on any post containing &quot;r/&quot; and more than 23 characters, but then there are subreddits in sentences, subreddit names in links, links to individual posts, and people who use &quot;/r/&quot; rather than &quot;r/&quot;.</p> <p>The final version of the bot also supported r/thirdsub among other things, and it worked by checking randomly sorted comments the top 100 posts of r/all (later the top 200 posts of r/all) and replying to them when certain cases were detected. As I added features, the bot's code became spaghetti code, and I really don't like how it turned out in that respect.</p> <h2>The Fallout</h2> <p>So I released the bot into the wild. For a while there were numerous bugs I had to deal with but I fixed them quickly. I also added later on random descriptions for posts, to make it more interesting. Most people thought it was cool, and upvoted my description post or said &quot;Good bot.&quot;</p> <p>Eventually r/ShootingFishInABarrel and r/EveryFuckingThread users started to catch on, and public opinion turned against the bot. I was mostly able to ignore the negative messages me and my bot received. I got a few feature requests, like adding &quot;Perfectly balanced as all things should be.&quot; I was planning on making posts on r/thirdsub when I got &quot;put me in the screenshot&quot; requests for my bot, but the r/thirdsub community had me covered. You can't comment once every 10 minutes on a post on the front page without getting noticed.</p> <p>I moved the bot from my laptop to my server, where I realized it never emptied its memory. I fixed that bug in the hackiest way possible, by killing the bot every twelve minutes and restarting it, occasionally rebooting the server...</p> <p>I realized the &quot;Perfectly balanced&quot; feature would spam a person with &quot;As all things should be,&quot; and accidentally replied to u/Obsidian2289 four times before I found the bug (if you're reading this, I'm so sorry).</p> <p>One of the most spectacular moments was when the bot - not my account, the bot account - was invited to moderate r/TitansTV, a DC subreddit, and received full permissions! Yes, that actually happened. Check the moderator list!</p> <h2>The end</h2> <p>r/funny was the first subreddit to ban my bot, followed by r/MurderedByWords. Both at least claimed to not allow bots. The first subreddits to ban me despite allowing bots were r/natureismetal and r/gifs. Furthermore, in subreddits where the bot was not banned, occasionally its posts were removed.</p> <p>r/SubsYouFellFor requested that it stop linking to them (which I did). This for a time significantly reduced how often the bot replied.</p> <p>I decided that I'd stop the bot when it started replying at a less-than-hourly frequency. However, some of my bans actually seemed to increase the rate at which my bot replied, probably because it was quicker to process comments if the bot can't reply to them and is forced to reset its loop. </p> <p>Two days after releasing the bot into the wild, I was getting a bit bored of haing a bot spam my own inbox by linking to my account across Reddit, so I killed the bot program on my server and removed the restart script. It was very fun to watch the reaction of most of Reddit, but all good things must come to an end.</p> <h2>The future</h2> <p>I might make another bot again in the future. It probably won't be a meme bot like this one, since this bot was the ultimate in that.</p> <p>Maybe I could make an html2text bot - that is, a bot that, when summoned, creates a reddit post from a link. Maybe I could make a bot that, when summoned, plays <em>Colossal Cave Adventure.</em> There's already such a bot on Twitter. It sounds like a fun challenge to make one on Reddit.</p> <p>Actually, speaking of Twitter, there's a Python library for that too! Maybe I could make a new Twitter bot. I wouldn't be able to do the low-effort memes of Twitter (like &quot;Twitter for Android&quot;) since that is against Twitter's rules (not just against etiquette as on Reddit). But Twitter does allow bots, so it's something to think about.</p> <p>Maybe obviousreplybot will come back if I ever feel like making it come back. That would be fun.</p> <p>I think, though, that I'll just focus on website design and development and see where that takes me.</p> <p>If you want to see the source code, please tell me and I might post it on GitLab in the public domain. Fair warning, though, it's a mess and should not be used as a template for your own bot. If you want to make a bot, I recommend starting with the <a href="https://praw.readthedocs.io/en/latest/tutorials/reply_bot.html">LMGTFY bot</a> instead.</p> <p>Oh, and check out the two creators I recommended with my bot - <a href="https://c418.bandcamp.com">C418</a> and <a href="https://www.youtube.com%2Fchannel%2FUClt01z1wHHT7c5lKcU8pxRQ&amp;usg=AOvVaw0gpjOo2ubzBOOqNPhzm1Iu">Hbomberguy</a>.</p> https://hypertextzone.net/blog/ivans1/reddit Writeup: Geneaology Project Wed, 06 Feb 2019 00:00:00 +0000 https://hypertextzone.net/blog/writeups/geneaology <p>For the Gifted and Talented program at my school, I was asked to make a project about my family history. My mother recommended that I read my great grandfather's autobiography, so I built my project around that. Originally I was going to make a slideshow, but I figured I needed to develop my skills in web development, so I made a site instead. This article will focus on the design elements - the content of the page will speak for itself. The only thing I will say about the content here is that it was a bit more emotionally taxing to make than most projects, given its personal nature.</p> <p>The project is here: <a href="/projects/kastning">Ode to William Ray Kastning</a></p> <h2>Color scheme</h2> <p>I wanted to use alternating colors because I thought that'd look cool. I went for colors #ddd and #bbb at first, but found that scheme a bit too dark, so I used #eee and #ddd instead.</p> <h2>3DFX</h2> <p>I experimented with it before on this website, but this is the first time I've actually used fixed background attachment (better known by the buzzword parallax scrolling). Paired with a drop shadow it creates a nice 3D effect where the content appears above the banner. Implementing this is quite simple:</p> <pre><code>.class { background-image: url('https://picsum.photos/1920/1080?random') background-attachment: fixed; background-postition: bottom; }</code></pre> <p>Making the text stay with the fixed image required a non-intuitive solution. Instead of making the text absolutely positioned within the image, I had to make the text fixed within the body and set the z-index of the whole banner to -1.</p> <p>To create the box shadow with so many elements I simply wrapped all of the content in a div. It is quite difficult to make a good box shadow. I would simply recommend setting the horizontal and vertical sizes to zero and color to black or dark gray and playing with blur and spread radius for the optimal shadow. Exceptions to this rule are if you want an off-center shadow (vary horizontal and vertical size) or if you want to use the box shadow to make a glow effect (change shadow color).</p> <h2>Testing</h2> <p>I tested this on every browser engine apart from Microsoft Edge and NetSurf. It worked pretty well, though I noticed the browsers had different font preferences, so I set the default to Cantarell. I then found after reloading that weights below 400 were being ignored. I ultimately switched to Open Sans Light to fix the issue.</p> <h2>Navbar</h2> <p>I added a navbar as a result of Mom's insistence that I include multiple pages. It was rather difficult to get just right - specifically, I found that either the links were unclickable or the header continued to pop over the text. I won't go into all of the paramaters I had to tweak to get it to work, because there were so many and I seriously doubt my solution will be helpful to those with the same problems.</p> <p>The brand &quot;Stories by Ivan Stanton&quot; was just something I thought of as an umbrella term for other simple projects like this one. I don't plan on trademarking it or selling it (yet), but I do plan on using it for future projects, and maybe if I make enough of them it could be a whole site.</p> <h2>Conclusion</h2> <p>The last thing I added was a page describing William's family history. Because I couldn't keep up the alternating images thing, I had to add a special class to add padding so I could create an article with this theme.</p> https://hypertextzone.net/blog/writeups/geneaology Modding Minecraft with Datapacks Tue, 29 Jan 2019 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/minecraft-datapacks <p>Minecraft is either the first or second best-selling game of all time, depending on whether Tetris is one game or not. I played it quite some time ago, and have since decided to return to playing the game. I discovered that there were some new updates that were quite interesting.</p> <p>In update 1.13, Minecraft released a new feature called datapacks. These allowed players to customize the following:</p> <ul> <li>Console commands</li> <li>Commands to run every &quot;tick&quot; and when the level is loaded</li> <li>Generated structures</li> <li>Crafting recipes</li> <li>Achievements</li> <li>Mobs have been announced</li> </ul> <p>A long time ago, Mojang AB announced the development of a &quot;Minecraft API&quot; which would allow players to modify the game, and this is basically it. Until now, modifying crafting recipes would have been impossible normally. </p> <p>Of course, you can't make an API without programming, so let's look into that.</p> <h2>JSON</h2> <p>JSON (Javascript Object Notation) is a data-interchange format designed to be easy to parse, generate, read, and write. Minecraft also uses JSON for metadata about its versions and resource packs, so it is natural that JSON would be used for data notation in mods. A JSON file for a recipe might look something like this:</p> <pre><code class="language-json"> { "type": "crafting_shaped", "pattern": [ "TTT", "#X#", "#R#" ], "key": { "R": { "item": "minecraft:redstone" }, "#": { "item": "minecraft:cobblestone" }, "T": { "tag": "minecraft:planks" }, "X": { "item": "minecraft:iron_ingot" } }, "result": { "item": "minecraft:piston" } }</code></pre> <p>This says the following:</p> <ul> <li>I want to make a shaped crafting recipe</li> <li>The pattern should be &quot;TTT#X##R#&quot;</li> <li>T is wood, # is cobblestone, X is iron, and R is redstone</li> <li>The crafting recipe is to make a piston.</li> </ul> <h2>Where's the programming?</h2> <p>Minecraft has had an in-game console for some time that allows players to interact with the in-game world in numerous ways, so in essence, all of the programming is done in scripting a sequence of commands. Prior to the 1.13 update, someone had gone as far as to make an Atari emulator using commands, so it's fair to say they're versatile enough. I still wish there was more to do with them, though.</p> <p><img src="/assets/ataricraft.png" alt="Atari 2600 in Minecraft" /></p> <p>So those are datapacks, in a nutshell. I hope this feature evolves into a full plugin API. In the meantime, <a href="https://minecraft.curseforge.com/projects/craftable-command-blocks-datapack">check out something I created with datapacks.</a></p> https://hypertextzone.net/blog/ivans1/minecraft-datapacks Learn CSS 2.6: The Box Model Wed, 09 Jan 2019 00:00:00 +0000 https://hypertextzone.net/blog/learn-html/learn-css-1-6 <h2>Learn CSS 2.6: The Box Metaphor</h2> <p>It's been a while since <a href="https://hypertextzone.net/blog/learn-html/learn-css-1-5">I last did a Learn CSS article</a> or any article at all, so I'm well overdue to make one.</p> <p>If you've been reading Learn CSS up to this point, you will have learned to resize and recolor objects. But if you try to create a website this way, you likely won't be satisfied with the nearly-wall-to-wall text or the fact that objects with 100% width don't actually take up 100%. Both of these issues can be resolved with a set of properties which add space outside of the edge of an element's content.</p> <p>In CSS, elements are squares with a defined height and width (circles, etc. can be made by rounding corners and other tweaks). This is why the space an element takes up is called its box. The components of a box are illustrated in this image (via Wikimedia Commons):</p> <p><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/Box-model.svg/1000px-Box-model.svg.png" alt="Box model" /></p> <p>The CSS <code>padding:</code> attribute specifies the size of the &quot;padding&quot; area of the box in terms of the width/height of each side, in the order &quot;top, left, bottom, right.&quot; For example:</p> <pre><code class="language-css">div { padding: 20px 40px 20px 40px }</code></pre> <p>That code would add whitespace 20px tall on the top and bottom, and 40px wide on the sides. The same syntax is used for the <code>margin:</code> property, except that property is used to set the size of the margin, which is outside of the border.</p> <p>To set the contents of the border area, you can use the <code>border:</code>, <code>border-left:</code>, <code>border-right:</code>, and <code>border-top</code>, <code>border-bottom:</code> properties to set the color and size of the border. <code>border</code> sets all borders, whereas the others set the border for one side. All of these use the format <code>size type color</code>, and the following types are available:</p> <ul> <li> <div style="border: 4px dotted white;margin:2px;">dotted</div> </li> <li> <div style="border: 4px dashed white;margin:2px;">dashed</div> </li> <li> <div style="border: 4px solid white;margin:2px;">solid</div> </li> <li> <div style="border: 4px double white;margin:2px;">double</div> </li> <li> <div style="border: 4px groove white;margin:2px;">groove</div> </li> <li> <div style="border: 4px ridge white;margin:2px;">ridge</div> </li> <li> <div style="border: 4px inset white;margin:2px;">inset</div> </li> <li> <div style="border: 4px outset white;margin:2px;">outset</div> </li> <li> <p>none</p> </li> <li> <p>hidden</p> </li> </ul> <p>For example - if you want anything with &quot;class=example&quot; to have a red 4px border which is dotted at the top, dashed at the left, and solid everywhere else, the code would look like this:</p> <pre><code class="language-css">.example { border: 4px solid red; border-left: 4px dashed red; border-top: 4px dotted red; }</code></pre> <p>You can also add a round border if you use <code>border-radius:</code> to set the &quot;roundness&quot; of the border as a size.</p> https://hypertextzone.net/blog/learn-html/learn-css-1-6 A look at -webkit-text-stroke Thu, 20 Dec 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/stroke <p>In a previous article, I talked about <a href="/blog/ivans1/animation2">a gradient wipe with CSS</a>. Turns out that isn't the only cool graphical feature available in Safari CSS. In fact, there appears to be a whole suite of these features. One of these is text-stroke.</p> <p>The <code>-webkit-text-stroke:</code> and <code>-moz-text-stroke:</code> properties draw a border around text. This is the same property seen in the Traditional Meme Format, which uses the white Impact or Anton font and adds a text stroke.</p> <p>Unfortunately, as the names might suggest, cross-browser support for this feature is very limited. Most browser engines, including WebKit and Chrome, only have support for a center-aligned stroke, which can look quite ugly, as <a href="https://css-tricks.com/text-stroke-stuck-middle/">Chris Coyier of CSS Tricks explained</a>. TL;DR - most characters vary their width and spacing, but strokes don't, and they end up ruining that spacing.</p> <p>In Firefox and Safari (Webkit) only, you can use the <code>paint-order:</code> property for this. By setting <code>paint-order: stroke fill</code> you can make the text appear &quot;above&quot; the stroke, thus creating what looks like an outside-aligned stroke. But an inside-aligned stroke is still impossible.</p> <p><a href="/assets/meme.html">But hey, at least you can make memes in which the text is actually text! (linked here, shown below)</a></p> <iframe src="/assets/meme.html" width="500px" height="500px" style="max-width:100%;"></iframe> https://hypertextzone.net/blog/ivans1/stroke Raspberry Pi Emulator-Console Tutorial Tue, 11 Dec 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/lakkaconsole <h2>RetroArch is AWESOME!</h2> <p><a href="https://libretro.com">RetroArch</a> is a program that basically exists to manage emulators in one interface. It is the official front-end of Libretro, a library that allows emulators to be packaged as libraries. It isn't the only front-end to Libretro; also available are EmulationStation and GNOME Games. However, Retroarch provides more features than either of them.</p> <p>For example, RetroArch can manage an endless number of controllers and shaders, and has its own set of content made specifically for Libretro, which can be downloaded from the interface. Retroarch has nearly every feature an emulator needs, and some emulators don't need, set up for a number of emulators.</p> <p>Not only does RetroArch have its own games, it has an operating system which uses RetroArch to turn a small computer into a gaming console. This is <a href="https://lakka.tv">Lakka</a>, and you'll be using it to create your own game console.</p> <h2>Requirements</h2> <p>You'll need these items, many of which can be found in kits like the Canakit:</p> <ul> <li> <p><strong>Raspberry Pi 3 or above</strong>: The ideal computer for Lakka is the Raspberry Pi, which is not only small but cheap (only $15-35) and easy-to-use. Older versions of the Pi will not be able to emulate games for the Playstation or N64, which are more resource-intensive.</p> </li> <li> <p><strong>16GB+ microSD card</strong>: The &quot;hard disk&quot; of the Raspberry Pi.</p> </li> <li> <p><strong>A USB keyboard</strong>: A backup if controllers don't work.</p> </li> <li> <p><strong>A USB controller (PS4, X360, Nintendo Switch, some others; optional), a microUSB power adapter, an HDMI cable, and a, HDMI display.</strong></p> </li> </ul> <h2>Setting up</h2> <p>Install <a href="etcher.io">Etcher</a> on your computer, then <a href="http://le.builds.lakka.tv/RPi2.arm/Lakka-RPi2.arm-2.1.1.img.gz">download Lakka</a>. Open Etcher, select the Lakka image, and plug in your microSD card (you may need to use an adapter). You should now be able to click &quot;Flash!&quot;</p> <p>Once Etcher is done flashing the SD card, eject/unmount it and plug it in to the Raspberry Pi. Plug the Raspberry Pi into a display using HDMI and into a wall outlet using the power adapter.</p> <p>You should see a rainbow screen, followed by the logo. If it stays at the rainbow screen for over a minute you have used a corrupted disk image.</p> <p>Once Lakka boots up, plug in a keyboard or controller, and use arrow keys/D-pad to scroll to &quot;Restart&quot; so that it can perform some important actions. </p> <p>Once it reboots, go to Settings -&gt; Wi-Fi and choose your WiFi network, then enter the password to log in to WiFi. You may wish to go to Content Downloader -&gt; NXEngine and select the first item to download the indie classic Cave Story, then add it to the menu by going to the &quot;+&quot; menu, selecting Scan Directory -&gt; Downloads -&gt; Scan This Directory. Also, if you want to transfer files to the Pi, <a href="http://www.lakka.tv/doc/Accessing-Lakka-filesystem/">read these instructions</a>.</p> <p>You might have issues with the controller; I personally recommend getting a USB keyboard as backup for this reason. If your controller's D-Pad is moving through the menu too fast or the buttons are set improperly, unplug it, then plug in your USB keyboard and navigate to Settings -&gt; Input -&gt; Input User 1 Binds. Then move to User 1 Bind All <em>without pressing enter</em>. Plug in your controller now and press enter. You can now set the controller properly.</p> https://hypertextzone.net/blog/ivans1/lakkaconsole Making a Forum with FlatBoard Mon, 03 Dec 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/flatboard <p>So you might have noticed that <a href="/forum">I have a forum now</a> for website comments. I'm using <a href="https://flatboard.free.fr">Flatboard</a>, a rather obscure forum software, for the forum, mainly because my incompetence with SQL prevents me from using things like phpBB or NodeBB. In addition to being forum software, Flatboard can be a community blog as well. If you're in the same situation, here's how to install Flatboard. Because like Pico, <a href="http://flatboard.free.fr/view.php/plugin/page/p/docs">the documentation</a> is quite incomplete.</p> <h2>Installation</h2> <p>First, you'll need to <a href="http://flatboard.free.fr/download.php?file=flatboard_latest.zip">download Flatboard</a>. Extract the two files <code>flatboard.zip</code> and <code>index.php</code> somewhere in the folder where your HTTP documents are stored (usually /var/www/html). Make sure you have the following configured on your webserver:</p> <ul> <li> <p>PHP 5.3+ with PHP-ZIP and PHP-MBString modules</p> </li> <li> <p>Apache mod_rewrite with AllowOverride All (I don't think this is needed but just in case)</p> </li> </ul> <p>Change the ownership of both files and the folder containing them to <code>www-data:www-data</code>. Then, open the place where you installed Flatboard in a browser and click Unpack. Then enter appropriate content into the username, password, and email fields.</p> <h2>Is Flatboard Good?</h2> <p>Flatboard is a very easy-to-set-up bulletin board, with configurable folders and theming, that can also be used as community blog. It has all the features that are necessary and not many that are unnecessary. It is for those reasons that I use it.</p> <p>On the other hand, I can imagine it getting slow with time (though I can't be sure). Theming is difficult, as theme files are very splintered and use pure PHP. The community is small and documentation is scattered. CAPTCHAS are used, but they can easily be bypassed by advanced bots. For those reasons, I would not recommend Flatboard if you are able to use SQL or NodeJS.</p> https://hypertextzone.net/blog/ivans1/flatboard A brief history of GNU/Linux Mon, 03 Dec 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/history-of-linux <h2>Unix</h2> <p>The Unix operating system was created by Ken Thompson and Dennis Ritchie at AT&amp;T Bell Laboratories in 1969 and 1970, along with C, one of the first programming languages. It was one of the first operating systems that could be used on multiple different computers.</p> <p>The Computer Systems Research Group at the University of California at Berkeley developed an operating system based on Unix 6 called BSD, though AT&amp;T sued to stop development in the early 1990s.</p> <p>In 1983, a programmer named Richard Stallman decided to quit his job at MIT and start the GNU project, a project with the goal of creating a clone of Unix whose source code would be available under a permissive license, called GNU (for GNU is Not UNIX). The announcement was posted on the Unix Wizard board on the Usenet forum:</p> <pre><code>Free Unix! Starting this Thanksgiving I am going to write a complete Unix-compatible software system called GNU (for Gnu's Not Unix), and give it away free to everyone who can use it. Contributions of time, money, programs and equipment are greatly needed. To begin with, GNU will be a kernel plus all the utilities needed to write and run C programs: editor, shell, C compiler, linker, assembler, and a few other things. After this we will add a text formatter, a YACC, an Empire game, a spreadsheet, and hundreds of other things. We hope to supply, eventually, everything useful that normally comes with a Unix system, and anything else useful, including on-line and hardcopy documentation. GNU will be able to run Unix programs, but will not be identical to Unix. We will make all improvements that are convenient, based on our experience with other operating systems. In particular, we plan to have longer filenames, file version numbers, a crashproof file system, filename completion perhaps, terminal-independent display support, and eventually a Lisp-based window system through which several Lisp programs and ordinary Unix programs can share a screen. Both C and Lisp will be available as system programming languages. We will have network software based on MIT's chaosnet protocol, far superior to UUCP. We may also have something compatible with UUCP. Who Am I? I am Richard Stallman, inventor of the original much-imitated EMACS editor, now at the Artificial Intelligence Lab at MIT. I have worked extensively on compilers, editors, debuggers, command interpreters, the Incompatible Timesharing System and the Lisp Machine operating system. I pioneered terminal-independent display support in ITS. In addition I have implemented one crashproof file system and two window systems for Lisp machines. Why I Must Write GNU I consider that the golden rule requires that if I like a program I must share it with other people who like it. I cannot in good conscience sign a nondisclosure agreement or a software license agreement. So that I can continue to use computers without violating my principles, I have decided to put together a sufficient body of free software so that I will be able to get along without any software that is not free. How You Can Contribute I am asking computer manufacturers for donations of machines and money. I'm asking individuals for donations of programs and work. One computer manufacturer has already offered to provide a machine. But we could use more. One consequence you can expect if you donate machines is that GNU will run on them at an early date. The machine had better be able to operate in a residential area, and not require sophisticated cooling or power. Individual programmers can contribute by writing a compatible duplicate of some Unix utility and giving it to me. For most projects, such part-time distributed work would be very hard to coordinate; the independently-written parts would not work together. But for the particular task of replacing Unix, this problem is absent. Most interface specifications are fixed by Unix compatibility. If each contribution works with the rest of Unix, it will probably work with the rest of GNU. If I get donations of money, I may be able to hire a few people full or part time. The salary won't be high, but I'm looking for people for whom knowing they are helping humanity is as important as money. I view this as a way of enabling dedicated people to devote their full energies to working on GNU by sparing them the need to make a living in another way.</code></pre> <p>Development started in 1984. He used the TRIX kernel (a kernel is a program that coordinates between hardware and software) which had previously been developed by MIT. In 1985, the Free Software Foundation was started to fund GNU development.</p> <p>By 1990, GNU had a functional operating system, but TRIX was rather buggy, so it was necessary to replace it. The FSF began negotiations to create an open-source version of the Mach kernel, created by Professor Rashid at Carnegie Mellon University. These negotiations never finished.</p> <h2>Linux</h2> <p>In 1987, Andrew S, Tannenbaum released his own Unix clone called MINIX, which was made specifically for educational use. THe source code was made available, but redistribution was restricted and it was designed for 16-bit computers rather than the increasingly popular Intel 386's 32-bit architecture.</p> <p>In 1991, Linus Torvalds, a student at the University of Helsinki, started developing another free Unix clone called Freax as a hobby project, which he announced on the Internet forum Usenet, in a section dedicated to Minix:</p> <pre><code>Hello everybody out there using minix - I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones. This has been brewing since april, and is starting to get ready. I'd like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other things). I've currently ported bash(1.08) and gcc(1.40), and things seem to work. This implies that I'll get something practical within a few months, and I'd like to know what features most people would want. Any suggestions are welcome, but I won't promise I'll implement them :-) Linus (torv...@kruuna.helsinki.fi) PS. Yes - it's free of any minix code, and it has a multi-threaded fs. It is NOT protable (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that's all I have :-(. </code></pre> <p>Linus Torvalds created what we now know as the Linux kernel and ported several GNU utilities to create the operating system. He published it on FUNET FTP in September, under a non-commercial license.</p> <p>Server administrator Ari Lemmke hated the name Freax and thought a better name for the OS would be Linux (after Linus Torvalds), so on the FTP server he renamed the files to Linux. Though Ari did so without Torvalds' consent, Torvalds also liked the name, so he kept it.</p> <p>In 1992, Linus Torvalds changed Linux's licensing terms to use GNU's license, the GPL, which promoted commercial usage. The first Linux distributions, Yggdrasil LGX, MCC Linux, and Softlanding Linux were released, using the Linux name rather than the GNU name because it was simpler. Parts of Unix and BSD were also open-sourced. The GNU project was now successful in a way, even though they didn't get their choice of the name.</p> <p>By 1993, over 100 developers were now working on Linux, many of whom were from the GNU project, and who needed a kernel for GNU. The Linux kernel was adapted to GNU's environment and updated to work with one another. Softlanding Linux became Slackware Linux, the oldest surviving Linux distribution, and Debian GNU/Linux was created as another replacement for Softlanding Linux.</p> <h2>Microsoft Loves Linux, Microsoft Hates Linux</h2> <p>Throughout 1994 and 1995, many people noticed that nobody had trademark rights to Linux and tried to register the trademark. Linus Torvalds eventually successfully sued for the rights and gave them to the Linux Mark Institute, which was dedicated to protecting the trademark. In 2000, the Open Source Development Lab was created as a group optimising Linux for server use. Linus Torvalds got a job there after losing his previous job to the company's bankruptcy. </p> <p>In 1998, IBM, Compaq, Oracle, and Netscape all began supporting Linux, with IBM even creating an ad campaign targeted at server owners. Red Hat, a company created specifically for Linux, achieved widespread success.</p> <p>Microsoft saw Linux as a threat to Windows's marketshare, so in 1998 they discussed the potential of creating proprietary software for Linux that users couldn't live without, then removing support for said software to get those users to move to Windows, in a strategy called &quot;Embrace, Extend, Extinguish.&quot; In 2004, Microsoft and Linux distributors released conflicting studies regarding the reliability and security of Linux.</p> <p>The need emerged to protect Linux from Microsoft competition, so the OSDL merged with the Linux Mark Institute and Free Standards Group to create the Linux Foundation for that purpose in 2007. Later, though, starting in 2009 Microsoft started contributing to the Linux kernel in order to gain leverage over its developers, and even became a major contributor to the Linux Foundation.</p> <h2>Linux on the desktop</h2> <p>Most Linux distributions used the X Window System, which was created in 1984, along with a window manager which added window controls and a virtual terminal, to create the user interface. In 1996, developer Matthias Ettrich was concerned about the inconsistencies in the user interfaces of Linux's applications and proposed that an advanced, Windows-like desktop be created in a post on Usenet's German Linux board:</p> <pre><code> ------------------------------------------- New Project: Kool Desktop Environment (KDE) ------------------------------------------- Programmers wanted! Motivation ---------- Unix popularity grows thanks to the free variants, mostly Linux. But still a consistant, nice looking free desktop-environment is missing. There are several nice either free or low-priced applications available, so that Linux/X11 would almost fit everybody needs if we could offer a real GUI. Of course there are GUI's. There is the Commond Desktop Environment (much too exansive), Looking Glas (not too expensive but not really the solution), and several free X-Filemanagers that are almost GUI's. Moxfm for example is very well done, but unfortunately it is based on Motif. Anyway, the question is: What is a GUI? What should a GUI be? First of all, since there are a lot of missunderstandings on this topic, what is NOT a GUI: - the X-Window-System is NOT a GUI. It's what its name says: A Window system - Motif is NOT a GUI. They tried to create a GUI when they made Motif, but unfortunately they couldn't really agree, so they released Motif as Widget-Library with a Window-Manager. Much later they completed Motif with the CDE, but too late, since Windows already runs on the majority of desktops. - Window-managers are NOT GUI's. They are (better: should be) small programs that handle the windows. It's not really the idea to hack a lot of stuff into them. IMHO a GUI should offer a complete, graphical environment. It should allow a users to do his everyday tasks with it, like starting applications, reading mail, configuring his desktop, editing some files, delete some files, look at some pictures, etc. All parts must fit together and work together. A nice button with a nice "Editor"-icon isn't not at all a graphical user environment if it invokes "xterm -e vi". Maybe you have been disappointed long time ago too, when you installed X with a nice window manager, clicked on that beautiful "Help"-Icon ... chrk chrk (the hard disk)...an ugly, unsuable, weird xman appeared on the desktop :-(</code></pre> <p>So KDE was created. The first few versions were criticized because they used Qt, which had a restriction on modification, so the GNOME desktop environment and Harmony toolkit were created by GNU to either replace KDE or Qt. GNOME adapted code from and image editor called GIMP into a replacement for Qt, called GTK, and the Harmony project was cancelled. In 1998, Qt was made open source.</p> <p>In 2011, GNOME released a new version (GNOME 3) whose interface was designed primarily for tablets. This led GNOME 2 to be forked into the MATE project.</p> <p>X quickly became obsolete, so in 2008 the Wayland project was started to replace it. Wayland has now superseded X in GNOME, and is planned to in KDE.</p> <h2>Furthermore</h2> <p>Google uses the Linux kernel (but not any of GNU) in their Chrome OS and Android operating systems.</p> <h2>Sources</h2> <p><a href="https://www.gnu.org/gnu/gnu-history.en.html">https://www.gnu.org/gnu/gnu-history.en.html</a></p> <p><a href="https://www.gnu.org/software/hurd/history.html">https://www.gnu.org/software/hurd/history.html</a></p> <p><a href="https://en.wikipedia.org/wiki/History_of_Linux">https://en.wikipedia.org/wiki/History_of_Linux</a></p> <p><a href="https://groups.google.com/forum/#!original/comp.os.minix/dlNtH7RRrGA/SwRavCzVE7gJ">https://groups.google.com/forum/#!original/comp.os.minix/dlNtH7RRrGA/SwRavCzVE7gJ</a></p> <p><a href="https://groups.google.com/forum/#!msg/net.unix-wizards/8twfRPM79u0/1xlglzrWrU0J">https://groups.google.com/forum/#!msg/net.unix-wizards/8twfRPM79u0/1xlglzrWrU0J</a></p> <p><a href="https://groups.google.com/forum/#!msg/de.comp.os.linux.misc/SDbiV3Iat_s/zv_D_2ctS8sJ">https://groups.google.com/forum/#!msg/de.comp.os.linux.misc/SDbiV3Iat_s/zv_D_2ctS8sJ</a></p> <p><a href="https://en.wikipedia.org/wiki/History_of_free_and_open-source_software">https://en.wikipedia.org/wiki/History_of_free_and_open-source_software</a></p> <p>Linus Torvalds' autobiography, &quot;Just For Fun&quot;</p> https://hypertextzone.net/blog/ivans1/history-of-linux General Guidelines for Mobile Site Building Fri, 30 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/responsivetips1 <h2>Tip Number 1: Meta Viewport</h2> <p>Make sure to include this tag in your <code>&lt;head&gt;</code>. It will automatically change the size of the text on your site depending on the size of the screen. Otherwise, your text will look really small:</p> <pre><code class="language-html">&lt;meta name="viewport" content="width=device-width, initial-scale=1"/&gt;</code></pre> <h2>Tip Number 2: Optional sidebars</h2> <p>Sidebars take up vertical space on the screen. Generally you don't want the website to scroll in both directions, and you want there to be enough space for the text on mobile. So don't include a sidebar on your website. If you must include a sidebar, make sure that it can be shown or hidden using a button. This code can be very useful:</p> <pre><code>&lt;script&gt; if (document.getElementById("sidebar").style.display == "none") { document.getElementById("sidebar").style.display == "block" } else { if (document.getElementById("sidebar").style.display == "block") { document.getElementById("sidebar").style.display == "none" } } &lt;/script&gt;</code></pre> <p>If you are padding your text areas to add whitespace, I recommend changing the padding scheme using a <code>@media</code> query when your site is smaller/larger:</p> <pre><code class="language-css">.textcontainer { padding: 30px 30px 30px 30px; } @media screen and (min-width: 1000px) { padding: 25% 60px 60px 25%; }</code></pre> <p>In general, anything large and vertical should be either optional or removed on mobile.</p> <h2>Tip 3: Mobile first</h2> <p>Design your website for vertical smartphones first, then add special features to make it better on mobile. This helps your site load faster because smartphones will load slower than desktops, especially if they have to load the special &quot;exceptions&quot; made for mobile devices.</p> https://hypertextzone.net/blog/ivans1/responsivetips1 Learn CSS 2.5: Classes and IDs Thu, 29 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/learn-html/learn-css-1-5 <h2><a href="learn-css-1-4">Last time</a></h2> <p>Last time we learned:</p> <ul> <li>How to change the font, size, and alignment of text</li> </ul> <h2>Very useful features.</h2> <p>Professional web developers usually end up using a lot of <code>&lt;div&gt;</code>s, since they are the simplest tag whose only default rule is <code>display: block;</code> (what does that mean? We'll learn later.) So how do they make them all look different?</p> <p>Enter classes and IDs. Classes allow a developer to categorize elements and style each category. Meanwhile, IDs give each element a unique name which can be referenced in a stylesheet. Giving an element a class or id is as simple as adding a <code>class=</code> or <code>id=</code> attribute. Classes are referred to as <code>.classname</code> and IDs as <code>#id</code></p> <p>Take for example, the following code:</p> <pre><code class="language-html">&lt;div class=myfirstclass&gt;&lt;/div&gt; &lt;div class=myfirstclass id=myfirstid&gt;&lt;/div&gt; &lt;div class=mysecondclass id=mysecondid&gt;&lt;/div&gt; &lt;div class=mysecondclass id=mythirdid&gt;&lt;/div&gt; &lt;div&gt;&lt;/div&gt;</code></pre> <p>There are five tags here. A CSS rule for <code>.myfirstclass</code> would affect the first two. <code>#myfirstid</code> would affect only the second tag. Meanwhile, <code>div</code> would affect all of them. So, with:</p> <pre><code class="language-html">&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta name=viewport content="width=device-width, initial-scale=1" /&gt; &lt;style&gt; .myfirstclass { color: red; } .mysecondclass { color: blue; } #myfirstid { background-color: green; } #mysecondid { background-color: orange; } #mythirdid { background-color: purple; } &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div class=myfirstclass&gt;I used to find Slashdot delightful,&lt;/div&gt; &lt;div class=myfirstclass id=myfirstid&gt;But my feelings of late are more spiteful,&lt;/div&gt; &lt;div class=mysecondclass id=mysecondid&gt;My comments sarcastic&lt;/div&gt; &lt;div class=mysecondclass id=mythirdid&gt;The iconoclastic&lt;/div&gt; &lt;div&gt;Keep modding to plus five (insightful).&lt;/div&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> <p>The first two lines will have red text, the second two will have blue text, and the lines in order will have white, green, orange, purple, and white backgrounds, despite all of them being DIVs. <a href="https://xkcd.com/301/">Limerick credit: XKCD</a></p> https://hypertextzone.net/blog/learn-html/learn-css-1-5 Learn CSS 2.3: Sizing Wed, 28 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/learn-html/learn-css-1-3 <h2><a href="learn-css-1-2">Last Time</a></h2> <p>Last time, we learned:</p> <ul> <li>Seven ways to change colors and when to use each</li> </ul> <h2>Starting anew</h2> <p>Let's start again with a basic CSS template, but this time, we're going to be using a <code>&lt;div&gt;</code>:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta name=viewport content="width=device-width, initial-scale=1"&gt; &lt;meta charset=utf-8&gt; &lt;style&gt; &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;div&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> <p>We're going to give the <code>&lt;div&gt;</code> a background color of black. Add this to the <code>&lt;style&gt;</code> tag:</p> <pre><code>div { background-color: #000; }</code></pre> <p>Remember that <code>#000</code> is black in 3-digit hexadecimal RGB notation.</p> <p>Now, we're going to resize it to see how much of the screen is black. At the moment, opening your file in the browser should show that nothing is black.</p> <p>To resize an item, you use the <code>height</code> and <code>width</code> properties of an element. You can also use <code>max-</code> and <code>min-</code> versions of these.</p> <h2>Pixel units</h2> <pre><code>div { background-color: #000; height: 50px; width: 100px; }</code></pre> <p>You can define how tall and wide an element is in pixels or px for short. Pixels are usually 1/96 of an inch. The above code should result in the div being a small rectangle.</p> <h2>Point units</h2> <pre><code>div { background-color: #000; height: 50pt; width: 100pt; }</code></pre> <p>Points , or pt for short, are 1/72 of an inch on the screen. For elements you want to scale to the screen, they can be useful. The above code should resuly in a slightly larger rectangle than the last example.</p> <h2>Em Units</h2> <pre><code>div { background-color: #000; height: 50em; width: 100em; }</code></pre> <p>An em is one times the font size of the document (usually 12pt). Ems are useful for creating sites that scale to the screen. The above code should create a very large rectangle.</p> <h2>Rem Units</h2> <pre><code>div { background-color: #000; height: 50rem; width: 100rem; }</code></pre> <p>A rem is one times the font size set to the <code>&lt;html&gt;</code> tag containing the document. It is useful for situations in which you want to use ems, but the text size of the containing element is set to a size other than 12pt. </p> <h2>Centimeters, millimeters, inches</h2> <pre><code>div { background-color: #000; height: 50mm; width: 50mm;</code></pre> <p>You can also size items in centimeters (cm), millimeters (mm), or inches (in) of the screen.</p> <h2>Picas</h2> <pre><code>div { background-color: #000; height: 50pc; width: 100pc; }</code></pre> <p>Here's an obscure one. One pica (pc) is always equal to 12pt.</p> <h2>Character Height</h2> <pre><code>div { background-color: #000; height: 50ch; width: 100ch; }</code></pre> <p>One ch is equal to the width of the letter 0 in the current font.</p> <h2>&quot;x&quot; height</h2> <pre><code>div { background-color: #000; height: 50ex; width: 100ex; }</code></pre> <p>One ex is equal to the height of the lowercase X in the current font.</p> <h2>Other ways to size things.</h2> <p>Also available are percent of the screen (%), percent of the screen height (vh), and percent of the screen width (vw), and percent of the screen's smaller/larger dimension (vmin/vmax), but I was unable to get them to work properly for this demonstration.</p> <p>In conclusion, CSS offers many ways (at least six) to change an element's size. <a href="learn-css-1-4">Next article - fonts and text sizing</a></p> https://hypertextzone.net/blog/learn-html/learn-css-1-3 Learn CSS 2.4: Typography Wed, 28 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/learn-html/learn-css-1-4 <h2><a href="learn-css-1-3">Last Time</a></h2> <p>Last time we learned:</p> <ul> <li> <p>Many ways to size an element in CSS</p> </li> <li> <p>The <code>background-color</code> property</p> </li> </ul> <p>Now we'll see how to work with fonts.</p> <h2>Starting anew, once again!</h2> <p>This time we'll be dealing with an <code>&lt;h1&gt;</code> element. Start with this:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta name=viewport content="width=device-width, initial-scale=1"&gt; &lt;meta charset=utf-8&gt; &lt;style&gt; &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Some beautiful text&lt;/h1&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> <h2>px, pt, em, rem, ex, ch</h2> <p>Pixels, points, ems, rems, and most other units (the units previously discussed) work pretty much the same for fonts. 1px is one pixel, 1pt is 1/72 inch, 1em is one times the previous font size, and 1rem is one times the font size of <code>&lt;html&gt;</code>.</p> <p>To set the size of one rem, add this to <code>&lt;style&gt;</code>:</p> <pre><code class="language-css">html { font-size: 12pt; }</code></pre> <h2>%, vw, vh, vmin, vmax</h2> <p>For fonts, there are more ways to resize the text. As an alternative to ems, you can size text in percent:</p> <pre><code class="language-css">h1 { font-size: 200%; }</code></pre> <p>100% is equal to 1em, so 200% is equal to 2em or 2x the font size, which in this case is 24pt.</p> <p>You can also use VW and VH (stands for viewport width/height) to specifically refer to the width or height of the screen when sizing text. Example: for text that is 3% of the screen width:</p> <pre><code class="language-css">h1 { font-size: 3vw; }</code></pre> <p>Or 3% of the screen height:</p> <pre><code class="language-css">h1 { font-size: 3vh; }</code></pre> <p>You can also size an element in terms of percent of its larger or smaller dimension, using <code>vmax</code> units for percent of the larger dimension and <code>vmin</code> units for percent of the smaller dimension.</p> <p>All of these percentage units are useful for text that changes its size between mobile and desktop screens.</p> <h2>Fonts!</h2> <p>Now fonts are where it can get complicated. We talked about fonts in Learn HTML 1.4 previously.</p> <p>Fonts are added using the font-family property:</p> <pre><code class="language-css">h1 { font-size: 1rem; font-family: sans-serif; }</code></pre> <p>CSS has five built-in font types, which browsers assign to different fonts installed on the system. These are serif (Times New Roman), sans-serif (Arial), monospace (Courier New), cursive (Comic Sans), and fantasy (Impact). For most purposes you will want to use sans-serif.</p> <p>In addition to those, you can also use any font that will be installed on the system viewing the item. Be careful, because not everyone has the same fonts!</p> <pre><code class="language-css">h1 { font-size: 1rem; font-family: "Segoe UI"; }</code></pre> <p>If you really want to use a certain font badly, you can add it to your page. For now, I won't talk about how to do so. Instead, I recommend using <a href="https://fonts.google.com">Google Fonts</a> for beginners as it can generate simple embed links for a selection of fonts. This way, you can ensure that the font will be available on almost all systems that access your site, not just those that happen to have your font.</p> <p>Even then, it's generally recommended to have a fallback font which is one of CSS's built-in font types. You can do that by adding a comma after your preferred font, then add your fallback font. For example: <code>font-family: "Segoe UI", sans-serif;</code>.</p> <h2>Addendum: Text Alignment</h2> <pre><code class="language-css">h1 { font-size: 1rem; font-family: "Segoe UI"; text-align: center; }</code></pre> <p>The CSS <code>text-align</code> property is useful to properly align text to the &quot;left&quot;, &quot;right&quot;, or &quot;center&quot;. You can also use &quot;justify&quot; to space the text so that every line is the same width; this makes text less readable so I recommend NOT using it.</p> <p><a href="learn-css-1-5">Next article, on CSS classes</a></p> https://hypertextzone.net/blog/learn-html/learn-css-1-4 Fixing TLS Connection Issues in Debian 10 Tue, 27 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/debian10tls <p>With Debian 10's release fast approaching, you might not know about a change that could affect functionality.</p> <p>OpenSSL maintainer Kurt Roeckx modified OpenSSL's default configuration such that by default, only TLSv1.2 is used, due to security issues with TLS 1.0. This could break certain networks that use EAP-PEAP for authentication and do not support TLSv1.2. He did add a news item in the Debian documentation warning about this change, but I'm not sure many people will read it.</p> <p>If you are administrator of your computer and have issues connecting to networks that use EAP-PEAP or certain old websites, do the following:</p> <ol> <li> <p>Open a terminal.</p> </li> <li> <p>Enter <code>sudo nano /etc/ssl/openssl.cnf</code> (NOT .conf!) and enter your user password.</p> </li> <li> <p>A text editor will open. Go to the bottom of the file and you will see the line: <code>MinProtocol: TLSv1.2</code></p> </li> <li> <p>Change it to <code>MinProtocol: None</code>.</p> </li> <li> <p>Reboot.</p> </li> </ol> <p>Your system should now work with older sites and networks. Keep in mind that this setting shouldn't be applied to a production server, as it can lead to security risks.</p> https://hypertextzone.net/blog/ivans1/debian10tls Learn CSS 2.2: Color Notation Tue, 27 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/learn-html/learn-css-1-2 <h2><a href="learn-css-1-1.md">Last time</a></h2> <p>Last time we learned:</p> <ul> <li> <p>The <code>&lt;div&gt;</code> and <code>&lt;span&gt;</code> tags as generic tags to aid styling</p> </li> <li> <p>The <code>&lt;style&gt;</code> tag to enclose a CSS stylesheet</p> </li> <li> <p>A basic CSS stylesheet</p> </li> </ul> <p>We made a CSS stylesheet which was as follows:</p> <pre><code class="language-css">p { color: orange; }</code></pre> <p>But what if you want more than simple colors? What if you want a precise shade of green, or purple, or blue?</p> <p>Luckily, there are actually seven-ish ways to denote colors in CSS. Let's look at them, one by one, shall we?</p> <h2>Built-in colors</h2> <pre><code>p { color: orange; }</code></pre> <p>CSS has <a href="https://www.w3schools.com/cssref/css_colors.asp">140 built-in colors (listed here)</a> for you to use. These include the primary and secondary colors, several grays, and several variations.</p> <h2>The HSL (HSV) color model</h2> <pre><code class="language-css">p { color: hsl(32, 90%, 60%); }</code></pre> <p>A lot of drawing apps use the HSL color model, which uses values for &quot;hue&quot;, the exact color you want, &quot;saturation&quot;, the amount of color or greyness of the color, and &quot;lightness&quot; or how bright the color should be.</p> <p>In CSS, hue is expressed as a quantity between 0 and 360 (corresponding to degrees from red on the color wheel) while saturation and lightness are expressed in percent. All is formatted as <code>hsl(0-360, 0%-100%, 0%-100%)</code></p> <h2>The HSLA color model</h2> <pre><code class="language-css">p { color: hsla(32, 90%, 60%, 0.7); }</code></pre> <p>To make HSL colors transparent, change to HSLA and add the opacity value (a decimal) to the end.</p> <h2>The RGB color model</h2> <pre><code class="language-css">p { color: rgb(255,128,0); }</code></pre> <p>Computer screens work by displaying tiny red, green, and blue lights at just the right intensities to create the illusion of color. Red, green, and blue are used instead of red, yellow, and blue because of how the eye works; we have red, green, and blue photoreceptors in our eyes.</p> <p>Because computers work in a binary system, it is most convenient to express the amount of red, green, and blue in a program as amounts between 0-255, since 255 is 2⁸-1. You'll need three of these numbers: the first is red, then green. then blue. Enclose them in parentheses preceded by &quot;rgb&quot; for <code>rgb(0-255,0-255,0-255)</code>.</p> <h2>The RGBA color model</h2> <pre><code class="language-css">p { color: rgba(255,128,0,0.7) }</code></pre> <p>If you want to make something transparent while using RGB, make it RGBA and add the opacity value (as a decimal) afterwards.</p> <h2>24-bit Hexadecimal RGB</h2> <pre><code class="language-css">p { color: #ff8000; }</code></pre> <p>Binary is hard to read; it's just a bunch of ones and zeros, and it takes a long time to write. To solve this, a lot of things use hexadecimal, which is base 16. Hexadecimal uses all of the decimal digits and then A through F.</p> <p>Instead of noting a color with three numbers between 0-255, you can define them as hexadecimal numbers with two digits, since in hexadecimal, 100-1=FF, which is 255 in hexadecimal.</p> <p>Because computers know that the color will have exactly two digits, they do not need commas anymore. All the need is a number symbol (#) to tell them it's a color in this format.</p> <h2>12-bit Hexadecimal RGB</h2> <pre><code class="language-css">p { color: #f80; }</code></pre> <p>CSS will also accept three hexadecimal digits, with each being either red, green, or blue. This is arguably the most compact way to write any color (unless it's red, in which case there's a one-character improvement).</p> <h2>Conclusion</h2> <p>There are many ways to write a color in CSS. Which one to use depends on what computers and browsers you want your site to work on, whether you want to make your text transparent, and personal preference.</p> <p><a href="learn-css-1-3.md">Read the next article about sizing!</a></p> https://hypertextzone.net/blog/learn-html/learn-css-1-2 Learn CSS 2.1: Useful HTML and My First Style Fri, 23 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/learn-html/learn-css-1-1 <p>I recommend reading <a href="/blog/learn-html/learn-html-1-1">Learn HTML</a> first. Or alternatively, you may want to see <a href="/blog/learn-html/learn-html-1-4">the previous Learn HTML</a>.</p> <h2>Why learn CSS?</h2> <ul> <li> <p>CSS is a stylesheet language, i.e. a programming language used to determine the look and feel of an HTML or XML file. If you know HTML already, CSS can improve your websites significantly.</p> </li> <li> <p>Good CSS can make your website look modern, like all of the fancy websites of today.</p> </li> <li> <p>Without CSS, a site is just a document; CSS is what makes it great.</p> </li> </ul> <p>This course will mainly teach you the basic syntax of CSS, since a lot of CSS's features can be searched for on the fly.</p> <h2>The <code>&lt;div&gt;</code> and <code>&lt;span&gt;</code> tags</h2> <p>The <code>&lt;div&gt;</code> and <code>&lt;span&gt;</code> tags are special HTML tags that are very useful when styling text with CSS. The <code>&lt;div&gt;</code> tag is like a paragraph without any spacing, used as a catch-all tag in web design.</p> <p>Meanwhile, <code>&lt;span&gt;</code> is a special tag that takes the smallest width reasonable, just wrapping around other elements. It can be useful for getting sizes right.</p> <h2>Starting out</h2> <p>To start out, use this template for each page on which you want to style.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta name=viewport content="width=device-width, initial-scale=1"&gt; &lt;meta charset=utf-8&gt; &lt;style&gt; &lt;/style&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt;Hello world!&lt;/p&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> <p>The <code>&lt;style&gt;</code> tag encloses a CSS stylesheet, so you'd put your styling options there.</p> <h2>CSS syntax</h2> <p>CSS uses a curly brace <code>{}</code> to determine when the style for a specific tags begins or ends. Additionally, individual rules are listed as <code>property: value;</code>.</p> <p>One example of a property is <code>color</code>, which changes the color of the text inside the element. To make some text orange, for example, you would use <code>color: orange;</code></p> <p>Now let's create a basic stylesheet to make paragraphs orange. To do that, simply place this within the <code>&lt;style&gt;</code> tag of your HTML file.</p> <pre><code class="language-css">p { color: orange; }</code></pre> <p>The &quot;Hello world!&quot; text in the template should now appear orange.</p> <p>Read the <a href="learn-css-1-2">next article</a></p> https://hypertextzone.net/blog/learn-html/learn-css-1-1 Learn HTML 1.4: Addendum Fri, 23 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/learn-html/learn-html-1-4 <p><a href="/blog/learn-html/learn-html-1-3">Previous article</a></p> <h2>Addendum: Tables</h2> <p>Tables are useful for placing things side-to-side, or just for use as a table.</p> <p>To create a table, use the <code>&lt;table&gt;</code> tag. Each row is defined with <code>&lt;tr&gt;</code>, and within rows, columns are defined with <code>&lt;td&gt;</code>.</p> <p>An example of a table:</p> <pre><code>&lt;table&gt; &lt;tr&gt; &lt;td&gt;Row 1 Column 1&lt;/td&gt; &lt;td&gt;Row 1 Column 2&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Row 2 Column 1&lt;/td&gt; &lt;td&gt;Row 2 Column 2&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt;</code></pre> <p>The table should look like this:</p> <table> <thead> <tr> <th>Row 1 Column 1</th> <th>Row 1 Column 2</th> </tr> </thead> <tbody> <tr> <td>Row 2 Column 1</td> <td>Row 2 Column 2</td> </tr> </tbody> </table> <h2>Addendum: Centering and Fonts</h2> <p>The following two attributes are deprecated because of the advent of CSS, but you may still find them useful.</p> <p>Centering text is as easy as putting it in a <code>&lt;center&gt;</code> tag. For example:</p> <pre><code>&lt;center&gt;&lt;h1&gt;Centered Header&lt;/h1&gt;&lt;/center&gt;</code></pre> <p>Changing text fonts is done with a <code>&lt;font&gt;</code> tag. The font tag has the <code>size</code>, <code>color</code>, and <code>face</code> (font) attributes. <code>size</code> is the font size relative to the default; <code>color</code> is the text color; <code>face</code> is the font.</p> <p>For example, to make a green heading using the &quot;Segoe UI&quot; font:</p> <pre><code class="language-html">&lt;font face="Segoe UI" color=green size=2&gt;Green Segoe Header&lt;/font&gt;</code></pre> https://hypertextzone.net/blog/learn-html/learn-html-1-4 Code Snippet: Rendering Markdown pages as HTML Thu, 22 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/markdown-to-html <p>I haven't done any Javascript on this site yet. That's because I'm not very experienced with Javascript. Still, I know my way around it.</p> <p>I put together a quick code snippet to render a page formatted in Markdown as HTML. There's a library called <a href="marked.js.org">Marked.js</a> which is usually used with Node.js, but can also be used entirely clientside. It includes a function called <code>marked(string)</code> which takes a Markdown-formatted string and outputs an HTML-formatted string.</p> <p>We'll use it along with the (usually built in) XMLHttpRequest function to create a useful utlity, which prompts for a Markdown-formatted page and displays it as HTML.</p> <p><a href="/assets/markdown-viewer/html">The result (plus my website's style) is here</a>. I hope it is useful to you.</p> <pre><code>&lt;!doctype html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"/&gt; &lt;title&gt;Markdown page viewer&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;!doctype html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"/&gt; &lt;title&gt;Markdown page viewer&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"&gt;&lt;/script&gt; &lt;script&gt; function loadpage(url) { if (window.XMLHttpRequest) { request=new XMLHttpRequest(); } else { request=new ActiveXObject("Microsoft.XMLHTTP"); } request.onreadystatechange=function() { if (request.readyState==4 &amp;&amp; request.status==200) { document.write(marked(request.responseText)); } } request.open("GET", url, false); request.send(); } loadpage(prompt("Location of Markdown")) &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; &lt;script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"&gt;&lt;/script&gt; &lt;script&gt; function pageload(theURL) { if (window.XMLHttpRequest) {// Using XMLHttpRequest response=new XMLHttpRequest(); } else { // Using ActiveXObject response=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.write(marked(response.responseText)); } } response.open("GET", theURL, false); xmlhttp.send(); } loadXMLDoc(prompt("Location of Markdown")) &lt;/script&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> https://hypertextzone.net/blog/ivans1/markdown-to-html App Review: Mark Text Wed, 21 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/marktext <h2>Markdown is cool!</h2> <p>Markdown is a markup language created by John Gruber and the late Aaron Schwartz. Its design allows a user to write advanced pages using only a text editor, using number symbols to denote headings. You can also add links, images, line breaks, <code>&lt;hr&gt;</code>-like separators, preformatted areas, and code blocks - essentially, (almost) everything you need to make a website. And if that isn't enough, you can add HTML in the middle, provided that you are going to export it to HTML. </p> <p>You might have used Markdown without even knowing it. It's used on Reddit, StackOverflow, and a number of other sites for formatting comments because it's so simple to implement and simple for users to use. PicoCMS, the content management system I use for this website, uses Markdown.</p> <p>The only issue is that in an HTML editor or a document editor, you will never find a &quot;save as Markdown&quot; option. What if you want an editor that is both WYSIWYG and Markdown?</p> <p>The answer to that question is <a href="https://marktext.github.io/website">Mark Text</a>.</p> <h2>Using Mark Text</h2> <p><img src="/assets/marktext.jpg" alt="Screenshot" /></p> <p>Mark Text is available for Windows, OSX, and Linux, and on Linux, it's available as Flatpak, AppImage, and portable, which makes it easy to obtain. It's open source (and supposedly, it will be forever), which is also great.</p> <p>Mark Text uses a &quot;virtual DOM&quot; to render text. That means that as soon as you've typed in your MarkDown code, you can see what it will look like. The image above isn't a page. It's the actual Mark Text editor in action. This is one of the most useful features for me, because I can see what I am writing and it will still export to Markdown.</p> <p>Too many features can make an application less versatile. Take for example a visual HTML/CSS editor which is also a CMS and a web server. It might be easier to use, but what if you want to publish to your own CMS or web server?</p> <p>Fear not, because Mark Text won't limit you. Mark Text has three visual modes: Typewriter, Focus, and Source Code. Typewriter is default, Focus darkens certain elements so you may &quot;focus&quot; on the current paragraph, and source code. Source Code Mode lets you edit the Markdown directly in case the default syntax feels limiting. Since a text editor covers all of Markdown's capabilities (in both the CommonMark and GitHub standards), Mark Text is improved by, and not limited by, its features. It's also, thankfully, not a CMS or a web server.</p> <p>Support for embedded HTML and YAML in Mark Text is limited, but it's definitely there. You can't customize the look and feel all that much, but you can choose between light and dark theme and change the fonts.</p> <h2>Should I use it?</h2> <p>Yes, you should use Mark Text if you are regularly editing Markdown. There are a few use cases for which it might not be optimal, and obviously if you aren't <em>regularly</em> editing Markdown, you should just use a text editor (it's really easy). If there's a better MarkDown editor for your use case, then you should use it.</p> <p>Additionally, though Mark Text has syntax highlighting, it is definitely NOT an IDE, so it shouldn't be used as one.</p> https://hypertextzone.net/blog/ivans1/marktext Software Projects to Watch Wed, 21 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/projects-im-watching <p>I thought I'd list some projects that are great, but that don't quite have the features I need, so I'd really like them to be better. These are also projects I'd like to review in the future. I'm mainly talking about web software, but anything goes here.</p> <h2>List of projects I'm watching</h2> <ol> <li> <p><a href="http://chrisdiana.github.io/cms.js/">CMS.js</a>: Looking to become a strong blogging platform, possibly even better than Pico due to its static design, but it is missing search and pagination features. It's also somewhat difficult to set up and has some properties that are bad for UX. Still, it's blog-aware! And static! It almost draws me away from PicoCMS even without pagination and search! I previously heard about MDWiki, which is a wiki generator that runs client side and even more easily than CMS.js, but MDWiki is no longer developed and still depends on old versions of Bootstrap and JQuery.</p> </li> <li> <p><a href="https://www.wondercms.com">WonderCMS</a>: A good CMS with a built-in admin plugin, but it lacks any sort of blogging capability, and would be much better if Markdown were available for page editing.</p> </li> <li> <p><a href="https://bolt.cm">Bolt CMS</a>: Another great CMS, Bolt has an alluring array of features, including blogging support, an admin backend, and a larger community.</p> </li> <li> <p><a href="https://getgrav.org">Grav</a>: As you can see I did a great deal of research into content management systems. Most of it was before I made this website; I wanted to use a flat-file CMS, and had to choose which flat-file CMS to use, Grav is the most widely used flat-file CMS, and look at that list of features! The only reasons I didn't use it myself was because it required a newer version of PHP than I had access to at the time, it seemed more difficult to theme, and my tests on newer versions of PHP found it riddled with bugs.</p> </li> <li> <p><a href="https://mosh.org/">Mosh</a>: Promises to be a way better alternative to SSH, but there isn't much external support available for it.</p> </li> <li> <p><a href="http://brow.sh">Browsh</a>: A command-line-based browser that uses headless firefox. It can ruin your Firefox configuration if you try to use it and doesn't play well with animations, also keyboard control is limited, but it somehow supports images and video, putting it far above other command-line browsers like Lynx. I reviewed Browsh <a href="/blog/app-reviews/browsh">here</a>.</p> </li> <li> <p><a href="https://falkon.org">Falkon</a>: First there was KDE Konqueror, but no one updated it anymore, so KDE needed a new browser. Then there was QupZIlla, and for its 3.0 version it joined the KDE project. And it was renamed to KDE Falkon. QupZilla was a great browser, and Falkon continues to live up to its name. If it can get past a few bugs, Falkon could become my new favorite browser.</p> </li> <li> <p><a href="https://nodejs.org/en/">Node.js</a>: An up-and-coming alternative to PHP. Javascript isn't my strong suit, though, and most of the best web software are either static (like CMS.js) or PHP-based.</p> </li> <li> <p><a href="https://nixos.org/">NixOS</a>: I'm an avid Linux user, so when a distribution comes around that's as technically exciting as NixOS or its GNU-developed cousin GuixSD, I am very interested. Sadly, both remain hard to install.</p> </li> <li> <p><a href="https://github.com/nliautaud/pico-content-editor">Pico Content Editor</a>; Could be a very useful content editor for PicoCMS, making good use of the other Users plugin, but currently lacks the ability to add new posts and is very difficult to implement. It's last here because there don't seem to be any plans to resolve my issues.</p> </li> </ol> https://hypertextzone.net/blog/ivans1/projects-im-watching App Review: PicoCMS Tue, 20 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/pico <p>PicoCMS is the content management system I use for this website. It purports to be blazingly fast and stupidly simple. So is this description accurate?</p> <p>I discussed Pico in a <a href="my-workflow">previous article</a>. This article will go a bit more in depth, providing a basic explanation of the application's features.</p> <h2>Installing PicoCMS</h2> <p>Installing PicoCMS starts with some relatively simple Apache and PHP setup. Apache and PHP must both be installed, along with Apache's mod_rewrite and the standard PHP modules.</p> <p>Additionally, Apache must be configured to run PHP files with the appropriate PHP runtime and must have AllowOverride All for the HTAccess file to work. (I went into more detail in my first article).</p> <p>Once everything is in place, installing Pico should be as easy as extracting its files to your httpdocs folder (usually /var/www/html) and changing the file ownership to www-data:www-data. Pico is a flat-file CMS, i.e. it has no database, other than the one that is already available.</p> <h2>Developing for PicoCMS</h2> <p>PicoCMS uses Twig for templating, so it's rather easy to create your own website template. Everything you need to know is in the official documentation. PicoCMS can use either YAML or PHP for configuration; YAML is very easy to use, and in fact is almost natural. Plugins can be writtin in PHP. Lastly, Markdown is used for content, which makes it possible to edit posts in a text editor intuitively.</p> <p>The choice of languages makes it extremely easy to develop a PicoCMS website.</p> <h2>Secure by design or inconvenient by design?</h2> <p>PicoCMS has no admin backend. There are extensions that add one, but most of them are outdated. Some would argue that this is very inconvenient. Traditional CMS software like Grav and Wordpress include a comprehensive admin backend including at least a configuration editor and a content editor, and usually include multi-user support.</p> <p>Indeed, having no admin backend is very limiting to PicoCMS; it means that it can only be used in settings where a chosen few webmasters have total control over the site's content. This also, however, makes it secure by design, as the only way to edit the site's content or settings is to have filesystem access.</p> <p>I use SSHFS as an effective replacement for an &quot;admin backend.&quot; I can simply edit the themes, plugins, and content from my desktop. It's not much less convenient than a traditional admin backend.</p> <h2>Extensibility</h2> <p>As Pico's own documentation states, it is <em>not</em> a blogging platform. However, I wanted to use it as one, and to do that is rather simple.</p> <p>I installed the &quot;pagination&quot; and &quot;search&quot; plugins for Pico, and added a template called &quot;post&quot; which references &quot;image&quot;, &quot;title&quot;, &quot;date&quot; and &quot;description&quot; variables attached to each post in their YAML headers. The Pagination plugin allowed me to separate the main page into multiple pages and the Search plugin would allow users to search for pages on my website. Neither of these are default Pico functions, but they are added via plugins.</p> <p>While it might be better to include these functions by default, an extensible CMS is a universal one, so I like that.</p> <h2>Conclusion</h2> <p>Pico is a great CMS, but it should only be used if ALL content is controlled by experienced webmasters. That means no comments and no social networks.</p> <p>In cases where reader engagement is absolutely necessary, something like Wordpress should be used. If you want to build a forum, use something like phpBB. If you want to build a social network, use something like Mastodon. Inexperienced webmasters might benefit more from something like WonderCMS or Grav, which are easier to administrate and just as easy to install.</p> https://hypertextzone.net/blog/ivans1/pico Star Trek Discovery Season 1 Was Actually Good Mon, 19 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/discovery <p>COPYRIGHT WARNING: Star Trek Discovery, the featured image, and all images in this article are not public domain. They are used under fair use law.</p> <p>Also, MAJOR SPOILER WARNING for Star Trek: Discovery.</p> <p>This post will be a bit of a departure from my previous technical articles. Sadly, I only have one domain, so anything I want to blog about has to go here. Maybe if I can amass the budget I'll start a separate blog about media.</p> <p>I believe that what really matters in a fictional production is twofold: how much you enjoy it and what you learn from it. How much a story fits into the established &quot;canon&quot; of previous stories is irrelevant unless it affects one's overall enjoyment of the story. In fact, it might be best to ignore canon when it is better for enjoyment of the show,</p> <p>That being said, as a fan of Star Trek, I enjoyed Star Trek: Discovery. There were a few things I didn't like, but they didn't ruin the show for me. A lot of other people, though, disliked it,</p> <h2>Why people hated Discovery</h2> <p>When the first trailer for Star Trek: Discovery dropped, it was bombarded by negative comments online. Some people didn't like the fact that the trailer focused on the action, where Star Trek was known for focusing on moral dilemmas. Some people didn't like the change of appearance to make the show look more modern, as it broke the established appearance. Other, possibly racist fans simply decried the diversity of the show.</p> <p>But no mention was made of the fact that a trailer scarcely reflects the quality of the show, that Star Trek has changed many times before, and that Star Trek has been very diverse since <em>Deep Space Nine</em> and has tried to do so even before that.</p> <p>So, no one could tell how good <em>Discovery</em> was going to be until it came out. And for many in the Americas, including myself, they wouldn't be able to tell until afterwards, because it was a CBS All Access exclusive in the United States. Ultimately, I got to watch the first two episodes on a trip to Switzerland (where it was available on Netflix) and the other thirteen on DVD just recently.</p> <p>Most people expected it to fail, and believing that a production will be terrible before you watch it negatively affects your perception of the show. So people thought it would fail, and then they saw it, and then they hated it.</p> <p>On the other hand, I didn't expect <em>Discovery</em> to fail. In fact, I didn't know about it until a trip to Switizerland, where I saw it on Netflix, and my only preconception was that Star Trek, a very good show in the past, was back. I ended up enjoying it.</p> <h2>What actually happened?</h2> <p>I will now describe, to the best of my ability, the main plot threads of this season and my thoughts on them; plot descriptions might be innacurate, as they are based on my memory. Spoilers begin here.</p> <h3>The Vulcan Hello/Battle at the Binary Stars.</h3> <p><img src="/assets/discovery-battle.jpg" alt="Battle at the Binaries" /></p> <p>From the start, it was apparent that <em>Star Trek: Discovery</em> was going to be much different from previous shows. The premiere episode &quot;The Vulcan Hello&quot; reminded me somewhat of the Voyager premiere, &quot;Caretaker&quot;, in that it established that the show would be different. In the episode, the crew of the U. S. S. Shenzhou discovers a mysterious artifact in space which is impervious to their sensors. Commander Michael Burnham discovers that the artifact is in fact a Klingon monument. She is then attacked by a Klingon warrior, whom she kills in self-defense. Meanwhile, a Klingon, T'Kuvma, attempts to unite the Klingon Houses in an alliance against the Federation, and meets an albino Klingon named Voq, who he names Torchbearer.</p> <p>Returning to the Shenzhou, Burnham consults with her foster father, Sarek (the very same Sarek who was Spock's father). Burnham learns that the Vulcans fire on Klingon ships whenever they make contact, as a show of honor in battle, believing that Klingons will fire first if they don't. Burnham tries to convince Captain Georgiou to fire, but she scoffs at the idea, so Burnham attempts a mutiny. When she is stopped, several Klingon ships decloak, including the Klingon <em>Ship-of-the-Dead</em> which becomes important later on.</p> <p>That's when the episode ends. It's a cliffhanger, leading into the next episode. I'm not sure if I like that. On one hand, it established the format of this new show - where, at least in the first season, the entire season is one long story, with lots of twists, and focuses on a science officer rather than a ship's captain. It also established that the visuals of the new series would be more impressive than any previous production, possibly even the J. J, Abrams movies. On the other hand, I feel like the next episode, &quot;Battle at the Binary Stars&quot; wasn't very independent as an episode, and in fact was more of &quot;The Vulcan Hello, Part 2&quot;. As series premieres go, though, it's pretty good.</p> <p>In the aforementioned next episode, the Shenzhou fights a futile battle against the Klingon armada, and Michael Burnham is released from the brig for her own safety. Returning to the Shenzhou's bridge, she convinces Captain Georgiou to capture T'Kuvma so that he may become a symbol of defeat rather than a saint or a martyr. They fail, however, and Burnham kills T'Kuvma in self-defense after Georgiou is killed. Burnham pleads guilty for mutiny and is sentenced to prison for life, ending the opening arc.</p> <h3>The Spore Drive Arc</h3> <p><img src="/assets/discovery-spore.png" alt="Burnham&#039;s dream" /></p> <p>Six months later, Burnham is aboard a shuttle being transferred out of prison. When that shuttle is attacked by power-draining creatures, the shuttle's captain dies trying to remove them, but then the shuttle is picked up by a tractor beam belonging to the titular <em>Discovery</em>.</p> <p>Apparently, Captain Gabriel Lorca wanted Burnham as a science officer the whole time. Burnham doesn't want to accept the role, believing that she should complete her time in prison. She is also suspicious of Lorca, following a series of top-secret Black Alert tests involving <em>Proximates stellavatori</em> spores. When she confronts Lorca, he reveals that Starfleet is testing spore drive, a new propulsion technology by Chief Engineer Paul Stamets that could hypothetically take the ship anywhere in the universe.</p> <p>Soon afterwards, the <em>Discovery</em>'s sister ship is found floating in space. The entire crew is dead, but they find a &quot;tardigrade&quot; inside the ship, which they capture, and discover that they can use it to gain increased control over the spore drive.</p> <p>Eventually, though, the crew discovers that the spore drive is hurting the tardigrade, and that it will die if <em>Discovery</em> continues to use it. The only way to pilot it is to inject a human with the animal's DNA, which is impossible because genetic modification is illegal in the Federation. Chief Engineer Stamets secretly injects himself with the DNA, adversely affecting his health, but allowing him to pilot the spore drive.</p> <p>The spore drive could have turned out like the enhanced dilithium seen in <em>Voyager</em>'s much-maligned' &quot;Threshold&quot;, with a lack of meaningful continuity. It didn't, and that's great. I liked the way the drive was used in Discovery. On the other hand, sometimes the uses of the spore drive felt cheesy, especially later in the series when mirror universe Stamets was discovered to be depleting the plane which the spores are native to.</p> <h3>The Mirror Universe Arc</h3> <p><img src="/assets/discovery-mirror.jpg" alt="mirror bridge" /></p> <p>In episode 9, &quot;Into The Forest I Go,&quot; Stamets falls into a coma after piloting the spore drive into the Mirror Universe, an alternate reality first seen in the original Star Trek. The Mirror Universe is ruled by the evil Terran Empire, created by human fascists who believed that the only way to protect the human race from alien invasions was to conquer. They were ultimately defeated in the 24th century by a defensive alliance between Klingons and Cardassians.</p> <p><em>Discovery</em> is a prequel, so we get to see more of the Terran Empire before its defeat. In the mirror universe, Cadet Sylvia Tilly (one of the series' best characters, by the way) is actually Captain of the Discovery, and Captain Lorca is a fugitive wanted for Burnham's disappearance an attempted coup against the Terran empress, who is actually the Shenzhou's Captian Georgiou.</p> <p>The Discovery crew disguises as their mirror universe counterparts, and Burnham takes command of the ISS Shenzhou (which she was apparently Captain of prior to disappearance). There, she is instructed to wipe out a group of rebels which includes the counterparts of Sarek and the Klingon torchbearer Voq. Instead, she warns them and asks them to evacuate before the Terrans attack, but Empress Georgiou appears in order to wipe them out, and calls Burnham to the palace ship Charon, where Georgiou reveals that the difference between Mirror Universe humans and other humans was that they were more light sensitive, which she suddenly realizes is also true of Captain Lorca. Captain Lorca rescues several allies from their torture chambers and prepares to kill the Empress.</p> <p>Meanwhile, Stamets' soul is trapped on the Mycelial Plane, the native universe of <em>Proximates stellavatori</em>. He meets his mirror-universe self and an echo of Hugh, the now-dead medical officer of Discovery, who warns him than mirror Stamets has spread a disease into the plane. Apparently, if the plane is destroyed, all life in all universes will cease to exist (this isn't quite fully explained). Discovery subsequently prepares to attack the place ship Charon, where mirror Stamets' experiments have been occuring.</p> <p>Burnham is ordered by Discovery to disable the containment field surrounding the Charon's spore drive, so she takes Empress Georgiou into the throne room and pretends to be an ally of Lorca's. She causes a battle between Georgiou's and Lorca's forces and uses the distraction to disable the containment field. Lorca is thrown into the spore drive and mirror Georgiou is transported to Discovery along with Burnham. Stamets pilots the spore drive back into the prime universe, only to realize that he's also travelled nine months into the future, and the Klingons are closing in on Earth, having taken over all of the Federation's starbases.</p> <p>This plotline is good, but I feel that it's a bit weaker than the other elements of the story. The twist about Lorca is weakened because another twist about Lieutenant Ash Tyler was presented simultaneously, and it's hard to be excited about both. Additionally, the plot about the Charon's spore drive being a threat to all life in all universes felt rather cheesy.</p> <h3>The Klingon Arc</h3> <p><img src="/assets/discovery-klingons.jpg" alt="Klingons" /></p> <p>The Federation-Klingon War is the main element of this season. Apparently the events of &quot;Battle at the Binary Stars&quot; led to a full-scale war against the Klingons. After T'Kuvma's death and the disappearance of his successor Voq, a Klingon named Kol leads the armada, and has no intention of keeping the Klingons unified.</p> <p>Discovery uses its spore drive to defeat the Klingons at an important dilithium mining planet. Subsequently, Lorca finds himself captured along with con man Harry Mudd and <em>Shenzhou</em> lieutenant Ash Tyler. They escape and beam to Discovery, but Mudd is left behind. He later returns to attempt revenge on the crew. Ash Tyler is integrated into the <em>Discovery</em> crew.</p> <p>Meanwhile, the Federation's continued attempts at dialogue are futile, and only result in the death of more officers. Admiral Cornwell, Captain Lorca's superior, is captured.</p> <p>Saru, Burnham, and Ash Tyler form a landing party which attempts to use a powerful transmitter on the planet Pahvo to discover cloaked ships. The Pahvans mind-control Saru to convince them to stay, but Burnham manages to reach the transmitter alone. The mission ends with the Pahvans calling the Klingons to them, not realizing that doing so would create another confrontation with the Klingons. Burnham and Tyler beam to the Klingon <em>Ship-of-the-Dead</em> to plant sensors on it and rescue Admiral Cornwell. Simultaneously, Stamets completes 133 small jumps with the spore drive in order to expose the Klingon ship.</p> <p>Burnham attempts a dialogue with Kol using her communicator's universal translator, eventually leading to a batleth duel which is cut short by a transport to the DIscovery. Ash Tyler's torturer, L'Rell, is also in the transport. Afterwards, in an attempt to go to a starbase, Discovery instead ends up in the mirror universe.</p> <p>While in the mirror universe, L'Rell performs a Klingon prayer with Ash Tyler, and he begins to have unusual flashbacks. Chief Medical Officer Hugh discovers that his body has been altered, and then Ash instinctively kills him. When he meets the Klingon torchbearer Voq from the mirror universe, he realizes that he, in fact, is Voq, having transformed himself into a human spy. L'Rell decides to allow him to continue as Ash Tyler rather than turn him back into the Klingon.</p> <p>When the crew finally returns from the mirror universe, they end up nine months in the future. Without the intelligence on the Klingons' cloaking device, the Federation has suffered repeated losses to the Klingons, who are no longer unified and are closing in on Earth. Admiral Cornwell places mirror universe Georgiou at the helm of a mission to the Klingon home planet Qo'noS in a desperate attempt to turn the tide of war. Discovery makes a jump to a cave beneath the surface of the planet. Cadet Tilly, Specialist Burnham, and Georgiou go to the surface and attempt to find a shrine at which a probe will be dropped. Georgiou's backhanded tactics are the most successful, getting her to the shrine. Tilly is lost and realizes she's inhaled volcanic fumes, and also that the probe being sent below the surface is in fact a bomb which would render the planet uninhabitable. Burnham and Tilly stop &quot;Captain&quot; Georgiou from detonating the bomb, instead giving it to L'Rell so that she may unify the Klingon tribes and end the war.</p> <p>This plot thread was very well-executed. Like <em>Deep Space Nine</em> before it, <em>Star Trek: Discovery</em> deals with war rather well; rather than glorifying it, it tries to deal with the moral issues involved. It's hard to beat <em>Deep Space Nine</em>, though.</p> <h2>Everything else</h2> <p>I haven't yet mentioned the great acting and characterization throughout the show. I particularly liked the characters of Paul Stamets and Sylvia Tilly, who had some depth of character despite not having a large role in the main story.</p> <p>Though <em>Discovery</em> might have seemed at first like an action piece failing to imitate the likes of Star Wars and the Avengers, it actually continued to do what Star Trek does best. It is a decent exploration of war and its consequences, supported by a large but (mostly) well-developed cast of characters. It has a number of problems, as most first seasons do, but for a first season it holds up quite well. It's different, but different in a good way. I am excited to see Season 2 when it becomes available on DVD.</p> https://hypertextzone.net/blog/ivans1/discovery Making a Perfectly Colorized Header Sun, 18 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/css-colorize <h2>The CSS filter: property</h2> <p>While much of CSS's features are for positioning, a few of them exist to improve CSS's graphic design capabilities. One such feature is the <code>filter:</code> attribute. It does almost exactly what you'd expect - it applies a graphical filter to an element.</p> <p>I've found <code>filter:</code> very useful to blur images, but be forewarned: if the image is set with the <code>background-image</code> attribute, then anything above the background image will also be blurred. It's as simple as adding <code>filter: blur(5px);</code> to the image's CSS.</p> <p>What we'll do today is a bit more complicated. I want to colorize an image with only CSS. An example of this effect can be found on the template <a href="https://html5up.net/forty">Forty</a> Sadly, CSS doesn't have a <code>filter: colorize</code> yet, so we'll have to get creative.</p> <p>We'll do this with a class called &quot;myImage&quot;, used on <code>&lt;img&gt;</code> tags:</p> <pre><code class="language-css">.myImage { }</code></pre> <h2>Making an image grayscale</h2> <p>The first step in making a perfectly colorized header is making the image grayscale.</p> <p>Within the myImage class, we'll start constructing a filter property.</p> <p>This will make the image grayscale:</p> <pre><code class="language-css">.myImage { filter: grayscale(100%); }</code></pre> <h2>More filter options</h2> <p>Now that we have a grayscale image, we must add color using a somewhat dodgy method. Sepia seems to be the only available filter that can add color to a grayscale image.</p> <pre><code class="language-css">.myImage { filter: grayscale(100%) sepia(100%); }</code></pre> <p>Sepia makes the image beige, or very unsaturated orange. Of course, you might not want to make the image orange, so use the hue-rotate filter.</p> <p>The hue-rotate filter is odd; it won't take a color, but rather it will take a rotation of the RGB color wheel (different from the one you learned in art class) in degrees or radians. Here are the primary and secondary colors in rotations from orange:</p> <ul> <li> <p>Yellow: 15deg</p> </li> <li> <p>Green: 90deg</p> </li> <li> <p>Blue: 180deg</p> </li> <li> <p>Violet: 225deg</p> </li> <li> <p>Red: 315deg</p> </li> <li> <p>A better orange: 350deg</p> </li> </ul> <p>In this case, I'd like to make the image violet, but you can add any of these rotations, so I'll add a 225 degree rotation.</p> <pre><code class="language-css">.myImage { filter: grayscale(100%) sepia(100%) hue-rotate(225deg); }</code></pre> <p>So the image now looks much different, but it doesn't look violet enough - it looks gray with a violet tint. This is the final step; you need to turn up the saturation. Choose how much wisely, though. I've found that 600% is too high and 200% is too low, but otherwise it's your choice of how much to saturate. Use the <code>saturate</code> option:</p> <pre><code class="language-css">.myImage { filter: grayscale(100%) sepia(100%) hue-rotate(225deg) saturate(500%); }</code></pre> <p>Apply this CSS, then create an <code>&lt;img&gt;</code> tag with <code>class=myImage</code>. <a href="/assets/colorize.html">See the result here</a>.</p> https://hypertextzone.net/blog/ivans1/css-colorize CSS Gradient Wipe Animation Thu, 15 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/animation2 <p>Inspired by <a href="https://codepen.io/shshaw/pen/YpERQQ">this codepen.</a></p> <h2>Revisiting @keyframes</h2> <p>It occurs to me that in the <a href="animation">previous article on animation</a> I didn't go into much depth about what <code>@keyframes</code> actually did. Well, no longer, time to explain.</p> <p>Keyframes in an animation are basically prefined points in an animation that have certain variables attached and thus allow a computer to calculate what's in between. In CSS, keyframes are determined in terms of <em>how much of the animation has completed, in percent</em>, and placed the keyframes in an <code>@keyframes</code> query with the name of the animation. You can also use &quot;from&quot; for 0% and &quot;to&quot; for 100% if those are your only keyframes. For example:</p> <pre><code>@keyframes animation-name { from { color: #bada55; } to { color: #0ff1ce; } }</code></pre> <h2>A WebKit-only feature</h2> <p>The feature we're going to use is exclusive to WebKit (Safari) and Blink (Chrome).</p> <p>There are two CSS properties here - background-clip and text-fill-color.</p> <p>Let's make a class:</p> <pre><code class="language-css">.animated { font-family: Raleway, sans-serif; font-weight: bold; font-size: 4em; background: radial-gradient(circle farthest-corner, yellow, red); text-align: center; background-clip: text; text-fill-color: transparent; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }</code></pre> <p>This class has text whose color is a radial gradient from yellow to red. Both <code>-webkit-</code> and non-<code>-webkit-</code> versions are essential here as a future-proofing measure.</p> <h2>Just one keyframe!</h2> <p>Luckily, you'll only need one keyframe here:</p> <pre><code class="language-css">@keyframes colorfultext { to { background-position: 200% center; } }</code></pre> <p>In order to enable the animation, add the following lines to your CSS class:</p> <pre><code class="language-css"> background-size: 200% auto; animation: colorfultext 2s linear infinite;</code></pre> <p>The resulting code will be something like this and <a href="/assets/animated.html">the result is here</a>.</p> <pre><code class="language-css">@keyframes colorfultext { to { background-position: 200% center; } } .animated { font-family: Raleway, sans-serif; font-weight: bold; font-size: 4em; animation: colorfultext 2s linear infinite; background: radial-gradient(circle farthest-corner, yellow, red); text-align: center; background-clip: text; text-fill-color: transparent; -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-size: 200% auto; color: #000; }</code></pre> https://hypertextzone.net/blog/ivans1/animation2 CSS Animation - Spinning Newspaper Wed, 14 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/animation <h2>What are CSS Animations?</h2> <p>CSS Animations are a feature of CSS3 allowing developers to animate an object becoming visible.</p> <p>To define a CSS animation, one needs to define keyframes in terms of percent, then add the appropriate &quot;animation&quot; attribute to an object. In this article I will make a spinning newspaper animation using this image from The Simpsons (copyright warning): <img src="/assets/spinning_paper.jpg" alt="Spinning paper" /></p> <h2>The transform: property</h2> <p>Much of what you would want to do with animations is available with the Transform property.</p> <p>In this case, we'll be causing the image to spin and get larger, acheived through transform: scale and transform: rotate. Rotate takes a rotation in degrees. Let's start by making it spin twice.</p> <pre><code class="language-css">@keyframes spinny { 0% { transform: rotate(0deg); } 50% { transform: rotate(720deg); } }</code></pre> <p>(Be forewarned: this animation won't work in WebKit-based browsers, though it will work in Chromium-based ones.)</p> <p>Scale takes an argument in size relative to 1 for some reason, and transformations are space- rather than comma-separated, so the way to scale the newspaper would be as follows:</p> <pre><code class="language-css">@keyframes spinny { 0% { transform: rotate(0deg) scale(0.1,0.1); } 50% { transform: rotate(720deg) scale(2,2); } }</code></pre> <p>Filter and Opacity are also commonly used with animations, and we'll use them for a nice fade-out:</p> <pre><code class="language-css">@keyframes spinny { 0% { transform: rotate(0deg) scale(0.1,0.1); opacity: 1; } 50% { transform: rotate(720deg) scale(2,2); } 70% { filter: none; opacity: 1; } 100% { filter: blur(100px); opacity: 0; } }</code></pre> <p>Now let's create a CSS class with this animation enabled:</p> <pre><code>.spinner { text-align: center; position: absolute; top: 40%; left: 40%; animation: spinny 8s linear 0s 1 normal; opacity: 0; transform: scale(2,2); }</code></pre> <p>Make sure to include all of the final settings or else the animation will end improperly by transitioning into its default state.</p> <p>The animation: property used here is a &quot;combo property&quot; that goes as follows:</p> <ul> <li> <p>spinny: Name of the animation</p> </li> <li> <p>8s: speed of the animation in total length</p> </li> <li> <p>linear: progression of the animation</p> </li> <li> <p>0s: delay before showing animation</p> </li> <li> <p>1: number of times to play animation</p> </li> <li> <p>normal: direction of the animation</p> </li> </ul> <p>Now add the appropriate content to <code>&lt;body&gt;</code>:</p> <pre><code>&lt;div class=spinner&gt; &lt;img src=spinning_paper.jpg&gt;&lt;/div&gt;</code></pre> <p><a href="/assets/animation.html">Here's what the result should be in the end.</a></p> https://hypertextzone.net/blog/ivans1/animation App Review: Browsh Tue, 13 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/app-reviews/browsh <h2>Browsh: Review</h2> <p><a href="https://brow.sh">Browsh</a> is an app I discovered when doing research for <a href="https://hypertextzone.net/blog/ivans1/test-listhttps://hypertextzone.net/blog/ivans1/test-list">a previous article</a>. When most people think of text-based browsers, they think of w3m or Lynx: <img src="/assets/lynx.png" alt="lynx" /></p> <p>Browsh is a lot different from those browsers. It uses Firefox to load the page, then pixelates the background using UTF-8 half-blocks and converts all of the text to monospaced paragraphs.</p> <p>It therefore requires Firefox and a true-color terminal (which is a lot for a text browser) but what it does with that is very cool.</p> <p>Here's my website as seen in Browsh:</p> <table> <thead> <tr> <th>Main page</th> <th>An article</th> </tr> </thead> <tbody> <tr> <td><img src="/assets/browsh-index.png" alt="Main page with browsh" /></td> <td><img src="/assets/browsh-page.png" alt="Article with browsh" /></td> </tr> </tbody> </table> <p>Browsh can, inexplicably, render videos and WebGL, albeit they're pixelated and audio only sometimes works.</p> <p><img src="/assets/browsh-who.png" alt="Doctor Who with Browsh" /></p> <p>The intended use is for people who have low bandwidth, but who have access to a Linux server in a higher-bandwidth area. Browsh provides a great browsing experience at higher speeds by simply sending a pre-rendered page fetched over a faster network.</p> <p>Personally, I just think it's fun to use. Go get it for Linux or Mac at <a href="https://brow.sh">Brow.sh</a>.</p> https://hypertextzone.net/blog/app-reviews/browsh Moving away from Google Fonts Mon, 12 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/google-fonts <h2>What's Google Fonts</h2> <p>Google Fonts is a service that provides several SIL-licensed fonts to add to websites as a stylesheet. It makes it very easy to add fonts to a site.</p> <p>However, Firefox Focus blocks it as a tracker, as do other browser that don't like third-party additions, so I've decided to move away from it.</p> <h2>What to use instead</h2> <p>Google Fonts allows you to download its fonts, so take advantage of that. Download the fonts from Google, then write your own <code>@font-face</code> queries. Here are mine;</p> <pre><code class="language-css">@font-face { font-family: Raleway;     font-style: normal;     font-weight: normal; src: url(Raleway-Regular.ttf); } @font-face { font-family: Raleway;     font-style: italic;     font-weight: normal; src: url(Raleway-Italic.ttf); } @font-face { font-family: Raleway;     font-style: normal;     font-weight: bold; src: url(Raleway-Bold.ttf); } @font-face { font-family: Cinzel;     font-style: normal;     font-weight: normal; src: url(Cinzel-Regular.ttf); }</code></pre> https://hypertextzone.net/blog/ivans1/google-fonts Media Queries in CSS Mon, 12 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/media-queries <h2>Responsiveness</h2> <p><strong>Responsiveness</strong> in web design is the set of features designed to give the website a unified look on mobile, tablet, and desktop platforms. A responsive website will look good on every device.</p> <p>Because smartphones and tablets are increasingly used to access websites, responsiveness is absolutely essential to website building, and the simplest way to implement it is via media queries.</p> <h2>Useful media queries</h2> <p>CSS <code>@media</code> queries are a simple way of making a site responsive, usually taking the format of:</p> <pre><code class="language-css">@media only screen and (condition: value){ property: value; }</code></pre> <p>It's recommended to make your website for mobile and make <code>@media</code> queries specific to desktop; this is the &quot;mobile-first&quot; philosophy. Useful media queries to detect a desktop are <code>only screen and orientation: landscape</code> and <code>only screen and (min-width: 1000px)</code>. <strong>Always</strong> place queries at the end of the document, or else they could be overridden by other properties.</p> <p>Within those queries, another property which is very useful is the <code>text-size-adjust</code> property, which takes a percentage of the standard text size as the size text will be rendered at. Not all browsers support it, but most mobile browsers will. For example:</p> <pre><code class="language-css">body { text-size-adjust: 250%; -webkit-text-size-adjust: 250%; } @media only screen and (min-width: 1000px){ body { text-size-adjust: 100%; -webkit-text-size-adjust: 100%; } }</code></pre> <p>Make sure to include both <code>text-size-adjust</code> and <code>-webkit-text-size-adjust</code> in order to support iThings and the Librem 5.</p> <h2>Conclusion</h2> <p>CSS's <code>@media</code> query is a godsend for web developers. It makes responsiveness much easier than otherwise. On the other hand it isn't quite universally supported, though both Android and iOS support them in the latest version.</p> https://hypertextzone.net/blog/ivans1/media-queries Browsers I Test On Mon, 12 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/test-list <p>The following is a list of browsers that I test on.</p> <ul> <li> <p>Chromium (latest): This one is obvious. Half of Internet users use Chrome, so having some variant available is very useful.</p> </li> <li> <p>Firefox ESR: This is the Firefox (Gecko) version most readily available to me since I use Debian.</p> </li> <li> <p>Epiphany/GNOME Web: I use this as a representative of Webkit, which is used in Safari and many other browsers.</p> </li> <li> <p>Microsoft Edge: Uses a unique web engine and thus necessitates testing on it. Since I use Linux I don't usually have this available.</p> </li> <li> <p>Palemoon: Uses a fork of Gecko called Goanna, thus making it differ from Firefox in some ways.</p> </li> <li> <p>Chrome on Android: The default browser for Android, used to test mobile. This is my primary browser when testing on mobile devices,</p> </li> <li> <p>Firefox Focus: Blocks external sources, demonstrating how websites look when external sources are blocked. Also shows Gecko on mobile.</p> </li> <li> <p>Safari on iOS: The default iOS browser. Used to test mobile on iThings.</p> </li> </ul> <p>Current browsers I don't test on:</p> <ul> <li> <p>Internet Explorer: Internet Explorer has been in LTS for years, very few people use it, and it's lagging behind is very well-known, so I take test results there with a grain of salt (as should you).</p> </li> <li> <p>NetSurf: Netsurf is designed to be lightweight. It lacks many modern standards, and thus won't render well.</p> </li> <li> <p>Links: Also designed to be lightweight and thus only supports partial HTML4.</p> </li> <li> <p>Browsh: This text-based browser is basically a pixelated Firefox, and is the same except for appearance differences.</p> </li> <li> <p>Anything not listed: Browsers like Vivaldi don't require testing because they use the same web engine as another browser.</p> </li> <li> <p>Old-style text-based browsers like w3m, EWW, and Emacs/W3: Only one text-based browser needs to work, since others implement similar functionality. All that really matters is that the document is organized.</p> </li> </ul> <p>Basically, I want to test supported versions of the Blink, Gecko, WebKit, EdgeHTML, and Goanna on desktop, tablet, and mobile devices. Responsive mode is rarely enough to test this, since responsive mode doesn't emulate the quirks that mobile devices have.</p> https://hypertextzone.net/blog/ivans1/test-list Six resources for learning HTML Mon, 12 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/learn-html/other-resources <h2><a href="https://www.w3schools.com/">W3Schools</a></h2> <p>W3Schools is a good encyclopedic reference for tutorials on HTML/CSS/Javascript. I don't know if I can recommend their actual courses, though, since I haven't tried any of them beyond the first lesson. The general impression I have is that the course software is buggy and limited,</p> <h2><a href="https://css-tricks.com">CSS Tricks</a></h2> <p>CSS Tricks is a blog that posts short technical articles telling you how to do certain things in CSS and Javascript. I've found it rather useful in building this site. </p> <h2><a href="https://code.org">Code.org</a></h2> <p>This is a very popular resource for courses on programming in general, and its course on Web Development is very helpful to people who don't know HTML. However, I have found that it lacks in terms of education in web design norms, so learn those elsewhere (or by eye, as I did).</p> <h2><a href="https://repl.it">Repl.it</a></h2> <p>ReplIt not only serves as an example of great web design, it also has an IDE with the very useful feature of making your site a subdomain of repl.co, allowing you to test your HTML very quickly. Repl.it should not be used as hosting, though, because it does not allow you to choose your own subdomain. I would instead recommend <a href="https://neocities.org">Neocities</a> for free hosting.</p> <h2><a href="https://neocities.org">Neocities</a></h2> <p>Neocities is the only website creator I know of that actually lets you write your own CSS. It also has some in-depth HTML tutorials to get your website started, and a community that gives it an audience. <a href="https://wrhstechhtml.neocities.org">I even have a site there.</a>.</p> <h2>Your Local Bookstore</h2> <p>There are quite a few books on HTML and on other related topics that go much further in depth than my articles, from publishers like O'Reilly. Go to your local bookstore to find them.</p> https://hypertextzone.net/blog/learn-html/other-resources Learn HTML Part 1.3: Code, Links, and Images Fri, 09 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/learn-html/learn-html-1-3 <h2>Review</h2> <p><a href="learn-html-1-2">Previously</a>, we learned about:</p> <ul> <li> <p>How to add paragraphs and headings</p> </li> <li> <p>HTML's cascading nature</p> </li> </ul> <p>You should have by now a page like this:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf=8"&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Hello, world!&lt;/h1&gt; &lt;p&gt;Oi, spaceman!&lt;/p&gt; &lt;h2&gt;And this is a sub heading!&lt;/h2&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> <h2>Code and Other Styles</h2> <p>So you can write an article now, but what if you want to write an article about code? What if you want to display a text file?</p> <p>Use the <code>code</code> and <code>pre</code> tags. <code>&lt;code&gt;</code> and <code>&lt;/code&gt;</code> represent the beginning and end of a monospaced segment.</p> <p>So try adding this inside the paragraph from last lesson:</p> <pre><code>Oi spaceman! &lt;code&gt;Some code goes here.&lt;/code&gt;</code></pre> <p>The result should be something like:</p> <p>Oi, spaceman! <code>Some code goes here.</code></p> <h3>Trying to copy text files?</h3> <p>If you're writing some code, or using a text editor, you might find that trying to copy it into your website turns it from this:</p> <pre><code>|------------------------| |Neatly | | spaced | | as all things should be| |------------------------|</code></pre> <p>to this:</p> <p>|------------------------| |Neatly | | spaced | | as all things should be| |------------------------|</p> <p>That's because in HTML, lines break between certain tags, but not with a new line. Luckily, there's a solution: the <code>&lt;pre&gt;</code> tag.</p> <p>Try adding this to your page now:</p> <pre><code>&lt;pre&gt; |------------------------| |Neatly | | spaced | | as all things should be| |------------------------| &lt;/pre&gt;</code></pre> <p>It should appear properly!</p> <h2>Line Breaks</h2> <p>So, what if you aren't copying a text file, but maybe you're writing a poem and the spacing between paragraphs is too big? Simply add <code>&lt;br&gt;</code> to the end of the line you wish to partially break.</p> <p>Or maybe you want to draw a line through the page. Use <code>&lt;hr&gt;</code>.</p> <h2>Images</h2> <p>The last thing needed for a decent document is an image. HTML's tag for images is the <code>&lt;img&gt;</code> tag.</p> <p>Opening tags can have additional &quot;attributes&quot; - things about how to display the tag. An example is the <code>charset="utf-8"</code> part of <code>&lt;meta charset="utf-8"&gt;</code> from the necessary piece of HTML.</p> <p>The <code>&lt;img&gt;</code> tag is uses the <code>src=</code> attribute to determine which image to display. The SRC property takes a URL or a path to file, relative to the folder the HTML file is in.</p> <p>The URL: <code>https://picsum.photos/300/200?random</code> provides a random image that is 300x200, so let's use that as an example. Add this to your page:</p> <pre><code>&lt;img src=https://picsum.photos/300/200?random&gt;</code></pre> <p>There should now be a small image on the page.</p> <h2>Links</h2> <p>Another type of tag that uses attributes is <code>&lt;a&gt;</code> tag - a link, The <code>href=</code> attribute of this tag defines where the link points - a URL, or a path to another HTML file, relative to the folder the document is in. Inside the tag is the text of the link.</p> <p>Let's try this with <code>https://example.com</code>:</p> <pre><code>&lt;a href=https://example.com&gt;Example&lt;/a&gt;</code></pre> <h2>Conclusion</h2> <p>If everything works, you can move on to <a href="learn-css-1-1">Learn CSS</a> or read the <a href="learn-html-1-4">addendum</a>.</p> <p><a href="/feed">Subscribe to me with RSS</a>!</p> https://hypertextzone.net/blog/learn-html/learn-html-1-3 Why popularity actually matters in web design Thu, 08 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/popularity-matters <h2>Web Design Is Marketing</h2> <p>On most web development blogs (except for mine) you will find that marketing terms like <em>conversion</em> are used. This is because the primary purpose of web design, at least for many, is digital marketing.</p> <p>If you are doing web design as a form of digital marketing, then it is necessary to make your website look good in the way &quot;a good-looking website&quot; is popularly defined. Otherwise, users will think your website is old, unmaintained, and low-effort, which leaves a bad impression on your business. The popular definition of &quot;a good-looking website&quot; generally corresponds to flat design, possibly with images and color-to-color gradients.</p> <h2>Web Design is about User Experience</h2> <p>In every case, a primary purpose of web design should be to make it easy to access the content of a website. In order to access the content, you need to have a way of navigating to the content that users will understand.</p> <p>It's advantageous to have a navigation experience that users know about, i.e. one that is popular. This way, your users already know how to navigate your website, having used other ones.</p> <h2>Didn't every idea start out as unpopular?</h2> <p>Sure, and I definitely advocate for innovation in web design. But an unpopular design can make your site look unprofessional and make it hard to navigate. Sticking with design norms is generally a good idea. If you have a new concept that isn't popular, then you may implement it; it might actually be good for user experience and marketing.</p> <p>On the other hand, if you liked the old design seen in sites like <a href="https://old.reddit.com">Old Reddit</a> and most sites made with Old Google Sites, and prefer it to modern design, you still shouldn't implement it because it makes your website appear unmaintained or low-effort to users, and it draws people away.</p> https://hypertextzone.net/blog/ivans1/popularity-matters Learn HTML Part 1.2: Headings Thu, 08 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/learn-html/learn-html-1-2 <h2>Review</h2> <p><a href="learn-html-1-1">Last time</a> we learned:</p> <ul> <li> <p>The essential tags <code>&lt;html&gt;</code>, <code>&lt;head&gt;</code>, <code>&lt;meta charset=utf-8&gt;</code>, and <code>&lt;body&gt;</code></p> </li> <li> <p>The meaning of tags in HTML</p> </li> </ul> <p>We left off with the following page:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt; Hello, world! &lt;/p&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> <h2>Trying headings</h2> <p>A heading is a bit of text that tells the viewer what section this is. For example, the heading just above@</p> <p>In HTML, there are six types of headings: <code>&lt;h1&gt;</code>, <code>&lt;h2&gt;</code>, <code>&lt;h3&gt;</code>, <code>&lt;h4&gt;</code>...</p> <p>Load the file from the previous lession. Let's make our &quot;Hello, world&quot; a heading.</p> <pre><code>&lt;h1&gt; Hello, world! &lt;/h1&gt;</code></pre> <p>Save the file and open it in your web browser. You should now see &quot;Hello, world&quot; in big text.</p> <p>Let's try a smaller heading. Below your &quot;Hello, world&quot; message, add:</p> <pre><code>&lt;h2&gt; And this is a sub-heading! &lt;/h2&gt;</code></pre> <p>You should now have &quot;Hello world&quot; in large text and &quot;And this is a subheading&quot; in slightly smaller text.</p> <p>It's about time I showcased a common mistake. Try adding this to the Hello World!</p> <pre><code>&lt;h1&gt; Hello World! &lt;p&gt; Oi, spaceman! &lt;/p&gt;</code></pre> <p>You'll notice that &quot;Oi, spaceman!&quot; is also a heading. Remember to end with <code>&lt;/h1&gt;</code> every time.</p> <p><a href="learn-html-1-3">Learn HTML is continued here</a>.</p> https://hypertextzone.net/blog/learn-html/learn-html-1-2 Bottom-bar navigation Wed, 07 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/bottom-nav <h2>An experiment with bottom-bar navigation</h2> <p>I experimented with bottom-bar navigation in <a href="/assets/gallery">this template</a>. <a href="/assets/gallery.zip">Download the template here.</a>. As you can see, there's a navigation menu at the bottom on both desktop and mobile versions.</p> <p>Bottom navigation, especially with icons, is familiar to mobile users, since a lot of major apps use it, including YouTube, Facebook, and Twitter. In these cases, the functions correspond to the most important pages. In Twitter's case, these are Home (Recommended and followed tweets), Search, Notifications, and Messages. So does it have merit in web design?</p> <h2>Advantages and disadvantages</h2> <p>Bottom navigation is easier to use for mobile users, since it is easiest for the left thumb to reach the screen's bottom left, and the right thumb to reach the screens bottom right. </p> <p>Since it's at the bottom, people will see it last. This is advantageous for sites where content is a focus, since it gets out of the user's way. On the other hand, for online shopping sites or other sites where people should be looking at the navigation first, it's a disadvantage.</p> <p>Furthermore, putting navigation at the bottom moves it away from the main content, adding to the difficulty of usage on desktop.</p> <p>Bottom navigation should not be used for more than five important pages, since adding more can lead to problems.</p> <p>Issues could also arise because people will be visiting your site in apps that have their own bottom bar, so you could be facing the Android buttons bar stacked with a browser's bottom bar and your website's bottom bar, and that's not a good look.</p> <h2>So... should I use a bottom nav?</h2> <p>I'd recommend using a bottom bar for navigation if your site has five or fewer important pages and its focus is on the main content. In other situations it can be a detriment to UX.</p> <h3>What should I use instead?</h3> <ul> <li> <p>Use a sidebar for navigation on desktop, then convert it into a bottom bar.</p> </li> <li> <p>Use a tab bar at the top and set overflow-x to auto. If you do this in combination with a header, make sure that only one is fixed.</p> </li> <li> <p>There are tons of other options, so look around</p> </li> </ul> https://hypertextzone.net/blog/ivans1/bottom-nav Learn HTML part 1.1: Hello World Wed, 07 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/learn-html/learn-html-1-1 <h2>Why learn HTML?</h2> <p>There are many reasons to learn how to use HTML and how to create a website.</p> <ul> <li> <p><a href="https://www.bls.gov/ooh/computer-and-information-technology/web-developers.htm"><strong>It's a marketable skill.</strong></a> The BLS predicts an increase in job outlook much faster than the average. Web developers earned around $68,000/year, lower than the average for computer science occupations, but nearly twice the average income for all occupations.</p> </li> <li> <p><strong>It's fun</strong>. Or at least, it can be. Web design is like video-gaming; in both, the fun comes from the satisfaction of overcoming a challenge.</p> </li> <li> <p><strong>It's useful.</strong> Some of the target audience for this article may want a website on which they can display information about themselves or blog about a hobby (as I do on this website). In this case, learning HTML can be useful</p> </li> </ul> <h2>Scope of this series</h2> <p>This series will include specifically what I know. I am particularly unskilled in Javascript (I know enough to get by, but I should learn more). Instead, I am specifically talking about HTML and CSS here.</p> <h2>Getting started</h2> <p>HTML is a <em>markup language</em>. That means it's a way to store documents. Compared to other markup languages (like those used by Microsoft Word), HTML has support for <em>stylesheets</em>(sets of rules used to determine the document's look) and <em>scripts</em>(like macros, but way better), and it's designed to be edited in a text editor. HTML is the official markup language of the Web.</p> <p>HTML is made up of tags which consist of an opening tag, enclosed with &lt; and &gt;, and a closing tag enclosed with &lt;/ and &gt;.</p> <p>Every HTML document must include the following:</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;/head&gt; &lt;body&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> <p>Let's break this down, shall we?</p> <p><code>&lt;!DOCTYPE html&gt;</code> tells the browser that this is an HTML file. It also enables the compatibility options in most browsers.</p> <p><code>&lt;html&gt;</code> and <code>&lt;/html&gt;</code> determine where the document starts and ends.</p> <p><code>&lt;head&gt;</code> and <code>&lt;/head&gt;</code> are the start and end of some information for web browsers about the page.</p> <p><code>&lt;meta charset="utf-8"&gt;</code> tells the browser what to do with special characters like emojis and the copyright symbol.</p> <p><code>&lt;body&gt;</code> and <code>&lt;/body&gt;</code> determine the start and end of what's visible on the page. This is the most important section of a page.</p> <h2>Your first webpage</h2> <p>HTML consists of different tags determining the start and end of certain types of content. Let's start with the traditional first project, which begins with the template mentioned earlier:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;/head&gt; &lt;body&gt; &lt;/body&gt; &lt;/html&gt;</code></pre> <p>Now, add the following between the <code>&lt;body&gt;</code> tags:<br /> <code>&lt;p&gt;Hello, world!&lt;/p&gt;</code></p> <p>The <code>&lt;p&gt;</code> and <code>&lt;/p&gt;</code> determine where a paragraph starts and ends. Paragraphs are automatically spaced. You can place any text within the paragraph.</p> <p>Save your file and open it in a browser. You should see &quot;Hello, world!&quot;.</p> <p>I hope this article has been useful! <a href="learn-html-1-2">Read the next one</a>.</p> https://hypertextzone.net/blog/learn-html/learn-html-1-1 My web development workflow Tue, 06 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/my-workflow <h1>Get started</h1> <p>I made this site with <a href="http://picocms.org">PicoCMS</a>. Setting it up is more difficult than you might think. First, you need to download it (of course). Next, install and enable PHP and mod_rewrite on your Apache server (how that works differs by Linux distro). After installation, you have to add the following to <code>/etc/apache2/sites-enabled/000-default.conf</code>(or whatever your site conf is), below where it says <code>DocumentRoot /var/www/html</code>:</p> <pre><code>&lt;Directory /var/www/html&gt; AllowOverride All &lt;/Directory&gt;</code></pre> <p>You also have to edit your apache2.conf (or httpd.conf); add this at the end.</p> <pre><code>LoadModule php7_module modules/libphp7.so &lt;FilesMatch \.php$&gt; SetHandler application/x-httpd-php &lt;/FilesMatch&gt;</code></pre> <p>Installing PicoCMS is as simple as downloading it and extracting the archive into <code>/var/www/html</code>.</p> <h1>Managing Content</h1> <p>Pico is a pretty good flat file CMS once set up.</p> <p>I like to mount my site as a directory with SSHFS:</p> <p><code>sshfs -o IdentityFile=~/your/cryptographic/id root@example.org:/var/www/html /convenient-mountpoint</code></p> <p>This way I can easily modify content on the site using my own software.</p> <p>Content is in mixed Markdown and YAML, found in the <code>content</code> folder. I like to use <a href="https://marktext.github.io/website/">Mark Text</a> as my editor.</p> <p>Themes are Twig templates found in <code>themes/theme-name</code> with Pico's variables, all of which can be found in the official docs. I just use an HTML editor for Twig.</p> <p>Config is a mix of YAML and PHP.</p> <h1>Conclusion</h1> <p>To be honest, I'm actually starting to prefer Pico to major solutions like Wordpress. It's more convenient to install (being flat-file), and is secure by design.</p> <p>I also like to do things myself, and Pico gives me a lot of control over things. I get to use a desktop editor instead of a webapp.</p> https://hypertextzone.net/blog/ivans1/my-workflow Vertically Centering Text Tue, 06 Nov 2018 00:00:00 +0000 https://hypertextzone.net/blog/ivans1/vertical-center <h1>Vertically centering text in CSS</h1> <p>Vertically centering text is very difficult to pull off. CSS has no official support, except in flexbox.</p> <p>So here's how I do it on my website.</p> <pre><code>.parent { position: relative; } .child { position: absolute; top: 50%; transform: translateY(-50%); }</code></pre> <p>The old translateY trick is not without issues, but it works for most use cases. Others can play around with Flexbox.</p> https://hypertextzone.net/blog/ivans1/vertical-center