Crop the unused space on the download button image, which makes placing

it much easier.  Use this to move the button before the "Start Quickly"
header, making it show better in non-CSS text browsers.

Also, set a fixed height for the `slideshowframe' class, so the text
below it doesn't jump; rename `alts-panel' to `slideshow-panel';
and use `struct'; and more improvements.
This commit is contained in:
Eli Barzilay 2010-11-11 07:16:01 -05:00
parent 686ec837e9
commit 8e1b773df7
3 changed files with 35 additions and 38 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.3 KiB

View File

@ -2,20 +2,20 @@
(require "resources.rkt" "code.rkt" "download.rkt" "learning.rkt") (require "resources.rkt" "code.rkt" "download.rkt" "learning.rkt")
(define (doc s) (define (doc path . text)
(string-append "http://docs.racket-lang.org/" s)) (apply a href: (list "http://docs.racket-lang.org/" path) text))
(define-struct example (code desc)) (struct example (code desc))
(define-struct (cmdline-example example) ()) (struct cmdline-example example ())
(define-struct (scribble-example example) ()) (struct scribble-example example ())
(define-struct (graphical-example example) ()) (struct graphical-example example ())
(define desc div) (define desc div)
(define (elemcode . strs) (apply tt strs)) (define (elemcode . strs) (apply tt strs))
(define (examples) (define examples
@; --- Each example here should at most 7 lines long --- @; --- Each example here should at most 7 lines long ---
(alts-panel (list
@; Candidates for initial example: ------------------------ @; Candidates for initial example: ------------------------
(list (list
(example ; ----------------------------------------------- (example ; -----------------------------------------------
@ -235,35 +235,34 @@
@(delay more.css)} @(delay more.css)}
@div[class: 'whatpane]{ @div[class: 'whatpane]{
@span{@span[class: 'whatb]{Racket} is a programming language.}} @span{@span[class: 'whatb]{Racket} is a programming language.}}
(div class: 'aboutpane
@div[class: 'panetitle]{Start Quickly}
@div[class: 'downloadbutton]{@download-button} @div[class: 'downloadbutton]{@download-button}
@examples @div[class: 'aboutpane]{
@p{@a[href: (doc "quick/")]{Draw more pictures} or @div[class: 'panetitle]{Start Quickly}
@a[href: (doc "more/")]{build a web server from scratch}. @div{@(apply slideshow-panel examples)}
Racket includes both @a[href: (doc "")]{batteries} @p{@doc["quick/"]{Draw more pictures} or
and a @a[href: (doc "drracket/")]{programming environment}, @doc["more/"]{build a web server from scratch}. Racket includes both
so @a[href: (doc "getting-started/index.html")]{get started}!}) @doc[""]{batteries} and a @doc["drracket/"]{programming environment},
so @doc["getting-started/"]{get started}!}}
@((lambda xs @((lambda xs
(table class: 'threepanes (table class: 'threepanes
(tr (map (lambda (x) (td (div class: 'panetitle (car x)) (cdr x))) (tr (map (lambda (x) (td (div class: 'panetitle (car x)) (cdr x)))
xs)))) xs))))
(list "Grow your Program" (list "Grow your Program"
@p{Racket's @p{Racket's
@a[href: (doc "guide/intro.html#(part._.Interacting_with_.Racket)")]{interactive mode} @doc["guide/intro.html#(part._.Interacting_with_.Racket)"]{
interactive mode}
encourages experimentation, and quick scripts easily compose into encourages experimentation, and quick scripts easily compose into
larger systems. Small scripts and large systems both benefit from larger systems. Small scripts and large systems both benefit from
@a[href: (doc "guide/performance.html")]{native-code JIT compilation}. @doc["guide/performance.html"]{native-code JIT compilation}.
When a system gets too big to keep in your head, you can add When a system gets too big to keep in your head, you can add
@a[href: (doc "ts-guide/index.html")]{static types}.}) @doc["ts-guide/index.html"]{static types}.})
(list "Grow your Language" (list "Grow your Language"
@p{@a[href: (doc "guide/languages.html")]{Extend Racket} whenever you @p{@doc["guide/languages.html"]{Extend Racket} whenever you need to.
need to. Mold it to better suit your tasks without sacrificing Mold it to better suit your tasks without sacrificing
@a[href: (doc "guide/dialects.html")]{interoperability} with @doc["guide/dialects.html"]{interoperability} with existing
existing libraries and without having to modify the libraries and without having to modify the
@a[href: (doc "guide/intro.html")]{tool chain}. When less is more, @doc["guide/intro.html"]{tool chain}. When less is more, you can
you can remove parts of a language or start over and build a new remove parts of a language or start over and build a new one.})
one.})
(list "Grow your Skills" (list "Grow your Skills"
@p{Whether you're just @-htdp{starting out}, want to know more about @p{Whether you're just @-htdp{starting out}, want to know more about
programming language @-plai{applications} or @-redex{models}, programming language @-plai{applications} or @-redex{models},
@ -271,21 +270,21 @@
@learning{research}, Racket can help you become a better programmer @learning{research}, Racket can help you become a better programmer
and system builder.})))) and system builder.}))))
(define (alts-panel l1 l2) (define (slideshow-panel l1 l2)
(define l (append l1 l2)) (define l (append l1 l2))
(define button-ids+labels '()) (define button-ids+labels '())
(define (mk-button txt tip id onclick) (define (button txt tip id onclick)
(set! button-ids+labels (cons (cons id txt) button-ids+labels)) (set! button-ids+labels (cons (cons id txt) button-ids+labels))
(a href: "#" id: id onclick: (list onclick "; return false;") title: tip (a href: "#" id: id onclick: (list onclick "; return false;") title: tip
nbsp)) ; empty, filled by JS code, so JS-less browsers won't see it nbsp)) ; empty, filled by JS code, so JS-less browsers won't see it
(div class: 'slideshow (div class: 'slideshow
(div class: 'buttonpanel (div class: 'buttonpanel
@mk-button["<" "Previous example" 'rewindbutton "rewind_show()"] @button["<" "Previous example" 'rewindbutton "rewind_show()"]
@mk-button[">" "Next example" 'advancebutton "advance_show()"] @button[">" "Next example" 'advancebutton "advance_show()"]
@mk-button["?" "Explain this code" 'helpbutton "set_help(!help_showing)"] @button["?" "Explain this code" 'helpbutton "set_help(!help_showing)"]
(div class: 'hiddenhelp id: "helppanel" style: "display: none;" (div class: 'hiddenhelp id: "helppanel" style: "display: none;"
(div class: 'helpcontent (div class: 'helpcontent
@mk-button["close" "Close help" 'closebutton "set_help(false)"] @button["close" "Close help" 'closebutton "set_help(false)"]
(div class: 'helpdesc (div class: 'helpdesc
(for/list ([elem (in-list l)] [pos (in-naturals)]) (for/list ([elem (in-list l)] [pos (in-naturals)])
@div[id: @list{helpframe@pos} style: "display: none;"]{ @div[id: @list{helpframe@pos} style: "display: none;"]{
@ -432,6 +431,9 @@
.slideshow { .slideshow {
position: relative; position: relative;
} }
.slideshowframe {
height: 12ex;
}
.buttonpanel { .buttonpanel {
display: block; display: block;
position: absolute; position: absolute;
@ -478,11 +480,6 @@
.downloadbutton { .downloadbutton {
position: relative; position: relative;
float: right; float: right;
left: 1em;
top: -1em;
height: 0em;
width: 1em;
margin: 0em -1em 0em 0em;
} }
@; @;
.codecomment { .codecomment {