-
Notifications
You must be signed in to change notification settings - Fork 61
Embedded SplashKit Online #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
WhyPenguins
wants to merge
18
commits into
splashkit:main
Choose a base branch
from
WhyPenguins:SKO-activity-embed
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
- embeds an SKO iFrame and sends the code between the <></> in - added to a couple of pages as test/demo - not sure about the name
- extracts editable blocks from the markdown - easy to use, but perhaps brittle to changes in the generated page?
- 4s fade to mask load time - looks okay locally but may need adjusting
- code has to be in 'code' directory in zip
- Safety measure, especially once the iFrame starts sending back data we put in links the user can click in the main page...
a20fa37 to
c6f88aa
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Preview Deployment 😃
Quick links:
Note when testing: Cached old versions of the SplashKit Online page can break things - if things are behaving strangely I recommend visiting with Disable Cache ticked on. Also I find turning it back off continues using the old cache sometimes...
Overview
This is a PR for embedding SplashKit Online in the Field Guide as in-page activities. It adds a new component,
CodeActivity, that can be used similar to normal code blocks, but instead creates an accordion that loads a SplashKit Online iFrame when opened.{10-20}). These can also be given names ({"inputBlock":5-27}), though this is unused currently.utilities.h/cpp)I believe the code quality can likely be improved - some parts of this are likely more hacky than needed due to my inexperience with Astro. Interested to know any changes needed to get this merged in, thanks!
Questionable points:
divwith the markdown output of the code, and extracts the code and block information by scanning through the elements. This feels hacky - maybe someone with more Starlight experience might have some ideas for improvements?CodeActivitymight not be the best name for the component?Linked to https://github.com/WhyPenguins/SplashkitOnline/tree/field-guide-embedding-work branch.
Done-ish/To Do (for this repo + SplashKit Online repo):
Investigate Firefox input not workingWorks in newer versions, not worth investigating...Match Field Guide's themesExample Usage and Output