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

add all files #1

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
61e7d36
add all files
idanasayag0 Mar 13, 2024
96b36a2
.
idanasayag0 Mar 13, 2024
3ee28eb
.
idanasayag0 Mar 13, 2024
c398ea6
.
idanasayag0 Mar 13, 2024
b9f092b
.
idanasayag0 Mar 13, 2024
94dc553
.
idanasayag0 Mar 13, 2024
f17982c
.
idanasayag0 Mar 13, 2024
221f0b4
Update README.md
idanasayag0 Mar 13, 2024
bed053f
Update README.md
idanasayag0 Mar 13, 2024
9f075e6
Update README.md
idanasayag0 Mar 14, 2024
7931232
.
idanasayag0 Mar 14, 2024
692355e
Merge branch 'fyloCR' of https://github.com/ColmanDevClub/FyloCodeRev…
idanasayag0 Mar 14, 2024
d4b4678
Update README.md
idanasayag0 Mar 14, 2024
75af4e5
.
idanasayag0 Mar 14, 2024
c2f1060
Update README.md
idanasayag0 Mar 14, 2024
b1ce200
.
idanasayag0 Mar 14, 2024
a86be5a
Update README.md
idanasayag0 Mar 14, 2024
6c5ade7
Update README.md
idanasayag0 Mar 14, 2024
2a08027
Update README.md
GilHeller Mar 14, 2024
a871d98
readme
alonman17 Mar 14, 2024
005fc8d
.
idanasayag0 Mar 14, 2024
5284aa6
Update README.md
idanasayag0 Mar 14, 2024
6e2a02f
Update README.md
idanasayag0 Mar 14, 2024
da4e84a
Update README.md
YuvalOfek1 Mar 14, 2024
ad8a394
Update README.md
GilHeller Mar 14, 2024
bbc0357
.
idanasayag0 Mar 14, 2024
b63449c
Update README.md
idanasayag0 Mar 14, 2024
5566d6a
Update README.md
GilHeller Mar 14, 2024
5dea12a
.
idanasayag0 Mar 15, 2024
e54d5dc
Update README.md
idanasayag0 Mar 15, 2024
a84a25a
Update README.md
idanasayag0 Mar 15, 2024
6a38d35
Update README.md
idanasayag0 Mar 15, 2024
728540c
.
idanasayag0 Mar 15, 2024
8444cb5
Ori Joseph
Tamir198 Mar 15, 2024
95738ed
.
idanasayag0 Mar 15, 2024
2c1e643
Update README.md
YuvalOfek1 Mar 15, 2024
b813360
Noa Gedo
Tamir198 Mar 15, 2024
46deff2
.
idanasayag0 Mar 15, 2024
f3ae26f
readme
alonman17 Mar 15, 2024
ab68d1a
Omer Elias
Tamir198 Mar 15, 2024
f5f7136
Update README.md
GilHeller Mar 15, 2024
48157b3
Update README.md
GilHeller Mar 15, 2024
604a830
Update README.md
ozizhakGT Mar 15, 2024
dde49b4
Update README.md
idanasayag0 Mar 16, 2024
c6e6cc5
Update README.md
idanasayag0 Mar 16, 2024
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
1 change: 1 addition & 0 deletions amosZohar
Submodule amosZohar added at 181a5b
1 change: 1 addition & 0 deletions benda
Submodule benda added at 579ab0
1 change: 1 addition & 0 deletions evyatarBabay/firstTask
Submodule firstTask added at 7058ca
Binary file not shown.
21 changes: 21 additions & 0 deletions hinoy/Fylo Project - Week 1/fylo-solution-main/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Ekaterine (Catherine) Mitagvaria

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
50 changes: 50 additions & 0 deletions hinoy/Fylo Project - Week 1/fylo-solution-main/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
![Fylo data storage component](https://github.com/catherineisonline/fylo-data-storage-component-frontendmentor/blob/main/images/project-preview.png?raw=true)


<h1 align="center">Fylo data storage component</h1>

<div align="center">

[Live](https://catherineisonline.github.io/fylo-data-storage-component-frontendmentor/)
| [Solution](https://www.frontendmentor.io/solutions/fylo-data-storage-component-gpaJOs4EP)
| [Challenge](https://www.frontendmentor.io/challenges/fylo-data-storage-component-1dZPRbV5n)

Solution for a challenge from [frontendmentor.io](https://www.frontendmentor.io/)
</div>



## About The Project

This component has some interesting CSS challenges in the design. If you're looking to test your CSS skills, this will be a great project for you!
The main challenge is to build out this data storage component and get it looking as close to the design as possible.
You can use any tools you like to help you complete the challenge. So if you've got something you'd like to practice, feel free to give it a go.

Your users should be able to:
1. View the optimal layout depending on their device's screen size</p>

I do not have access to the Figma sketch so the design is not pixel perfect.</p>




## Built with

- Semantic HTML5 markup
- CSS custom properties
- Grid
- Desktop-first workflow

## What I learned

This project helped me to practice some grid as it's a little difficult for me to make the grid responsive. My goal is to make grid change from 1 row to 2 rows without using media query however I lack enough experience in this. I decided to finish this project as it is and deepen my knowledge of the grid in another project that I plan to make, specifically - a photography portfolio website.


## Useful resources

1. [Figma](https://www.figma.com/) - Paste your design image to check the size of containers, width, etc.
2. [Perfect Pixel](https://chrome.google.com/webstore/detail/perfectpixel-by-welldonec/dkaagdgjmgdmbnecmcefdhjekcoceebi) - Awesome Chrome extension that helps you to match the pixels of the provided design.

## Acknowledgments

A big thank you to anyone providing feedback on my [solution](https://www.frontendmentor.io/solutions/fylo-data-storage-component-gpaJOs4EP). It definitely helps to find new ways to code and find easier solutions!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions hinoy/Fylo Project - Week 1/fylo-solution-main/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="description" content="Frontend Mentor - Fylo data storage component">
<meta name="keywords" content="Fylo data storage component, Frontend Mentor">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="styles.css" rel="stylesheet">
</link>
<link rel="icon" type="image/png" sizes="32x32" href="images/favicon-32x32.png">
<title>Fylo data storage component</title>
</head>

<body>
<main>
<!--Fylo Container -->
<section class="fylo-container">
<img class="logo" src="images/logo.svg" alt="Fylo logo" />
<section class="icons">
<div class="icon-img">
<img src="images/icon-document.svg" alt="" aria-hidden="true" />
</div>
<div class="icon-img">
<img src="images/icon-folder.svg" alt="" aria-hidden="true" />
</div>
<div class="icon-img">
<img src="images/icon-upload.svg" alt="" aria-hidden="true" />
</div>
<button type="button" class="icon-img" onclick="openFile()">
<strong>Upload Image</strong>
</button>
<input type="file" id="fileInput" accept=".jpg, .jpeg, .gif, .png" onchange="fileSelection()" multiple>
</section>
</section>
<!-- Storage Container -->
<section class="storage-container">
<h1>You've used <span id="usedStorage">0 MB</span> of your storage</h1>
<!-- Progress Bar -->
<section class="progress-bar">
<div class="gradient-bar">
<div id="progressDot" class="dot-container">
<div class="dot"></div>
</div>
</div>
</section>
<h2>
<span id="minStorage">0 MB</span>
<span id="maxStorage">15 MB</span>
</h2>
<!-- GB left -->
<section class="gb-left">
<p id="mbLeft">15 <span>MB left</span></p>
</section>
</section>
</main>
<script src="script.js"></script>
</body>

</html>
53 changes: 53 additions & 0 deletions hinoy/Fylo Project - Week 1/fylo-solution-main/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
var totalSizeLimit = 15; // 15 MB maximum
var totalUploadedSize = 0; // aggregated size of all files uploaded in bytes

function openFile() {
document.getElementById('fileInput').click(); // opens the Finder/File Explorer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why didn't you utilize the onclick attribute of the element?

}

function fileSelection() {
var selectedFiles = document.getElementById('fileInput').files;
var validFiles = [".png", ".jpg", ".gif", ".jpeg"];
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more elegant solution utilizes regular expressions (regex). For instance, consider the following example employing regex:

(/\.(gif|jpe?g|tiff?|png|webp|bmp)$/i).test(filename)

This approach efficiently checks if the filename has any of the specified image file extensions, enhancing code readability and conciseness.


for (var i = 0; i < selectedFiles.length; i++) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using a for loop, utilize the forEach function on the array.

var selectedFile = selectedFiles[i];
var filesFormat = selectedFile.name.split('.').pop().toLowerCase(); // split the files extensions by "." (.jpg, .jpeg ...)

if (validFiles.indexOf('.' + filesFormat) === -1) {
alert("File format isn't supported: " + selectedFile.name);
} else {
var fileSize = selectedFile.size;
var remainingStorage = totalSizeLimit - (totalUploadedSize / (1024 * 1024));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if u are gonna use a lot in files size make a consts in the top of the code

const GB = 1024 * 1024 * 1024;
const MB = 1024 * 1024;
const KB = 1024;

and then it looks like this:

(totalUploadedSize / MB)


if (fileSize / (1024 * 1024) > remainingStorage) { // (fileSize / (1024 * 1024)) -> convert to MB
alert("There is not enough space on the disk");
return;
}
totalUploadedSize += fileSize;
}
}
updateProgressBar();
updateUploadedStorage();
}

function updateProgressBar() {

var progressBar = document.querySelector('.gradient-bar');
var progressDot = document.getElementById('progressDot');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove if it not used

var mbLeft = document.getElementById('mbLeft');
var percentageCalc = (totalUploadedSize / (totalSizeLimit * 1024 * 1024)) * 100; // (totalSizeLimit * 1024 * 1024) convert from MB to bytes and multiply by 100 to convert to a percentage
progressBar.style.width = percentageCalc + '%';
var remainingStorage = totalSizeLimit - (totalUploadedSize / (1024 * 1024));
mbLeft.textContent = remainingStorage.toFixed(2) + ' MB LEFT';
}

function updateUploadedStorage() {
var usedStorageElement = document.getElementById('usedStorage');
var uploadedSizeInMB = totalUploadedSize / (1024 * 1024); // convert bytes to MB
usedStorageElement.textContent = uploadedSizeInMB.toFixed(2) + ' MB';
}

// place the progress bar at starting point
window.onload = function () {
updateProgressBar();
}
Loading