Line 39: | Line 39: | ||
$(".timeline-content").addClass("contentDay"); | $(".timeline-content").addClass("contentDay"); | ||
$(".timeline").addClass("timelineDay"); | $(".timeline").addClass("timelineDay"); | ||
− | $(". | + | $(".toolate".addClass("timelineDay"); |
$('#change').click(function(){NightStyle();}); | $('#change').click(function(){NightStyle();}); | ||
} | } |
Revision as of 02:43, 18 October 2018
$(document).ready(function(){
DayorNight(); }) function DayorNight(){ var hour = new Date().getHours(); if (hour>6&&hour<18) {DayStyle();}; if (hour<=6||hour>=18) {NightStyle();}; function DayStyle(){ /*var arrimg= new Array(); var arrimg=["img/mydesign/rigui.png","img/mydesign/sunflower.png","img/mydesign/clock.png","img/mydesign/hourglass2.png","img/mydesign/Annual ring.jpg","img/mydesign/bud.jpg"];*/ $("#BgChange img:eq(0)").attr('src','https://static.igem.org/mediawiki/2018/3/35/T--Tianjin--Day.jpg'); /*$(".timeline-image img").each(function(e){ $(this).attr('src',arrimg[e]); })*/ /*$(".timeline-icon").each(function(e){if(e>=1){var i=2*e+8;var t=i+":00";};if(e<1){var i=2*e+8;var t="0"+i+":00";};$(this).text(t);});*/ /*remove*/ $(".bulb").removeClass("buttonNight"); $("body").removeClass("bodyNight"); $(".timeline-title").removeClass("titleNight"); $(".timeline-icon").removeClass("iconNight"); $(".timeline-bar").removeClass("barNight"); $(".timeline-bar-fill").removeClass("bgcNight"); $("#MainPic").removeClass("MainNight"); $(".right").removeClass("rightNight"); $(".left").removeClass("leftNight"); $(".timeline-content").removeClass("contentNight"); $(".timeline").removeClass("timelineNight"); $(".toolate").removeClass("timelineNight"); /*add*/ $("body").addClass("bodyDay"); $(".bulb").addClass("buttonDay"); $(".timeline-title").addClass("titleDay"); $(".timeline-icon").addClass("iconDay"); $(".timeline-bar").addClass("barDay"); $(".timeline-bar-fill").addClass("bgcDay"); $("#MainPic").addClass("MainDay"); $(".right").addClass("rightDay"); $(".left").addClass("leftDay"); $(".timeline-content").addClass("contentDay"); $(".timeline").addClass("timelineDay"); $(".toolate".addClass("timelineDay"); $('#change').click(function(){NightStyle();}); } function NightStyle(){ /*var arrimg= new Array(); var arrimg=["img/mydesign/star.png","img/mydesign/hourglass1.png","img/mydesign/model.png","img/mydesign/Experiment.png","img/mydesign/Fireworks.jpg","img/mydesign/fallingstar.jpg"];*/ $("#BgChange img:eq(0)").attr('src','https://static.igem.org/mediawiki/2018/8/8f/T--Tianjin--Night.jpg'); /*$(".timeline-image img").each(function(e){ $(this).attr('src',arrimg[e]); })*/ /*$(".timeline-icon").each(function(e){if(e>=3){var i=2*e-4;var t="0"+i+":00";};if(e<3){var i=2*e+20;var t=i+":00";};$(this).text(t);});*/ /*remove*/ $("body").removeClass("bodyDay"); $(".bulb").removeClass("buttonDay"); $(".timeline-title").removeClass("titleDay"); $(".timeline-icon").removeClass("iconDay"); $(".timeline-bar").removeClass("barDay"); $(".timeline-bar-fill").removeClass("bgcDay"); $("#MainPic").removeClass("MainDay"); $(".right").removeClass("rightDay"); $(".left").removeClass("leftDay"); $(".timeline-content").removeClass("contentDay"); $(".timeline").removeClass("timelineDay"); $(".toolate").removeClass("timelineDay"); /*add*/ $("body").addClass("bodyNight"); $(".bulb").addClass("buttonNight"); $(".timeline-title").addClass("titleNight"); $(".timeline-icon").addClass("iconNight"); $(".timeline-bar").addClass("barNight"); $(".timeline-bar-fill").addClass("bgcNight"); $("#MainPic").addClass("MainNight"); $(".right").addClass("rightNight"); $(".left").addClass("leftNight"); $(".timeline-content").addClass("contentNight"); $(".timeline").addClass("timelineNight"); $(".toolate").addClass("timelineNight"); $('#change').click(function(){DayStyle();}); } }