Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev build-site #1

Merged
merged 12 commits into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/build-site → .github/workflows/build-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ jobs:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand All @@ -30,3 +35,26 @@ jobs:
uses: matteopic/[email protected]
with:
thconfig: 'buco-del-bagno.thconfig'

- name: Retrieve CaveView.js
uses: robinraju/[email protected]
with:
repository: "aardgoose/CaveView.js"
latest: true
fileName: "CaveView.zip"
extract: true
out-file-path: 'out'

- name: Cleanup
run: |
rm -f CaveView.zip .gitkeep

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
# Upload 'out' directory
path: 'out'

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
/.history

# Ignore output files
/out/*
/out/*
!out/inde.html
88 changes: 88 additions & 0 deletions out/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
<!DOCTYPE html>
<html lang="it">
<head>
<title>73MAAN - Buco del Bagno</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link type="text/css" href="CaveView/css/caveview.css" rel="stylesheet"/>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css">
<meta name="Description" content="Buco del Bagno survey data">
<style>.cv-container{width: 100%;}</style>
</head>
<body onload="onload();" >
<div class="container-fluid">
<h1 class="text-center">73MAAN - Buco del Bagno</h1>
<div class="row">
<div class="col">
<div id="scene"></div>
</div>
</div>

<div class="row mt-5">
<div class="offset-lg-3 col-lg-6">
<h3>Globale</h3>
<p>
<i class="bi bi-file-earmark-pdf"></i> <a href="./Buco del Bagno - sezione.pdf">Sezione</a><br/>
<i class="bi bi-file-earmark-pdf"></i> <a href="./Buco del Bagno - poligonali sezione.pdf">Poligonali - Sezione</a><br/>
<i class="bi bi-file-earmark-pdf"></i> <a href="./Buco del Bagno - poligonali pianta.pdf">Poligonali - Pianta</a><br/>
</p>
</div>
</div>
<div class="row">
<div class="offset-lg-3 col-lg-6">
<h3>3D</h3>
<p>
<a href="./Buco del Bagno.lox">Therion LOX file</a>
</p>
</div>
</div>

<footer>
<div class="row mt-3">
<div class="offset-lg-3 col-lg-6">
<p>
<i class="bi bi-github"></i>
<a href="https://github.com/matteopic/buco-del-bagno">Follow this project on GitHub</a>
</p>
</div>
</div>
</footer>
</div>

<script type="text/javascript" src="CaveView/js/CaveView2.js" ></script>
<script type="text/javascript" >
function openExternalLink(event){
event.preventDefault();
const aElement = event.target;
window.open(aElement.href, '_blank');
return false;
}

function onload () {
[...document.getElementsByClassName("external-link")].forEach(element => {
element.onclick = openExternalLink;
});

const viewer = new CV2.CaveViewer( "scene", {
terrainDirectory: "",
surveyDirectory: "",
home: "/CaveView/",
view:{
scraps: true,
terrain: true,
grid: true,
},
});

viewer.addEventListener('newCave', (e)=>{
viewer.getControls().rotateUp(Math.PI / 180.0 * (27-90));
viewer.getControls().rotateLeft(Math.PI / 180.0 * -35);
});

const ui = new CV2.CaveViewUI( viewer );
ui.loadCave( 'Buco%20del%20Bagno.lox' );
}
</script>
</body>
</html>