page1.html 2.25 KB
Newer Older
Alfakhori's avatar
Alfakhori committed
1
2
3
4
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
5
  <title>ChatGPT code</title>
Alfakhori's avatar
Alfakhori committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  <script src="https://aframe.io/releases/1.2.0/aframe.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/@argonjs/argon@4.0.0/dist/argon.min.js"></script>
  <script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar-nft.js"></script>
  <script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script>
  <script src="https://unpkg.com/@seregpie/VueGestures@1.0.0/dist/vue-gestures.umd.min.js"></script>
  <script src="https://unpkg.com/@seregpie/VueDraggableResizable@2.2.0/dist/vue-draggable-resizable.umd.min.js">
  </script>
  <style>
    #info {
      position: absolute;
      top: 20px;
      width: 100%;
      text-align: center;
      z-index: 1;
    }

    #arjsDebugUIContainer {
      position: absolute;
      bottom: 5px;
      left: 5px;
      z-index: 1;
    }

    .draggable {
      border: 2px solid blue;
      position: absolute;
      background-color: rgba(255, 255, 255, 0.8);
      padding: 10px;
    }
  </style>
</head>
<body>
  <a-scene
    vr-mode-ui="enabled: false"
    arjs="debugUIEnabled: false; sourceType: webcam; debug: true; patternRatio: 0.75; detectionMode: mono_and_matrix;"
  >
    <a-marker
      preset="custom"
      type="barcode"
      barcode-value="4"
      id="marker1"
      emitevents="true"
48
      location-based="latitude: 48.77988545503521; longitude: 9.173586527979367; altitude: 0;"
Alfakhori's avatar
Alfakhori committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
    >
      <a-entity
        id="model1"
        gltf-model="url(/models/duck/scene.gltf)"
        scale="0.1 0.1 0.1"
      ></a-entity>
    </a-marker>
  </a-scene>

  <div id="info">
    <p>Loading...</p>
  </div>

  <div id="arjsDebugUIContainer"></div>

  <script>
    const scene = document.querySelector("a-scene");
    const marker1 = document.querySelector("#marker1");
    const model1 = document.querySelector("#model1");
    const info = document.querySelector("#info");

    // Wait for marker to load before displaying content
    marker1.addEventListener("markerFound", (e) => {
      info.style.display = "none";
    });

    // When the marker is lost, display the info again
    marker1.addEventListener("markerLost", (e) => {
      info.style.display = "block";
    });
  </script>
</body>
</html>