Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
mkpro118 authored May 29, 2024
1 parent 27c01c8 commit 45e1a7f
Show file tree
Hide file tree
Showing 10 changed files with 136 additions and 0 deletions.
Binary file added HBD Krish/assets/2015.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added HBD Krish/assets/2016.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added HBD Krish/assets/2017.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added HBD Krish/assets/2018.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added HBD Krish/assets/2019.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added HBD Krish/assets/2021.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added HBD Krish/assets/2022.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added HBD Krish/assets/2023.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions HBD Krish/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const card = $('.card');
const year = $('.year');
const img = $('img');

const assets = {imgs: [], idx: 0, cap: 0};

for (let i = 2015; i <= 2023; i++) {
if (i == 2020) continue;
assets.imgs.push({year: i, file: `./assets/${i}.jpg`});
assets.cap++;
}

function set_card_bg() {
card.css('background', `url('${assets.imgs[assets.idx].file}')`);
}

function set_img() {
img.get().src = assets.imgs[assets.idx].file;
year.text(assets.imgs[assets.idx].year);
set_card_bg();
}

$('.footer').on('click', () => {
$('.active').removeClass('active');
$('.back').addClass('active');
})

$('.left').on('click', () => {
assets.idx = (assets.idx > 0 ? assets.idx : assets.cap) - 1;
set_img();
})

$('.right').on('click', () => {
assets.idx = (assets.idx + 1) % assets.cap;
set_img();
})
100 changes: 100 additions & 0 deletions HBD Krish/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
font-family: 'Poppins', sans-serif;
}

.card {
background: white;
padding: 20px;
border-radius: 15px;
box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
text-align: center;
max-width: 500px;
max-height: 90vh;
width: 90%;
margin: 20px;
position: relative;
overflow: scroll;
}
.card-stuff {
display: none;
}

.ctrl {
position: absolute;
width: 50%;
top: 0;
bottom: 0;
}

.left {
left: 0;
background: transparent;
}

.right {
right: 0;
background: transparent;
}

.active {
display: initial;
}

.header {
background: #ff6f91;
padding: 10px;
border-radius: 10px 10px 0 0;
}

.header h1 {
color: white;
font-family: 'Pacifico', cursive;
margin: 0;
font-size: 2.5em;
text-shadow: 1px 1px black;
}

.content {
padding: 20px;
}

.message {
font-size: 1.2em;
color: #555;
margin-top: 20px;
}

fieldset {
border: none;
}

.year {
font-size: 1.5rem;
color: #ff6f91;
text-shadow: 1px 1px black;
}

.footer {
background: #ff6f91;
padding: 10px;
border-radius: 0 0 10px 10px;
color: white;
font-weight: bold;
}

/* Responsive Styles */
@media (max-width: 600px) {
.header h1 {
font-size: 2em;
}

.message {
font-size: 1em;
}
}

0 comments on commit 45e1a7f

Please sign in to comment.