Skip to content

Commit 2d66232

Browse files
committed
⬆️ updagrade ar.js to 1.6.0 🚀 deploy scripts and some
💄 to the instant app
1 parent 8688c7d commit 2d66232

File tree

7 files changed

+688
-448
lines changed

7 files changed

+688
-448
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ pids
1010
*.pid
1111
*.seed
1212
*.pid.lock
13+
dist
1314

1415
# Directory for instrumented libs generated by jscoverage/JSCover
1516
lib-cov

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"description": "Post-Internet Era is a multimedia and documentary long-form narrative analyzing post-internet democracies, documenting the rising of new e-models, the ways big datas and technologies are challenging the democratic process from the inside and their impact on environment.",
55
"keywords": [
66
"ar",
7-
"vr",
87
"photography",
98
"post-internet",
109
"e-democracy",
@@ -17,7 +16,7 @@
1716
"license": "AGPL-3.0",
1817
"author": {
1918
"name": "Puria Nafisi Azizi",
20-
"email": "puria@achemenide.com"
19+
"email": "puria@dyne.org"
2120
},
2221
"dependencies": {
2322
"babel-core": "6",
@@ -30,7 +29,8 @@
3029
},
3130
"scripts": {
3231
"start": "webpack-dev-server --mode development",
33-
"build": "webpack --mode production"
32+
"build": "webpack --mode production",
33+
"deploy": "yarn build && scp -r dist/* pie:www/ar && scp -r src/markup/glint/* pie:www/"
3434
},
3535
"devDependencies": {
3636
"autoprefixer": "^8.2.0",

src/css/style.scss

+23-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
1-
@import 'theme';
2-
@import '~bootstrap/scss/bootstrap';
1+
.popup {
2+
position:absolute;
3+
z-index:2;
4+
top:0;
5+
left:0;
6+
width:100%;
7+
height:100%;
8+
background:rgba(0,0,0,0.7);
9+
opacity:0;
10+
visibility:hidden;
11+
transition:.3s ease;
312

4-
.puria {
5-
color: $primary;
6-
}
13+
.show-popup & {
14+
opacity:1;
15+
visibility: visible;
16+
}
17+
18+
& > iframe {
19+
position:absolute;
20+
top:50px;
21+
left:50%;
22+
margin-left:-280px;
23+
}
24+
}

src/index.js

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
1-
import $ from 'jquery'
21
import 'bootstrap'
2+
import $ from 'jquery'
33
import style from './css/style.scss'
44

55
let found = false
66

77
$(() => {
8-
const goto_video = () => {
8+
const isMarkerFound = () => found
9+
const setMarkerFound = (s) => { found = s }
10+
const gotoVideo = () => {
911
const marker = document.body.querySelector("a-marker")
1012
if (marker.object3D.visible) {
11-
if (found) return
12-
found = true
13+
if (isMarkerFound()) return
14+
setMarkerFound(true)
1315
$("#media-popup").find("iframe").attr("src", $('a-marker').data('video'))
1416
$("body").addClass("show-popup")
1517
}
16-
requestAnimationFrame(goto_video)
18+
requestAnimationFrame(gotoVideo)
1719
}
1820

19-
requestAnimationFrame(goto_video)
21+
requestAnimationFrame(gotoVideo)
2022

2123
$(".popup").on("click", e => {
2224
e.preventDefault()
2325
e.stopPropagation()
2426
$("body").removeClass("show-popup")
27+
$("#media-popup").find("iframe").attr("src", '')
28+
setMarkerFound(false)
29+
requestAnimationFrame(gotoVideo)
2530
})
2631
$(".popup > iframe").on("click", e => { e.stopPropagation() })
27-
})
32+
})

src/markup/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
66
<title>PIE</title>
7-
<script src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.5.5/aframe/examples/vendor/aframe/build/aframe.min.js"></script>
8-
<script src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.5.5/aframe/build/aframe-ar.js"></script>
7+
<script src="https://aframe.io/releases/0.8.0/aframe.min.js"></script>
8+
<script src="https://cdn.rawgit.com/jeromeetienne/AR.js/1.6.0/aframe/build/aframe-ar.min.js"></script>
99
</head>
1010
<body>
1111
<div class="popup" id="media-popup">
@@ -16,4 +16,4 @@
1616
<a-marker preset="hiro" data-video="//www.youtube.com/embed/W_dyqGHBHck?autoplay=1"></a-marker>
1717
</a-scene>
1818
</body>
19-
</html>
19+
</html>

webpack.config.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = (env, argv) => {
1616
const images_path = 'img/'
1717

1818
const extract_scss = new wp_extract_text({
19-
filename: '[name].[contenthash].css',
19+
filename: '[name].css',
2020
disable: !is_production,
2121
});
2222

@@ -30,14 +30,14 @@ module.exports = (env, argv) => {
3030
// ]
3131
},
3232
output: {
33-
filename: is_production? '[chunkhash].js' : '[name].js',
33+
filename: is_production? 'index.[hash].js' : '[name].js',
3434
path: build,
3535
pathinfo: !is_production,
3636
},
3737
devtool: is_production? '' : 'eval-cheap-module-source-map',
3838
devServer: { contentBase: build, hot: !is_production, https: true },
3939
bail: is_production,
40-
resolve: { extensions: ['.js'] },
40+
resolve: { extensions: ['.js'] },
4141

4242
module: {
4343
rules: [
@@ -68,7 +68,7 @@ module.exports = (env, argv) => {
6868
},
6969
],
7070
},
71-
71+
7272
plugins: [
7373
new wp_copy([{ from: images_path, to: images_path }]),
7474
new wp_image_min({
@@ -88,4 +88,4 @@ module.exports = (env, argv) => {
8888
new webpack.HotModuleReplacementPlugin()
8989
],
9090
}
91-
}
91+
}

0 commit comments

Comments
 (0)