From: Andy Spencer Date: Fri, 17 Jun 2011 05:28:22 +0000 (+0000) Subject: Initial import X-Git-Url: http://pileus.org/git/?p=~andy%2Faweather-web;a=commitdiff_plain;h=49bfe2490d94cf946b9fd521c69ee1ea46a3ee67 Initial import --- 49bfe2490d94cf946b9fd521c69ee1ea46a3ee67 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ea1a3a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +*~ +*.o +*.cgi +*.swp +html.c diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..60d65f6 --- /dev/null +++ b/.htaccess @@ -0,0 +1,4 @@ +Options +ExecCGI +AddHandler cgi-script .cgi +RewriteEngine on +RewriteRule ^([a-z]*)$ 'index.cgi/$1' diff --git a/data/global.css b/data/global.css new file mode 100644 index 0000000..f65efc9 --- /dev/null +++ b/data/global.css @@ -0,0 +1,314 @@ +/* Clearn defaults */ +* { + margin: 0; + padding: 0; + outline: 0; + position: relative; +} + +h1, h2, h3, h4, h5, h6 { + font-weight: normal; +} + +a { + color: black; + text-decoration: none; +} + +a img { + border: none; +} + +ul { + display: block; +} + +/* Global styles */ +.content h1, h2 { + margin-top: 1em; +} +h3, h4, h5, h6 { + margin-top: 0.5em; +} +blockquote { + font-style: italic; + font-family: serif; +} +blockquote:before { + font-weight: bold; + content: '“'; +} +blockquote:after { + font-weight: bold; + content: '”'; +} +ul { + left: 30px; +} +span.code { + font-family: monospace; +} +div.code { + font-family: monospace; + background-color: #666; + border: solid 1px #222; + padding: 2px 6px 2px 6px; + margin-bottom: 5px; + color: white; + font-weight: bold; +} + +/* Layout */ +body { + background: fixed; + background-image: url('../images/main-bg.png'); + background-repeat: repeat-x; + background-color: white; + margin-left: auto; + margin-right: auto; + font-family: sans-serif; + width: 850px; + /* width: 80%; */ + +} + +/* Header stuff */ +.top { + height: 80px; + margin-top: 15px; + border-collapse: collapse; +} + +.top * { + float: left; +} + +.logo { + width: 130px; + z-index: 1; +} + +.title { + font-size: 22pt; + font-weight: bold; + font-style: italic; + font-family: 'DejaVu Sans', sans-serif; + color: #222; +} + +.nav { + position: absolute; + top: 45px; + left: 135px; + right: 0px; + z-index: 1; + height: 36px; + margin: 0 0px 0 30px; + padding: 0 15px 0 15px; + border-radius: 8px; + -moz-border-radius: 8px; + background-image: url("../images/nav-bg.png"); + box-shadow: 0px 2px 2px #a0a0ff; +} + +.nav .sep { + float: left; + clear: none; + display: block; + float: left; + width: 0px; + height: 36px; + border-left: solid 1px #222; + border-right: solid 1px #777; + margin: 0 10px 0 10px; +} + +.nav a { + display: block; + margin: 5px 7px 5px 7px; + padding: 2px; + font-size: 12pt; + font-weight: normal; + color: #f4f4f4; + border: solid 1px transparent; + border-radius: 4px; + -moz-border-radius: 4px; +} + +.nav a:hover { + text-decoration: underline; +} + +.nav a.cur { + background-color: #666; + border: solid 1px #888; + text-decoration: none; +} + +/* Content */ +.content { + background-color: white; + color: black; + margin-top: 20px; + padding: 24px; + border: solid 1px #bce; + border-top: solid 1px #abd; + border-radius: 8px; + -moz-border-radius: 8px; +} + +.content hr { + margin: 25px 0 25px 0; +} + +.content ul.left { + width: 250px; +} + +.content a { + text-decoration: underline; +} + +/* Footer */ +.footer, .footer * { + text-align: center; + font-size: 8pt; + margin-top: 5px; + color: #444; +} +.footer a { + text-decoration: underline; +} + +/*********************** + * Page specific stuff * + ***********************/ +/* Index page */ +.buttons { + float: right; + width: 200px; + margin-left: 25px; +} + +.buttons > * { + margin-bottom: 10px; +} + +.download { + display: block; + height: 62px; + color: white; + padding: 8px 10px 8px 10px; + background-image: url("../images/dl-bg.png"); + border-radius: 10px; + -moz-border-radius: 10px; + box-shadow: 0px 2px 2px rgba(0,0,0,0.30); +} + +.download:first-line { + font-weight: bold; + font-style: italic; + line-height: 2em; +} + +.download img { + position: absolute; + top: 10px; + right: 10px; +} + +.screen { + float: right; + margin-left: 25px; +} + +/* Screnshots */ +.gallery { + left: 0px; /* override ul */ + margin: 20px; + font-size: larger; +} +.gallery > * { + list-style: none; + text-align: center; + left: 0; + float: left; + width: 320px; + height: 350px; + margin: 15px; + padding-left: 15px; + padding-right: 15px; +} +.gallery a { + display: block; +} +.gallery img { + box-shadow: 0px 2px 6px #888; + margin-bottom: 4px; + float: none; + margin-left: 0px; +} + +/* News */ +.news { + margin-top: 20px; +} +.news dt { + clear: both; + font-weight: bold; +} +.news dd { + margin-left: 10px; + margin-bottom: 15px; +} +.note { + font-style: italic; + text-align: center; +} + +/* Downloads */ +li.linux, li.windows, li.macos { + list-style-type: none; + background-repeat: no-repeat; + padding-left: 50px; + margin: 10px 10px 20px 0; + clear: both; +} +li.linux { + background-image: url("../images/os-linux.png"); +} +li.windows { + background-image: url("../images/os-windows.png"); +} +li.macos { + background-image: url("../images/os-macos.png"); +} +dl.inline dt { + display: block; + float: left; + clear: both; + font-weight: bold; + width: 8em; +} +dl.inline dt:after { + content: ":"; +} +h1 + .note, +h2 + .note { + text-align: left; + margin-bottom: 10px; +} + +dl.inline dt { + display: block; + float: left; + clear: both; + font-weight: bold; + width: 8em; +} +dl.inline dt:after { + content: ":"; +} +dl.small dt { + width: 4em; +} diff --git a/html.ct b/html.ct new file mode 100644 index 0000000..af42dca --- /dev/null +++ b/html.ct @@ -0,0 +1,334 @@ +<% #include "html.h" %> + +<% /* Global functions */ %> +<% void print_header(void) { %> +Content-Type: application/xhtml+xml; charset=UTF-8 + +<% } %> + +<% void print_nav(const page_t *page, const page_t *cur) { %> + <% const char *class = page == cur ? " class=\"cur\"" : ""; %> + ><%= page->name %> +<% } %> + +<% void print_screen(char *name) { %> + + <%= name %> + +<% } %> + +<% void print_page(const page_t *page) { %> + + + + + AWeather<% if (page->name) printf(" - %s", page->name); %> + + + + + + +
+ + +

