Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Added random Halloween facts and adjusted styles" #186

Merged
merged 1 commit into from Oct 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 6 additions & 12 deletions css/styles.css
Expand Up @@ -4,19 +4,13 @@ body {
.jumbotron {
background-color: #f29810;
}

.jumbotron p {
margin: 10% 0;
font-size: 12px;
}

.jumbotron h3 {
margin: 10% 0;
.jumbotron p {
margin-top: 20%;
font-size: 12px;
}

a {
text-decoration: underline;
color: black;
a {
text-decoration: underline;
color: black;
}

.konami {
Expand Down
3 changes: 1 addition & 2 deletions index.html
Expand Up @@ -19,7 +19,6 @@
<!--google analytics-->
<script>
(function (i, s, o, g, r, a, m) {

i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
Expand All @@ -39,7 +38,6 @@
<div class="jumbotron">
<div class="container">
<h1 class="text-left" id="spooky">How many days until Halloween?</h1>
<h3 class="text-left" id="fact"></h3>
<p>Powered by <a href="https://getbootstrap.com">Boo-t-strap</a>, <a href="https://momentjs.com/">Moment.js</a>, and Spookiness! | <a href="https://github.com/scrabill/how-many-days-until-halloween">Fork
this on Github</a></p>
</div>
Expand All @@ -51,4 +49,5 @@ <h3 class="text-left" id="fact"></h3>
<script src="js/bootstrap.min.js"></script>
<script src="js/script.js"></script>
</body>

</html>
39 changes: 1 addition & 38 deletions js/script.js
@@ -1,40 +1,3 @@
let message;
const halloween = 31;
let d = new Date();
let today = d.getDate(); // return the day of the month as a number 0-30
const daysUntilHalloween = halloween - today;

const spookyElement = document.querySelector('#spooky');
const factElement = document.querySelector('#fact');

const facts = [
'California, Illinois, Michigan, New York, Ohio, and Pennsylvania produce the majority of pumpkins for Halloween – over 1 billion pounds a year!',
'The name Jack-O-Lantern first originated from an Irish folktale about a man named Stingy Jack who tricked the Devil over and over again. When Jack died, he was forced to walk the Earth with only a carved-out turnip and burning coal to help light his way.',
'The Plymouth Colony Pilgrims started the superstition about black cats.',
'Tootsie Rolls, Smarties, and candy corn were among the most hated candies in 2017.',
"Reese's Peanut Butter Cups were 2017’s most popular Halloween candy.",
'At one time, it was customary to perform dances, songs, prayers, and plays in order to receive treats.',
'Silly String is banned in Hollywood on Halloween.',
'In 2014, the total estimated cost of all Halloween costumes was $2.8 billion.',
'Candy Corn was created in 1898 and 35 million pounds of it are made every year.',
'Halloween in the second largest consumer holiday in the United States. Consumers spent about $7 billion in 2015.',
"Guinness World Records has named the Haunted Cave in Lewisburg, Ohio as the world's longest haunted house. It measures 3,564 feet long and is located 80 feet below ground in an abandoned mine.",
'Harry Houdini died on Halloween in 1926.',
'Trunk-or-Treating was created as a safer alternative to Trick-or-Treating in 2000.',
'Halloween ranks as the sixth most popular card-giving holiday, with 20 million cards sent each year.',
'In 2017, the most popular pet costumes were pumpkins, hot dogs, and a tie between a dog, lion, and pirate.',
];

if (today === halloween) {
message = "It's Halloween! Stay spooky!";
} else {
message = 'There are ' + daysUntilHalloween + ' days until Halloween';
}

// Display message and fact
spookyElement.innerText = message;
factElement.innerHTML = facts[Math.floor(Math.random() * facts.length)];

// Assign DOM elements
const spooky = document.querySelector("#spooky");
const jumbotron = document.querySelector(".jumbotron");
Expand Down Expand Up @@ -121,4 +84,4 @@ const doKonami = () => {
link.style.color = colors["spooky"];
}
});
};
};