Test Redux Counter

Developer
Size
5,053 Kb
Views
6,072

How do I make an test redux counter?

Counter utilizing Redux. What is a test redux counter? How do you make a test redux counter? This script and codes were developed by Feng on 07 January 2023, Saturday.

Test Redux Counter Previews

Test Redux Counter - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Test Redux Counter</title> <link rel='stylesheet prefetch' href='css/bnwxdq.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class='wrap'> <h1 id='counter'></h1> <div class='wrap-buttons'> <button id='increment'>+</button> <button id='decrement'>-</button> <button id='reset'>Reset</button> </div>
</div> <script src='https://cdnjs.cloudflare.com/ajax/libs/redux/3.5.2/redux.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Test Redux Counter - Script Codes CSS Codes

body { height: 100vh; display: flex; justify-content: center; align-items: center; font-family: Roboto Slab; background: linear-gradient(-150deg,#25c7f9,#07b0e3);
}
h1 { padding: 0; margin: 0; font-size: 180px; line-height: 1;
}
.wrap { display: flex; align-items: center; justify-content: center; flex-direction: column; font-size: 200%; border-radius: 3px; background: #fefefe; height: 300px; width: 300px; text-align: center; box-shadow: long-shadow( $direction: 75deg, $length: 150px, $color: rgba(darken(#24c7f9, 15%), 0.5), $fade: rgba(lighten(#07b0e3, 5%), 0.1) )
}
button { padding: 0.20em 0.4em; line-height: 1; vertical-align: middle; border-radius: 3px; color: #fefefe; border: 3px solid; background: #fefefe; margin-top: 10px; margin-bottom: 10px; transition: transform 60ms ease-out; &:active { transform: translateY(2px); transition: transform 100ms ease-out; } &:hover, &:focus { outline: none; }
}
#increment, #decrement { width: 50px;
}
#increment { color: #5cb85c; border-color: lighten(#5cb85c, 7%);
}
#decrement { color: #E67373; border-color: lighten(#E67373, 7%);
}
#reset { color: #ff9d5d; border-color: lighten(#ff9d5d, 7%);
}

Test Redux Counter - Script Codes JS Codes

'use strict';
function counter() { var state = arguments.length <= 0 || arguments[0] === undefined ? 0 : arguments[0]; var action = arguments[1]; switch (action.type) { case 'INCREMENT': return state + 1; case 'DECREMENT': return state - 1; case 'RESET': return 0; default: return state; }
}
var store = Redux.createStore(counter);
function render() { document.querySelector('#counter').innerText = store.getState();
}
store.subscribe(render);
render();
document.querySelector('#increment').addEventListener('click', function () { store.dispatch({ type: 'INCREMENT' });
});
document.querySelector('#decrement').addEventListener('click', function () { store.dispatch({ type: 'DECREMENT' });
});
document.querySelector('#reset').addEventListener('click', function () { store.dispatch({ type: 'RESET' });
});
Test Redux Counter - Script Codes
Test Redux Counter - Script Codes
Home Page Home
Developer Feng
Username felixfeng
Uploaded January 07, 2023
Rating 3
Size 5,053 Kb
Views 6,072
Do you need developer help for Test Redux Counter?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Feng (felixfeng) Script Codes
Create amazing Facebook ads with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!