Widget:3D-Modell: Unterschied zwischen den Versionen
Simon (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung Markierung: 2017-Quelltext-Bearbeitung |
Simon (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung Markierung: 2017-Quelltext-Bearbeitung |
||
Zeile 1: | Zeile 1: | ||
style type="text/css"> | |||
body { | body { | ||
margin: 0; | margin: 0; | ||
Zeile 16: | Zeile 16: | ||
height: 100%; | height: 100%; | ||
z-index: 0; | z-index: 0; | ||
background-image: url(/alteskoeln/3dmodel/Giesen-Stadtmodell-2000.jpg); | background-image: url(../alteskoeln/3dmodel/Giesen-Stadtmodell-2000.jpg); | ||
background-position: center; | background-position: center; | ||
background-repeat: no-repeat; | background-repeat: no-repeat; | ||
Zeile 124: | Zeile 124: | ||
.ak-3dmodel__poi-list ol a:hover, | .ak-3dmodel__poi-list ol a:hover, | ||
.ak-3dmodel__poi-list ol a.ak-3dmodel__poi-list-link_active { | .ak-3dmodel__poi-list ol a.ak-3dmodel__poi-list-link_active { | ||
background-color: #fefefe; | |||
} | |||
.ak-3model__info-link { | |||
position: absolute; | |||
right: 2em; | |||
top: 2em; | |||
z-index: 11; | |||
display: inline-block; | |||
width: 2.5em; | |||
height: 2.5em; | |||
color: #495057; | |||
/* Info icon taken from https://feathericons.com/ and adjusted. */ | |||
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='16' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='8' x2='12' y2='8'%3E%3C/line%3E%3C/svg%3E"); | |||
background-color: hsla(0,0%,99.6%,.85); | |||
border-radius: 50%; | |||
} | |||
.ak-3model__info-link:hover { | |||
background-color: #fefefe; | background-color: #fefefe; | ||
} | } | ||
Zeile 199: | Zeile 218: | ||
<div class="ak-3dmodel__background-blur"></div> | <div class="ak-3dmodel__background-blur"></div> | ||
<div class="ak-3dmodel__view"> | <div class="ak-3dmodel__view"> | ||
<!-- TODO Attribution --> | <!-- TODO Attribution | ||
<img src="/alteskoeln/3dmodel/Giesen-Stadtmodell-2000.jpg" class="ak-3dmodel__fullview" usemap="#ak-3dmodel__imagemap" width="2000" height="1707" alt="Plastisches Stadtmodell von Köln um 1571" /> | Köln-Stadtmodell von Theo Giesen (1922-1990) - Sammlung Kormann im KuMuMü - Kulturmuseum Mülheim an der Ruhr - Fotografien: Bernd Pirschtat --> | ||
<img src="/alteskoeln/3dmodel/Giesen-Stadtmodell-2000_fow.jpg" class="ak-3dmodel__fowview" alt="" width="2000" height="1707" /> | <img src="../alteskoeln/3dmodel/Giesen-Stadtmodell-2000.jpg" class="ak-3dmodel__fullview" usemap="#ak-3dmodel__imagemap" width="2000" height="1707" alt="Plastisches Stadtmodell von Köln um 1571" /> | ||
<img src="../alteskoeln/3dmodel/Giesen-Stadtmodell-2000_fow.jpg" class="ak-3dmodel__fowview" alt="" width="2000" height="1707" /> | |||
<img src="/alteskoeln/3dmodel/SB_01_St_Martin.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-martin" alt="" /> | <img src="../alteskoeln/3dmodel/SB_01_St_Martin.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-martin" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_02_St_Brigiden.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-brigiden" alt="" /> | <img src="../alteskoeln/3dmodel/SB_02_St_Brigiden.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-brigiden" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_03_Unterlan.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-unterlan" alt="" /> | <img src="../alteskoeln/3dmodel/SB_03_Unterlan.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-unterlan" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_04_St_Alban.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-alban" alt="" /> | <img src="../alteskoeln/3dmodel/SB_04_St_Alban.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-alban" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_05_St_Laurenz.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-laurenz" alt="" /> | <img src="../alteskoeln/3dmodel/SB_05_St_Laurenz.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-laurenz" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_06_St_Peter.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-peter" alt="" /> | <img src="../alteskoeln/3dmodel/SB_06_St_Peter.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-peter" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_07_St_Columba.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-kolumba" alt="" /> | <img src="../alteskoeln/3dmodel/SB_07_St_Columba.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-kolumba" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_08_St_Aposteln.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-aposteln" alt="" /> | <img src="../alteskoeln/3dmodel/SB_08_St_Aposteln.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-aposteln" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_09_Niederich.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-niederich" alt="" /> | <img src="../alteskoeln/3dmodel/SB_09_Niederich.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-niederich" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_10_Airsbach.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-airsbach" alt="" /> | <img src="../alteskoeln/3dmodel/SB_10_Airsbach.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-airsbach" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_11_St_Christoph.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-christoph" alt="" /> | <img src="../alteskoeln/3dmodel/SB_11_St_Christoph.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-christoph" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_12_St_Mauritius.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-mauritius" alt="" /> | <img src="../alteskoeln/3dmodel/SB_12_St_Mauritius.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-mauritius" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_13_St_Severin.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-severin" alt="" /> | <img src="../alteskoeln/3dmodel/SB_13_St_Severin.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-severin" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_14_St_Gereon.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-gereon" alt="" /> | <img src="../alteskoeln/3dmodel/SB_14_St_Gereon.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-gereon" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_15_Eigelstein.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-eigelstein" alt="" /> | <img src="../alteskoeln/3dmodel/SB_15_Eigelstein.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-eigelstein" alt="" /> | ||
<img src="/alteskoeln/3dmodel/SB_16_Hacht.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-hacht" alt="" /> | <img src="../alteskoeln/3dmodel/SB_16_Hacht.jpg" class="ak-3dmodel__sb" id="ak-3dmodel__sb-hacht" alt="" /> | ||
<map name="ak-3dmodel__imagemap" class="ak-3dmodel__imagemap"> | <map name="ak-3dmodel__imagemap" class="ak-3dmodel__imagemap"> | ||
Zeile 238: | Zeile 258: | ||
<area alt="Hacht" title="Hacht" href="/wiki/Schreinsbezirk_XVI_Hacht" coords="1245,725,1209,689,1199,693,1140,636,1132,587,1112,557,1178,497,1190,502,1199,491,1273,544,1319,585,1335,622,1372,663,1391,677,1393,663,1404,682,1400,691,1386,698,1374,677,1287,703" shape="poly" data-highlight-image="ak-3dmodel__sb-hacht"> | <area alt="Hacht" title="Hacht" href="/wiki/Schreinsbezirk_XVI_Hacht" coords="1245,725,1209,689,1199,693,1140,636,1132,587,1112,557,1178,497,1190,502,1199,491,1273,544,1319,585,1335,622,1372,663,1391,677,1393,663,1404,682,1400,691,1386,698,1374,677,1287,703" shape="poly" data-highlight-image="ak-3dmodel__sb-hacht"> | ||
</map> | </map> | ||
<div class="ak-3dmodel__sidebar"> | <div class="ak-3dmodel__sidebar"> | ||
<div class="ak-3dmodel__poi-list ak-3dmodel__poi-list-sb"> | <div class="ak-3dmodel__poi-list ak-3dmodel__poi-list-sb"> | ||
Zeile 261: | Zeile 282: | ||
</div> | </div> | ||
</div> | </div> | ||
<a href="/wiki/Stadtmodell/Info_zum_Stadtmodell" class="ak-3model__info-link" aria-label="Über das Stadtmodell" title="Über das Stadtmodell"></a> | |||
</div> | </div> | ||
</div> | </div> | ||
Zeile 266: | Zeile 289: | ||
<!-- Make image map responsive. --> | <!-- Make image map responsive. --> | ||
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> | <script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> | ||
<script type="text/javascript" src="/alteskoeln/jquery.rwdImageMaps.min.js"></script> | <script type="text/javascript" src="../alteskoeln/jquery.rwdImageMaps.min.js"></script> | ||
<script> | <script> | ||
$(document).ready(function() { | $(document).ready(function() { |
Version vom 9. Januar 2021, 14:07 Uhr
style type="text/css"> body { margin: 0; padding: 0; }
.ak-3dmodel__widget { height: 100vh; }
.ak-3dmodel__background-blur { position: absolute; left: 0; top: 0; width: 100%; height: 100%; z-index: 0; background-image: url(../alteskoeln/3dmodel/Giesen-Stadtmodell-2000.jpg); background-position: center; background-repeat: no-repeat; background-size: cover; filter: blur(10px); opacity: 0.7; }
.ak-3dmodel__view { position: relative; height: 100%; width: calc(100vh * 1.171646162858817); margin-left: auto; margin-right: auto; }
.ak-3dmodel__fullview { position: relative; z-index: 1; width: auto; height: 100%; opacity: 1; transition: opacity .2s; }
.ak-3dmodel__view:hover .ak-3dmodel__fullview, .ak-3dmodel__view.ak-3dmodel__view_highlighted .ak-3dmodel__fullview { opacity: 0; }
/* TODO Can we do this with a CSS colour overlay instead to avoid loading this data? But it probably wouldn't match the colour of the highlight images. Maybe we can do that purely with canvas/SVG and very precise outlines? */ .ak-3dmodel__fowview { position: absolute; top: 0; left: 0; width: auto; height: 100%; }
.ak-3dmodel__sb { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .2s; /* TODO Use cutouts from the images and position them relative to the full image to reduce amount of data to be loaded. How to scale and position them to the responsive image? */ width: auto; height: 100%; }
.ak-3dmodel__sb.ak-3dmodel__sb_active { opacity: 1; }
.ak-3dmodel__sidebar { position: absolute; right: 2em; bottom: 2em; z-index: 11; font-family: Arial, sans-serif; font-size: 16px; color: #495057; }
.ak-3dmodel__sidebar a { color: #495057; text-decoration: none; }
.ak-3dmodel__poi-list h3 { margin: 0; padding: 0.5em 1em; background-color: rgba(73, 80, 87, .85); color: #fefefe; font-weight: bold; font-size: 16px; line-height: normal; }
.ak-3dmodel__poi-list h3:hover { background-color: rgb(73, 80, 87); }
.ak-3dmodel__poi-list ol { list-style-type: none; margin: 0; padding: 0; overflow-y: auto; height: 52vh; }
.ak-3dmodel__poi-list ol li { margin: 0; }
.ak-3dmodel__poi-list ol li + li { border-top: 1px solid #ccc; }
.ak-3dmodel__poi-list ol a { display: block; padding: 0.5em 1em; background-color: hsla(0,0%,99.6%,.85); transition: background-color .2s; }
.ak-3dmodel__poi-list ol a:hover, .ak-3dmodel__poi-list ol a.ak-3dmodel__poi-list-link_active { background-color: #fefefe; }
.ak-3model__info-link { position: absolute; right: 2em; top: 2em; z-index: 11; display: inline-block; width: 2.5em; height: 2.5em; color: #495057; /* Info icon taken from https://feathericons.com/ and adjusted. */ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='16' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='8' x2='12' y2='8'%3E%3C/line%3E%3C/svg%3E"); background-color: hsla(0,0%,99.6%,.85); border-radius: 50%; }
.ak-3model__info-link:hover { background-color: #fefefe; } </style>
<script> document.addEventListener('DOMContentLoaded', function(event) { var widgets = document.getElementsByClassName('ak-3dmodel__widget'); for (var i = 0; i < widgets.length; i++) { initWidget(widgets[i]); } });
function initWidget(widget) { var imageMap = widget.getElementsByClassName('ak-3dmodel__imagemap')[0]; var areas = imageMap.children; for (var i = 0; i < areas.length; i++) { addAreaEventListeners(areas[i]); }
var view = widget.getElementsByClassName('ak-3dmodel__view')[0]; var poiList = widget.getElementsByClassName('ak-3dmodel__poi-list-sb')[0]; var sbLinks = poiList.querySelectorAll('ol li a'); for (i = 0; i < sbLinks.length; i++) { addSBLinksEventListeners(sbLinks[i], view); } }
function addAreaEventListeners(area) { // TODO How to make this accessible on mobile? Tapping would activate the link. Maybe change that on mobile. area.addEventListener('mouseenter', function() { if (area.dataset.highlightImage) { var highlightImage = document.getElementById(area.dataset.highlightImage); highlightImage.classList.add('ak-3dmodel__sb_active');
var sbLink = document.querySelector('.ak-3dmodel__poi-list-sb a[data-highlight-image="' + area.dataset.highlightImage + '"]'); if (sbLink) { sbLink.classList.add('ak-3dmodel__poi-list-link_active'); } } }); area.addEventListener('mouseleave', function() { if (area.dataset.highlightImage) { var highlightImage = document.getElementById(area.dataset.highlightImage); highlightImage.classList.remove('ak-3dmodel__sb_active');
var sbLink = document.querySelector('.ak-3dmodel__poi-list-sb a[data-highlight-image="' + area.dataset.highlightImage + '"]'); if (sbLink) { sbLink.classList.remove('ak-3dmodel__poi-list-link_active'); } } }); }
function addSBLinksEventListeners(sbLink, view) { // TODO How to make this accessible on mobile? Tapping would activate the link. Maybe change that on mobile. sbLink.addEventListener('mouseenter', function() { if (sbLink.dataset.highlightImage) { var highlightImage = document.getElementById(sbLink.dataset.highlightImage); highlightImage.classList.add('ak-3dmodel__sb_active'); view.classList.add('ak-3dmodel__view_highlighted'); } }); sbLink.addEventListener('mouseleave', function() { if (sbLink.dataset.highlightImage) { var highlightImage = document.getElementById(sbLink.dataset.highlightImage); highlightImage.classList.remove('ak-3dmodel__sb_active'); view.classList.remove('ak-3dmodel__view_highlighted'); } }); } </script>
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> <script type="text/javascript" src="../alteskoeln/jquery.rwdImageMaps.min.js"></script> <script> $(document).ready(function() { $('img[usemap]').rwdImageMaps(); }); </script>