diff options
| author | liwencTaiwan <Liwen@Liwens-MBP.wv.cc.cmu.edu> | 2016-10-17 00:08:27 -0400 |
|---|---|---|
| committer | liwencTaiwan <Liwen@Liwens-MBP.wv.cc.cmu.edu> | 2016-10-17 00:08:32 -0400 |
| commit | ab24c5c9fe7a61049a89d2d44cbbd15162174d6d (patch) | |
| tree | e88e15642642484e60bbc592bb46117f51aea199 | |
| parent | 61b74608ce06bed0b9b7597af4ac7f6b9b3baac2 (diff) | |
| download | bridge-ab24c5c9fe7a61049a89d2d44cbbd15162174d6d.tar.zst | |
Change omg url & add different depth
| -rw-r--r-- | fish_show.py | 40 | ||||
| -rw-r--r-- | webapp/app/templates/index.html | 18 |
2 files changed, 49 insertions, 9 deletions
diff --git a/fish_show.py b/fish_show.py index 2894863..143cdad 100644 --- a/fish_show.py +++ b/fish_show.py @@ -106,6 +106,15 @@ class FishShow(Show): self.fishes = set() self.tick_count = 0 self.depth = 0 + self.send_event('disable image', {'name': 'jellyfish'}) + self.send_event('disable image', {'name': 'dolphin'}) + self.send_event('disable image', {'name': 'boat'}) + self.send_event('disable image', {'name': 'nemo'}) + self.send_event('disable image', {'name': 'dory'}) + self.send_event('disable image', {'name': 'whale'}) + self.send_event('disable image', {'name': 'eel'}) + self.send_event('disable image', {'name': 'stingray'}) + self.send_event('disable image', {'name': 'shark'}) def update(self): event = self.recv_event() @@ -136,6 +145,37 @@ class FishShow(Show): if self.tick_count % self.TICKS_PER_DEPTH == 0: self.depth += 1 print("DEPTH: ", self.depth) + if depth == 1: + """boat, dolphin""" + self.send_event('enable image', {'name': 'boat'}) + self.send_event('enable image', {'name': 'dolphin'}) + else if depth == 2: + """dolphin, jellyfish""" + self.send_event('disable image', {'name': 'boat'}) + self.send_event('enable image', {'name': 'jellyfish'}) + else if depth == 3: + """jellyfish, nemo, dory, whale""" + self.send_event('disable image', {'name': 'dolphin'}) + self.send_event('enable image', {'name': 'nemo'}) + self.send_event('enable image', {'name': 'dory'}) + self.send_event('enable image', {'name': 'whale'}) + else if depth == 4: + """nemo, dory, whale, shark""" + self.send_event('disable image', {'name': 'jellyfish'}) + self.send_event('enable image', {'name': 'shark'}) + else if depth == 5: + """whale, shark, stingray""" + self.send_event('disable image', {'name': 'nemo'}) + self.send_event('disable image', {'name': 'dory'}) + self.send_event('enable image', {'name': 'stingray'}) + else if depth == 6: + """stingray, eel""" + self.send_event('disable image', {'name': 'whale'}) + self.send_event('disable image', {'name': 'shark'}) + self.send_event('enable image', {'name': 'eel'}) if self.depth > self.MAX_DEPTH: + self.send_event('disable image', {'name': 'stingray'}) + self.send_event('disable image', {'name': 'eel'}) self.stop() + diff --git a/webapp/app/templates/index.html b/webapp/app/templates/index.html index 4dadb7b..a61b59f 100644 --- a/webapp/app/templates/index.html +++ b/webapp/app/templates/index.html @@ -43,37 +43,37 @@ <!-- Three columns of text below the carousel --> <div class="row"> <div class="col-lg-4"> - <img id="jellyfish" onClick="clickImg(this)" class="img-circle" src="http://animalia-life.com/data_images/jellyfish/jellyfish7.jpg" alt="Generic placeholder image" width="140" height="140"> + <img id="jellyfish" onClick="clickImg(this)" class="img-circle" src="http://i.imgur.com/wZl8BhW.jpg" alt="Generic placeholder image" width="140" height="140"> </div><!-- /.col-lg-4 --> <div class="col-lg-4"> - <img id="dolphin" onClick="clickImg(this)" class="img-circle" src="http://kids.nationalgeographic.com/content/dam/kids/photos/animals/Mammals/A-G/bottlenose-dolphin-jumping.jpg.adapt.945.1.jpg" alt="Generic placeholder image" width="140" height="140"> + <img id="dolphin" onClick="clickImg(this)" class="img-circle" src="http://i.imgur.com/MLP3x37.jpg" alt="Generic placeholder image" width="140" height="140"> </div><!-- /.col-lg-4 --> <div class="col-lg-4"> - <img id="boat" onClick="clickImg(this)" class="img-circle" src="http://yachtpals.com/files/groupimages/woodduck.jpg" alt="Generic placeholder image" width="140" height="140"> + <img id="boat" onClick="clickImg(this)" class="img-circle" src="http://i.imgur.com/ZU8sA8Z.jpg" alt="Generic placeholder image" width="140" height="140"> </div><!-- /.col-lg-4 --> </div><!-- /.row --> <br> <div class="row"> <div class="col-lg-4"> - <img id="dory" onClick="clickImg(this)" class="img-circle" src="https://www.sciencenewsforstudents.org/sites/default/files/2016/06/main/articles/wt_blue_tang_dory_free.jpg" alt="Generic placeholder image" width="150" height="150"> + <img id="dory" onClick="clickImg(this)" class="img-circle" src="http://i.imgur.com/Ky67jAq.jpg" alt="Generic placeholder image" width="150" height="150"> </div><!-- /.col-lg-4 --> <div class="col-lg-4"> - <img id="nemo" onClick="clickImg(this)" class="img-circle" src="http://img.wallpaperfolder.com/f/63DCF495B5BC/clown-fish-75948.jpg" alt="Generic placeholder image" width="140" height="140"> + <img id="nemo" onClick="clickImg(this)" class="img-circle" src="http://i.imgur.com/XGxdSI0.jpg" alt="Generic placeholder image" width="140" height="140"> </div><!-- /.col-lg-4 --> <div class="col-lg-4"> - <img id="whale" onClick="clickImg(this)" class="img-circle" src="http://media-channel.nationalgeographic.com/media/uploads/photos/content/photo/2013/01/30/KillerWhale_01_BuiltForTheKillV.jpg" alt="Generic placeholder image" width="140" height="140"> + <img id="whale" onClick="clickImg(this)" class="img-circle" src="http://i.imgur.com/s3J3Csx.jpg" alt="Generic placeholder image" width="140" height="140"> </div><!-- /.col-lg-4 --> </div><!-- /.row --> <br> <div class="row"> <div class="col-lg-4"> - <img id="stingray" onClick="clickImg(this)" class="img-circle" src="http://3.bp.blogspot.com/-enlwcfp2skQ/Tlxxws9FRlI/AAAAAAAAAmg/0-TEWn8Sokw/s1600/stingray_5.JPG" alt="Generic placeholder image" width="140" height="140"> + <img id="stingray" onClick="clickImg(this)" class="img-circle" src="http://i.imgur.com/RuOqhqh.jpg" alt="Generic placeholder image" width="140" height="140"> </div><!-- /.col-lg-4 --> <div class="col-lg-4"> - <img id="eel" onClick="clickImg(this)" class="img-circle" src="http://blogs.courierpostonline.com/fishhead/files/2012/11/eel.jpg" alt="Generic placeholder image" width="140" height="140"> + <img id="eel" onClick="clickImg(this)" class="img-circle" src="http://i.imgur.com/RmK7wJv.jpg" alt="Generic placeholder image" width="140" height="140"> </div><!-- /.col-lg-4 --> <div class="col-lg-4"> - <img id="shark" onClick="clickImg(this)" class="img-circle" src="http://www.livescience.com/images/i/000/083/926/original/shark-attacks-increased-in-2015.jpg?interpolation=lanczos-none&downsize=*:1000" alt="Generic placeholder image" width="140" height="140"> + <img id="shark" onClick="clickImg(this)" class="img-circle" src="http://i.imgur.com/6AuJ36F.jpg" alt="Generic placeholder image" width="140" height="140"> </div><!-- /.col-lg-4 --> </div><!-- /.row --> |
