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

Komponent_miecz_świetlny #48

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
1 change: 1 addition & 0 deletions src/app/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { iconButton } from '../components/iconButton';
import { buttonPlay } from '../components/buttonPlay/buttonPlay.js';
import { gameNavigation } from '../components/gameNavigation/gameNavigation.js';
import {createLightSaber} from '../components/lightSaber/lightSaber.js';

export const App = ({ options }) => {
gameNavigation();
Expand Down
Binary file added src/components/lightSaber/img/Lightsaber.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 35 additions & 0 deletions src/components/lightSaber/lightSaber.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
export const createLightSaber=()=>{
const component= document.createElement('div');
const handle=document.createElement('div');
const processBar=document.createElement('div');
const lightprocessBar=document.createElement('div');
component.className="lightBar";
handle.style.backgroundImage=`url(img/Lightsaber.png)`;
Copy link
Owner

Choose a reason for hiding this comment

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

handle.style.backgroundImage=url(img/Lightsaber.png);
obraz jest w static\assets\ui\LightsaberHandle.png

handle.className="lightSaberHandle";
processBar.className="lightSaberProcessBar";
lightprocessBar.className="LightProcessBar";
component.appendChild(handle);
component.appendChild(processBar);
processBar.appendChild(lightprocessBar);
var soundOnEl = document.getElementById('soundOn');

window.onload = countingFunction=()=>{

const time=120;
let fullwidth=1480;
setInterval(c,1000/8);
function c(){
fullwidth -=1480/(time*8);
lightprocessBar.style.width=`${fullwidth}px`;
if(fullwidth<0){
clearInterval(c);
}
}

};
return component;
}




47 changes: 47 additions & 0 deletions src/components/lightSaber/lightSaber.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
body{

}

.lightSaberHandle{

position:absolute;
width: 315px;
height: 65px;
left: 0px;
top: 0px;
background-repeat: no-repeat;
background-position: center;


}
.lightBar{
position: absolute;
width: 1480px;
height: 65px;
left: 0px;
top: 0px;
display:flex;
flex-direction: column;


}

.lightSaberProcessBar{
position: absolute;
width: 1480px;
height: 24px;
left: 278px;
top: 21px;
background-color: #BCBCBC;
box-shadow: inset 0px 4px 4px rgba(0, 0, 0, 0.25);
border-radius: 8px;
}

.LightProcessBar{
position: absolute;
width: 1480px;
height: 100%;
background: #FFFFFF;
box-shadow: 10px -5px 15px #FF0000, 10px 5px 15px #FF0000, inset 0px 5px 4px rgba(255, 0, 0, 0.25);
border-radius: 8px;
}