-
Notifications
You must be signed in to change notification settings - Fork 326
Add carousel of code snippets to front page #1462
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
Merged
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
f3627c7
upgrade fontawesome
bishabosha 248427f
add code carousel and darkmode code theme
bishabosha 761345f
add dark theme to nutshell snippets
bishabosha 221c8be
add timer to switch slides automatically
bishabosha 964506b
address review: remove commented css
bishabosha 3b80408
address review: adjust wording
bishabosha d17c14d
address review: scale with text size
bishabosha b06c96f
address comment: compact mode for snippet buttons
bishabosha 26f0013
recolor header background
bishabosha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{% assign firstOption = true %} | ||
{% assign darkClassOpt = '' %} | ||
{% if page.darkmodeCode %} | ||
{% assign darkClassOpt = 'dark' %} | ||
{% endif %} | ||
<div id="{{include.id}}" class="code-carousel"> | ||
{% assign totalSize = 0 %} | ||
{% for example in include.collection %} | ||
<input | ||
type="radio" | ||
name="{{include.id}}_tabs" | ||
id="{{example.optionId}}_description" | ||
data-target="{{example.optionId}}" | ||
class="code-carousel_control" | ||
hidden | ||
aria-hidden="true" | ||
{% if firstOption %}checked{% endif %} | ||
> | ||
{% assign firstOption = false %} | ||
{% assign totalSize = totalSize | plus: 1 %} | ||
{% endfor %} | ||
<div class="content-area"> | ||
{% for example in include.collection %} | ||
<section id="{{example.optionId}}_content"> | ||
<div class="code-element {{darkClassOpt}}"> | ||
<div class="bar-code"><span>{{example.codeTitle}}</span></div> | ||
<div class="code-background {{darkClassOpt}} code-snippet-buttons"> | ||
<button class="code-snippet-button"> | ||
<a href="{{ example.scastieLink }}" target="_blank"> | ||
Run in playground <i class="fa-solid fa-play"></i> | ||
</a> | ||
</button> | ||
</div> | ||
<div class="code-snippet-area"> | ||
<div class="progress-label code-background {{darkClassOpt}}"> | ||
{{forloop.index}}<span class="progress-out-of"> /{{totalSize}}</span> | ||
</div> | ||
{% if forloop.first %} | ||
{% assign previousIdx = include.collection.length | minus: 1 %} | ||
{% else %} | ||
{% assign previousIdx = forloop.index0 | minus: 1 %} | ||
{% endif %} | ||
{% if forloop.last %} | ||
{% assign nextIdx = 0 %} | ||
{% else %} | ||
{% assign nextIdx = forloop.index %} | ||
{% endif %} | ||
<div class="arrow-switcher arrow-switcher_left {{darkClassOpt}}"> | ||
<label for="{{include.collection[previousIdx].optionId}}_description"> | ||
<i class="fa-solid fa-chevron-left"></i> | ||
</label> | ||
</div> | ||
<div class="arrow-switcher arrow-switcher_right {{darkClassOpt}}"> | ||
<label for="{{include.collection[nextIdx].optionId}}_description"> | ||
<i class="fa-solid fa-chevron-right"></i> | ||
</label> | ||
</div> | ||
<div class="code-background {{darkClassOpt}}"> | ||
<!-- the code snippet should be a raw markdown code block --> | ||
{{example.content}} | ||
</div> | ||
</div> | ||
</div> | ||
<p>{{example.description}}</p> | ||
bishabosha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
</section> | ||
{% endfor %} | ||
</div> | ||
</div> |
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.