ajout variable texte lien ArtStation

This commit is contained in:
nyanloutre 2019-07-14 12:33:35 +02:00
parent 3a329b42ef
commit b170d96546
Signed by: nyanloutre
GPG Key ID: 194A92D1103ACB2A
1 changed files with 7 additions and 4 deletions

View File

@ -148,7 +148,7 @@
<source src="video/portfolio/lant.webm" type="video/webm"> <source src="video/portfolio/lant.webm" type="video/webm">
</video> </video>
</div> </div>
<div class="element-portfolio video-portfolio clickable col-lg-4 col-sm-6" data-toggle="modal" data-target="#iframeModal" data-vimeoid="287802537?autoplay=1&loop=1&autopause=0" data-artstationid="xzKzvX" data-comment="When a train leaves the earth..."> <div class="element-portfolio video-portfolio clickable col-lg-4 col-sm-6" data-toggle="modal" data-target="#iframeModal" data-vimeoid="287802537?autoplay=1&loop=1&autopause=0" data-artstationid="xzKzvX" data-artstationtext="More details on ArtStation" data-comment="When a train leaves the earth...">
<video loop muted poster="img/portfolio/loco.jpg"> <video loop muted poster="img/portfolio/loco.jpg">
<source src="video/portfolio/loco.webm" type="video/webm"> <source src="video/portfolio/loco.webm" type="video/webm">
</video> </video>
@ -386,6 +386,7 @@
var vimeo_id = button.data('vimeoid'); var vimeo_id = button.data('vimeoid');
var sketchfab_id = button.data('sketchfabid'); var sketchfab_id = button.data('sketchfabid');
var artstation_id = button.data('artstationid'); var artstation_id = button.data('artstationid');
var artstation_text = button.data('artstationtext');
var comment = button.data('comment'); var comment = button.data('comment');
var options = button.data('options'); var options = button.data('options');
@ -423,18 +424,20 @@
var modal_comment = modal.find('.modal-body .modal-comment')[0]; var modal_comment = modal.find('.modal-body .modal-comment')[0];
if (comment || artstation_id) {
modal_comment.appendChild(document.createElement('hr'));
}
if (comment) { if (comment) {
var comment_object = document.createElement('p'); var comment_object = document.createElement('p');
comment_object.innerText = comment; comment_object.innerText = comment;
modal_comment.appendChild(document.createElement('hr'));
modal_comment.appendChild(comment_object); modal_comment.appendChild(comment_object);
} }
if (artstation_id) { if (artstation_id) {
var artstation_link = document.createElement('a'); var artstation_link = document.createElement('a');
artstation_link.title = "More details on ArtStation"; artstation_link.text = artstation_text;
artstation_link.href = "https://www.artstation.com/artwork/" + artstation_id; artstation_link.href = "https://www.artstation.com/artwork/" + artstation_id;
modal_comment.appendChild(document.createElement('hr'));
modal_comment.appendChild(artstation_link); modal_comment.appendChild(artstation_link);
} }
}); });