-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(theme): Implement a 3d model viewer page type
- Loading branch information
Showing
10 changed files
with
116 additions
and
3 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
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,43 @@ | ||
{{ define "footerjs" }} | ||
<script type="module" src="/js/model-viewer.min.js"></script> | ||
{{ end }} | ||
{{ define "main" }} | ||
<div class="content"> | ||
{{ if (.Title | len) }} | ||
<h1>{{ .Title }}</h1> | ||
{{ end }} | ||
|
||
{{ .Content }} | ||
|
||
{{ if isset .Params "model3d" }} | ||
<div class="models3d"> | ||
{{ range $_, $model := .Params.model3d }} | ||
<div class="model3d"> | ||
<h2>{{ $model.title }}</h2> | ||
{{ if isset $model "description" }} | ||
<p>{{ $model.description }}</p> | ||
{{ end }} | ||
{{ range $_, $file := $model.files }} | ||
<a href="{{ $file.modelFile }}">{{ $file.name }}</a> | ||
|
||
<div class="model"> | ||
<model-viewer | ||
alt="{{ $model.description }}" | ||
src="{{ $file.modelViewer }}" | ||
camera-controls="1" | ||
touch-action="pan-y" | ||
ar-status="not-presenting"></model-viewer> | ||
</div> | ||
{{ end }} | ||
{{ if isset $model "homepage"}} | ||
<p>Homepage: <a href="{{ $model.homepage }}">{{ $model.homepage }}</a></p> | ||
{{ end }} | ||
{{ if isset $model "license" }} | ||
<p>License: <a href="{{ $model.license.url }}">{{ $model.license.name }}</a></p> | ||
{{ end }} | ||
</div> | ||
{{ end }} | ||
</div> | ||
{{ end }} | ||
</div> | ||
{{ end }} |
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,15 @@ | ||
--- | ||
title: 3D Models | ||
type: 3d-models | ||
model3d: | ||
- title: Test viewing of Neil Armstrong | ||
description: This is a test with a 3d model of Neil Armstrongn | ||
files: | ||
- name: NeilArmstrong.3mf | ||
modelFile: https://via.placeholder.com/150 | ||
modelViewer: "https://modelviewer.dev/shared-assets/models/NeilArmstrong.glb" | ||
license: | ||
name: CC-BY-SA-4.0 | ||
url: https://spdx.org/licenses/CC-BY-SA-4.0.html | ||
--- | ||
This page is an overview of 3d models that I have done something with. |
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 @@ | ||
--- | ||
title: 3D Modeller | ||
type: 3d-models | ||
model3d: | ||
- title: Test visning av Neil Armstrong | ||
description: Detta är ett test med en 3d-modell av Neil Armstrong | ||
files: | ||
- name: NeilArmstrong.3mf | ||
modelFile: https://via.placeholder.com/150 | ||
modelViewer: https://modelviewer.dev/shared-assets/models/NeilArmstrong.glb | ||
license: | ||
name: CC-BY-SA-4.0 | ||
url: https://spdx.org/licenses/CC-BY-SA-4.0.html | ||
--- | ||
|
||
Denna sida är en översikt av 3d-modeller som jag har gjort något med. |