Test Redux Counter
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 - 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](http://shots.codepen.io/felixfeng/pen/zBZqvy-512.jpg)
Developer | Feng |
Username | felixfeng |
Uploaded | January 07, 2023 |
Rating | 3 |
Size | 5,053 Kb |
Views | 6,072 |
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!
Name | Size |
Practice - Connect 4 | 3,976 Kb |
Test Slides | 3,617 Kb |
Test Redux Counter | 5,053 Kb |
Test - ScrollSpy | 3,092 Kb |
A Pen by Feng | 1,151 Kb |
Lights Out Game | 3,419 Kb |
Test Photo Gallery | 4,801 Kb |
Test Pen | 1,240 Kb |
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!
Name | Username | Size |
A Pen by Bryan Rojas | Bryanrojas | 1,873 Kb |
Animated SVG stroke-dasharray | Netsi1964 | 3,179 Kb |
Fixed with using Calc | Tomleo | 2,542 Kb |
Adding and Removing Element | Accimeesterlin | 2,119 Kb |
Simple Responsive Text | Fbrz | 2,282 Kb |
Free css icon set v2 - one div | Ben_jammin | 0 Kb |
Fluid Grid 12 | Alexoliverwd | 2,309 Kb |
Project -Show the Local Weather | Luciano_Britis | 2,583 Kb |
Find The Penguin | Lelder | 2,212 Kb |
Cloudy Spiral CSS animation | Hakimel | 6,587 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!