website-archana
Version:
This is small website with html,js,css
61 lines (55 loc) • 2.1 kB
JavaScript
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
//(function(win, doc, $){
(function(){
var chatModule = (function() {
var _leadself = 'Me: ',
_leadcomputer = "PC: ",
_aSaid = ["This is a Cyber Chat"],
_msgYes = "Yes, that's a great idea.",
_msgNo = "No, that must be a mistake.",
_aSassyStuff = ["Like mold on books, grow myths on history.",
"She moved like a poem and smiled like a sphinx.",
"As long as we don’t die, this is gonna be one hell of a story.",
"She laughed, and the desert sang.",
"You’ve got about as much charm as a dead slug."];
function _talk(msg){
_echo(_leadself + msg);
}
function _replyYesNo()
{
var msg = Math.random() > 0.5 ? _msgYes : _msgNo;
_echo(_leadcomputer + msg);
}
function _saySassyStuff()
{
var msg = _aSassyStuff[Math.floor(Math.random() * _aSassyStuff.length)];
_echo(_leadcomputer + msg);
}
function _echo(msg)
{
_aSaid.push("<div>"+msg+"</div>");
var aSaidLength = _aSaid.length,
start = Math.max(aSaidLength - 6, 0),
out = "";
for(var i=start; i<aSaidLength; i++)
{
out += _aSaid[i];
}
$(".advert").html(out);
$("#talk span").text(msg);
}
return {
talk : _talk,
replyYesNo : _replyYesNo,
saySassyStuff : _saySassyStuff
};
})();
$(document).ready(function(){
chatModule.talk("This is much better...");
chatModule.replyYesNo();
chatModule.saySassyStuff();
chatModule.saySassyStuff();
});
//if(!win.chatModule) win.chatModule = chatModule;
})();//(window, document, jQuery);
},{}]},{},[1]);