vishwamano

source of vishwamano.com
git clone git://git.ricketyspace.net/vishwamano.git
Log | Files | Refs

commit 43882d807f5a1b20b6fd1a78a4cf61da289a28fc
parent b01c7616b6762b67b8e71fe18c69013be8642ebf
Author: rsiddharth <s@ricketyspace.net>
Date:   Mon,  5 Nov 2018 21:58:06 -0500

Update index.php.

Rewrite without using smarty.

* index.php: Update file.
* init.php: New file.
* parts/aside.php: New file.
* parts/footer.php: New file.
* parts/frontpage.php: New file.
* parts/header.php: New file.
* parts/js.php: New file.

Diffstat:
index.php | 49+++++++++++++++----------------------------------
init.php | 17+++++++++++++++++
parts/aside.php | 22++++++++++++++++++++++
parts/footer.php | 20++++++++++++++++++++
parts/frontpage.php | 66++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
parts/header.php | 55+++++++++++++++++++++++++++++++++++++++++++++++++++++++
parts/js.php | 1+
7 files changed, 196 insertions(+), 34 deletions(-)

diff --git a/index.php b/index.php @@ -1,42 +1,23 @@ <?php -/* Vishwamano.com PHP snafu. +/** + * License: CC0-1.0 + */ - Copyright (C) 2014 rsiddharth <rsiddharth@ninthfloor.org> - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - COPYING contains the full text of the GNU Affero General Public - License. If you have not recieved a copy of the file along with - this program, see <http://www.gnu.org/licenses/>. - -*/ - - -require_once('./templating.php'); -require_once($abs_path . '/utils.php'); +require_once('./init.php'); $title = 'Vishwa Mano Photography'; $meta_keywords = 'Vishwa, Mano, Manoharan, Basic, Advanced, Photography, Workshops, Class, Chennai, Wildlife, Nature, Photographer'; -$meta_desc = 'Mind of an Engineer and Soul of an Artist, Vishwa Manoharan loves to escape the urban jungle every now and then to explore and photograph Nature and Wildlife.'; - -$image_directory = $abs_path . '/images/carousel/'; -$images = get_images($image_directory); -$carousel = array('imgs' => $images, - 'path' => '/images/carousel'); - -$smarty->assign('carousel', $carousel); -$smarty->assign('title', $title); -$smarty->assign('meta_keywords', $meta_keywords); -$smarty->assign('meta_description', $meta_desc); -$smarty->display('frontpage.tpl'); +$meta_desc = 'Mind of an Engineer and Soul of an Artist,' + . ' Vishwa Manoharan loves to escape the urban jungle every' + . ' now and then to explore and photograph Nature and' + . ' Wildlife.'; +$images = get_images('./images/carousel/'); + +require(PARTS . 'header.php'); +require(PARTS . 'frontpage.php'); +require(PARTS . 'aside.php'); +require(PARTS . 'footer.php'); +?> diff --git a/init.php b/init.php @@ -0,0 +1,17 @@ +<?php + +/** + * License: CC0-1.0 + */ + +/** + * Constants + */ +define('VM', $_SERVER['DOCUMENT_ROOT'] . '/'); +define('PARTS', VM . 'parts/'); + +/** + * Stuff. + */ +require_once(VM . 'utils.php'); +?> diff --git a/parts/aside.php b/parts/aside.php @@ -0,0 +1,22 @@ +<hr class="hr-long"/> + +<div id="aside-row" class="row"> + <div class="col-sm-offset-4 col-sm-4 sitouch"> + <h2 class="margin-top text-center">Stay in touch</h2> + <hr class="hr-short" /> + <ul id="stay-in-touch" class="list-inline text-center"> + <li> + <a href="https://www.instagram.com/beyond.the.mirage"> + <i class="fa fa-instagram"></i> + </a> + </li> + <li> + <a href="mailto:vishwa91photography@gmail.com"> + <i class="fa fa-envelope"></i> + </a> + </li> + </ul> + </div> <!-- sitouch end --> +</div> <!-- aside row end --> + +<hr class="hr-long"/> diff --git a/parts/footer.php b/parts/footer.php @@ -0,0 +1,20 @@ + <footer class="footer"> + <div class="container-fluid footer-overlay"> + <p> + Copyright &copy; 2018 + <a href="http://vishwamano.com/"> + Vishwa Manoharan + </a> + <a href="http://creativecommons.org/licenses/by-nc-nd/4.0/"> + <img alt="[ Creative Commons License BY-NC-ND ]" + style="border-width:0; padding-left: 2px;" + src="/themes/bs3/img/cc-by-nc-nd.png" /> + </a> + </p> + <p class="colophon"> + <a href="/colophon">Colophon</a> + </p> + </div> + </footer> + </body> +</html> diff --git a/parts/frontpage.php b/parts/frontpage.php @@ -0,0 +1,66 @@ +<div class="container-fluid"> <!-- top container start --> + <div id="vm-static-img" class="row"> + <div class="col-sm-12"> + <img class="img-responsive center-block" + src="/images/carousel/<?=$images[0]?>" + alt="[ VishwaMano.com Front Page Image ]"> + </div> + </div> + + <div class="row"> + <div class="col-sm-12 vegas-container"> + </div> + </div> +</div> + +<script> + function startVegas() { + $('#vm-static-img').addClass('hidden'); + var screenWidth = $(window).width(); + var screenHeight = $(window).height(); + var vegasHeight = screenHeight; + + var vegasWidth = ((vegasHeight * 3) / 2.0); + + while(vegasWidth > screenWidth) { + vegasHeight = vegasHeight - 1; + vegasWidth = ((vegasHeight * 3) / 2.0); + } + + if(vegasWidth > 1200 || vegasHeight > 800) { + vegasWidth = 1200; + vegasHeight = 800; + } + + var vegasLeft = ((screenWidth - vegasWidth) / 2.0); + if(vegasLeft < 0) + vegasLeft = 0; + + // setup hr lines. + if($(window).width > 768) + $('.hr-long').css('width', vegasWidth); + else + $('.hr-long').css('width', vegasWidth - 20); + + $('.vegas-container').css('width', vegasWidth); + $('.vegas-container').css('height', vegasHeight); + $('.vegas-container').css('left', vegasLeft); + $('.vegas-container').css('right', vegasLeft); + $('.vegas-container').vegas({ + delay: 4900, + timer: false, + shuffle: false, + transition: 'fade', + transitionDuration: 4900, + animationDuration: 4900, + slides: [ + <?php foreach($images as $image) { ?> + { src: '/images/carousel/<?=$image?>' }, + <?php } ?> + ], + animation: 'random', + }); + } + $(document).ready(startVegas); + $(window).resize(startVegas); +</script> diff --git a/parts/header.php b/parts/header.php @@ -0,0 +1,55 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + + <?php if ($meta_keywords) { ?> + <meta name="keywords" content="$meta_keywords"> + <?php } ?> + + <?php if ($meta_desc) { ?> + <meta name="description" content="$meta_description"> + <?php } ?> + + <title><?=$title?></title> + <link href="/themes/bs3/css/style.min.css" rel="stylesheet" media="screen"> + </head> + <body> + + <?php require(PARTS . 'js.php'); ?> + + <nav id="vm-navbar" class="navbar navbar-default"> + <div class="container-fluid"> + <!-- Brand and toggle get grouped for better mobile display --> + <div class="navbar-header"> + <button type="button" class="navbar-toggle collapsed" + data-toggle="collapse" + data-target="#vm-navbar-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand visible-xs" href="/"> + <img class="img-responsive" + src="/themes/bs3/img/vm-logo.jpg" + alt="[ Vishwa Mano Photography ]" /> + </a> + </div> + + <!-- Collect the nav links, forms, and other content for toggling --> + <div class="collapse navbar-collapse" id="vm-navbar-collapse"> + + <ul class="nav navbar-nav"> + <li class="vm-nav-item" id="nav-link-wildlife-mammals"><a href="/gallery/wildlife/mammals">Mammals<span>Gallery</span></a></li> + <li class="vm-nav-item" id="nav-link-wildlife-birds"><a href="/gallery/wildlife/birds">Birds<span>Gallery</span></a></li> + <li class="vm-nav-item" id="nav-link-landscapes"><a href="/gallery/landscapes">Landscapes<span>Gallery</span></a></li> + <li class="vm-nav-logo-middle hidden-xs" id="nav-link-home"><a href="/"><img src="/themes/bs3/img/vm-logo.jpg" alt="[ Vishwa Mano Photography ]" /></a></li> + <li class="vm-nav-item" id="nav-link-macro"><a href="/gallery/macro">Little World<span>Gallery</span></a></li> + <li class="vm-nav-item" id="nav-link-pc"><a href="/as/">A&amp;S</a></li> + <li class="vm-nav-item" id="nav-link-bio"><a href="/bio/">Bio</a></li> + </ul> + </div><!-- /.navbar-collapse --> + </div><!-- /.container-fluid --> + </nav> diff --git a/parts/js.php b/parts/js.php @@ -0,0 +1 @@ +<script type="text/javascript" src="/themes/bs3/js/vm.min.js"></script>