Team:Hong Kong-CUHK/team.html
From 2014.igem.org
(Difference between revisions)
m (slide box update) |
|||
Line 56: | Line 56: | ||
text-align: justify; | text-align: justify; | ||
text-justify: distribute; | text-justify: distribute; | ||
+ | } | ||
+ | </style> | ||
+ | <style type="text/css"> | ||
+ | .profile { | ||
+ | background-size: cover; | ||
+ | background-repeat: no-repeat; | ||
+ | background-position: center; | ||
+ | display: inline-block; | ||
+ | width: 180px; | ||
+ | height: 180px; | ||
+ | border-radius: 20%; | ||
+ | position: absolute; | ||
+ | cursor: default; | ||
+ | box-shadow: inset 0 0 0 0 rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1); | ||
+ | -webkit-transition: all 0.4s ease-in-out; | ||
+ | -moz-transition: all 0.4s ease-in-out; | ||
+ | -o-transition: all 0.4s ease-in-out; | ||
+ | -ms-transition: all 0.4s ease-in-out; | ||
+ | transition: all 0.4s ease-in-out; | ||
+ | } | ||
+ | .profile:hover { | ||
+ | box-shadow: inset 0 0 0 110px rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.1); | ||
+ | } | ||
+ | .profile:hover .boxAbout { | ||
+ | opacity: 1; | ||
+ | -webkit-transform: scale(1); | ||
+ | -moz-transform: scale(1); | ||
+ | -o-transform: scale(1); | ||
+ | -ms-transform: scale(1); | ||
+ | transform: scale(1); | ||
+ | } | ||
+ | .description { | ||
+ | display: block; | ||
+ | position: absolute; | ||
+ | top: 27px; | ||
+ | width: 420px; | ||
+ | height: 330px; | ||
+ | background: rgba(255, 255, 255, 0.701961); | ||
+ | } | ||
+ | .row-0-col-0 { | ||
+ | top: 7px; | ||
+ | left: 520px; | ||
+ | } | ||
+ | .row-0-col-1 { | ||
+ | top: 7px; | ||
+ | left: 750px; | ||
+ | } | ||
+ | .row-1-col-0 { | ||
+ | top: 207px; | ||
+ | left: 520px; | ||
+ | } | ||
+ | .row-1-col-1 { | ||
+ | top: 207px; | ||
+ | left: 750px; | ||
+ | } | ||
+ | </style> | ||
+ | <style type="text/css"> | ||
+ | .boxAbout { | ||
+ | position: absolute; | ||
+ | width: 100%; | ||
+ | height: 100%; | ||
+ | text-align: center center; | ||
+ | border-radius: 50%; | ||
+ | opacity: 0; | ||
+ | -webkit-transition: all 0.4s ease-in-out; | ||
+ | -moz-transition: all 0.4s ease-in-out; | ||
+ | -o-transition: all 0.4s ease-in-out; | ||
+ | -ms-transition: all 0.4s ease-in-out; | ||
+ | transition: all 0.4s ease-in-out; | ||
+ | -webkit-transform: scale(0); | ||
+ | -moz-transform: scale(0); | ||
+ | -o-transform: scale(0); | ||
+ | -ms-transform: scale(0); | ||
+ | transform: scale(0); | ||
+ | -webkit-backface-visibility: hidden; | ||
+ | } | ||
+ | .boxAbout h3 { | ||
+ | color: #fff; | ||
+ | text-align: center; | ||
+ | text-transform: uppercase; | ||
+ | position: relative; | ||
+ | letter-spacing: 2px; | ||
+ | font-size: 18px; | ||
+ | padding-top: 22px 0 0 0; | ||
+ | font-family: 'Open Sans', Arial, sans-serif; | ||
+ | text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3); | ||
} | } | ||
</style> | </style> | ||
<center> | <center> | ||
- | <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> | + | <div id="carousel-example-generic" class="carousel slide" data-ride="carousel"> |
- | + | <!-- Indicators --> | |
- | + | <ol class="carousel-indicators"> | |
- | + | <li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li> | |
- | + | <li data-target="#carousel-example-generic" data-slide-to="1"></li> | |
- | + | <li data-target="#carousel-example-generic" data-slide-to="2"></li> | |
- | + | </ol> | |
- | + | <!-- Wrapper for slides --> | |
- | + | <div class="carousel-inner"> | |
- | + | <div class="item active"> | |
- | + | <img src="https://static.igem.org/mediawiki/2014/thumb/a/ad/CUHKTEAM1.JPG/800px-CUHKTEAM1.JPG" alt="Team Photo"> | |
- | + | <div class="carousel-caption"> | |
- | + | <h3>Our Team Photo</h3> | |
- | + | </div> | |
- | + | </div> | |
- | + | <div class="item"> | |
- | + | <img src="https://static.igem.org/mediawiki/2014/thumb/a/ad/CUHKTEAM1.JPG/800px-CUHKTEAM1.JPG" alt="..."> | |
- | + | <div class="carousel-caption"> | |
- | + | <h3>2</h3> | |
- | + | <p>234</p> | |
- | + | </div> | |
- | + | </div> | |
- | + | <div class="item"> | |
- | + | <img src="https://static.igem.org/mediawiki/2014/thumb/a/ad/CUHKTEAM1.JPG/800px-CUHKTEAM1.JPG" alt="..."> | |
- | + | <div class="carousel-caption"> | |
- | + | <h3>3</h3> | |
- | + | <p>3456789</p> | |
- | + | </div> | |
- | + | </div> | |
- | + | </div> | |
- | + | <!-- Controls --> | |
- | + | <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev"> | |
- | + | <img src="https://static.igem.org/mediawiki/2014/a/ab/Cuhkleft.png" style=" | |
position: inherit; | position: inherit; | ||
display: inline-block; | display: inline-block; | ||
Line 100: | Line 186: | ||
margin-left: 0; | margin-left: 0; | ||
background:transparent;"> | background:transparent;"> | ||
- | + | </a> | |
- | + | <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next"> | |
- | + | <img src="https://static.igem.org/mediawiki/2014/b/bc/Cuhkright.png" style=" | |
position: inherit; | position: inherit; | ||
display: inline-block; | display: inline-block; | ||
Line 110: | Line 196: | ||
background:transparent; | background:transparent; | ||
"> | "> | ||
- | + | </a> | |
- | </div> | + | </div> |
</center> | </center> | ||
- | <div class="row"> | + | |
+ | <div id="team-container"> | ||
+ | <div style="display: none; width: 1024px; margin:auto;"> | ||
+ | <div style="position: relative;"> | ||
+ | <img src="https://static.igem.org/mediawiki/2014/thumb/4/49/CUHKwikiLogo.png/600px-CUHKwikiLogo.png" style="width:400px; margin:0 40px 0 0px;"> | ||
+ | <img src="https://static.igem.org/mediawiki/2014/f/fc/BIT_teamline.png" style=" margin:20px 60px 0 0;vertical-align:top;"> | ||
+ | <img src="https://static.igem.org/mediawiki/2014/5/58/BIT_teamline1.png" style=" margin:45px 40px 0 65px;vertical-align:top; width:300px;"> | ||
+ | <div class="description"></div> | ||
+ | <div class="profile row-0-col-0"> | ||
+ | <div class="boxAbout"> | ||
+ | <h3></h3> | ||
+ | </div> | ||
+ | </div> | ||
+ | <div class="profile row-0-col-1"> | ||
+ | <div class="boxAbout"> | ||
+ | <h3></h3> | ||
+ | </div> | ||
+ | </div> | ||
+ | <div class="profile row-1-col-0"> | ||
+ | <div class="boxAbout"> | ||
+ | <h3></h3> | ||
+ | </div> | ||
+ | </div> | ||
+ | <div class="profile row-1-col-1"> | ||
+ | <div class="boxAbout"> | ||
+ | <h3></h3> | ||
+ | </div> | ||
+ | </div> | ||
+ | </div> | ||
+ | </div> | ||
+ | </div> | ||
+ | |||
+ | <!-- <div class="row" style="display: none;"> | ||
<div id="board" class="center-block"> | <div id="board" class="center-block"> | ||
Line 119: | Line 237: | ||
<div id="top-bar"></div> | <div id="top-bar"></div> | ||
</div> | </div> | ||
- | + | --> | |
<script type="text/javascript"> | <script type="text/javascript"> | ||
var content = { | var content = { | ||
- | + | "containerId": "team-container", | |
- | + | "data": [{ | |
- | name: " | + | "members": [{ |
- | about: " | + | "name": "Lily1", |
- | + | "about": "1", | |
- | }, | + | "profilePicUrl": "http://placehold.it/300x300" |
- | + | }, { | |
- | + | "name": "Lily2", | |
- | + | "about": "2", | |
- | }, | + | "profilePicUrl": "http://placehold.it/300x300" |
- | + | }, { | |
- | + | "name": "Lily3", | |
- | + | "about": "3", | |
- | + | "profilePicUrl": "http://placehold.it/300x300" | |
- | + | }, { | |
- | + | "name": "Lily4", | |
- | }, | + | "about": "4", |
- | + | "profilePicUrl": "http://placehold.it/300x300" | |
- | + | }] | |
- | + | }, { | |
- | + | "members": [{ | |
- | + | "name": "Lily5", | |
- | } | + | "about": "1", |
- | } | + | "profilePicUrl": "http://placehold.it/300x300" |
+ | }, { | ||
+ | "name": "Lily6", | ||
+ | "about": "2", | ||
+ | "profilePicUrl": "http://placehold.it/300x300" | ||
+ | }, { | ||
+ | "name": "Lily7", | ||
+ | "about": "3", | ||
+ | "profilePicUrl": "http://placehold.it/300x300" | ||
+ | }, { | ||
+ | "name": "Lily8", | ||
+ | "about": "4", | ||
+ | "profilePicUrl": "http://placehold.it/300x300" | ||
+ | }] | ||
}] | }] | ||
}; | }; | ||
+ | |||
+ | function fillMemberContent(model, boxProfile, boxAbout) { | ||
+ | |||
+ | |||
+ | // $.each(model['members'], function(index, value) { | ||
+ | // var row = Math.floor((index + 0.5) / 2); | ||
+ | // var col = index % 2; | ||
+ | // var classToFind = '#' + model['tableId'] + ' .row .' + 'row-' + row + '-col-' + col; | ||
+ | // console.log(classToFind + ', ' + value['name']); | ||
+ | // $(classToFind).text(value['name']); | ||
+ | // $(classToFind).mouseenter(function() { | ||
+ | // '#' + model['tableId'] + '' | ||
+ | // }); | ||
+ | // }); | ||
+ | boxProfile.find('.boxAbout h3').text(model['name']); | ||
+ | boxProfile.css('background-image', "url('" + model['profilePicUrl'] + "')"); | ||
+ | boxProfile.click(function() { | ||
+ | boxAbout.text(model['about']); | ||
+ | }); | ||
+ | boxProfile.hover(function() { | ||
+ | boxAbout.text(model['about']); | ||
+ | }); | ||
+ | } | ||
$(document).ready(function() { | $(document).ready(function() { | ||
- | + | $(function() { | |
- | + | $('.carousel').carousel({ | |
- | + | interval: 3000 | |
+ | }); | ||
}); | }); | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | + | var contentContainer = $('#' + content.containerId); | |
- | + | $.each(content.data, function(rowIndex, data) { | |
- | + | //var viewRow = $('#' + content.containerId + ' .row:nth-of-type(' + (rowIndex + 1) + ')'); | |
- | + | var viewRow = contentContainer.find('div:first').clone(); | |
- | . | + | console.log(viewRow); |
- | . | + | var boxAbout = viewRow.find('.description'); |
+ | $.each(data.members, function(position, member) { | ||
+ | var row = Math.floor((position + 0.5) / 2); | ||
+ | var col = position % 2; | ||
+ | var boxProfile = viewRow.find(' .' + 'row-' + row + '-col-' + col); | ||
+ | fillMemberContent(member, boxProfile, boxAbout); | ||
+ | }); | ||
+ | viewRow.show(); | ||
+ | contentContainer.append(viewRow); | ||
+ | }); | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | + | //fillTeamContent(content.webLab); | |
- | + | ||
- | + | ||
- | + | ||
- | wrapper.append(chess); | + | // $.each(content.members, function(index, value) { |
- | + | // var wrapper = $('<div></div>') | |
- | + | // .addClass('member-wrapper') | |
- | + | // .css('position', 'relative') | |
- | }); | + | // .offset(value.offset); |
+ | |||
+ | // var dialog = $('<div></div>') | ||
+ | // .addClass('profile-dialog') | ||
+ | // .css('font-size', '18') | ||
+ | // .css('background', value.dialog.background) | ||
+ | // .text(value.info.about) | ||
+ | // .offset(value.dialog.offset); | ||
+ | |||
+ | // var profile_pic = $('<div></div>') | ||
+ | // .addClass('profile-pic') | ||
+ | // .data("index", index) | ||
+ | // .css('background', value.profilePic.background) | ||
+ | // .offset(value.profilePic.offset); | ||
+ | |||
+ | // var chess = $('<div></div>') | ||
+ | // .addClass('chess') | ||
+ | // .data("index", index) | ||
+ | // .css('background-image', 'url(images/chess/chess_' + value.info.chessColor + '.png)'); | ||
+ | |||
+ | // wrapper.append(chess); | ||
+ | // wrapper.append(profile_pic); | ||
+ | // wrapper.append(dialog); | ||
+ | // $("#board").append(wrapper); | ||
+ | // }); | ||
}); | }); | ||
</script> | </script> |
Revision as of 02:29, 18 October 2014
<style type="text/css">
- board {
background-image: url('images/board.png'); background-size: 100% 100%; width: 700px; height: 700px;
} .chess {
background-size: 100% 100%; width: 40px; height: 40px; position: absolute; cursor: pointer;
} .profile-pic {
background-size: 100% 100%; width: 100px; height: 100px; position: absolute; cursor: pointer;
} .profile-dialog {
width: 300px; height: 300px; position: absolute; display: none;
} .member-wrapper:hover > .profile-dialog {
display: block;
} .photo {
width: 83px; height: 250px; background-position: center; background-size: auto 100%; background-repeat: no-repeat; -webkit-filter: grayscale(80%); margin: 0;
} .photo:hover {
-webkit-filter: grayscale(0%);
} .photo.show {
width: 250px; height: 250px; -webkit-filter: grayscale(0%);
} .member-name {
text-transform: uppercase; margin: 0;
} .member-role {
font-style: italic;
} .member-about {
text-align: justify; text-justify: distribute;
} </style> <style type="text/css"> .profile {
background-size: cover; background-repeat: no-repeat; background-position: center; display: inline-block; width: 180px; height: 180px; border-radius: 20%; position: absolute; cursor: default; box-shadow: inset 0 0 0 0 rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1); -webkit-transition: all 0.4s ease-in-out; -moz-transition: all 0.4s ease-in-out; -o-transition: all 0.4s ease-in-out; -ms-transition: all 0.4s ease-in-out; transition: all 0.4s ease-in-out;
} .profile:hover {
box-shadow: inset 0 0 0 110px rgba(200, 95, 66, 0.4), inset 0 0 0 16px rgba(255, 255, 255, 0.8), 0 1px 2px rgba(0, 0, 0, 0.1);
} .profile:hover .boxAbout {
opacity: 1; -webkit-transform: scale(1); -moz-transform: scale(1); -o-transform: scale(1); -ms-transform: scale(1); transform: scale(1);
} .description {
display: block; position: absolute; top: 27px; width: 420px; height: 330px; background: rgba(255, 255, 255, 0.701961);
} .row-0-col-0 {
top: 7px; left: 520px;
} .row-0-col-1 {
top: 7px; left: 750px;
} .row-1-col-0 {
top: 207px; left: 520px;
} .row-1-col-1 {
top: 207px; left: 750px;
} </style> <style type="text/css"> .boxAbout {
position: absolute; width: 100%; height: 100%; text-align: center center; border-radius: 50%; opacity: 0; -webkit-transition: all 0.4s ease-in-out; -moz-transition: all 0.4s ease-in-out; -o-transition: all 0.4s ease-in-out; -ms-transition: all 0.4s ease-in-out; transition: all 0.4s ease-in-out; -webkit-transform: scale(0); -moz-transform: scale(0); -o-transform: scale(0); -ms-transform: scale(0); transform: scale(0); -webkit-backface-visibility: hidden;
} .boxAbout h3 {
color: #fff; text-align: center; text-transform: uppercase; position: relative; letter-spacing: 2px; font-size: 18px; padding-top: 22px 0 0 0; font-family: 'Open Sans', Arial, sans-serif; text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
} </style>
<script type="text/javascript"> var content = {
"containerId": "team-container", "data": [{ "members": [{ "name": "Lily1", "about": "1", "profilePicUrl": "http://placehold.it/300x300" }, { "name": "Lily2", "about": "2", "profilePicUrl": "http://placehold.it/300x300" }, { "name": "Lily3", "about": "3", "profilePicUrl": "http://placehold.it/300x300" }, { "name": "Lily4", "about": "4", "profilePicUrl": "http://placehold.it/300x300" }] }, { "members": [{ "name": "Lily5", "about": "1", "profilePicUrl": "http://placehold.it/300x300" }, { "name": "Lily6", "about": "2", "profilePicUrl": "http://placehold.it/300x300" }, { "name": "Lily7", "about": "3", "profilePicUrl": "http://placehold.it/300x300" }, { "name": "Lily8", "about": "4", "profilePicUrl": "http://placehold.it/300x300" }] }]
};
function fillMemberContent(model, boxProfile, boxAbout) {
// $.each(model['members'], function(index, value) { // var row = Math.floor((index + 0.5) / 2); // var col = index % 2; // var classToFind = '#' + model['tableId'] + ' .row .' + 'row-' + row + '-col-' + col; // console.log(classToFind + ', ' + value['name']); // $(classToFind).text(value['name']); // $(classToFind).mouseenter(function() { // '#' + model['tableId'] + // }); // }); boxProfile.find('.boxAbout h3').text(model['name']); boxProfile.css('background-image', "url('" + model['profilePicUrl'] + "')"); boxProfile.click(function() { boxAbout.text(model['about']); }); boxProfile.hover(function() { boxAbout.text(model['about']); });
}
$(document).ready(function() {
$(function() { $('.carousel').carousel({ interval: 3000 }); });
var contentContainer = $('#' + content.containerId); $.each(content.data, function(rowIndex, data) { //var viewRow = $('#' + content.containerId + ' .row:nth-of-type(' + (rowIndex + 1) + ')'); var viewRow = contentContainer.find('div:first').clone(); console.log(viewRow); var boxAbout = viewRow.find('.description'); $.each(data.members, function(position, member) { var row = Math.floor((position + 0.5) / 2); var col = position % 2; var boxProfile = viewRow.find(' .' + 'row-' + row + '-col-' + col); fillMemberContent(member, boxProfile, boxAbout); }); viewRow.show(); contentContainer.append(viewRow); });
//fillTeamContent(content.webLab);
// $.each(content.members, function(index, value) {// var wrapper = $('')
// .addClass('member-wrapper') // .css('position', 'relative') // .offset(value.offset);// var dialog = $('')
// .addClass('profile-dialog') // .css('font-size', '18') // .css('background', value.dialog.background) // .text(value.info.about) // .offset(value.dialog.offset);// var profile_pic = $('')
// .addClass('profile-pic') // .data("index", index) // .css('background', value.profilePic.background) // .offset(value.profilePic.offset);// var chess = $('')
// .addClass('chess') // .data("index", index) // .css('background-image', 'url(images/chess/chess_' + value.info.chessColor + '.png)');
// wrapper.append(chess); // wrapper.append(profile_pic); // wrapper.append(dialog); // $("#board").append(wrapper); // });
}); </script>