Birble
I am currently in birbta beta! I made this game/study tool to get better at non-visual aspects of bird identification. For example, you might not be able to see or hear the bird entirely clearly, but what if you did the logic of thinking about position, time of year, general size, behaviour etc? Real birders study hard and gain experience, but we will stay inside and play computer games!
Identify the bird in question by spending points to uncover information about its appearance, behaviour, and more!
Code
//Common name, conservation status, latin name, abundance image link, McCauley call audio file asset number, physical description, size category
birbdata = [
[["Double-Crested Cormorant"],["Least Concern"],["Nannopterum auritum"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/31913881/640"],[65707121],["Dark body with orange bare skin at the base of the bill. Breeding adults are all black. Immatures and nonbreeders have paler breast."],["GSL"]],
[["Black-Capped Chickadee"],["Least Concern"],["Poecile atricapillus"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/120480101/640"],[54840711],["This tiny, plump-bodied, big-headed bird is a familiar woodland resident and backyard visitor in the northern U.S. and Canada. Gray overall with light buffy flanks and a contrasting head pattern: black cap, white cheek, and black throat. Short, stubby bill is used for hammering open seeds."],["SSS"]],
[["California Condor"],["Critical"],["Gymnogyps californianus"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/25035971/640"],[163903],["This behemoth is unmistakable solely due to its massive size, much larger than any other [REDACTED]. Adults are black with a white stripe on the underwing and an orange head. Wingtips are splayed into conspicuous fingertips. Young birds are duller with a gray head and only slightly paler stripe on the underwing."],["GSL"]],
[["White-Breasted Nuthatch"],["Least Concern"],["Sitta carolinensis"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/31504131/640"],[120214],["The largest [REDACTED]] in North America, with distinctive white face, black cap, and blue-gray upperparts. Also note rusty lower belly and undertail coverts. Females have a slightly paler crown than males."],["BSB"]],
[["Red-Breasted Nuthatch"],["Least Concern"],["Sitta canadensis"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/32258961/640"],[287188101],["Small, cute, energetic [REDACTED]. Distinctive with bold black-and-white head pattern, blue-gray upperparts, and orangey belly. Males are brighter than females. "],["BSB"]],
[["Pileated Woodpecker"],["Least Concern"],["Dryocopus pileatus"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/32323421/640"],[88310041],["Large, unmistakable [REDACTED]. Mostly black, with red crest and bold white stripes on head and neck. Flies with deep, rowing wingbeats, almost like a crow but more irregular; also look for mostly white underwings and white patches on upperwing. "],["CS"]],
[["Common Loon"],["Least Concern"],["Gavia immer"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/317961781/640"],[33842721],["A large, heavy-billed [REDACTED]. Common and widespread in North America; somewhat less common and more local in Europe. Breeding adults have gorgeous black-and-white patterning; especially note fully black head with iridescent sheen and boldly checkered back. Nonbreeding plumage is plainer gray above and white below; note the jagged border between gray and white on the neck. Heavy bill is usually held straight (compare with Yellow-billed [REDACTED])."],["BCG"]],
[["Wild Turkey"],["Least Concern"],["Meleagris gallopavo"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/25003991/640"],[73964601],["Among the largest birds in North America. The large-bodied, long-legged and small-headed look of a [REDACTED] is distinctive. Appears dark from a distance. "],["GSL"]],
[["Bald Eagle"],["Least Concern"],["Haliaeetus leucocephalus"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/490921951/640"],[200943],["Majestic adults have blackish-brown body with white head and tail. Several stages of immature plumages aren't quite as majestic, from fully dark brown to messy and mottled with large patches of white. Look especially for white mottling on the belly on immatures. Soars with wings flat, like a large, dark plank. Head appears large in flight; projects far in front of wings."],["BCG"]],
[["Barred Owl"],["Least Concern"],["Strix varia"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/621274649/640"],[311542871],["Large [REDACTED], mottled brown and white. Rounded head lacks ear tufts. Black eyes."],["BCG"]],
[["Red Crossbill"],["Least Concern"],["Loxia curvirostra"],["https://www.allaboutbirds.org/guide/assets/photo/32257131-1280px.jpg"],[64047331],["Stocky, large-headed [REDACTED] with unique crossed bill used to pry seeds out of conifer cones. Males are dull red or orange overall with gray or brown highlights. Females are dull olive-yellow. Immatures are streakier than adults. Look for brownish wings with no wingbars."],["SSS"]],
[["Tundra Swan"],["Least Concern"],["Cygnus columbianus"],["https://www.allaboutbirds.org/guide/assets/photo/31493371-1280px.jpg"],[406700341],["Huge white bird with a long elegant neck. North American “Whistling” [REDACTED]s have a mostly black bill, with a yellow spot near the eye; Eurasian “Bewick’s” [REDACTED]s have a more evenly divided black-and-yellow bill. Immatures dusky gray-brown with pink on bill. Easily confused with Whooper and Trumpeter [REDACTED]s where their ranges overlap"],["GSL"]],
[["Trumpeter Swan"],["Least Concern"],["Cygnus buccinator"],["https://www.allaboutbirds.org/guide/assets/photo/175747531-1280px.jpg"],[70543481],["Huge white bird with long neck and all-black bill. Immatures dusky gray-brown with pink on bill. Extremely similar to Tundra [REDACTED], but never shows yellow on bill. Also, note subtle features of face: facial skin is relatively broad where it meets eye, so the eye doesn't stand out, and border between white face and black bill is straight (curved on Tundra)."],["GSL"]],
[["American Robin"],["Least Concern"],["Turdus migratorius"],["https://www.allaboutbirds.org/guide/assets/photo/615207099-1280px.jpg"],[94261],["Fairly large songbird with round body, long legs, and longish tail. Gray above with warm orange underparts and blackish head."],["BBS"]],
[["Northern Cardinal"],["Least Concern"],["Cardinalis cardinalis"],["https://www.allaboutbirds.org/guide/assets/photo/311148961-1280px.jpg"],[339922801],["Striking and familiar [REDACTED]. Crest, large red bill, and long tail render this species distinctive even with a poor view. Male is entirely red with a black face. Female is brownish overall with redder wings and tail."],["BSB"]],
[["Pine Sisken"],["Least Concern"],["Spinus pinus"],["https://www.allaboutbirds.org/guide/assets/photo/31752411-1280px.jpg"],[89549511],["Small, brown, streaked [REDACTED]. Some show yellow in the wing and tail. Sharply pointed bill. Short, notched tail and long wings."],["SSS"]],
[["Red-Winged Blackbird"],["Least Concern"],["Agelaius phoeniceus"],["https://www.allaboutbirds.org/guide/assets/photo/32257341-1280px.jpg"],[314523871],["Males are black with red shoulder patch that is sometimes concealed. Males have rusty feather edges in the winter. Females are streaked brown and often confused with [REDACTED]. Look for long, sharply pointed bill."],["BBS"]],
[["Swamp Sparrow"],["Least Concern"],["Melospiza georgiana"],["https://www.allaboutbirds.org/guide/assets/photo/31752291-1280px.jpg"],[55235401],["A medium-sized [REDACTED] with attractive rufous and gray pattern. Slightly smaller than Song [REDACTED], with a blurrier look overall (like a watercolor vs. an oil painting). Look for bright reddish-brown wings and relatively plain underparts. Adults are plain grayish below with buffy sides; males have a rufous crown. Immatures often show buffy tones on the face and streaking on the underparts, but never as crisp and extensive as Lincoln’s [REDACTED]."],["SSS"]],
[["Canada Goose"],["Least Concern"],["Branta canadensis"],["https://www.allaboutbirds.org/guide/assets/photo/31492711-1280px.jpg"],[158978601],["A large brown [REDACTED] with a black neck and white chinstrap. Overall size, bill size, and brown coloration variable across subspecies. [REDACTED] is almost always larger, longer-necked, and longer-billed than Cackling [REDACTED], although beware there is some overlap between the smallest [REDACTED] and largest Cackling."],["GSL"]],
[["Canada Jay"],["Least Concern"],["Perisoreus canadensis"],["https://www.allaboutbirds.org/guide/assets/photo/41196131-1280px.jpg"],[13510],["Adults are gray overall with a white head and dark nape. Juveniles are dark sooty-gray with a white mustache stripe. Some variation across range; Rocky Mountain birds are palest."],["BSB"]],
[["Bufflehead"],["Least Concern"],["Bucephala albeola"],["https://www.allaboutbirds.org/guide/assets/photo/38821501-1280px.jpg"],[326635731],["Small, compact diving [REDACTED] with large head and small gray bill. Breeding males are black and white with large white patch on back of head. Females and immature males are gray-brown with white patch on cheek. Much smaller than [REDACTED] with which it often associates"],["BCG"]],
[["Mallard"],["Least Concern"],["Anas platyrhynchos"],["https://www.allaboutbirds.org/guide/assets/photo/169626481-1280px.jpg"],[105200981],["A large [REDACTED]. Males are distinctive with iridescent green head, yellow bill, chestnut breast, and gray body. Females are mottled brown with orange and black splotches on the bill."],["BCG"]],
[["Hooded Merganser"],["Least Concern"],["Lophodytes cucullatus"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/32312371/640"],[414920021],["Small diving [REDACTED] with thin serrated bill. Breeding males have showy black-and-white crest, a couple zebra stripes on the white breast, and cinnamon-colored sides. Females are brown with a puffy crest and partly yellow bill. Looks slender and long-necked in flight, with very fast wingbeats."],["CS"]],
[["Ring-billed Gull"],["Least Concern"],["Larus delawarensis"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/39431981/640"],[78362981],["Fairly small [REDACTED]. Breeding adults are white-headed with a bold black ring around the bill; nonbreeding adults have smudgy brown markings on the head. Note pale eye and yellow legs. Immatures are mottled brownish overall; note pink bill with black tip."],["CS"]],
[["Great Blue Heron"],["Least Concern"],["Ardea herodias"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/39447471/640"],[92488041],["Huge gray [REDACTED], no other similar species in range. Note large yellow-orange bill, short black plumes on head, and black and chestnut pattern on shoulder. Immatures are more brownish than adults, and have a dark crown."],["GSL"]],
[["Red-tailed Hawk"],["Least Concern"],["Buteo jamaicensis"],["https://www.allaboutbirds.org/guide/assets/photo/39403381-1280px.jpg"],[241076151],["Incredible variation in plumages, including less common dark morphs and various regional differences. Eastern adults have brilliant reddish-orange tail and pale underparts with obvious band of dark marks across belly. Western birds are typically darker. Immatures do not have a red tail."],["BCG"]],
[["Red-shouldered Hawk"],["Least Concern"],["Buteo lineatus"],["https://www.allaboutbirds.org/guide/assets/photo/32257721-1280px.jpg"],[229090],["Smaller than [REDACTED]. Adults are beautiful with rich orange barring below and bold black-and-white checkerboard patterning on wings. In flight, wings seem narrow and pushed forward compared to [REDACTED] or [REDACTED]; also note relatively long tail. Population in California is more richly colored (darker orange) than paler Eastern birds; while Florida birds are paler with gray head and back."],["BCG"]],
[["Chimney Swift"],["Vulnerable"],["Chaetura pelagica"],["https://www.allaboutbirds.org/guide/assets/photo/39419141-1280px.jpg"],[527296],["The 'flying cigar' with a blunt head, squared-off tail, and long, sickle-shaped wings. Body is dark gray with a slightly paler throat. Flies all day long with ridiculously fast, snappy wingbeats."],["BSB"]],
[["Yellow-bellied Sapsucker"],["Least Concern"],["Sphyrapicus varius"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/39441281/640"],[425580881],["Striking and unmistakable. Long, solid white wing patch helps distinguish it from [REDACTED] and [REDACTED]. Adult male has red cap and throat; females are similar but with white throat; juveniles are messy brownish-gray overall. Yellow belly can be difficult to see and is sometimes almost absent. Often looks disheveled, especially in fall and winter. Note [this bird] has complete black border around red throat patch, and the white markings on the back are more extensive and messy."],["BSB"]],
[["Eastern Whip-poor-whill"],["Near Threatened"],["Antrostomus vociferus"],["https://www.allaboutbirds.org/guide/assets/photo/39404921-1280px.jpg"],[245943381],["Intricately patterned with a complicated mottling of gray, brown, and black. Note blackish throat bordered by thin white collar."],["BBS"]],
[["Blue Jay"],["Least Concern"],["Cyanocitta cristata"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/31964581/640"],[173749],["Familiar but stunning [REDACTED] found year-round throughout most of eastern North America. Bright blue above and pale gray below with a fluffy crest. Also look for black necklace and black and white markings on the wings and tail."],["BBS"]],
[["Steller's Jay"],["Least Concern"],["Cyanocitta stelleri"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/598222291/640"],[42204],["Black-and-blue with a crest. Shows marked variation across range: coastal populations are the darkest, generally black front and crest with blue wings, tail and hindquarters marked with black stripes. [REDACTED] birds instead have shorter crest, limited black on the face, and very bold white markings around the eye."],["BBS"]],
[["American Barn Owl"],["Endangered, Special Concern, or Low Concern depending on State/Province"],["Tyto furcata"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/624648173/640"],[50147],["Medium-sized owl with a heart-shaped facial disc and deep dark eyes. Varies across a wide range, but always note white-and-black speckling on the upperparts, beautiful gray-and-tawny wings, and large round head. Color of the facial disc and underparts varies from pure white to rusty orange."],["BCG"]],
[["King Rail"],["Near Threatened"],["Rallus elegans"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/25038011/640"],[356332391],["Large, bright [REDACTED] of freshwater marshes. Note rich orange neck and face, contrasty black-and-white barring on sides, and rich brownish upperparts with distinct dark streaks. Females are duller than males. "],["BBC"]],
[["Cerulean Warbler"],["Near Threatened"],["Setophaga cerulea"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/39411061/640"],[455179961],["Brilliant sky-blue [REDACTED]. From below, look for white throat and belly, thin necklace, and dark streaks on sides. Female is a unique muted turquoise with pale eyebrow and blurry streaks on sides. Immature birds show yellow wash on underparts. All plumages have bold white wingbars."],["SSS"]],
[["Piping Plover"],["Near Threatened"],["Charadrius melodus"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/32323591/640"],[158754681],["Small, plump, pale [REDACTED]; the color of dry sand. In breeding plumage look for thin broken black collar across chest, black stripe across forehead, orange legs, and orange bill with black tip. Nonbreeding and immature birds have black bills and sandy-colored breastbands. White wingstripe visible in flight. Notably paler than other small [REDACTED], with the exception of [REDACTED], from which [this bird] is distinguished by thicker bill and orange legs. This bird is also the cutest bird according to me."],["BSB"]],
[["American Goshawk"],["Least Concern"],["Astur atricapillus"],["https://cdn.download.ams.birds.cornell.edu/api/v1/asset/608734764/640"],[298237561],["Powerfully-built [REDACTED]. Adults are distinctive if seen well: bulky and broad-winged, gray above and whitish below with fine barring, prominent pale eyebrow, and dark reddish eye"],["BCG"]],
[["American Herring Gull"],["Least Concern"],["Larus smithsonianus"],["https://www.allaboutbirds.org/guide/assets/photo/624717220-1280px.jpg"],[165927],["Large [REDACTED]. Adults have a fairly pale gray back, pale eye, and dull pinkish legs. Takes four years for immatures to progress from mostly brown to fully white and gray adult plumage; intermediate plumages are often mottled and messy. Usually shows a dull pinkish base to the bill by the first winter, and develops a pale eye by the second winter. Some immature birds can fade to almost white, especially in their first or second summer, but they always show darker wingtips."],["BCG"]],
[["American Coot"],["Least Concern"],["Fulica americana"],["https://www.allaboutbirds.org/guide/assets/photo/39417941-1280px.jpg"],[41572901],["Plump, chicken-like bird that is also duck-like if you think about it. Gray overall with blacker head and white bill. Tiny tail and short wings. Feet are large, yellow-green, and oddly lobed. Comically evil-looking sanguine-red eyes."],["BBC"]],
[["Ruffed Grouse"],["Least Concern"],["Bonasa umbellus"],["https://www.allaboutbirds.org/guide/assets/photo/32254071-1280px.jpg"],[446222541],["Well-camouflaged chickenlike bird. Intricately patterned plumage varies from cold gray to rich reddish-brown. Look for relatively long, squared tail with dark band near the tip, bold barring on the sides, and small pointed crest."],["CS"]],
[["Mourning Dove"],["Least Concern"],["Zenaida macroura"],["https://www.allaboutbirds.org/guide/assets/photo/39454711-1280px.jpg"],[348310361],["Svelte with a long, pointed tail. Plain brown overall with dark spots on wing. Juvenile is covered with pale scaly pattern, but is much larger and longer-tailed than [REDACTED]. Black, souless eyes betray limited cognition."],["BSB"]],
[["Cooper's Hawk"],["Least Concern"],["Astur cooperii"],["https://www.allaboutbirds.org/guide/assets/photo/39401301-1280px.jpg"],[231229351],["Small to medium-sized [REDACTED] with relatively short rounded wings and rounded tail. Adults are gray above with pale orange barring below; immatures are browner and streaky. Very similar to [REDACTED], but larger with bigger head. "],["CS"]],
[["Northern Harrier"],["Least Concern"],["Circus hudsonius"],["https://www.allaboutbirds.org/guide/assets/photo/169656321-1280px.jpg"],[248049481],["Medium-sized [REDACTED] with long tail and thin wings. Flies with wings held in a V-shape. Conspicuous white patch on rump in all plumages. Females and immatures are warm brown. Adult males gray above and whitish below with black wingtips."],["BCG"]],
[["Turkey Vulture"],["Least Concern"],["Cathartes aura"],["https://www.allaboutbirds.org/guide/assets/photo/39405531-1280px.jpg"],[321016811],["Large [REDACTED]. Appears dark from a distance. Up close, dark brown above with bare red head. In flight, undersides of wings are two-toned; lighter on the entire trailing edge of the wing, opposed to just wingtips on [REDACTED]. Wings are held slightly raised when soaring, making a V when seen head-on."],["GSL"]],
[["Snowy Owl"],["Vulnerable"],["Bubo scandiacus"],["https://www.allaboutbirds.org/guide/assets/photo/169653561-1280px.jpg"],[233160],["Otherworldly, beautiful large [REDACTED]. White with a variable amount of black markings; old males are the whitest, while immature females have the densest dark patterning. Piercing citrine eyes."],["BCG"]],
[["Great Horned Owl"],["Least Concern"],["Bubo virginianus"],["https://www.allaboutbirds.org/guide/assets/photo/495748271-1280px.jpg"],[132729861],["Large [REDACTED] with distinctive ear tufts. Typically well-camouflaged dark brown overall, but varies in color: Mottled gray-brown, with reddish brown faces and a neat white patch on the throat typical. Their overall color tone varies regionally from sooty to pale. Intimidating stare, typical for this type of bird, appears especially and explicitly angry in this species."],["BCG"]],
[["Belted Kingfisher"],["Least Concern"],["Megaceryle alcyon"],["https://www.allaboutbirds.org/guide/assets/photo/39433821-1280px.jpg"],[343599271],["Stocky and large-headed with a distincive shaggy, punk-rock crest. Bill is long, straight, thick, and pointed. Powder blue above with white underparts and blue breast band. Females have additional rusty band across belly."],["BBS"]],
[["Downy Woodpecker"],["Least Concern"],["Dryobates pubescens"],["https://www.allaboutbirds.org/guide/assets/photo/32267171-1280px.jpg"],[107289]["Tiny [REDACTED]. Checkered black-and-white impression. The black upperparts are checked with white on the wings, the head is boldly striped, and the back has a broad white stripe down the center. Males have a small red patch on the back of the head. Black-and-white plumage is nearly identical to the larger [REDACTED]. Focus on the bill: [this bird] has a very short bill, much shorter than the length of the head. Also note the small black markings on the white outer tail feathers."],["BSB"]],
[["Northern Flicker"],["Least Concern"],["Colaptes auratus"],["https://www.allaboutbirds.org/guide/assets/photo/624722298-1280px.jpg"],[324133871],["Large, brownish [REDACTED] with black barring on the back and black spots on the belly. Easily recognized in flight by its bright white rump. Also note large black crescent-shaped mark on breast. Wings and tail flash yellow or red, depending on the subspecies. Note red marking on back of head or throat based on sex and subspecies."],["BBC"]],
[["Brown Thrasher"],["Least Concern"],["Toxostoma rufum"],["https://www.allaboutbirds.org/guide/assets/photo/25014181-1280px.jpg"],[94280],["Fairly large and very long-tailed, with bright rufous upperparts and whitish underparts heavily streaked with rufous brown. Also note white wingbars, staring yellow eyes, and slightly decurved bill."],["BBS"]],
]
Code
// Helper function for synchronizing variables across cells, see https://observablehq.com/@observablehq/synchronized-inputs
function adjust(input, value) {
// Set a new value to the input
input.value = input.value + value;
// Dispatch an update event to the input
input.dispatchEvent(new Event("input", {bubbles: true}));
}
Code
Code
viewof BC = {
newbirb;
let value = 0;
const button = html`<button>[3] Hear birb call</button>`;
Object.defineProperty(button, "value", {get() { return value; }});
button.onclick = () => ++value;
return button;
}
BCembedsrc = {
if (BC > 0) {
//Adjust score at one button press
if (BC == 1){adjust(viewof score,-3)};
//Change conservation status text
return (newbirb, 'https://macaulaylibrary.org/asset/'.concat(current_birb[4][0],'/embed'))
} else {return "\n"}
}
html`<iframe src="${BCembedsrc}" height="340" width="320" scrolling="no" style="border: 3px solid black;" allowfullscreen></iframe>`
Code
viewof CS = {
newbirb;
let value = 0;
const button = html`<button>[1] Conservation Status</button>`;
Object.defineProperty(button, "value", {get() { return value; }});
button.onclick = () => ++value;
return button;
}
CStext = {
if (CS > 0) {
//Adjust score at one button press
if (CS == 1){adjust(viewof score,-1)};
//Change conservation status text
return (newbirb, current_birb[1][0])
} else {return "\n"}
}
//Output conservation status text
viewof CSA = Inputs.text({value:CStext, disabled:true})
Code
viewof BN = {
newbirb;
let value = 0;
const button = html`<button>[1] Latin Name</button>`;
Object.defineProperty(button, "value", {get() { return value; }});
button.onclick = () => ++value;
return button;
}
BNtext = {
if (BN > 0) {
//Adjust score at one button press asdas
if (BN == 1){adjust(viewof score,-1)};
//Change conservation status text
return (newbirb, current_birb[2][0])
} else {return "\n"}
}
//Output conservation status text
viewof BNA = Inputs.text({value:BNtext, disabled:true})
Code
BSfile = {
//sparrow-sized or smaller
if (current_birb[6][0] == "SSS"){
return "birble_resources/SSS.png"
//between sparrow and blackbird
} else if (current_birb[6][0] == "BSB"){
return "birble_resources/BSB.png"
//blackbird sized
} else if (current_birb[6][0] == "BBS"){
return "birble_resources/BBS.png"
//between blackbird and crow
} else if (current_birb[6][0] == "BBC"){
return "birble_resources/BBC.png"
//crow sized
} else if (current_birb[6][0] == "CS"){
return "birble_resources/CS.png"
//between crow and goose
} else if (current_birb[6][0] == "BCG"){
return "birble_resources/BCG.png"
//goose sized or larger
} else if (current_birb[6][0] == "GSL"){
return "birble_resources/GSL.png"
}
}
/*
html`
<body>
<button onclick="document.getElementById('myImage').src=${BSfile}">[3] Reveal birb size</button>
<img id="myImage" src="birble_resources/birbsizeplaceholder.png" style="width:400px">
</body>
`*/
FileAttachment("birble_resources/birbsizeplaceholder.png").image({
width: 500,
border: "10px solid black",
onclick: (e)=> {
e.target.src=`${BSfile}`;
if (BSclick==0){
adjust(viewof score,-3)
adjust(viewof BSclick,1)
};
},
})
Code
viewof PD = {
newbirb;
let value = 0;
const button = html`<button>[3] Physical Description</button>`;
Object.defineProperty(button, "value", {get() { return value; }});
button.onclick = () => ++value;
return button;
}
PDtext = {
if (PD > 0) {
//Adjust score at one button press asdas
if (PD == 1){adjust(viewof score,-3)};
//Change status text
return (newbirb, current_birb[5][0])
} else {return "\n"}
}
PDtext;
Code
viewof BR = {
newbirb;
let value = 0;
const button = html`<button>[3] Birb Range data</button>`;
Object.defineProperty(button, "value", {get() { return value; }});
button.onclick = () => ++value;
return button;
}
BRembedsrc = {
if (BR > 0) {
//Adjust score at one button press
if (BR == 1){adjust(viewof score,-3)};
//Change conservation status text
return (newbirb, current_birb[3][0])
} else {return "\n"}
}
html`<iframe src="${BRembedsrc}" height="340" width="320" style="border: 3px solid black;" allowfullscreen></iframe>`
Code
viewof guess = Inputs.text({placeholder:"e.g. American Robin", disabled:false, width:400});
viewof guessbirb = {
newbirb;
let value = "";
const button = html`<button>${gbtext}</button>`;
Object.defineProperty(button, "value", {get() { return value; }});
button.onclick = () => {
if (giveup==0){
if (guess.toLowerCase() == current_birb[0][0].toLowerCase()){
value = "Correct | ".concat(current_birb[0][0], " | Final Score: ", String(score));
return value;
} else {
value = "Incorrect guess";
return value
}
} else{
value = current_birb[0][0].concat(" ")
return value;
}
}
return button;
}
Code
Code
viewof newbirb = html`<button>New Birb</button>`;
//html`<p style="font-family:courier;">This is a paragraph.</p>`;
// Select from array of birb data
current_birb = {
set(viewof score, 20);
set(viewof BSclick, 0);
const buttonClicked = await newbirb;
return birbdata[Math.floor(Math.random()*birbdata.length)];
}
Compliance:
This material uses data from the eBird Status and Trends Project at the Cornell Lab of Ornithology, eBird.org. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the Cornell Lab of Ornithology.
Range data: Fink, D., T. Auer, A. Johnston, M. Strimas-Mackey, S. Ligocki, O. Robinson, W. Hochachka, L. Jaromczyk, C. Crowley, K. Dunham, A. Stillman, I. Davies, A. Rodewald, V. Ruiz-Gutierrez, C. Wood. 2023. eBird Status and Trends, Data Version: 2022; Released: 2023. Cornell Lab of Ornithology, Ithaca, New York. https://doi.org/10.2173/ebirdst.2022