code on The Indie Web https://theindieweb.com/code/ Recent content in code on The Indie Web Hugo -- gohugo.io en-us Mon, 31 Aug 2020 09:00:00 +0000 A tower defense game, utilizing the power of CSS flexbox. https://theindieweb.com/a-tower-defense-game-utilizing-the-power-of-css-flexbox./ Mon, 31 Aug 2020 09:00:00 +0000 https://theindieweb.com/a-tower-defense-game-utilizing-the-power-of-css-flexbox./ <p><img src="https://tiw.accelerator.net/flexboxdefense.png;resize(450,400,fit)/quantize(10)/quality(60).png" alt="Flexbox Defense"></p> <p>Whether you&rsquo;re the master of flexbox or someone who&rsquo;s looking to learn, <a href="http://www.flexboxdefense.com/">flexbox defense</a> by <a href="https://twitter.com/ChanningAllen">Channing Allen</a> is the game for you. Although it&rsquo;s been around for a while (5 years!) its lessons are as relevant as ever.</p> Typography in 3d, reminiscent of the glorious days of WordArt. https://theindieweb.com/typography-in-3d-reminiscent-of-the-glorious-days-of-wordart./ Wed, 26 Aug 2020 13:00:00 +0000 https://theindieweb.com/typography-in-3d-reminiscent-of-the-glorious-days-of-wordart./ <p><img src="https://tiw.accelerator.net/ztext.png;resize(450,400,fit)/quantize(10)/quality(60).png" alt="ztext"></p> <p>That&rsquo;s right, nows the time to move your text off the boring x and y axis, and leap into the 3d world of z(text).</p> <p><a href="https://bennettfeely.com/">Creative developer Bennett Feely</a> has created a hyper nifty library that will add that extra level of spice to your home page, landing page, titles &hellip; well, just about everywhere if I&rsquo;m honest.</p> Get Nostalgic with the Oregon Trail running in this Mac OS8 simulation https://theindieweb.com/get-nostalgic-with-the-oregon-trail-running-in-this-mac-os8-simulation/ Tue, 07 Jul 2020 13:00:00 +0000 https://theindieweb.com/get-nostalgic-with-the-oregon-trail-running-in-this-mac-os8-simulation/ <p><img src="https://tiw.accelerator.net/mac-js.jpg;resize(450,400,fit)/quantize(20)/quality(20).png" alt="Macintosh.js"></p> <p>That&rsquo;s right, we&rsquo;ve officially gone too far, developer <a href="https://github.com/felixrieseberg">Felix Rieseberg</a> has ported Mac OS8 (with some help) into an <a href="https://github.com/felixrieseberg/macintosh.js">Electron App</a> that you can download and run on your Mac, or PC.</p> A handy script to reverse your codes indentation, for a harder life https://theindieweb.com/a-handy-script-to-reverse-your-codes-indentation-for-a-harder-life/ Fri, 03 Jul 2020 13:00:00 +0000 https://theindieweb.com/a-handy-script-to-reverse-your-codes-indentation-for-a-harder-life/ <p><img src="https://tiw.accelerator.net/reversed-code.png;resize(450,400,fit)/quantize(20)/quality(20).png" alt="Code with Reverse Indentation"></p> <p>Have you been coding in easy mode? Well, now its time to flip into the upside-down, where your indents are backward and nothing makes sense.</p> Interested in DataViz? Shirley Wu's new series is a great place to start https://theindieweb.com/interested-in-dataviz-shirley-wus-new-series-is-a-great-place-to-start/ Mon, 15 Jun 2020 10:00:00 +0000 https://theindieweb.com/interested-in-dataviz-shirley-wus-new-series-is-a-great-place-to-start/ <p><img src="https://tiw.accelerator.net/datavis-with-shirley.png;resize(450,400,fit)/quantize(20)/quality(20).png" alt="Datavis With Shirley"></p> <p>If you&rsquo;ve got an interest in data visualization on the web, it&rsquo;s hard to look past Shirley Wu&rsquo;s fantastic work. Now you can follow along via video as she goes through her entire workflow from beginning to end.</p> GitHub has added profiles, here are the most creative ones so far! https://theindieweb.com/github-has-added-profiles-here-are-the-most-creative-ones-so-far/ Sat, 13 Jun 2020 13:00:00 +0000 https://theindieweb.com/github-has-added-profiles-here-are-the-most-creative-ones-so-far/ <p><img src="https://tiw.accelerator.net/github-profiles.png;resize(450,400,fit)/quantize(20)/quality(20).png" alt="Creative Github Profiles"></p> <p>GitHub has released a new feature allowing people to display a readme markdown file on their profile, while it seems like a small feature at first, people are turning this simple readme into some incredibly creative and funny profiles!</p> A scary fright in your developer console! https://theindieweb.com/a-scary-fright-in-your-developer-console/ Mon, 25 May 2020 11:00:00 +0000 https://theindieweb.com/a-scary-fright-in-your-developer-console/ <p><img src="https://tiw.accelerator.net/console-spider.png;resize(450,400,fit)/quantize(20)/quality(20).png" alt="A Spidery Suprise"></p> <p>I know its there to catch the bugs, but nope, nope nope.</p> <p>The self-proclaimed <a href="https://defaced.dev/web/the-buggiest-site-on-the-web/">buggiest site on the web</a> really takes the cake with this scary console-based beast (use <code>CMD + OPT + I</code> on Mac, or <code>CTRL + SHIFT + I</code> on Windows to open the console!)</p> There ain't no party like a domino party. https://theindieweb.com/there-aint-no-party-like-a-domino-party./ Sat, 16 May 2020 12:00:00 +0000 https://theindieweb.com/there-aint-no-party-like-a-domino-party./ <p><em>If only you could reset real-life dominoes with the click of a button</em></p> <p><img src="https://tiw.accelerator.net/dominoes.png;resize(450,400,fit)/quantize(32)/quality(20).png" alt="Domino mario takes a spill"></p> <p>This is probably the most fun you can have with dominoes without leaving your browser.</p> Experience your coding journey in 3d with with repo surf. https://theindieweb.com/experience-your-coding-journey-in-3d-with-with-repo-surf./ Sat, 16 May 2020 11:00:00 +0000 https://theindieweb.com/experience-your-coding-journey-in-3d-with-with-repo-surf./ <p><img src="https://tiw.accelerator.net/repo-surf.png;resize(450,400,fit)/quantize(32)/quality(20).png" alt="Flying high with repo surf"></p> <p>Ever wondered what your branches, merges &amp; commits would look like in the third dimension, well now you can find out.</p> Real vim users use vim cubed! https://theindieweb.com/real-vim-users-use-vim-cubed/ Tue, 31 Mar 2020 11:00:00 +0000 https://theindieweb.com/real-vim-users-use-vim-cubed/ <p>Has anyone ever stopped you on the street to show you their vim setup? Well, now you have the perfect reply with <a href="https://github.com/oakes/vim_cubed">vim cubed</a>.</p> <p>Vim Cubed will bring your code editing into the 3rd dimension, literally in the form of a spinning cube. As the cube spins infinitely, your editor works with all the gusto and power that vim can provide.</p> Beep beep bloop bloop - Listen to your webpage in action! https://theindieweb.com/beep-beep-bloop-bloop-listen-to-your-webpage-in-action/ Wed, 26 Feb 2020 09:00:00 +0000 https://theindieweb.com/beep-beep-bloop-bloop-listen-to-your-webpage-in-action/ <p>Debugging tools are better than ever, but some things still remain hidden to the un-observant eye&hellip; this small script is a delightful way to hear what webpages are doing behind the scenes.</p> <p>Accurately named <code>plink-plonk.js</code> by developer <a href="http://tomhicks.github.io">Tom Hicks</a>, <a href="https://gist.github.com/tomhicks/6cb5e827723c4eaef638bf9f7686d2d8">this small snippet</a> of JavaScript is a clever and simple way to create sounds from the browser whenever the webpage you&rsquo;re on modifies itself in any way. (For single-page apps, this will be a lot!)</p> <p>The script is activated by pasting it into your console (not always the best idea, if you can&rsquo;t understand all the code). Here&rsquo;s a quick video of it in action:</p> <blockquote class="twitter-tweet"><p lang="en" dir="ltr">Beep beep bloop bloop - Listen to your webpage load /w this nifty script by <a href="https://twitter.com/Hicksyfern?ref_src=twsrc%5Etfw">@hicksyfern</a> - <a href="https://t.co/2AcR7DTJBr">https://t.co/2AcR7DTJBr</a> <a href="https://t.co/V9DkagWmts">pic.twitter.com/V9DkagWmts</a></p>&mdash; The Indie Web (@the_indie_web) <a href="https://twitter.com/the_indie_web/status/1232852862776020992?ref_src=twsrc%5Etfw">February 27, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <p>The simplicity of the script, is based in both the power of the Web Audio API and the Mutation Observer API.</p> <p>So how does this work? Lets break it down!</p> Always judge a book by its cover, bits'n'pieces. https://theindieweb.com/always-judge-a-book-by-its-cover-bitsnpieces./ Tue, 18 Feb 2020 09:00:00 +0000 https://theindieweb.com/always-judge-a-book-by-its-cover-bitsnpieces./ <p>Last week I completed a small weekend project called <a href="http://alwaysjudgeabookbyitscover.com/">Always Judge a Book by its Cover</a>. Rather write about it, I thought it would be fun to go over some of the neater pieces of tech that have gone into it and break them down into small examples.</p> <p>The first, and perhaps the most obvious, is the goop effect that sits on the header and in between each of the books (alternating from white to a light grey). This is created using JS and a <code>canvas</code> element. (Although CSS Houdini could be a good option in the future.)</p> <script data-slug-hash="poJvZYL" data-height="300" data-default-tab="result" class='codepen' async src="//codepen.io/assets/embed/ei.js" ></script> <p>You can have a look at the code above&hellip; Ultimately, it&rsquo;s a fairly simple effect that definitely looks a little more complex than its actual code.</p> <p>The second little flair, which was a fun one to make, is the 3D CSS book.</p> <script data-slug-hash="gOpMBjL" data-height="300" data-default-tab="result" class='codepen' async src="//codepen.io/assets/embed/ei.js" ></script> <p>The book gets its 3D effect from the CSS transform property. I used the <code>transform-style: preserve-3d;</code> property to really give it that semi-realistic feel. The pages are just divs with box shadows and rounded corners. And then to top it all off, an image of the cover is used on the front and back.</p> <p>The inline <code>padding-top</code> stops the image from jumping as it loads. There are <a href="https://css-tricks.com/what-if-we-got-aspect-ratio-sized-images-by-doing-almost-nothing/">lots of thoughts</a> on how to patch up this annoying part of loading images on the web, but I chose to stick with this old faithful method.</p> Run your tweet on a virtual 8-bit computer. https://theindieweb.com/run-your-tweet-on-a-virtual-8-bit-computer./ Fri, 14 Feb 2020 09:00:00 +0000 https://theindieweb.com/run-your-tweet-on-a-virtual-8-bit-computer./ <p>This is a true gem in the realm of <a href="https://theindieweb.com/tag/microcode/">microcode</a>. <a href="https://twitter.com/bbcmicrobot">BBC Micro Bot</a> is an amazing tweet-bot, with a simple premise. Just @ mention it in a tweet with some BASIC code, and it will reply with an animated rendering of the result.</p> <p>This project is fairly fresh, but already yielding fantastic results. I love the many ways such a small amount of code can result in something so beautiful and animated.</p> <blockquote class="twitter-tweet"><p lang="en" dir="ltr">Deploy your BASIC code to our 6502 data center in just one tweet. Welcome to 8-bit cloud 😜 <a href="https://t.co/ZmB1WIUx4C">pic.twitter.com/ZmB1WIUx4C</a></p>&mdash; BBC Micro πŸ¦‰ bot (@bbcmicrobot) <a href="https://twitter.com/bbcmicrobot/status/1227267937947541505?ref_src=twsrc%5Etfw">February 11, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <p>For the tweets below, you can see both the code and the outcome. I&rsquo;ve tried to identify and link out to the theory or idea behind the code if I can spot it easily.</p> <p>With all creative code&hellip; playing around with it is an incredible opportunity to learn while exploring your creative side! Remix, resend, and create something new! If you&rsquo;ve got something you&rsquo;re proud of, <a href="https://github.com/tholman/inspiring-online/blob/master/content/posts/2020-02-15-eight-bit-code.md">edit this post on GitHub</a> to share it!</p> <p>Here, we have <a href="https://en.wikipedia.org/wiki/Sierpi%C5%84ski_triangle">SierpiΕ„ski&rsquo;s Triangle</a>. It&rsquo;s amazing how much complexity can be pulled from recursive code!</p> <blockquote class="twitter-tweet"><p lang="und" dir="ltr"> <a href="https://t.co/g3ig6hzZbt">pic.twitter.com/g3ig6hzZbt</a></p>&mdash; BBC Micro πŸ¦‰ bot (@bbcmicrobot) <a href="https://twitter.com/bbcmicrobot/status/1226924794077159425?ref_src=twsrc%5Etfw">February 10, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <p>This is a great instance of a beautiful and beloved <a href="https://10print.org/">staple</a> in the world of generative code: <div class="highlight"><pre style="color:#272822;background-color:#fafafa;-moz-tab-size:4;-o-tab-size:4;tab-size:4"><code class="language-basic" data-lang="basic"><span style="color:#111">10</span> <span style="color:#00a8c8">PRINT</span> <span style="color:#00a8c8">CHR$</span><span style="color:#111">(</span><span style="color:#ae81ff">205.5</span><span style="color:#f92672">+</span><span style="color:#00a8c8">RND</span><span style="color:#111">(</span><span style="color:#ae81ff">1</span><span style="color:#111">));</span> <span style="color:#f92672">:</span> <span style="color:#00a8c8">GOTO</span> <span style="color:#111">10</span></code></pre></div> The randomization of two characters shows so much complexity and beauty!</p> <blockquote class="twitter-tweet"><p lang="und" dir="ltr"> <a href="https://t.co/XfUQR9U9sg">pic.twitter.com/XfUQR9U9sg</a></p>&mdash; BBC Micro πŸ¦‰ bot (@bbcmicrobot) <a href="https://twitter.com/bbcmicrobot/status/1228093563143180288?ref_src=twsrc%5Etfw">February 13, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <p>Random triangle generation, colors, and fills. Really such simple code that still sucks you into the screen!</p> <blockquote class="twitter-tweet"><p lang="und" dir="ltr"> <a href="https://t.co/qDwNMjyyYV">pic.twitter.com/qDwNMjyyYV</a></p>&mdash; BBC Micro πŸ¦‰ bot (@bbcmicrobot) <a href="https://twitter.com/bbcmicrobot/status/1227368897952829440?ref_src=twsrc%5Etfw">February 11, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <p>It&rsquo;s projects like this that really show how powerful visual code can be!</p> A super way to show off your stunning shaders. https://theindieweb.com/a-super-way-to-show-off-your-stunning-shaders./ Tue, 28 Jan 2020 09:00:00 +0000 https://theindieweb.com/a-super-way-to-show-off-your-stunning-shaders./ <p>If you&rsquo;ve ever looked into shaders, then you&rsquo;ve probably run into <a href="https://www.shadertoy.com/">Shadertoy</a>, a fantastic tool for building shaders in the browser, as well as a community for showing off what you&rsquo;ve made. That said, Shadertoy&rsquo;s aesthetic and appeal is directly targeted at developers who want the shader and its code.</p> <p><a href="https://cineshader.com/">CineShader</a>, is a layer over top of Shadertoy created by <a href="https://lusion.co/">Lusion</a>. It&rsquo;s a website built to share your shader with a broader audience. CineShader does this in a way that shows off more than just the art. It showcases the beauty and feel of the shader as though it&rsquo;s artwork on a wall.</p> <blockquote class="twitter-tweet"><p lang="en" dir="ltr">Today, we are launching CineShader - A cinematic shader visualiser! It is a little side project we created for the shader community using the <a href="https://twitter.com/Shadertoy?ref_src=twsrc%5Etfw">@Shadertoy</a> API. Retweet is appreciated.πŸ˜‰<br><br>πŸ‘‰<a href="https://t.co/1lCYNSnZVT">https://t.co/1lCYNSnZVT</a><a href="https://twitter.com/hashtag/webgl?src=hash&amp;ref_src=twsrc%5Etfw">#webgl</a> <a href="https://twitter.com/hashtag/threejs?src=hash&amp;ref_src=twsrc%5Etfw">#threejs</a> <a href="https://twitter.com/hashtag/shadertoy?src=hash&amp;ref_src=twsrc%5Etfw">#shadertoy</a> <a href="https://twitter.com/hashtag/cineshader?src=hash&amp;ref_src=twsrc%5Etfw">#cineshader</a> <a href="https://twitter.com/hashtag/realtime?src=hash&amp;ref_src=twsrc%5Etfw">#realtime</a> <a href="https://twitter.com/hashtag/webdesign?src=hash&amp;ref_src=twsrc%5Etfw">#webdesign</a> <a href="https://t.co/BjaSwi6qZO">pic.twitter.com/BjaSwi6qZO</a></p>&mdash; Lusion (@lusionltd) <a href="https://twitter.com/lusionltd/status/1222121803499393025?ref_src=twsrc%5Etfw">January 28, 2020</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <p>By creating a 3D scene, along with a dark shaded audience member, CineShader creates the tone and feel of being in a gallery, silently observing and enjoying a piece of work</p> Fifty-Two weeks of canvas creativity! https://theindieweb.com/fifty-two-weeks-of-canvas-creativity/ Sat, 25 Jan 2020 09:00:00 +0000 https://theindieweb.com/fifty-two-weeks-of-canvas-creativity/ <p><a href="https://canvas-cards.glitch.me/">Canvas Cards</a> is an amazing year-long project by <a href="https://twitter.com/friendofpixels">Luke Patton</a> which features weekly creations using HTML <code>&lt;canvas&gt;</code> elements. Each of the cards has a different set of inspirations, looks, aims, and goals. And wow are they beautiful!</p> <blockquote class="twitter-tweet"><p lang="en" dir="ltr">This week&#39;s card, another Hilma af Klint inspired piece. Grab the code and check out the full gallery here: <a href="https://t.co/upLwkNcfQl">https://t.co/upLwkNcfQl</a> <a href="https://twitter.com/hashtag/generative?src=hash&amp;ref_src=twsrc%5Etfw">#generative</a> <a href="https://twitter.com/hashtag/creativecoding?src=hash&amp;ref_src=twsrc%5Etfw">#creativecoding</a> <a href="https://t.co/pSgEnidwrO">pic.twitter.com/pSgEnidwrO</a></p>&mdash; Luke Patton (@friendofpixels) <a href="https://twitter.com/friendofpixels/status/1116782813632716800?ref_src=twsrc%5Etfw">April 12, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <p>The website itself also allows you to edit the code and re-run the preview in the browser, meaning you can get to play with each and every demo without cloning the repository.</p> <blockquote class="twitter-tweet"><p lang="en" dir="ltr">This week&#39;s card! Simple math, interesting results. Check out the source code and full gallery here: <a href="https://t.co/upLwkNcfQl">https://t.co/upLwkNcfQl</a> <a href="https://twitter.com/hashtag/generativeart?src=hash&amp;ref_src=twsrc%5Etfw">#generativeart</a> <a href="https://twitter.com/hashtag/creativecoding?src=hash&amp;ref_src=twsrc%5Etfw">#creativecoding</a> <a href="https://t.co/AwoXFMyFeo">pic.twitter.com/AwoXFMyFeo</a></p>&mdash; Luke Patton (@friendofpixels) <a href="https://twitter.com/friendofpixels/status/1200527692438941698?ref_src=twsrc%5Etfw">November 29, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <p>The different combinations of colors and styles have really kept the project amazingly interesting as it progressed throughout the year.</p> <p>For anyone who&rsquo;s ever tried to do something every week for an entire year, you know how difficult it can be, which really gives the project that extra special shine.</p> The best time to start tracking your year is now. https://theindieweb.com/the-best-time-to-start-tracking-your-year-is-now./ Tue, 07 Jan 2020 12:00:00 +0000 https://theindieweb.com/the-best-time-to-start-tracking-your-year-is-now./ <p>If you&rsquo;re the kind of person who likes beautiful graphs as well as keeping tight track of your life, this project is one for you.</p> <p><a href="https://year-in-pixels.glitch.me/">Year in Pixels</a> is a clever <a href="https://kinduff.com/">Alejandro AR</a> app with a minimalistic design that will allow you to track your mood throughout the year.</p> <p>For those now looking back at 2019 and worrying about 2020, <a href="https://www.goodtherapy.org/blog/5-good-reasons-to-chart-your-mood-changes-1019155">logging your daily mood</a> is a fantastic way to start your year off right. It not only allows you to spot patterns in your life, but also helps you recognize earlier when you&rsquo;re starting to wear down.</p> <blockquote class="twitter-tweet"><p lang="en" dir="ltr">I made a small tool using <a href="https://twitter.com/glitch?ref_src=twsrc%5Etfw">@glitch</a> so you can keep track of your mood using pixels <a href="https://t.co/Es9RHuhoTy">https://t.co/Es9RHuhoTy</a></p>&mdash; Alejandro AR (@kinduff) <a href="https://twitter.com/kinduff/status/954942816878284800?ref_src=twsrc%5Etfw">January 21, 2018</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <p>And if you&rsquo;ve noticed in the url, the app is built on Glitch! That means you can <a href="https://glitch.com/~year-in-pixels">remix it</a>, changing the design, colors, or whatever you desire.</p> Does this code make sense? No, not really. But wow is this demo nice! https://theindieweb.com/does-this-code-make-sense-no-not-really.-but-wow-is-this-demo-nice/ Sun, 05 Jan 2020 12:00:00 +0000 https://theindieweb.com/does-this-code-make-sense-no-not-really.-but-wow-is-this-demo-nice/ <p>When it comes to fitting amazing creations into the smallest amount of code possible, I don&rsquo;t think there are any better than <a href="http://www.p01.org/">Mathieu &lsquo;p01&rsquo; Henri</a>&hellip; And his most recent sketch, Night Train, is no exception.</p> <blockquote class="twitter-tweet"><p lang="en" dir="ltr">NIGHT TRAIN<br>A quick <a href="https://twitter.com/hashtag/pico8?src=hash&amp;ref_src=twsrc%5Etfw">#pico8</a> <a href="https://twitter.com/hashtag/tweetjam?src=hash&amp;ref_src=twsrc%5Etfw">#tweetjam</a><br><br>x=0::_::cls(13)srand()for i=0,44 do<br>z=64+3*sin(i/45)y=z+cos(i/2)*(9+z*z%61)x-=3<br>?&quot;Λ‡&quot;,x,rnd(128),6<br>u=x+2*sin(x/31)<br>for j=-9,rnd(4)+7 do line(u,y-9,x+j,y+4+i%9,1+flr(y%2)*5)end<br>?&quot;=&quot;,x,z,1<br>if(sin(x/84)&gt;.8)print(&quot;😐&quot;,x,z-2)<br>x%=134end<br>flip()goto _ <a href="https://t.co/ZQboc8Iet6">pic.twitter.com/ZQboc8Iet6</a></p>&mdash; Mathieu &#39;p01&#39; Henri (@p01) <a href="https://twitter.com/p01/status/1208545167894089728?ref_src=twsrc%5Etfw">December 22, 2019</a></blockquote> <script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script> <p>The scene, featuring a train rolling through a generative field dotted with grass and some windy trees, is really a mind blower&hellip; Especially considering the formula generating it consists of 242 characters, fitting inside the tweet!</p> <p>For real though, what is that emoji doing in there?</p> Elevation Lines https://theindieweb.com/elevation-lines/ Sat, 30 Jun 2018 00:00:00 +0000 https://theindieweb.com/elevation-lines/ Elevations of the world. Elevation Lines - by Damon Burgett