Building a responsive Web Comic

Live Site Address: http://www.thedreamreaper.net

The Dream Reaper is a new webcomic being published online by Artist and Illustrator Augustinas Naslenas, working from his studio in Sheffield. This is a brief exploration of the code I used to make the site and some background. I will transform it into a tutorial in the coming week, but for now it is annotated code with some information / rough description.

Design Proposal

Gus approached me about a month or so ago to see if I could assist him with his vision with Dream Reaper, we had met randomly at a show he was doing at a Sheffield gallery and had a chat about Terrence Mckenna, technology and plants, so I knew that this guy was a fellow I had a lot in common with haha, his art piece also wowed me with it’s mix of the futuristic, the sacred and the ancient / occult symbolism and I recognised him as an artist engaged in work that was of much interest.

He proposed creating a multi-platform, responsive template for a webcomic he had in the pipeline, based around ideas of Shamanism, journeying and dreamwork. This naturally to me sounded like an amazing idea and challenge, so I jumped at the chance to approach it with my knowledge and experience of designing for the web.

The initial brief was clear, but it was going to be challenging in some respects, these respects being the way each strips had to nicely scroll on all devices (Tablet / Mobile / Desktop etc) and how to present that best was a key element, and had to be central to the sites design. The website also provided some interesting presentation / UX / UI questions – how to present the strip, but also how best to display chapters and navigation etc.

What follows is an exploration into the main technical implementations on the site thus far and some context and explanation of what the code is doing. It’s the first time I’ve done a more technical / in-depth blog like this, so please give me feedback if you have any. I am still looking to develop this website still further, so please bear in mind that whilst the website is up and running, there are still some incremental improvements to be made, so this does not reflect the final version of the code, which I am looking to next convert into a WordPress theme. Now with that preamble out the way….

Dependencies

[snippet slug=head lang=html]

Layout and Design of Dream Reaper

The first challenge and the major one to tackle straight away was the representation of the strips themselves as part of the main interface, Gus wanted ideally a responsive horizontal strip that would scale appropriately, maintaining maximum readability across all devices. I decided to use Bootstrap to create a basic layout (Using bootstrap pre-defined layout classes such as container / row fluid etc ) with container and a sidemenu.

The code for the HTML5 layout and associated presentation CSS (defined in Custom CSS) for responsiveness is displayed blow with annotations.

Layout HTML for comic Image/s

[snippet slug=762 lang=html]

Notes: Images have to be inserted into div as they are presented or else it creates a gap between images, breaking the design somewhat, seems to be a whitespace issue. The row fluid is a standard Bootstrap class that defines a row within the container div above it. The custom classes are “strip” and “scrollmenu” which in turn define that div as scrollable and defines some responsive and presentational css to ensure readability and scalability of the div / images within across all devices.

Each image also has it’s own class “make-it-fit”. .

The Button is for the menu to open up with an on click to trigger the openNav() javascript function which opens up the sidemenu.

Get onto that more below later…

Read CSS below for further context

CSS for presentation  of Comic Image/s

[snippet slug=css-for-strip-resize lang=css]

Next up is the layout and presentation / CSS and javascript controlling the side menu

Side Menu Layout HTML

[snippet slug=sidemenu lang=html]

Notes: See below for CSS context for classes. The div with class collapse chatpernav is the submenu for the chapter list that is opened via the datatoggle controls in bootstrap which you can read more about on the Bootstrap knowledge base 

CSS Sidemenu

[snippet slug=sidenav-css lang=css]

Custom Javascript

[snippet slug=custom-js-dream-reaper lang=javascript]

[snippet slug=reorient lang=javascript]

Notes: Two main function of the javascript here – top one two function simply control the sidemenu – showing and hiding it from view , and the other reloads the page when the orientation changes (was having a distortion issue when orientation changes from vertical to horizontal on mobile devices so this was required.

Future Developments of Dream Reaper

I am looking to next convert the dreamreaper code into a PHP WordPress template, which I will release as a general purpose template for people who want to publish web comics.

The website is online and working fine, but this remains the next stage in it’s development and in general, the next stage in the development of a theme for people who want to publish a web comic via wordpress which I think would be a nice addition.

Thanks for reading. Look for updates soon, I will be updating this blog over the next few weeks when time allows.