-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#72] Implement new parts kit template code
- Loading branch information
1 parent
3a46810
commit e4e2469
Showing
7 changed files
with
46 additions
and
312 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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,16 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Parts Kit</title> | ||
<meta name="robots" content="none"> | ||
</head> | ||
<body> | ||
<script | ||
type="module" | ||
src="https://unpkg.com/@viget/parts-kit@^0/lib/parts-kit.js" | ||
></script> | ||
<parts-kit config-url="{{ actionUrl('parts-kit/config') }}"></parts-kit> | ||
</body> | ||
</html> |
This file contains 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 |
---|---|---|
@@ -1,111 +1,9 @@ | ||
{% extends craft.viget.partsKit.getConfig('layout') %} | ||
{% extends craft.viget.partsKit.isRootRequest() | ||
? 'viget-base/_layouts/parts-kit-root' | ||
: craft.viget.partsKit.getConfig('layout') | ||
%} | ||
|
||
{% block content %} | ||
<style> | ||
.parts-kit { | ||
{{ craft.viget.partsKit.getTheme() }} | ||
} | ||
</style> | ||
|
||
<div class="parts-kit" data-parts-kit data-turbo="false"> | ||
<aside | ||
class="parts-kit__sidebar" | ||
data-sidebar | ||
> | ||
<h2 class="parts-kit__sr-only">Parts Navigation</h2> | ||
|
||
<label class="parts-kit__sr-only" for="pk-search">Search parts kit</label> | ||
<div class="parts-kit__search"> | ||
<input class="parts-kit__search-input" | ||
id="pk-search" | ||
type="search" | ||
placeholder="Press / to search..." | ||
data-focus-placeholder="Type to search..." | ||
data-sidebar-search | ||
> | ||
{{ svg('@viget/base/resources/icons/search.svg') | attr({ | ||
class: 'parts-kit__search-icon', | ||
}) }} | ||
</div> | ||
|
||
{% set navSections = craft.viget.partsKit.getNav() %} | ||
|
||
{% if navSections %} | ||
<ol class="parts-kit__nav"> | ||
{% for title, section in navSections %} | ||
{% set id = "nav-section-#{loop.index}" %} | ||
|
||
<li data-parts-kit-toggle | ||
{% if section.isActive %}data-active-section{% endif %} | ||
> | ||
<button | ||
class="parts-kit__button parts-kit__nav-button" | ||
aria-controls="{{ id }}" | ||
aria-expanded="{{ section.isActive ? 'true' : 'false' }}" | ||
> | ||
<div class="flex"> | ||
{{ svg('@viget/base/resources/icons/caret.svg') | attr({ | ||
class: 'parts-kit__nav-caret', | ||
}) }} | ||
{{ svg('@viget/base/resources/icons/pk-component.svg') | attr({ | ||
class: 'parts-kit__nav-component', | ||
}) }} | ||
<h3>{{ title | title }}</h3> | ||
</div> | ||
</button> | ||
|
||
<ol | ||
class="parts-kit__nav-sub-items {% if not section.isActive %}collapsed{% endif %}" | ||
id="{{ id }}" | ||
data-togglee | ||
> | ||
{% for item in section.items %} | ||
<li data-section-item | ||
data-search-text="{{ title ~ ' ' ~ item.title }}" | ||
> | ||
<a | ||
href="{{ url(item.url) }}" | ||
{% if item.isActive %}class="active"{% endif %} | ||
> | ||
<div class="flex"> | ||
{{ svg('@viget/base/resources/icons/pk-sidebar.svg') | attr({ | ||
class: 'parts-kit__nav-story', | ||
}) }} | ||
{{ item.title }} | ||
</div> | ||
</a> | ||
</li> | ||
{% endfor %} | ||
</ol> | ||
</li> | ||
{% endfor %} | ||
</ol> | ||
{% endif %} | ||
</aside> | ||
|
||
<div class="parts-kit__main"> | ||
<div class="parts-kit__main-wrapper"> | ||
<div class="parts-kit__main-header"> | ||
<button | ||
class="parts-kit__button hidden hover:text-robins-egg" | ||
data-fullscreen-expand | ||
> | ||
<span class="parts-kit__sr-only">Expand</span> | ||
{{ svg('@viget/base/resources/icons/pk-expand.svg') }} | ||
</button> | ||
<button | ||
class="parts-kit__button hidden hover:text-robins-egg" | ||
data-fullscreen-close | ||
> | ||
<span class="parts-kit__sr-only">Close</span> | ||
{{ svg('@viget/base/resources/icons/close-circle.svg') }} | ||
</button> | ||
</div> | ||
|
||
<div class="parts-kit__main-container"> | ||
{% block main %}{% endblock %} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% block main %} | ||
{% endblock %} | ||
{% endblock %} |
Oops, something went wrong.