Search code examples
phpjavascriptajaxweb-applicationswindows-8

Create Webpage like Windows 8 Start Screen (Newbie)


First, I am a high-schooler and a very new programmer (think CS101 level). In my free time (sadly limited), I want to try some project to encourage me to learn more, and I have an interesting idea.

I'm not sure if this is the right place to ask, but I'm wondering if anyone could get me pointed in the right direction. I want to make a web site that looks similar to the Windows 8 Start Screen (here is a link to an image, if, for some reason, you don't know what it looks like).

The idea is have similar block-like objects of varying lengths (maybe not as neat of a grid as Windows 8 has) that one can scroll though horizontally, and that can have some "active" things on them. Clicking on one could use some AJAX techniques to either change to another menu, or open an information window on the page. Kind of like how Outlook/Hotmail can change screens without reloading. The information for the box items would probably come from a database.

I have a small amount of experience in PHP, MySQL, and JavaScript - enough to understand some code and write simple scripts. What should I focus on learning for my idea of a project? I'm just looking for a roadmap of things to study.

Thanks!


Solution

  • You can mock up the win8 look with css and 2 image widths and whether its a normal or wide item just add the extra class to the style. With jQuery you can make the icons/page drag-able ect, with a bit of work you could simply measure the width and load more content via ajax much like lazy load but horizontal, use the ondblclick="" to initiate loading of the app/content, this is what I come up with in 30min. Source & images

    enter image description here

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>basic win8</title>
    <style>
    *{font-family: "Segoe UI", Frutiger, "Frutiger Linotype";}
    body{background-image:url('Win8Background.jpg');}
    
    #wrapper {
        width: 70%;
        padding: 0px;
        margin-left:auto;
         margin-right:auto;
    }
    .sortable-list li {
        padding: 4px;
        margin: 4px;
        float: left;
        border: 1px solid black;
        list-style-image: none;
        list-style: none;
        list-style-type: none;
        background-color:#204558;
    }
    
    #dashboard-layout .item.normal {
        width: 100px;
        height: 100px;
    }
    
    #dashboard-layout .item.wide {
        width: 224px;
        height: 100px;
    }
    
    .item.normal p{
    margin:0px;
    padding: 0px;
    }
    
    .item.wide p{
    margin:0px;
    padding: 0px;
    }
    
    h1{color:white;}
    
    #left_head{width:45%; float:left;}
    #right_head{width:45%; float:right; text-align:right;margin-right:15px;}
    </style>
    
    <script type="text/javascript" src="jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="jquery-ui-1.8.23.custom.min.js"></script>
    <script type="text/javascript">
    function update_columns() {
        var positions = []
        $("#dashboard-layout .item").each(function() {
            var $item = $(this);
            positions.push($item.attr('id'));
        });
        $.post("./", { 'positions[]': positions },
            function(data) {
                alert("Update Success - New positions:" + positions);
            }
        );
    }
    
    $(function() {
        $("ul.sortable-list").sortable({
            connectWith: "#wrapper",
            placeholder: 'ui-state-highlight',
            tolerance: 'pointer',
            revert: true,
            forcePlaceholderSize: true,
            forceHelperSize: true,
            update: update_columns,
        }).disableSelection();
    });
    </script>
    
    </head>
    
    <body>
    
    <div id="left_head"><h1>Start</h1></div>
    <div id="right_head"><h1>Lawrence Cherone</h1></div>
    <div style="clear:both;"></div>
    
    <div id="wrapper">
    
    <ul class="sortable-list" id="dashboard-layout">
    
        <li id="a" ondblclick="" class="item normal" style="background-image:url(xbox.png); background-size:110px">
        content a
        </li>
    
        <li id="b" ondblclick="" class="item normal" style="background-image:url(xbox.png); background-size:110px">
        content b
        </li>
    
        <li id="c" ondblclick="" class="item wide" style="background-image:url(photos.png); background-size:224px">
        content c
        </li>
    
        <li id="d" ondblclick="" class="item wide" style="background-image:url(photos.png); background-size:224px">
        content d
        </li>
    
        <li id="e" ondblclick="" class="item wide" style="background-image:url(photos.png); background-size:224px">
        content e
        </li>
    
        <li id="f" ondblclick="" class="item normal" style="background-image:url(xbox.png); background-size:110px">
        content f
        </li>
    
        <li id="g" ondblclick="" class="item normal" style="background-image:url(xbox.png); background-size:110px">
        content g
        </li>
    
        <li id="h" ondblclick="" class="item wide" style="background-image:url(photos.png); background-size:224px">
        content h
        </li>
    
        <li id="i" ondblclick="" class="item wide" style="background-image:url(photos.png); background-size:224px">
        content i
        </li>
    
        <li id="j" ondblclick="" class="item normal" style="background-image:url(xbox.png); background-size:110px">
        content j
        </li>
    
        <li id="k" ondblclick="" class="item wide" style="background-image:url(photos.png); background-size:224px">
        content k
        </li>
    </ul>
    
    </div>
    
    </body>
    </html>