Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 49 additions & 23 deletions example/css/flipdown/flipdown.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@
color: #000000;
}
/* Delimeters */
.flipdown.flipdown__theme-dark .rotor-group:nth-child(n+2):nth-child(-n+3):before,
.flipdown.flipdown__theme-dark .rotor-group:nth-child(n+2):nth-child(-n+3):after {
.flipdown.flipdown__theme-dark
.rotor-group:nth-child(n + 2):nth-child(-n + 3):before,
.flipdown.flipdown__theme-dark
.rotor-group:nth-child(n + 2):nth-child(-n + 3):after {
background-color: #151515;
}
/* Rotor tops */
.flipdown.flipdown__theme-dark .rotor,
.flipdown.flipdown__theme-dark .rotor-top,
.flipdown.flipdown__theme-dark .rotor-leaf-front {
color: #FFFFFF;
color: #ffffff;
background-color: #151515;
}
/* Rotor bottoms */
.flipdown.flipdown__theme-dark .rotor-bottom,
.flipdown.flipdown__theme-dark .rotor-leaf-rear {
color: #EFEFEF;
color: #efefef;
background-color: #202020;
}
/* Hinge */
Expand All @@ -41,25 +43,27 @@
}
/* Rotor group headings */
.flipdown.flipdown__theme-light .rotor-group-heading:before {
color: #EEEEEE;
color: #eeeeee;
}
/* Delimeters */
.flipdown.flipdown__theme-light .rotor-group:nth-child(n+2):nth-child(-n+3):before,
.flipdown.flipdown__theme-light .rotor-group:nth-child(n+2):nth-child(-n+3):after {
background-color: #DDDDDD;
.flipdown.flipdown__theme-light
.rotor-group:nth-child(n + 2):nth-child(-n + 3):before,
.flipdown.flipdown__theme-light
.rotor-group:nth-child(n + 2):nth-child(-n + 3):after {
background-color: #dddddd;
}
/* Rotor tops */
.flipdown.flipdown__theme-light .rotor,
.flipdown.flipdown__theme-light .rotor-top,
.flipdown.flipdown__theme-light .rotor-leaf-front {
color: #222222;
background-color: #DDDDDD;
background-color: #dddddd;
}
/* Rotor bottoms */
.flipdown.flipdown__theme-light .rotor-bottom,
.flipdown.flipdown__theme-light .rotor-leaf-rear {
color: #333333;
background-color: #EEEEEE;
background-color: #eeeeee;
}
/* Hinge */
.flipdown.flipdown__theme-light .rotor:after {
Expand All @@ -70,7 +74,6 @@

.flipdown {
overflow: visible;
width: 510px;
height: 110px;
}

Expand Down Expand Up @@ -107,8 +110,8 @@
content: attr(data-before);
}

.flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):before {
content: '';
.flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):before {
content: "";
position: absolute;
bottom: 20px;
left: 115px;
Expand All @@ -117,8 +120,8 @@
border-radius: 50%;
}

.flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):after {
content: '';
.flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):after {
content: "";
position: absolute;
bottom: 50px;
left: 115px;
Expand Down Expand Up @@ -200,7 +203,7 @@
}

.flipdown .rotor:after {
content: '';
content: "";
z-index: 2;
position: absolute;
bottom: 0px;
Expand All @@ -210,10 +213,8 @@
border-radius: 0px 0px 4px 4px;
}

@media (max-width: 550px) {

@media (max-width: 570px) {
.flipdown {
width: 312px;
height: 70px;
}

Expand Down Expand Up @@ -246,18 +247,18 @@
line-height: 20px;
}

.flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):before,
.flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):after {
.flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):before,
.flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):after {
left: 69px;
}

.flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):before {
.flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):before {
bottom: 13px;
height: 8px;
width: 8px;
}

.flipdown .rotor-group:nth-child(n+2):nth-child(-n+3):after {
.flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):after {
bottom: 29px;
height: 8px;
width: 8px;
Expand All @@ -281,3 +282,28 @@
height: 25px;
}
}

@media screen and (max-width: 350px) {
.flipdown .rotor,
.flipdown .rotor-leaf,
.flipdown .rotor-leaf-front,
.flipdown .rotor-leaf-rear,
.flipdown .rotor-top,
.flipdown .rotor-bottom,
.flipdown .rotor:after {
width: 20px;
}

.flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):before,
.flipdown .rotor-group:nth-child(n + 2):nth-child(-n + 3):after {
left: 49px;
}
}

@media screen and (max-width: 260px) {
.flipdown,
.flipdown * {
display: none;
height: 0;
}
}
23 changes: 10 additions & 13 deletions example/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,35 @@ body,
.example h1,
.example p,
.example .button {
transition: all .2s ease-in-out;
transition: all 0.2s ease-in-out;
}

body.light-theme {
background-color: #151515;
}

body.light-theme .example h1 {
color: #FFFFFF;
color: #ffffff;
}

body.light-theme .example p {
color: #FFFFFF;
color: #ffffff;
}

body.light-theme .buttons .button {
color: #FFFFFF;
border-color: #FFFFFF;
color: #ffffff;
border-color: #ffffff;
}

body.light-theme .buttons .button:hover {
color: #151515;
background-color: #FFFFFF;
background-color: #ffffff;
}

.example {
font-family: 'Roboto', sans-serif;
width: 550px;
font-family: "Roboto", sans-serif;
height: 378px;
margin: auto;
padding: 20px;
box-sizing: border-box;
}

Expand Down Expand Up @@ -97,21 +95,20 @@ body.light-theme .buttons .button:hover {
border-radius: 4px;
text-transform: uppercase;
font-weight: 700;
transition: all .2s ease-in-out;
transition: all 0.2s ease-in-out;
}

.example .button:hover {
background-color: #333;
color: #FFF;
color: #fff;
}

.example .button i {
margin-right: 5px;
}

@media(max-width: 550px) {
@media (max-width: 550px) {
.example {
width: 100%;
height: 362px;
}

Expand Down
15 changes: 7 additions & 8 deletions example/js/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
document.addEventListener('DOMContentLoaded', () => {

document.addEventListener("DOMContentLoaded", () => {
// Unix timestamp (in seconds) to count down to
var twoDaysFromNow = (new Date().getTime() / 1000) + (86400 * 2) + 1;
var twoDaysFromNow = new Date() / 1000 + 86400 * 2 + 1;

// Set up FlipDown
var flipdown = new FlipDown(twoDaysFromNow)
Expand All @@ -11,18 +10,18 @@ document.addEventListener('DOMContentLoaded', () => {

// Do something when the countdown ends
.ifEnded(() => {
console.log('The countdown has ended!');
console.log("The countdown has ended!");
});

// Toggle theme
var interval = setInterval(() => {
let body = document.body;
body.classList.toggle('light-theme');
body.querySelector('#flipdown').classList.toggle('flipdown__theme-dark');
body.querySelector('#flipdown').classList.toggle('flipdown__theme-light');
body.classList.toggle("light-theme");
body.querySelector("#flipdown").classList.toggle("flipdown__theme-dark");
body.querySelector("#flipdown").classList.toggle("flipdown__theme-light");
}, 5000);

// Show version number
var ver = document.getElementById('ver');
var ver = document.getElementById("ver");
ver.innerHTML = flipdown.version;
});
Loading