Created
January 25, 2023 20:39
-
-
Save hawkz/29b92d200fcd8c11178e4d05e745af94 to your computer and use it in GitHub Desktop.
A mockup of a beginner pypercard
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def MyCard(Pypercard): | |
# setup card - let me change the background on the card, maybe dimensions. | |
styles = "css reference or raw css here" | |
# django model-like element definitions | |
hero_image = card.image('url to image') # styles could reference MyCard.hero_image | |
card_title = card.text('You enter the jungle') # same styles effect, maybe magic for page title?? | |
description = card.text('You see a glowing orb, what do you do?') | |
choose_left = card.button('Choose left') # clickable button, magics up event below | |
choose_orb = card.button('Look at the orb') | |
# events | |
def hero_image_hover(event): # not sure on this syntax | |
# switch the image for a flickering orb | |
MyCard.hero_image.src = 'alt image' | |
# could do style changes here maybe... or just have magic classes applied on hover... | |
def choose_left.click(event): | |
MyOtherCard.navigate() # takes me to a new card | |
def choose_orb.click(event): | |
if self.text == "Look at the orb": | |
Character.items.append('orb') # access element/variable on another card | |
MyCard.hero_image.src = "url of hand holding image" | |
Mycard.choose_left.disable() | |
Mycard.choose_orb.text = "Explore further" | |
else: | |
MyOtherCard.navigate() # takes me to a new card | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment