Submissions from 2015-02-07 to 2015-02-08 (5 total)

Worked on an old prototype I had lying around. Might try and finish it for the 'finish your game' itch.io jam...maybe.

It's what can be described as a bit buggy, but I've got the painting working in the map editor.

The brush position is wrong but it kinda sort works.

Pretty much the bulk of the mobile UI work is done. Need to hook it up tomorrow but thats a simple copy and paste of the code from the old client. Should hook in pretty clean. Though I've figured I'm going to process the data more in the DB than depend on the client because some text transforms are easier to perform than others.

Go

A submission for Code @Home 13

I've got the itch to make a Go library. Without saying too much about it (in case I never release it) it could at some point be part of a web framework.

Ahh damn, haven't posted in 3 days but TECHNICALLY speaking I only really missed yesterday, that's a bit disappointing. In any case, I've got child nodes working! You can now place components within components which I think is really neat. The perfect example of where you might want this is the typical navigation dropdown dropdown pattern(1). Instead of having a UL inside your first level LI tag, your code would just be something like this:

Nav
{
    Nav_Item(label = "Home", source = "<a href="http://<a href=" http:="" <a="">www.google.com</a>">www.google.com">www.google.com")
    {
    }
    Nav_Item(label = "About Us", source = "www.google.com") 
    {
        Nav_Item(label = "What We Do", source = "www.yahoo.com") 
        {
        }
    }
    Nav_Item(label = "Contact Us", source = "www.google.com");
}

The actual components used in this layout however, are defined as so:

def Link 
{
    attributes
    {
        element = "a";
        href = source;
    }

    variables
    {
        source = "";
    }
}

def Nav
{
    attributes
    {
        element = "ul";
        class = "nav";
    }


    styles
    {
        self
        {
            list-style: none;
            margin: 0;
            padding: 0;
        }
    }
}


def Nav_Section
{
    attributes
    {
        element = "ul";
        class = "nav-sub";
    }


    styles
    {
        self
        {
            position: relative;
            left: 0;
            top: 0;
            display: none;
            width: 100%;
            margin: 0;
            padding: 0;
        }
    }
}


def Nav_Item
{
    attributes
    {
        element = "li";
        class = "nav-item";
    }


    variables
    {
        label = "";
        source = "";
    }


    styles
    {
        self
        {
            position: relative;
        }


        // todo(SW): replace .nav-sub with ability to just use component names
        // ie. self:hover > Nav_Section
        self:hover > .nav-sub 
        {
            display: block;
        }
    }


    layout
    {
        self
        {
            Link(source = source)
            {
                // use 'label' variable
                label;
            }
            // Only display these sub-elements if I have children
            if (children.count)
            {
                Nav_Section
                {
                    children;
                }
            }
        }
    }
}

As you can see, this has the capability to abstract your code in a much neater way as well as coupling your HTML and CSS closer together.

(1) http://osvaldas.info/drop-down-navigation-responsi...