Skip to content

Commit

Permalink
add initial heem air example (not linked in sidebar because it is WIP…
Browse files Browse the repository at this point in the history
…, we need to calculate the fitting of the image in the viewport based on aspect ratio)
  • Loading branch information
trusktr committed Aug 24, 2021
1 parent 9908f25 commit 93f6d04
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
14 changes: 14 additions & 0 deletions packages/lume/docs/examples/heem-air/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Heem Air

<div id="example"></div>
<script>
new Vue({
el: '#example',
template: '<live-code class="full" :template="code" :autorun="true" mode="html>iframe" />',
data: { code: perspectiveLayeredImage({
bg: '/examples/heem-air/bg.jpg',
fg: '/examples/heem-air/fg.png',
bgPosition: {x: 0, y: 36},
}) },
})
</script>
Binary file added packages/lume/docs/examples/heem-air/bg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added packages/lume/docs/examples/heem-air/fg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions packages/lume/docs/examples/indian-boombox/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Buttons with shadow
# Indian Boombox

<div id="example"></div>
<script>
new Vue({
el: '#example',
template: '<live-code class="full" :template="code" :autorun="true" mode="html>iframe" />',
data: { code: indianBoombox() },
data: { code: perspectiveLayeredImage({bg: '/examples/indian-boombox/bg.jpg', fg: '/examples/indian-boombox/fg.png'}) },
})
</script>
9 changes: 5 additions & 4 deletions packages/lume/docs/js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ function directionalLightExample() {
`)
}

function indianBoombox() {
function perspectiveLayeredImage({bg, fg, bgPosition = {}, fgPosition = {}}) {
return stripIndent(/*html*/ `
<script src="${location.origin + location.pathname}global.js"></script>
Expand All @@ -612,15 +612,16 @@ function indianBoombox() {
mount-point="0.5 0.5"
size-mode="proportional proportional"
size="1 1"
scale="1.2 1.2 1.2"
>
<lume-mixed-plane
size-mode="proportional proportional"
size="1 1"
position="0 0 -50"
position="${bgPosition.x || 0} ${bgPosition.y || 0} -50"
color="#444"
TODO-material-opacity="0.3"
>
<img src="${location.origin + location.pathname}/examples/indian-boombox/bg.jpg" />
<img src="${location.origin + location.pathname}${bg}" />
</lume-mixed-plane>
<lume-mixed-plane
size-mode="proportional proportional"
Expand All @@ -629,7 +630,7 @@ function indianBoombox() {
color="#444"
TODO-material-opacity="0.3"
>
<img src="${location.origin + location.pathname}/examples/indian-boombox/fg.png" />
<img src="${location.origin + location.pathname}${fg}" />
</lume-mixed-plane>
</lume-node>
</lume-scene>
Expand Down

0 comments on commit 93f6d04

Please sign in to comment.