AWeather

+ +
+
+ <% page->print(); %> +
+
+ + + +<% } %> + +<% /* Normal Pages */ %> +<% void print_about(void) { %> +

+ To the best of my knowledge, all the weather related programs currently + available for Linux are either very simple and provide little + meteorological information or are huge, ancient, or proprietary beasts + created for the National Weather Service. AWeather is made to fill the + gap by providing lots of weather information while still using standard + free software practices. As such, the research focus of this software + is weather, not creative way to write software. +

+
+

Intended Features

+ + +

Status

+
Now that it's spring again, progress on AWeather is continuing.
+

Working

+ +

Todo

+ +<% } %> + +<% void print_news(void) { %> +
+
2011-06-13
+
Started work on this new website. Lots of progress in AWeather as well:
    +
  • Merged support for isosurfaces to the main branch (Finally!)
  • +
  • Added an option to automatically refresh after a timeout
  • +
  • New fullscreen mode
  • +
+ +
2010-05-17
+
AWeather 0.4.1:
    +
  • Win32 fixes and improved debug support
  • +
  • Fix bug with daylight savings time
  • +
  • Function to clear old cache entries
  • +
+ +
2010-05-14
+
AWeather 0.4:
    +
  • Conus radar images
  • +
  • Multiple radars support
  • +
  • Gentoo, Ubuntu, MS Windows and source packages are available
  • +
+ +
2009-11-09
+
AWeather 0.3.0 released, based on libgis but still rather + buggy.
+ +
2009-10-24
+
AWeather 0.2.3 (maintenance release).
+ Added a Application menu entry and a few build/runtime fixes.
+ +
2009-09-02
+
The source repository has been migrated to Git. A lot of + progress is being made on libgis, which is now able to display + a virtual globe using data from NASA servers.
+
+

See also: AWeather's gitweb

+<% } %> + +<% void print_screenshots(void) { %> +
+

+ AWeather provides consistent user interface that allows the + user to zoom in from a high level view of the entire Earth down + to regional and microscale views. +

+ +<% } %> + +<% void print_download(void) { %> +

Stable release

+

+ While AWeather won't be considered stable until version 1.0,
+ these are as close to stable as you can get until then +

+ + +

Unstable releases

+

Pre-releases, betas, and other hazardous software

+
+

Check out the releases directory for any potential updates

+

Pre-releases are labeled with a -p0 and are mainly build for testing the Windows packages

+
+ +

Development code

+

+ Development code is available from Git, and from gitweb + (AWeather, + Grits, + RSL) +

+
+
git clone git://lug.rose-hulman.edu/proj/aweather
+
git clone git://lug.rose-hulman.edu/proj/grits
+
git clone git://lug.rose-hulman.edu/~spenceal/rsl
+
+<% } %> + +<% void print_development(void) { %> + + +

+ The AWeather development wiki + is the main resource for development material. +

+ +

Bug report and feature requests

+
+

New issue

+

Open issues

+
+ +

How to contribute?

+ + +

Building AWeather

+

See the install wiki page for more details

+ + +

Architecture Overview

+ +<% } %> + +<% void print_grits(void) { %> +

Grits

+

Grits is a Virtual Globe library developed along side AWeather, but + can be used by other programs as well.

+

It is differentiated from other Virtual Globes such as Google Earth, + NASA World Wind, and KDE Marble in that it is developed as a library + that is used by other programs, such as AWeather, rather than + providing a user interface that is used directly.

+ +<% } %> + +<% /* Footer Pages */ %> +<% void print_contact(void) { %> +

Contact

+

Questions? Comments? Trouble compiling AWeather?

+
+
Email
Andy Spencer
+
IRC
#rhlug@irc.freenode.net
+
+<% } %> + +<% void print_legal(void) { %> +

Legal

+<% } %> + +<% /* Special Pages */ %> +<% void print_index(void) { %> +

+ AWeather is designed to be an advanced weather program which is + designed to be used by weather enthusiasts. AWeather is not + another weather dockapp that simply displays a pre-computed + forecast. It is designed to be an easy to use program that + integrates a variety of weather data in simple unified + interface; see features for more details. +

+
+ <% print_screen("meso"); %> +
+ +

Download

+

AWeather 0.5-p0 source

+ +
+ +

Download

+

AWeather 0.5-p0 source

+ +
+
+ Features: + +<% } %> + +<% void print_notfound(void) { %> +

404 - Not found

+<% } %> diff --git a/html.h b/html.h new file mode 100644 index 0000000..ef99197 --- /dev/null +++ b/html.h @@ -0,0 +1,30 @@ +/* Types */ +typedef struct { + const char *link; + const char *name; + void (*print)(void); +} page_t; + +/* Data */ +extern page_t header[]; +extern page_t grits[]; +extern page_t footer[]; +extern page_t special[]; + +/* Global functions */ +void print_header(void); +void print_page(const page_t *which); + +/* Pages */ +void print_about(void); +void print_news(void); +void print_screenshots(void); +void print_download(void); +void print_development(void); +void print_grits(void); + +void print_contact(void); +void print_legal(void); + +void print_index(void); +void print_notfound(void); diff --git a/images/aweather.ico b/images/aweather.ico new file mode 100644 index 0000000..b3730fc Binary files /dev/null and b/images/aweather.ico differ diff --git a/images/dl-arrow.png b/images/dl-arrow.png new file mode 100644 index 0000000..264822f Binary files /dev/null and b/images/dl-arrow.png differ diff --git a/images/dl-bg.png b/images/dl-bg.png new file mode 100644 index 0000000..b3fed97 Binary files /dev/null and b/images/dl-bg.png differ diff --git a/images/logo.png b/images/logo.png new file mode 100644 index 0000000..29c9da4 Binary files /dev/null and b/images/logo.png differ diff --git a/images/main-bg.png b/images/main-bg.png new file mode 100644 index 0000000..fc7bbd6 Binary files /dev/null and b/images/main-bg.png differ diff --git a/images/nav-bg.png b/images/nav-bg.png new file mode 100644 index 0000000..975257e Binary files /dev/null and b/images/nav-bg.png differ diff --git a/images/os-linux.png b/images/os-linux.png new file mode 100644 index 0000000..17cdb9e Binary files /dev/null and b/images/os-linux.png differ diff --git a/images/os-macos.png b/images/os-macos.png new file mode 100644 index 0000000..ecc6a52 Binary files /dev/null and b/images/os-macos.png differ diff --git a/images/os-windows.png b/images/os-windows.png new file mode 100644 index 0000000..e04f057 Binary files /dev/null and b/images/os-windows.png differ diff --git a/index.c b/index.c new file mode 100644 index 0000000..d66adff --- /dev/null +++ b/index.c @@ -0,0 +1,50 @@ +#include +#include "html.h" + +/* Page data */ +page_t header[] = { + {"about", "About", print_about}, + {"news", "News", print_news}, + {"screenshots", "Screenshots", print_screenshots}, + {"download", "Download", print_download}, + {"development", "Development", print_development}, + {NULL, NULL, NULL}, +}; +page_t grits[] = { + {"grits", "Grits", print_grits}, + {NULL, NULL, NULL}, +}; +page_t footer[] = { + {"contact", "Contact", print_contact}, + {"legal", "Legal", print_legal}, + {NULL, NULL, NULL}, +}; +page_t special[] = { + {"index.cgi", NULL, print_index}, + {"notfound", "Not found", print_notfound}, + {NULL, NULL, NULL}, +}; +page_t *everything[] = {header, grits, footer, special, NULL}; +const page_t *index = &special[0]; +const page_t *notfound = &special[1]; + +/* Main */ +int main(int argc, char **argv) +{ + print_header(); + + const gchar *name = g_getenv("PATH_INFO"); + if (name == NULL || name[0] == '\0' || name[1] == '\0') + return print_page(index), 0; + + /* Look up a specific page */ + for (int i = 0; everything[i]; i++) + for (int j = 0; everything[i][j].link; j++) { + page_t *page = &everything[i][j]; + if (g_str_equal(page->link, name+1)) + return print_page(page), 0; + } + + /* 404 */ + return print_page(notfound), 0; +} diff --git a/mkfile b/mkfile new file mode 100644 index 0000000..a0db4a4 --- /dev/null +++ b/mkfile @@ -0,0 +1,17 @@ +CT=/scratch/ct/ct +CFLAGS='--std=c99 -Wall' + +PKG_FLAGS=`{pkg-config --cflags glib-2.0} +PKG_LIBS=`{pkg-config --libs glib-2.0} + +index.cgi: index.o html.o + gcc $CFLAGS -o $target $prereq $PKG_LIBS + +%.o: %.c + gcc $CFLAGS $PKG_FLAGS -c -o $target $prereq + +%.c: %.ct + $CT -o $target $prereq + +clean: + rm -f *.o *.cgi html.c diff --git a/push.sh b/push.sh new file mode 100755 index 0000000..02940a0 --- /dev/null +++ b/push.sh @@ -0,0 +1,11 @@ +#!/bin/bash +user=spenceal +dest=/home/lug/htdocs/proj/aweather/web/ +rsync -uavz \ + .htaccess $user@lug.rose-hulman.edu:$dest +rsync -uavz \ + --delete \ + --exclude '*~' \ + --exclude '.*' \ + --exclude '*.o' \ + ./ $user@lug.rose-hulman.edu:$dest diff --git a/screens/globe.png b/screens/globe.png new file mode 100644 index 0000000..06311a7 Binary files /dev/null and b/screens/globe.png differ diff --git a/screens/globe_s.png b/screens/globe_s.png new file mode 100644 index 0000000..6ff962c Binary files /dev/null and b/screens/globe_s.png differ diff --git a/screens/grits.png b/screens/grits.png new file mode 100644 index 0000000..22df408 Binary files /dev/null and b/screens/grits.png differ diff --git a/screens/grits_s.png b/screens/grits_s.png new file mode 100644 index 0000000..b808bc5 Binary files /dev/null and b/screens/grits_s.png differ diff --git a/screens/iso.png b/screens/iso.png new file mode 100644 index 0000000..d2cc2fd Binary files /dev/null and b/screens/iso.png differ diff --git a/screens/iso_s.png b/screens/iso_s.png new file mode 100644 index 0000000..c07da8e Binary files /dev/null and b/screens/iso_s.png differ diff --git a/screens/meso.png b/screens/meso.png new file mode 100644 index 0000000..12ddfb9 Binary files /dev/null and b/screens/meso.png differ diff --git a/screens/meso_s.png b/screens/meso_s.png new file mode 100644 index 0000000..15811a3 Binary files /dev/null and b/screens/meso_s.png differ diff --git a/screens/plugins.png b/screens/plugins.png new file mode 100644 index 0000000..720535d Binary files /dev/null and b/screens/plugins.png differ diff --git a/screens/plugins_s.png b/screens/plugins_s.png new file mode 100644 index 0000000..909f221 Binary files /dev/null and b/screens/plugins_s.png differ diff --git a/screens/region.png b/screens/region.png new file mode 100644 index 0000000..7600f9b Binary files /dev/null and b/screens/region.png differ diff --git a/screens/region_s.png b/screens/region_s.png new file mode 100644 index 0000000..fb40ef8 Binary files /dev/null and b/screens/region_s.png differ diff --git a/screens/synop.png b/screens/synop.png new file mode 100644 index 0000000..ee2d374 Binary files /dev/null and b/screens/synop.png differ diff --git a/screens/synop_s.png b/screens/synop_s.png new file mode 100644 index 0000000..2ccf9ed Binary files /dev/null and b/screens/synop_s.png differ diff --git a/screens/terrain.png b/screens/terrain.png new file mode 100644 index 0000000..e95ea6d Binary files /dev/null and b/screens/terrain.png differ diff --git a/screens/terrain_s.png b/screens/terrain_s.png new file mode 100644 index 0000000..27ce3d7 Binary files /dev/null and b/screens/terrain_s.png differ